# HG changeset patch # User Richard M. Stallman # Date 915769760 0 # Node ID 7ffc864294599285673e26cd624d2b7ccf844843 # Parent 660b6f8b792855ec85e6d9b46e52253d902bbcf4 (comment-region): Delete spaces only if we deleted a comment starter. diff -r 660b6f8b7928 -r 7ffc86429459 lisp/simple.el --- a/lisp/simple.el Fri Jan 08 04:19:24 1999 +0000 +++ b/lisp/simple.el Fri Jan 08 04:29:20 1999 +0000 @@ -2804,18 +2804,21 @@ (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