]> git.eshelyaron.com Git - emacs.git/commitdiff
(comment-enter-backward): Be careful to restore point changed during narrowing.
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 3 Apr 2008 22:26:39 +0000 (22:26 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 3 Apr 2008 22:26:39 +0000 (22:26 +0000)
lisp/ChangeLog
lisp/newcomment.el

index d8aad9da9533c7b3fd72fe4e6666ecbf5b70895a..efdc2bfc405cfcc6069d5c793728d159d0e7f449 100644 (file)
@@ -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):
index 565b5e39137d27192425b227810071293f718eaf..3961d9dbb36b8c8140273ed7f6ec604e8c990641 100644 (file)
@@ -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