# HG changeset patch # User Richard M. Stallman # Date 897171837 0 # Node ID b64e8aaad74eba5a4b2755ba359e08d0633a549d # Parent aaa851980d1e8863209756f6f82fe619fdca2041 (comment-region): Check for enough chars to delete in the numrg != t case as in the numar = t case. diff -r aaa851980d1e -r b64e8aaad74e lisp/simple.el --- 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]*$") ()