[Top][All Lists]

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

Recursive edits in `save-excursion'

From: Stuart D. Herring
Subject: Recursive edits in `save-excursion'
Date: Sun, 24 Sep 2006 20:57:09 -0700 (PDT)
User-agent: SquirrelMail/1.4.6-7.el3.7lanl

I find that I get unexpected results from multiple recursive edits in
`save-excursion' forms in one command (e.g., evaluating

(list (save-excursion (recursive-edit) (current-buffer)) (save-excursion
(recursive-edit) (current-buffer)))

and, during each recursive edit, selecting some different buffer).  The
first time, `current-buffer' returns the buffer selected during the
recursive edit, but the second time the buffer that was current when the
evaluation began is returned.  Similar things happen with `point-marker'
in place of `current-buffer', which is how I found this.  Is this a bug,
or is it just some consequence of interaction between the (recursive)
command loop and `save-excursion' that I don't understand?


PS - The "Recent Input" below is everything from "emacs -Q", so can be
used as a precise test case.

In GNU Emacs (i686-pc-linux-gnu, Motif Version 2.2.2)
 of 2006-09-24 on callahan
X server distributor `The XFree86 Project, Inc', version 11.0.40300000
configured using `configure '--with-x-toolkit=motif' '--with-xpm'
'--with-jpeg' '--with-tiff' '--with-gif' '--with-png' '--with-x''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8
  default-enable-multibyte-characters: t

Major mode: Fundamental

Minor modes in effect:
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  blink-cursor-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  auto-compression-mode: t
  line-number-mode: t

Recent input:
C-x b a <return> C-x b b <return> C-x b * s c r <tab>
<return> ( l i s t SPC ( s a v e - e x c u r s i o
n SPC ( r e c u r s i v e - e d i t ) S-SPC ( c u r
r e n t - b u f f e r ) ) C-- C-M-k C-y SPC C-y ) C-x
C-e C-x b a <return> C-M-c C-x b b <return> C-M-c <help-echo>
<help-echo> <help-echo> <help-echo> <menu-bar> <help-menu>

Recent messages:
(emacs -Q)
For information about the GNU Project and its goals, type C-h C-p.
Mark set [2 times]
(#<buffer a> #<buffer *scratch*>)
Loading emacsbug...
Loading regexp-opt...done
Loading emacsbug...done

This product is sold by volume, not by mass.  If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during

reply via email to

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