From 0d0bbf0ea7c73b0e26060d9cf45967d406d96d30 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sat, 6 Sep 2025 13:57:59 -0500 Subject: don't leave trailing space if there's no end-comment character --- modules/custom-functions.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/custom-functions.el b/modules/custom-functions.el index b3a2b0a6..04be6c19 100644 --- a/modules/custom-functions.el +++ b/modules/custom-functions.el @@ -623,8 +623,11 @@ begin and end the line with the appropriate comment symbols based on programming (- space-on-each-side 1) space-on-each-side)) (insert comment-char)) - (insert " ") - (insert comment-end))))) + ;; Only insert trailing space and comment-end if comment-end is not empty + (when (not (string-empty-p comment-end)) + (insert " ") + (insert comment-end)))))) + (defun cj/comment-box () "Insert a comment box around text that the user inputs. The box extends to the fill column, centers the text, and uses the current -- cgit v1.2.3