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

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

with-current-buffer


From: Andreas Röhler
Subject: with-current-buffer
Date: Mon, 11 Nov 2019 09:31:08 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

Hi,

docstring of "with-current-buffer" says:

"Execute the forms in BODY with BUFFER-OR-NAME temporarily current."

However, seems the old buffer isn't stored, buffer-or-name specified here remain current.

Also don't see inside the macro which way the old buffer should be restored:

(defmacro with-current-buffer (buffer-or-name &rest body)
  "Execute the forms in BODY with BUFFER-OR-NAME temporarily current.
BUFFER-OR-NAME must be a buffer or the name of an existing buffer.
The value returned is the value of the last form in BODY.  See
also `with-temp-buffer'."
  (declare (indent 1) (debug t))
  `(save-current-buffer
     (set-buffer ,buffer-or-name)
     ,@body))


A bug?

Thanks,

Andreas,

GNU Emacs 26.3 (build 1, i686-pc-linux-gnu, GTK+ Version 3.14.5) of 2019-09-04




reply via email to

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