[Top][All Lists]

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

save-excursion doesn't restore point

From: Dominic Mitchell
Subject: save-excursion doesn't restore point
Date: Tue, 24 Jan 2006 17:12:33 +0000 (GMT)

This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English, because the Emacs maintainers do not have
translators to read other languages for them.

Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list,
and to the gnu.emacs.bug news group.

In GNU Emacs 21.3.1 (i386--freebsd, X toolkit, Xaw3d scroll bars)
 of 2005-12-09 on ppe.happygiraffe.net
configured using `configure  --x-libraries=/usr/X11R6/lib 
--x-includes=/usr/X11R6/include --prefix=/usr/local i386--freebsd'
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: nil
  locale-coding-system: nil
  default-enable-multibyte-characters: t

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

I have this bit of code in my .emacs file:

(defun perltidy ()
  "Run perltidy on the current region or buffer."
    (unless mark-active (mark-defun))
    (shell-command-on-region (point) (mark) "perltidy -q" nil t)))

If I run it from inside a Perl function (in cperl-mode), then the
point ends up _above_ the Perl function, instead of remembering where
it was.

I would guess that this is because save-excursion uses markers, and
those markers then get invalidated by shell-command-on-region.  But
it's still a little weird.  Is this a bug?


Recent input:
ESC ? a b u g RET ESC x r e p o r t TAB RET

Recent messages:
Loading easy-mmode...done
Loading /usr/local/libexec/emacs/21.3/i386--freebsd/fns-21.3.1.el 
Loading executable...done
Loading haskell-site-file...done
For information about the GNU Project and its goals, type C-h C-p.
Loading view...done

Loading apropos...done
Type C-x 1 to remove help window.  C-M-v to scroll the help.
Loading emacsbug...done

reply via email to

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