From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: akrl Newsgroups: gmane.emacs.help Subject: Re: question about buffer mechanism Date: Sun, 19 Aug 2018 22:04:25 +0000 Organization: SDF Public Access UNIX System, Est. 1987 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1534716817 20527 195.159.176.226 (19 Aug 2018 22:13:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 19 Aug 2018 22:13:37 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (berkeley-unix) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Aug 20 00:13:33 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1frVwy-00057T-VG for geh-help-gnu-emacs@m.gmane.org; Mon, 20 Aug 2018 00:13:33 +0200 Original-Received: from localhost ([::1]:44259 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1frVz0-0000sW-4p for geh-help-gnu-emacs@m.gmane.org; Sun, 19 Aug 2018 18:15:38 -0400 Original-Path: usenet.stanford.edu!goblin3!goblin.stu.neva.ru!odin.sdf-eu.org!.POSTED.iceland.sdf.org!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Injection-Info: odin.sdf-eu.org; posting-host="iceland.sdf.org:205.166.94.5"; logging-data="16212"; mail-complaints-to="usenet@odin.sdf-eu.org" Cancel-Lock: sha1:e7h9eN4wmOLny+zsg2mdC64rcPI= Original-Xref: usenet.stanford.edu gnu.emacs.help:223574 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:117699 Archived-At: Stefan Monnier writes: >> When I call it on an org link the link at point is opened and when >> my-open-at-point has finished the current buffer is the one pointed by >> the link. > > Not sure what you mean by "the current buffer" above, but I suspect you > mean "the buffer that I visually see as being the current one" > (i.e. that corresponds to the buffer of the window that was selected at > the time the display is refreshed). > > This is not the definition of `current-buffer`, although the two are > tightly linked in practice by the fact that `current-buffer` is set to > the buffer of the window that is selected at the time a user causes > a command to be run. > > > Stefan > Hi Stefan, for current buffer I mean the "current buffer" as indicated by the manual (assuming my understanding of it is correct). I'll try to be more clear about my problem. If I have: (defun my-open-at-point (&rest _) (interactive) (org-open-at-point) (insert "foo")) When I call it with point on an org link on buffer "A" I obtain two effects: 1- after the execution the cursor is at the right position in the buffer "B" (the one containing the file targeted by the link) 2- "foo" is inserted in the buffer "A" (the one containing the link) I would really expect "foo" being inserted in the buffer "B" instead but this is not the case. When insert is executed the current buffer seams to be "A" but when my-open-at-point has finished seams to be "B". Where the current buffer after my-open-at-point has returned is changed? I suspect I'm really missing something basic. Thanks! Andrea -- akrl@sdf.org