[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: point moved despite save-excursion, after deleting/reinserting regio
From: |
Eli Zaretskii |
Subject: |
Re: point moved despite save-excursion, after deleting/reinserting region |
Date: |
Thu, 18 Oct 2018 05:38:08 +0300 |
> From: "Garreau\, Alexandre" <galex-713@galex-713.eu>
> Cc: help-gnu-emacs@gnu.org
> Date: Wed, 17 Oct 2018 22:13:28 +0200
>
> 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.
If that's what you want, why not record the position of point before
the delete/insert operation and restore it afterwards?
> 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
> afterwards?
When you delete text, markers pointing into that text cannot follow,
they get relocated to the beginning/end of the deletion/insertion.
What else can Emacs do, given that it doesn't know your future
intentions?
- point moved despite save-excursion, after deleting/reinserting region, Garreau, Alexandre, 2018/10/16
- Re: point moved despite save-excursion, after deleting/reinserting region, Eli Zaretskii, 2018/10/17
- Re: point moved despite save-excursion, after deleting/reinserting region, Garreau, Alexandre, 2018/10/17
- Re: point moved despite save-excursion, after deleting/reinserting region,
Eli Zaretskii <=
- Re: point moved despite save-excursion, after deleting/reinserting region, Garreau, Alexandre, 2018/10/18
- Re: point moved despite save-excursion, after deleting/reinserting region, Yuri Khan, 2018/10/18
- Re: point moved despite save-excursion, after deleting/reinserting region, Garreau, Alexandre, 2018/10/18
- Re: point moved despite save-excursion, after deleting/reinserting region, Eli Zaretskii, 2018/10/18
- Saving (and finding) markers (Was: Re: point moved despite save-excursion, after deleting/reinserting region), Garreau, Alexandre, 2018/10/18
- Re: Saving (and finding) markers (Was: Re: point moved despite save-excursion, after deleting/reinserting region), Eli Zaretskii, 2018/10/18
- Re: Saving (and finding) markers, Garreau, Alexandre, 2018/10/18
- Re: Saving (and finding) markers, Eli Zaretskii, 2018/10/18
- Re: Saving (and finding) markers, Stefan Monnier, 2018/10/18
- Re: Saving (and finding) markers, Eli Zaretskii, 2018/10/19