[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: question about buffer mechanism
From: |
akrl |
Subject: |
Re: question about buffer mechanism |
Date: |
Thu, 23 Aug 2018 08:49:41 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.3 (berkeley-unix) |
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> 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
Hi Stefan,
thanks this really helped me to understand how it works and to solve my
problem.
Bests
Andrea
--
akrl@sdf.org