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

(comment-region): Delete spaces only if we

deleted a comment starter.
This commit is contained in:
Richard M. Stallman 1999-01-08 04:29:20 +00:00
parent bc10f81b82
commit 7be272f43c

View File

@ -2804,18 +2804,21 @@ not end the comment. Blank lines do not get comments."
(goto-char beg)
(if (or (eq numarg t) (< numarg 0))
(while (not (eobp))
(progn
(let (found-comment)
;; Delete comment start from beginning of line.
(if (eq numarg t)
(while (looking-at (regexp-quote cs))
(setq found-comment t)
(delete-char (length cs)))
(let ((count numarg))
(while (and (> 1 (setq count (1+ count)))
(looking-at (regexp-quote cs)))
(setq found-comment t)
(delete-char (length cs)))))
;; Delete comment padding from beginning of line
(when (and comment-padding (looking-at (regexp-quote cp)))
(delete-char comment-padding))
(when (and found-comment comment-padding
(looking-at (regexp-quote cp)))
(delete-char comment-padding))
;; Delete comment end from end of line.
(if (string= "" ce)
nil