# HG changeset patch # User Stefan Monnier # Date 1207269707 0 # Node ID 8faef799d3b85d0972c5cc2b91b5c9b1a5c4a789 # Parent 0a96ecdd8f7a3a9411b2a8328f913e46b409ebd0 (comment-enter-backward): Be careful to restore point changed during narrowing. diff -r 0a96ecdd8f7a -r 8faef799d3b8 lisp/ChangeLog --- a/lisp/ChangeLog Thu Apr 03 08:38:51 2008 +0000 +++ b/lisp/ChangeLog Fri Apr 04 00:41:47 2008 +0000 @@ -1,3 +1,8 @@ +2008-04-04 Stephen Berman + + * newcomment.el (comment-enter-backward): Be careful to restore + position changed during narrowing. + 2008-04-03 Nick Roberts * progmodes/gdb-ui.el (gdb-mouse-set-clear-breakpoint): @@ -10,8 +15,8 @@ 2008-04-02 Alan Mackenzie - * progmodes/cc-cmds.el (c-defun-name, c-cpp-define-name): New - optimised functions to get the name of the current defun/macro. + * progmodes/cc-cmds.el (c-defun-name, c-cpp-define-name): + New optimised functions to get the name of the current defun/macro. * add-log.el (add-log-current-defun): Move the functionality which gets the current function name for C like modes to cc-cmds.el, diff -r 0a96ecdd8f7a -r 8faef799d3b8 lisp/newcomment.el --- a/lisp/newcomment.el Thu Apr 03 08:38:51 2008 +0000 +++ b/lisp/newcomment.el Fri Apr 04 00:41:47 2008 +0000 @@ -487,10 +487,11 @@ ;; 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. Maybe we're at EOB which implicitly ;; closes the comment.