help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: A problem (apparently) connected with window point


From: Stefan Monnier
Subject: Re: A problem (apparently) connected with window point
Date: Sat, 03 Apr 2021 11:22:07 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>> That's right.  To avoid the problem you have to understand that
>> `(with-current-buffer reorder-sentence--buffer ...)` will select the
>> right buffer but will place point at a location that depends on what was
>> the last use of that buffer (and redisplay *is* a use of that buffer,
>> which is why having the buffer displayed makes a difference).
>> In your case I think you have two options:
>
> Thanks!  I have to admit that I still don't get _why_ this is
> happening.

Where do you expect `with-current-buffer` (or `set-buffer` for that
matter) to put the position of `point`?  Remember that between execution
of two commands, there can be a *lot* of other code that will be running
(via redisplay, jit-lock, post/pre-command-hook, you name it).

So while you want to go back to where *you* were, Emacs doesn't really
know what you mean by that.


        Stefan




reply via email to

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