all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Behaviour for save-excursion
@ 2009-10-06 13:44 Nathaniel Flath
  2009-10-06 14:44 ` martin rudalics
  2009-10-06 14:48 ` Chong Yidong
  0 siblings, 2 replies; 3+ messages in thread
From: Nathaniel Flath @ 2009-10-06 13:44 UTC (permalink / raw)
  To: emacs-devel

[-- 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 --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-10-06 14:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-06 13:44 Behaviour for save-excursion Nathaniel Flath
2009-10-06 14:44 ` martin rudalics
2009-10-06 14:48 ` Chong Yidong

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.