diff options
| -rw-r--r-- | lisp/simple.el | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index 45b68b65599..ca083f963d5 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2769,10 +2769,11 @@ not end the comment. Blank lines do not get comments." ;; this is questionable if comment-end ends in whitespace ;; that is pretty brain-damaged though (skip-chars-backward " \t") - (save-excursion - (backward-char (length ce)) - (if (looking-at (regexp-quote ce)) - (delete-char (length ce)))))))) + (if (>= (- (point) (point-min)) (length ce)) + (save-excursion + (backward-char (length ce)) + (if (looking-at (regexp-quote ce)) + (delete-char (length ce))))))))) (forward-line 1)) ;; Insert at beginning and at end. (if (looking-at "[ \t]*$") () |
