From 5c93063129de0a2005aac1ffe1c48c372b918634 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 18 Mar 2021 20:01:26 +0200 Subject: [PATCH] * lisp/newcomment.el: Allow 'comment-continue' with whitespace (bug#47167) * lisp/newcomment.el (comment-region-default-1): Still use 'comment-continue' as a string with whitespace even when 'comment-padright' returns nil. --- lisp/newcomment.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/newcomment.el b/lisp/newcomment.el index ea47eec4fda..a5bfb067954 100644 --- a/lisp/newcomment.el +++ b/lisp/newcomment.el @@ -1300,7 +1300,11 @@ out." (let ((s (comment-padleft comment-end numarg))) (and s (if (string-match comment-end-skip s) s (comment-padright comment-end)))) - (if multi (comment-padright comment-continue numarg)) + (if multi + (or (comment-padright comment-continue numarg) + ;; `comment-padright' returns nil when + ;; `comment-continue' contains only whitespace + (and (stringp comment-continue) comment-continue))) (if multi (comment-padleft (comment-string-reverse comment-continue) numarg)) block -- 2.39.2