Mercurial > emacs
changeset 22375:b64e8aaad74e
(comment-region): Check for enough chars to delete
in the numrg != t case as in the numar = t case.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 06 Jun 1998 22:23:57 +0000 |
parents | aaa851980d1e |
children | 84967b95587b |
files | lisp/simple.el |
diffstat | 1 files changed, 5 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/simple.el Sat Jun 06 22:10:19 1998 +0000 +++ b/lisp/simple.el Sat Jun 06 22:23:57 1998 +0000 @@ -2769,10 +2769,11 @@ ;; 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]*$") ()