comparison lisp/newcomment.el @ 49768:ffe55e61c3fc

(comment-indent): Ensure space before added comment.
author Dave Love <fx@gnu.org>
date Thu, 13 Feb 2003 15:54:19 +0000
parents e88404e8f2cf
children 8ec8f6706902 d7ddb3e565de
comparison
equal deleted inserted replaced
49767:4a50d348a2b1 49768:ffe55e61c3fc
471 (save-excursion 471 (save-excursion
472 ;; Some comment-indent-function insist on not moving comments that 472 ;; Some comment-indent-function insist on not moving comments that
473 ;; are in column 0, so we first go to the likely target column. 473 ;; are in column 0, so we first go to the likely target column.
474 (indent-to comment-column) 474 (indent-to comment-column)
475 (setq begpos (point)) 475 (setq begpos (point))
476 ;; Ensure there's a space before the comment for things
477 ;; like sh where it matters (as well as being neater).
478 (unless (eq ?\ (char-syntax (char-before)))
479 (insert ?\ ))
476 (insert starter) 480 (insert starter)
477 (setq cpos (point-marker)) 481 (setq cpos (point-marker))
478 (insert ender))) 482 (insert ender)))
479 (goto-char begpos) 483 (goto-char begpos)
480 ;; Compute desired indent. 484 ;; Compute desired indent.