diff options
Diffstat (limited to 'lisp/newcomment.el')
-rw-r--r-- | lisp/newcomment.el | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lisp/newcomment.el b/lisp/newcomment.el index e111ae8e225..3eb158dc2c8 100644 --- a/lisp/newcomment.el +++ b/lisp/newcomment.el @@ -1292,7 +1292,15 @@ changed with `comment-style'." (defun comment-region-default (beg end &optional arg) (if comment-combine-change-calls - (combine-change-calls beg end (comment-region-default-1 beg end arg)) + (combine-change-calls beg + ;; A new line might get inserted and whitespace deleted + ;; after END for line comments. Ensure the next argument is + ;; after any and all changes. + (save-excursion + (goto-char end) + (forward-line) + (point)) + (comment-region-default-1 beg end arg)) (comment-region-default-1 beg end arg))) ;;;###autoload |