diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2008-04-03 22:26:39 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2008-04-03 22:26:39 +0000 |
commit | 33d71ec3b1f0efd667f3e27dd9b9c046fc6bce04 (patch) | |
tree | 3155db6ab33a5653d3daff4dc0eaa6280572ce48 /lisp/newcomment.el | |
parent | 957e449ecc6c52f69236ce25bfc4487b5e5b7068 (diff) | |
download | emacs-33d71ec3b1f0efd667f3e27dd9b9c046fc6bce04.tar.gz |
(comment-enter-backward): Be careful to restore point changed during narrowing.
Diffstat (limited to 'lisp/newcomment.el')
-rw-r--r-- | lisp/newcomment.el | 9 |
1 files changed, 5 insertions, 4 deletions
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 |