Mercurial > emacs
comparison src/fileio.c @ 83676:27d11c1d4e46
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 857-862)
- Update from CVS
- Merge from emacs--rel--22
- Update from CVS: lisp/emacs-lisp/avl-tree.el: New file.
* emacs--rel--22 (patch 97-100)
- Update from CVS
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 246-247)
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--multi-tty--0--patch-38
author | Miles Bader <miles@gnu.org> |
---|---|
date | Mon, 27 Aug 2007 09:21:49 +0000 |
parents | 5b644ae74c91 496cd44c3983 |
children | 480b9674f921 |
comparison
equal
deleted
inserted
replaced
83675:67601f702028 | 83676:27d11c1d4e46 |
---|---|
4733 `point' iff format-decode did not insert or delete any text. | 4733 `point' iff format-decode did not insert or delete any text. |
4734 Otherwise we leave `point' at point-min. */ | 4734 Otherwise we leave `point' at point-min. */ |
4735 int opoint = PT; | 4735 int opoint = PT; |
4736 int opoint_byte = PT_BYTE; | 4736 int opoint_byte = PT_BYTE; |
4737 int oinserted = ZV - BEGV; | 4737 int oinserted = ZV - BEGV; |
4738 int ochars_modiff = CHARS_MODIFF; | |
4738 | 4739 |
4739 TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE); | 4740 TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE); |
4740 insval = call3 (Qformat_decode, | 4741 insval = call3 (Qformat_decode, |
4741 Qnil, make_number (oinserted), visit); | 4742 Qnil, make_number (oinserted), visit); |
4742 CHECK_NUMBER (insval); | 4743 CHECK_NUMBER (insval); |
4743 if (XINT (insval) == oinserted) | 4744 if (ochars_modiff == CHARS_MODIFF) |
4745 /* format_decode didn't modify buffer's characters => move | |
4746 point back to position before inserted text and leave | |
4747 value of inserted alone. */ | |
4744 SET_PT_BOTH (opoint, opoint_byte); | 4748 SET_PT_BOTH (opoint, opoint_byte); |
4745 inserted = XFASTINT (insval); | 4749 else |
4750 /* format_decode modified buffer's characters => consider | |
4751 entire buffer changed and leave point at point-min. */ | |
4752 inserted = XFASTINT (insval); | |
4746 } | 4753 } |
4747 | 4754 |
4748 /* For consistency with format-decode call these now iff inserted > 0 | 4755 /* For consistency with format-decode call these now iff inserted > 0 |
4749 (martin 2007-06-28) */ | 4756 (martin 2007-06-28) */ |
4750 p = Vafter_insert_file_functions; | 4757 p = Vafter_insert_file_functions; |
4763 { | 4770 { |
4764 /* For the rationale of this see the comment on format-decode above. */ | 4771 /* For the rationale of this see the comment on format-decode above. */ |
4765 int opoint = PT; | 4772 int opoint = PT; |
4766 int opoint_byte = PT_BYTE; | 4773 int opoint_byte = PT_BYTE; |
4767 int oinserted = ZV - BEGV; | 4774 int oinserted = ZV - BEGV; |
4768 | 4775 int ochars_modiff = CHARS_MODIFF; |
4776 | |
4769 TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE); | 4777 TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE); |
4770 insval = call1 (XCAR (p), make_number (oinserted)); | 4778 insval = call1 (XCAR (p), make_number (oinserted)); |
4771 if (!NILP (insval)) | 4779 if (!NILP (insval)) |
4772 { | 4780 { |
4773 CHECK_NUMBER (insval); | 4781 CHECK_NUMBER (insval); |
4774 if (XINT (insval) == oinserted) | 4782 if (ochars_modiff == CHARS_MODIFF) |
4783 /* after_insert_file_functions didn't modify | |
4784 buffer's characters => move point back to | |
4785 position before inserted text and leave value of | |
4786 inserted alone. */ | |
4775 SET_PT_BOTH (opoint, opoint_byte); | 4787 SET_PT_BOTH (opoint, opoint_byte); |
4776 inserted = XFASTINT (insval); | 4788 else |
4789 /* after_insert_file_functions did modify buffer's | |
4790 characters => consider entire buffer changed and | |
4791 leave point at point-min. */ | |
4792 inserted = XFASTINT (insval); | |
4777 } | 4793 } |
4778 } | 4794 } |
4779 | 4795 |
4780 QUIT; | 4796 QUIT; |
4781 p = XCDR (p); | 4797 p = XCDR (p); |