# HG changeset patch # User Richard M. Stallman # Date 1190305895 0 # Node ID a5c8194cf0e834eb6b5c35bc9ef43843bd1827af # Parent 40619cd555e9e591db83147d9b845c5ec5216e27 (comment-add): If EXTRA, double `comment-add' value. diff -r 40619cd555e9 -r a5c8194cf0e8 lisp/newcomment.el --- a/lisp/newcomment.el Thu Sep 20 14:58:41 2007 +0000 +++ b/lisp/newcomment.el Thu Sep 20 16:31:35 2007 +0000 @@ -942,11 +942,11 @@ ;; Compute the number of extra semicolons to add to the comment starter ;; in Lisp mode, extra stars in C mode, etc. ;; If ARG is non-nil, just follow ARG. -;; If the comment-starter is mult-char, just follow ARG. -;; Otherwise obey comment-add, and add one more if EXTRA is non-nil. +;; If the comment-starter is multi-char, just follow ARG. +;; Otherwise obey comment-add, and double it if EXTRA is non-nil. (defun comment-add (arg &optional extra) (if (and (null arg) (= (string-match "[ \t]*\\'" comment-start) 1)) - (+ comment-add (if extra 1 0)) + (* comment-add (if extra 2 1)) (1- (prefix-numeric-value arg)))) (defun comment-region-internal (beg end cs ce @@ -1088,7 +1088,7 @@ (t ;; Add an extra semicolon in Lisp and similar modes. ;; If STYLE doesn't specify indenting the comments, - ;; then add yet one more semicolon. + ;; then double the value of `comment-add'. (setq numarg (comment-add arg (null (nth 3 style)))) (comment-region-internal beg end