aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2008-04-04 00:41:47 +0000
committerStefan Monnier2008-04-04 00:41:47 +0000
commit389ea1e5e58d9dabe14d8c10a259d63fe1cd8a50 (patch)
tree4dc8d155c3fa5bcf33e99430b86c515e72c2eb83
parentf1febefae4fe34bc8f9108f23c0e2d38177c512f (diff)
downloademacs-389ea1e5e58d9dabe14d8c10a259d63fe1cd8a50.tar.gz
emacs-389ea1e5e58d9dabe14d8c10a259d63fe1cd8a50.zip
(comment-enter-backward): Be careful to restore point changed during narrowing.
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/newcomment.el9
2 files changed, 12 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 8efe904a294..00e51eb43ed 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12008-04-04 Stephen Berman <Stephen.Berman@gmx.net>
2
3 * newcomment.el (comment-enter-backward): Be careful to restore
4 position changed during narrowing.
5
12008-04-03 Nick Roberts <nickrob@snap.net.nz> 62008-04-03 Nick Roberts <nickrob@snap.net.nz>
2 7
3 * progmodes/gdb-ui.el (gdb-mouse-set-clear-breakpoint): 8 * progmodes/gdb-ui.el (gdb-mouse-set-clear-breakpoint):
@@ -10,8 +15,8 @@
10 15
112008-04-02 Alan Mackenzie <acm@muc.de> 162008-04-02 Alan Mackenzie <acm@muc.de>
12 17
13 * progmodes/cc-cmds.el (c-defun-name, c-cpp-define-name): New 18 * progmodes/cc-cmds.el (c-defun-name, c-cpp-define-name):
14 optimised functions to get the name of the current defun/macro. 19 New optimised functions to get the name of the current defun/macro.
15 20
16 * add-log.el (add-log-current-defun): Move the functionality which 21 * add-log.el (add-log-current-defun): Move the functionality which
17 gets the current function name for C like modes to cc-cmds.el, 22 gets the current function name for C like modes to cc-cmds.el,
diff --git a/lisp/newcomment.el b/lisp/newcomment.el
index 4aed3157ada..5ee32e2ffcb 100644
--- a/lisp/newcomment.el
+++ b/lisp/newcomment.el
@@ -487,10 +487,11 @@ Point is assumed to be just at the end of a comment."
487 ;; comment-end = "" 487 ;; comment-end = ""
488 (progn (backward-char) (skip-syntax-backward " ")) 488 (progn (backward-char) (skip-syntax-backward " "))
489 (cond 489 (cond
490 ((save-restriction 490 ((save-excursion
491 (narrow-to-region (line-beginning-position) (point)) 491 (save-restriction
492 (goto-char (point-min)) 492 (narrow-to-region (line-beginning-position) (point))
493 (re-search-forward (concat comment-end-skip "\\'") nil t)) 493 (goto-char (point-min))
494 (re-search-forward (concat comment-end-skip "\\'") nil t)))
494 (goto-char (match-beginning 0))) 495 (goto-char (match-beginning 0)))
495 ;; comment-end-skip not found. Maybe we're at EOB which implicitly 496 ;; comment-end-skip not found. Maybe we're at EOB which implicitly
496 ;; closes the comment. 497 ;; closes the comment.