all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: akrl <akrl@sdf.org>
To: help-gnu-emacs@gnu.org
Subject: Re: question about buffer mechanism
Date: Thu, 23 Aug 2018 08:49:41 +0000	[thread overview]
Message-ID: <xjfva81h3h6.fsf@sdf.org> (raw)
In-Reply-To: mailman.5308.1534719353.1292.help-gnu-emacs@gnu.org

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


      parent reply	other threads:[~2018-08-23  8:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-19 19:04 question about buffer mechanism akrl
2018-08-19 20:34 ` Stefan Monnier
     [not found] ` <mailman.5302.1534710880.1292.help-gnu-emacs@gnu.org>
2018-08-19 22:04   ` akrl
2018-08-19 22:55     ` Stefan Monnier
     [not found]     ` <mailman.5308.1534719353.1292.help-gnu-emacs@gnu.org>
2018-08-23  8:49       ` akrl [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xjfva81h3h6.fsf@sdf.org \
    --to=akrl@sdf.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.