1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-01 11:14:55 +00:00

(comment-region): Check for enough chars to delete

in the numrg != t case as in the numar = t case.
This commit is contained in:
Richard M. Stallman 1998-06-06 22:23:57 +00:00
parent b5e00b0200
commit e1f0a6d2e8

View File

@ -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]*$") ()