[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: point moved despite save-excursion, after deleting/reinserting regio

From: Garreau, Alexandre
Subject: Re: point moved despite save-excursion, after deleting/reinserting region
Date: Wed, 17 Oct 2018 22:13:28 +0200
User-agent: Gnus (5.13), GNU Emacs 25.1.1 (i686-pc-linux-gnu)

On 2018-10-17 at 19:12, Eli Zaretskii wrote:
> Please explain what did you want the code to do instead, it's unclear
> from your description.

I’m not sure of what wasn’t clear so I’m how to reexplain but:

The point was, say, in the middle of the SRC block, and (as I said in
the subject) after the operation, was moved: at the end of the block.

This must be because I deleted a region of text (the whole SRC block)
then reinserted it (or rather, its original content, so that to restore
buffer as before), so the point is after the insertion.

However, I’d have expected save-excursion to put the point again where
it was inside the block.  So either it does save it as a buffer position
but garbled it when deleting region, either it does with a marker and
this very one wasn’t saved within the portion of text I later

Is there something such as `restore-markers'/`save-markers' that would
allow me to restore point after doing this operation?  Or better some
`save-buffer-content' like `save-excursion' but restoring the buffer

reply via email to

[Prev in Thread] Current Thread [Next in Thread]