aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuanma Barranquero2006-08-20 12:48:19 +0000
committerJuanma Barranquero2006-08-20 12:48:19 +0000
commit016c63b6451d72765ceaa11d6afff6b3dcfb84b1 (patch)
tree883c788fe4dba3bc770cb23bd62a5dd721b6eef7
parentce6297137d3f5ae98335f35119faae72d04d6a44 (diff)
downloademacs-016c63b6451d72765ceaa11d6afff6b3dcfb84b1.tar.gz
emacs-016c63b6451d72765ceaa11d6afff6b3dcfb84b1.zip
(comment-box): Call `comment-normalize-vars'. Add autoload cookie.
-rw-r--r--lisp/newcomment.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/newcomment.el b/lisp/newcomment.el
index 358c834de73..0cf0160afb1 100644
--- a/lisp/newcomment.el
+++ b/lisp/newcomment.el
@@ -299,7 +299,7 @@ the variables are properly set."
299 (substring comment-start 1))) 299 (substring comment-start 1)))
300 ;; Hasn't been necessary yet. 300 ;; Hasn't been necessary yet.
301 ;; (unless (string-match comment-start-skip comment-continue) 301 ;; (unless (string-match comment-start-skip comment-continue)
302 ;; (kill-local-variable 'comment-continue)) 302 ;; (kill-local-variable 'comment-continue))
303 ) 303 )
304 ;; comment-skip regexps 304 ;; comment-skip regexps
305 (unless (and comment-start-skip 305 (unless (and comment-start-skip
@@ -602,7 +602,7 @@ If CONTINUE is non-nil, use the `comment-continue' markers if any."
602 ;; Update INDENT to leave at least one space 602 ;; Update INDENT to leave at least one space
603 ;; after other nonwhite text on the line. 603 ;; after other nonwhite text on the line.
604 (save-excursion 604 (save-excursion
605 (skip-chars-backward " \t") 605 (skip-chars-backward " \t")
606 (unless (bolp) 606 (unless (bolp)
607 (setq indent (max indent (1+ (current-column)))))) 607 (setq indent (max indent (1+ (current-column))))))
608 ;; If that's different from comment's current position, change it. 608 ;; If that's different from comment's current position, change it.
@@ -769,7 +769,7 @@ comment markers."
769 (box-equal nil)) ;Whether we might be using `=' for boxes. 769 (box-equal nil)) ;Whether we might be using `=' for boxes.
770 (save-restriction 770 (save-restriction
771 (narrow-to-region spt ept) 771 (narrow-to-region spt ept)
772 772
773 ;; Remove the comment-start. 773 ;; Remove the comment-start.
774 (goto-char ipt) 774 (goto-char ipt)
775 (skip-syntax-backward " ") 775 (skip-syntax-backward " ")
@@ -798,7 +798,7 @@ comment markers."
798 ;; If there's something left but it doesn't look like 798 ;; If there's something left but it doesn't look like
799 ;; a comment-start any more, just remove it. 799 ;; a comment-start any more, just remove it.
800 (delete-region (point-min) (point)))) 800 (delete-region (point-min) (point))))
801 801
802 ;; Remove the end-comment (and leading padding and such). 802 ;; Remove the end-comment (and leading padding and such).
803 (goto-char (point-max)) (comment-enter-backward) 803 (goto-char (point-max)) (comment-enter-backward)
804 ;; Check for special `=' used sometimes in comment-box. 804 ;; Check for special `=' used sometimes in comment-box.
@@ -1062,11 +1062,13 @@ The strings used as comment starts are built from
1062 lines 1062 lines
1063 (nth 3 style)))))) 1063 (nth 3 style))))))
1064 1064
1065;;;###autoload
1065(defun comment-box (beg end &optional arg) 1066(defun comment-box (beg end &optional arg)
1066 "Comment out the BEG .. END region, putting it inside a box. 1067 "Comment out the BEG .. END region, putting it inside a box.
1067The numeric prefix ARG specifies how many characters to add to begin- and 1068The numeric prefix ARG specifies how many characters to add to begin- and
1068end- comment markers additionally to what `comment-add' already specifies." 1069end- comment markers additionally to what `comment-add' already specifies."
1069 (interactive "*r\np") 1070 (interactive "*r\np")
1071 (comment-normalize-vars)
1070 (let ((comment-style (if (cadr (assoc comment-style comment-styles)) 1072 (let ((comment-style (if (cadr (assoc comment-style comment-styles))
1071 'box-multi 'box))) 1073 'box-multi 'box)))
1072 (comment-region beg end (+ comment-add arg)))) 1074 (comment-region beg end (+ comment-add arg))))