diff options
| author | Stefan Monnier | 2008-04-03 22:26:39 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-04-03 22:26:39 +0000 |
| commit | 33d71ec3b1f0efd667f3e27dd9b9c046fc6bce04 (patch) | |
| tree | 3155db6ab33a5653d3daff4dc0eaa6280572ce48 | |
| parent | 957e449ecc6c52f69236ce25bfc4487b5e5b7068 (diff) | |
| download | emacs-33d71ec3b1f0efd667f3e27dd9b9c046fc6bce04.tar.gz emacs-33d71ec3b1f0efd667f3e27dd9b9c046fc6bce04.zip | |
(comment-enter-backward): Be careful to restore point changed during narrowing.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | 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 @@ | |||
| 1 | 2008-04-03 Stephen Berman <Stephen.Berman@gmx.net> | ||
| 2 | |||
| 3 | * newcomment.el (comment-enter-backward): Be careful to restore | ||
| 4 | position changed during narrowing. | ||
| 5 | |||
| 1 | 2008-04-03 Giuliano Procida <giuliano.procida@googlemail.com> (tiny change) | 6 | 2008-04-03 Giuliano Procida <giuliano.procida@googlemail.com> (tiny change) |
| 2 | 7 | ||
| 3 | * progmodes/perl-mode.el (perl-font-lock-syntactic-keywords): | 8 | * 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." | |||
| 492 | ;; comment-end = "" | 492 | ;; comment-end = "" |
| 493 | (progn (backward-char) (skip-syntax-backward " ")) | 493 | (progn (backward-char) (skip-syntax-backward " ")) |
| 494 | (cond | 494 | (cond |
| 495 | ((save-restriction | 495 | ((save-excursion |
| 496 | (narrow-to-region (line-beginning-position) (point)) | 496 | (save-restriction |
| 497 | (goto-char (point-min)) | 497 | (narrow-to-region (line-beginning-position) (point)) |
| 498 | (re-search-forward (concat comment-end-skip "\\'") nil t)) | 498 | (goto-char (point-min)) |
| 499 | (re-search-forward (concat comment-end-skip "\\'") nil t))) | ||
| 499 | (goto-char (match-beginning 0))) | 500 | (goto-char (match-beginning 0))) |
| 500 | ;; comment-end-skip not found probably because it was not set | 501 | ;; comment-end-skip not found probably because it was not set |
| 501 | ;; right. Since \\s> should catch the single-char case, let's | 502 | ;; right. Since \\s> should catch the single-char case, let's |