diff options
| author | Richard M. Stallman | 2007-09-20 16:32:26 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2007-09-20 16:32:26 +0000 |
| commit | 7f821b793827f75f08becb06ce90b3e8a5e9d4fe (patch) | |
| tree | 2f26fd647f9337ba82191fe258856bc605bebbcc | |
| parent | c801ad51b2a5de48bf6005305a7a3b11370d2f58 (diff) | |
| download | emacs-7f821b793827f75f08becb06ce90b3e8a5e9d4fe.tar.gz emacs-7f821b793827f75f08becb06ce90b3e8a5e9d4fe.zip | |
(comment-add): If EXTRA, double `comment-add' value.
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/newcomment.el | 8 |
2 files changed, 8 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5c62f586ace..c9b13c2e9ff 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2007-09-20 Richard Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * newcomment.el (comment-add): If EXTRA, double `comment-add' value. | ||
| 4 | |||
| 1 | 2007-09-20 Stefan Monnier <monnier@iro.umontreal.ca> | 5 | 2007-09-20 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 6 | ||
| 3 | * add-log.el (add-log-current-defun): Fix thinko w.r.t derived-mode-p. | 7 | * add-log.el (add-log-current-defun): Fix thinko w.r.t derived-mode-p. |
diff --git a/lisp/newcomment.el b/lisp/newcomment.el index abe97c9efbe..6b0589da43d 100644 --- a/lisp/newcomment.el +++ b/lisp/newcomment.el | |||
| @@ -942,11 +942,11 @@ indentation to be kept as it was before narrowing." | |||
| 942 | ;; Compute the number of extra semicolons to add to the comment starter | 942 | ;; Compute the number of extra semicolons to add to the comment starter |
| 943 | ;; in Lisp mode, extra stars in C mode, etc. | 943 | ;; in Lisp mode, extra stars in C mode, etc. |
| 944 | ;; If ARG is non-nil, just follow ARG. | 944 | ;; If ARG is non-nil, just follow ARG. |
| 945 | ;; If the comment-starter is mult-char, just follow ARG. | 945 | ;; If the comment-starter is multi-char, just follow ARG. |
| 946 | ;; Otherwise obey comment-add, and add one more if EXTRA is non-nil. | 946 | ;; Otherwise obey comment-add, and double it if EXTRA is non-nil. |
| 947 | (defun comment-add (arg &optional extra) | 947 | (defun comment-add (arg &optional extra) |
| 948 | (if (and (null arg) (= (string-match "[ \t]*\\'" comment-start) 1)) | 948 | (if (and (null arg) (= (string-match "[ \t]*\\'" comment-start) 1)) |
| 949 | (+ comment-add (if extra 1 0)) | 949 | (* comment-add (if extra 2 1)) |
| 950 | (1- (prefix-numeric-value arg)))) | 950 | (1- (prefix-numeric-value arg)))) |
| 951 | 951 | ||
| 952 | (defun comment-region-internal (beg end cs ce | 952 | (defun comment-region-internal (beg end cs ce |
| @@ -1088,7 +1088,7 @@ The strings used as comment starts are built from | |||
| 1088 | (t | 1088 | (t |
| 1089 | ;; Add an extra semicolon in Lisp and similar modes. | 1089 | ;; Add an extra semicolon in Lisp and similar modes. |
| 1090 | ;; If STYLE doesn't specify indenting the comments, | 1090 | ;; If STYLE doesn't specify indenting the comments, |
| 1091 | ;; then add yet one more semicolon. | 1091 | ;; then double the value of `comment-add'. |
| 1092 | (setq numarg (comment-add arg (null (nth 3 style)))) | 1092 | (setq numarg (comment-add arg (null (nth 3 style)))) |
| 1093 | (comment-region-internal | 1093 | (comment-region-internal |
| 1094 | beg end | 1094 | beg end |