# HG changeset patch # User Stefan Monnier # Date 1207261599 0 # Node ID 5d2b21aad9af4345d38435a5b81750e62611313c # Parent 755f65f1ae15d2818eafd4c1829f5d08a49a02de (comment-enter-backward): Be careful to restore point changed during narrowing. diff -r 755f65f1ae15 -r 5d2b21aad9af lisp/ChangeLog --- a/lisp/ChangeLog Thu Apr 03 22:10:44 2008 +0000 +++ b/lisp/ChangeLog Thu Apr 03 22:26:39 2008 +0000 @@ -1,3 +1,8 @@ +2008-04-03 Stephen Berman + + * newcomment.el (comment-enter-backward): Be careful to restore + position changed during narrowing. + 2008-04-03 Giuliano Procida (tiny change) * progmodes/perl-mode.el (perl-font-lock-syntactic-keywords): diff -r 755f65f1ae15 -r 5d2b21aad9af lisp/newcomment.el --- a/lisp/newcomment.el Thu Apr 03 22:10:44 2008 +0000 +++ b/lisp/newcomment.el Thu Apr 03 22:26:39 2008 +0000 @@ -492,10 +492,11 @@ ;; comment-end = "" (progn (backward-char) (skip-syntax-backward " ")) (cond - ((save-restriction - (narrow-to-region (line-beginning-position) (point)) - (goto-char (point-min)) - (re-search-forward (concat comment-end-skip "\\'") nil t)) + ((save-excursion + (save-restriction + (narrow-to-region (line-beginning-position) (point)) + (goto-char (point-min)) + (re-search-forward (concat comment-end-skip "\\'") nil t))) (goto-char (match-beginning 0))) ;; comment-end-skip not found probably because it was not set ;; right. Since \\s> should catch the single-char case, let's