GNU bug report logs -
#4312
23.1; save-excursion and goto-char fail
Previous Next
Reported by: RSridhar <rsridar50 <at> dataone.in>
Date: Wed, 2 Sep 2009 10:15:07 UTC
Severity: normal
Merged with 4313,
4314
Done: Chong Yidong <cyd <at> stupidchicken.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>> 1. I have a lisp code which saves file buffer and does some
>> manipulation on the file in shell. subsequently it is reverted.
>> However I have tried save-excursion before saving file which did not
>> restore the file position on reverting.
>
> save-excursion uses markers to remember the position. But markers only
> keep track of positions by keeping track of insertions/deletions and
> adjusting the position accordingly. When the changes happen outside
> Emacs, this doesn't work too well, because Emacs sees your revert-buffer
> as just one big delete&insert.
insert-file-contents tries to keep markers if possible, but that only
works if the marker points into the unchanged head or tail of the
replaced contents.
Andreas.
--
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
This bug report was last modified 15 years and 304 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.