aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2023-06-17 05:02:56 -0400
committerEli Zaretskii2023-06-17 05:02:56 -0400
commitb51be64a715f9f00d3f413aff4ee8a10d30d2a04 (patch)
tree4d6aa8e8d2062bb79ff5944de4f51de96e7b150a
parentf01821cd00b1f941b6a3ea5fc44a10834d02786d (diff)
parent3b0bf359e9ac2d1a0abe1d625ce63fa8c9c6e9b4 (diff)
downloademacs-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.texi19
-rw-r--r--lisp/newcomment.el9
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
1178comment on the current line, along with the whitespace before it. 1178region is not active kills any comment on the current line, along with
1179Since the comment is saved to the kill ring, you can reinsert it on 1179the whitespace before it. Since the comment is saved to the kill
1180another line by moving to the end of that line, doing @kbd{C-y}, and 1180ring, you can reinsert it on another line by moving to the end of that
1181then @kbd{M-;} to realign the comment. You can achieve the same 1181line, doing @kbd{C-y}, and then @kbd{M-;} to realign the comment. You
1182effect as @kbd{C-u M-;} by typing @kbd{M-x comment-kill} 1182can 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 1183comment-kill} (@code{comment-dwim} actually calls @code{comment-kill}
1184subroutine when it is given a prefix argument). 1184as 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).
1357If the region is active and `transient-mark-mode' is on, call 1357If 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
1359case it calls `uncomment-region'). 1359case it calls `uncomment-region'); in this case, prefix numeric
1360argument ARG specifies how many characters to remove from each
1361comment delimiter (so don't specify a prefix argument whose value
1362is greater than the total length of the comment delimiters).
1360Else, if the current line is empty, call `comment-insert-comment-function' 1363Else, if the current line is empty, call `comment-insert-comment-function'
1361if it is defined, otherwise insert a comment and indent it. 1364if it is defined, otherwise insert a comment and indent it.
1362Else if a prefix ARG is specified, call `comment-kill'. 1365Else, if a prefix ARG is specified, call `comment-kill'; in this
1366case, prefix numeric argument ARG specifies on how many lines to kill
1367the comments.
1363Else, call `comment-indent'. 1368Else, call `comment-indent'.
1364You can configure `comment-style' to change the way regions are commented." 1369You can configure `comment-style' to change the way regions are commented."
1365 (interactive "*P") 1370 (interactive "*P")