Mercurial > emacs
changeset 93622:5d2b21aad9af
(comment-enter-backward): Be careful to restore point changed during narrowing.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Thu, 03 Apr 2008 22:26:39 +0000 |
parents | 755f65f1ae15 |
children | 0d8f85920a66 |
files | lisp/ChangeLog lisp/newcomment.el |
diffstat | 2 files changed, 10 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- 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 <Stephen.Berman@gmx.net> + + * newcomment.el (comment-enter-backward): Be careful to restore + position changed during narrowing. + 2008-04-03 Giuliano Procida <giuliano.procida@googlemail.com> (tiny change) * progmodes/perl-mode.el (perl-font-lock-syntactic-keywords):
--- 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