From 33d71ec3b1f0efd667f3e27dd9b9c046fc6bce04 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 3 Apr 2008 22:26:39 +0000 Subject: [PATCH] (comment-enter-backward): Be careful to restore point changed during narrowing. --- lisp/ChangeLog | 5 +++++ lisp/newcomment.el | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d8aad9da953..efdc2bfc405 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -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 --git a/lisp/newcomment.el b/lisp/newcomment.el index 565b5e39137..3961d9dbb36 100644 --- a/lisp/newcomment.el +++ b/lisp/newcomment.el @@ -492,10 +492,11 @@ Point is assumed to be just at the end of a comment." ;; 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 -- 2.11.4.GIT