summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1998-06-06 22:23:57 +0000
committerRichard M. Stallman <rms@gnu.org>1998-06-06 22:23:57 +0000
commite1f0a6d2e83242f6fabf1381f31321e115782b34 (patch)
tree42b2fae8f5d7281d408022455a00e0768cc3f216
parentb5e00b02008b667ed32e6fd47fd90e64a6ab95b6 (diff)
downloademacs-e1f0a6d2e83242f6fabf1381f31321e115782b34.tar.gz
(comment-region): Check for enough chars to delete
in the numrg != t case as in the numar = t case.
-rw-r--r--lisp/simple.el9
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]*$") ()