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

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

Re: question about buffer mechanism


From: Stefan Monnier
Subject: Re: question about buffer mechanism
Date: Sun, 19 Aug 2018 18:55:36 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> I suspect I'm really missing something basic.

The "current buffer" can be *any* buffer; it's a global variable that
refers to one of the buffers and that variable can be changed with
`set-buffer`.  Despite appearances, it is not directly related to which
buffer is displayed on screen.

org-open-at-point changes the buffer displayed on screen, but it happens
to do so while preserving the "current buffer", so when the function
returns, the current buffer is still the buffer in which you found the
link rather than the new buffer that is now displayed in its place.

As soon as the current *command* ends, the current buffer will be re-set
by the command loop to point to the buffer of the currently selected
window, i.e. the buffer which the user thinks of as "current" (in this
case, the new buffer containing the target of the link).


        Stefan




reply via email to

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