(substring comment-start 1)))
;; Hasn't been necessary yet.
;; (unless (string-match comment-start-skip comment-continue)
- ;; (kill-local-variable 'comment-continue))
+ ;; (kill-local-variable 'comment-continue))
)
;; comment-skip regexps
(unless (and comment-start-skip
;; Update INDENT to leave at least one space
;; after other nonwhite text on the line.
(save-excursion
- (skip-chars-backward " \t")
+ (skip-chars-backward " \t")
(unless (bolp)
(setq indent (max indent (1+ (current-column))))))
;; If that's different from comment's current position, change it.
(box-equal nil)) ;Whether we might be using `=' for boxes.
(save-restriction
(narrow-to-region spt ept)
-
+
;; Remove the comment-start.
(goto-char ipt)
(skip-syntax-backward " ")
;; If there's something left but it doesn't look like
;; a comment-start any more, just remove it.
(delete-region (point-min) (point))))
-
+
;; Remove the end-comment (and leading padding and such).
(goto-char (point-max)) (comment-enter-backward)
;; Check for special `=' used sometimes in comment-box.
lines
(nth 3 style))))))
+;;;###autoload
(defun comment-box (beg end &optional arg)
"Comment out the BEG .. END region, putting it inside a box.
The numeric prefix ARG specifies how many characters to add to begin- and
end- comment markers additionally to what `comment-add' already specifies."
(interactive "*r\np")
+ (comment-normalize-vars)
(let ((comment-style (if (cadr (assoc comment-style comment-styles))
'box-multi 'box)))
(comment-region beg end (+ comment-add arg))))