diff options
| author | Eli Zaretskii | 2023-06-17 05:02:56 -0400 |
|---|---|---|
| committer | Eli Zaretskii | 2023-06-17 05:02:56 -0400 |
| commit | b51be64a715f9f00d3f413aff4ee8a10d30d2a04 (patch) | |
| tree | 4d6aa8e8d2062bb79ff5944de4f51de96e7b150a | |
| parent | f01821cd00b1f941b6a3ea5fc44a10834d02786d (diff) | |
| parent | 3b0bf359e9ac2d1a0abe1d625ce63fa8c9c6e9b4 (diff) | |
| download | emacs-b51be64a715f9f00d3f413aff4ee8a10d30d2a04.tar.gz emacs-b51be64a715f9f00d3f413aff4ee8a10d30d2a04.zip | |
Merge from origin/emacs-29
3b0bf359e9a Fix documentation of comment-dwim (bug#64104)
| -rw-r--r-- | doc/emacs/programs.texi | 19 | ||||
| -rw-r--r-- | lisp/newcomment.el | 9 |
2 files changed, 18 insertions, 10 deletions
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index 62df88a731e..953de2e4786 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi | |||
| @@ -1174,14 +1174,17 @@ were negated. | |||
| 1174 | 1174 | ||
| 1175 | @findex comment-kill | 1175 | @findex comment-kill |
| 1176 | @kindex C-u M-; | 1176 | @kindex C-u M-; |
| 1177 | @kbd{C-u M-;} (@code{comment-dwim} with a prefix argument) kills any | 1177 | @kbd{C-u M-;} (@code{comment-dwim} with a prefix argument) when the |
| 1178 | comment on the current line, along with the whitespace before it. | 1178 | region is not active kills any comment on the current line, along with |
| 1179 | Since the comment is saved to the kill ring, you can reinsert it on | 1179 | the whitespace before it. Since the comment is saved to the kill |
| 1180 | another line by moving to the end of that line, doing @kbd{C-y}, and | 1180 | ring, you can reinsert it on another line by moving to the end of that |
| 1181 | then @kbd{M-;} to realign the comment. You can achieve the same | 1181 | line, doing @kbd{C-y}, and then @kbd{M-;} to realign the comment. You |
| 1182 | effect as @kbd{C-u M-;} by typing @kbd{M-x comment-kill} | 1182 | can achieve the same effect as @kbd{C-u M-;} by typing @kbd{M-x |
| 1183 | (@code{comment-dwim} actually calls @code{comment-kill} as a | 1183 | comment-kill} (@code{comment-dwim} actually calls @code{comment-kill} |
| 1184 | subroutine when it is given a prefix argument). | 1184 | as a subroutine when it is given a prefix argument). Invoking |
| 1185 | @code{comment-dwim} with a prefix numeric argument, as in @w{@kbd{C-u | ||
| 1186 | @var{n} M-;}}, when there's no active region, tells | ||
| 1187 | @code{comment-kill} to kill comments on @var{n} lines. | ||
| 1185 | 1188 | ||
| 1186 | @kindex C-c C-c @r{(C mode)} | 1189 | @kindex C-c C-c @r{(C mode)} |
| 1187 | @findex comment-region | 1190 | @findex comment-region |
diff --git a/lisp/newcomment.el b/lisp/newcomment.el index 022bf3059be..9ae7de70a0e 100644 --- a/lisp/newcomment.el +++ b/lisp/newcomment.el | |||
| @@ -1356,10 +1356,15 @@ is passed on to the respective function." | |||
| 1356 | "Call the comment command you want (Do What I Mean). | 1356 | "Call the comment command you want (Do What I Mean). |
| 1357 | If the region is active and `transient-mark-mode' is on, call | 1357 | If the region is active and `transient-mark-mode' is on, call |
| 1358 | `comment-region' (unless it only consists of comments, in which | 1358 | `comment-region' (unless it only consists of comments, in which |
| 1359 | case it calls `uncomment-region'). | 1359 | case it calls `uncomment-region'); in this case, prefix numeric |
| 1360 | argument ARG specifies how many characters to remove from each | ||
| 1361 | comment delimiter (so don't specify a prefix argument whose value | ||
| 1362 | is greater than the total length of the comment delimiters). | ||
| 1360 | Else, if the current line is empty, call `comment-insert-comment-function' | 1363 | Else, if the current line is empty, call `comment-insert-comment-function' |
| 1361 | if it is defined, otherwise insert a comment and indent it. | 1364 | if it is defined, otherwise insert a comment and indent it. |
| 1362 | Else if a prefix ARG is specified, call `comment-kill'. | 1365 | Else, if a prefix ARG is specified, call `comment-kill'; in this |
| 1366 | case, prefix numeric argument ARG specifies on how many lines to kill | ||
| 1367 | the comments. | ||
| 1363 | Else, call `comment-indent'. | 1368 | Else, call `comment-indent'. |
| 1364 | You can configure `comment-style' to change the way regions are commented." | 1369 | You can configure `comment-style' to change the way regions are commented." |
| 1365 | (interactive "*P") | 1370 | (interactive "*P") |