From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dominic Mitchell Newsgroups: gmane.emacs.bugs Subject: save-excursion doesn't restore point Date: Tue, 24 Jan 2006 17:12:33 +0000 (GMT) Message-ID: <20060124171233.1670DBACC@happygiraffe.net> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1138126944 12158 80.91.229.2 (24 Jan 2006 18:22:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 24 Jan 2006 18:22:24 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 24 19:22:16 2006 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1F1Snh-0006Ic-AD for geb-bug-gnu-emacs@m.gmane.org; Tue, 24 Jan 2006 19:21:53 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F1SqO-0006uc-Rr for geb-bug-gnu-emacs@m.gmane.org; Tue, 24 Jan 2006 13:24:40 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1F1RlT-0002gT-9D for bug-gnu-emacs@gnu.org; Tue, 24 Jan 2006 12:15:31 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1F1RlM-0002dj-7x for bug-gnu-emacs@gnu.org; Tue, 24 Jan 2006 12:15:30 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F1RlL-0002dU-T7 for bug-gnu-emacs@gnu.org; Tue, 24 Jan 2006 12:15:24 -0500 Original-Received: from [81.6.215.59] (helo=happygiraffe.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1F1RqI-0004Lo-CA for bug-gnu-emacs@gnu.org; Tue, 24 Jan 2006 12:20:30 -0500 Original-Received: from localhost (localhost.happygiraffe.net [127.0.0.1]) by happygiraffe.net (Postfix) with ESMTP id 84332BAD1 for ; Tue, 24 Jan 2006 17:12:33 +0000 (GMT) Original-Received: from happygiraffe.net ([127.0.0.1]) by localhost (ppe.happygiraffe.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 00885-07 for ; Tue, 24 Jan 2006 17:12:33 +0000 (GMT) Original-Received: by happygiraffe.net (Postfix, from userid 1001) id 1670DBACC; Tue, 24 Jan 2006 17:12:33 +0000 (GMT) Original-To: bug-gnu-emacs@gnu.org X-Virus-Scanned: amavisd-new at happygiraffe.net X-Mailman-Approved-At: Tue, 24 Jan 2006 12:55:00 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:14744 Archived-At: 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." (interactive) (save-excursion (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? Thanks, -Dom 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 (source)...done 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