From: Nathaniel Flath <flat0103@gmail.com>
To: emacs-devel@gnu.org
Subject: Behaviour for save-excursion
Date: Tue, 6 Oct 2009 09:44:38 -0400 [thread overview]
Message-ID: <5e3a506e0910060644y4ba6c73fv18d63ef8a1393117@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 749 bytes --]
What is the proper behaviour for save-excursion? The emacs-lisp intro and
the docstring seem to have slightly differing explanations - namely, the
docstring mentions that it saves current-buffer as well as point and mark,
and the emacs-lisp intro does not. Based on just what it does, I'm not
entirely sure which is correct - the following code snippet, executed in
*scratch*, returns the "*scratch*" buffer but the buffer displayed is the
"bar" buffer, and evaluating current-bufer afterwards returns the "bar"
buffer.
(progn
(save-excursion
(switch-to-buffer "bar"))
(current-buffer))
Either the manual or the docstring should be changed to reflect what it
does, but I'm not entirely sure which based on this.
Thanks,
Nathaniel Flath
[-- Attachment #2: Type: text/html, Size: 838 bytes --]
next reply other threads:[~2009-10-06 13:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-06 13:44 Nathaniel Flath [this message]
2009-10-06 14:44 ` Behaviour for save-excursion martin rudalics
2009-10-06 14:48 ` Chong Yidong
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=5e3a506e0910060644y4ba6c73fv18d63ef8a1393117@mail.gmail.com \
--to=flat0103@gmail.com \
--cc=emacs-devel@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.