[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-29 97b818a4fb9: Fix doc strings of 'mark-sexp' and 'mark-word'
From: |
Eli Zaretskii |
Subject: |
emacs-29 97b818a4fb9: Fix doc strings of 'mark-sexp' and 'mark-word' |
Date: |
Sat, 6 May 2023 04:47:17 -0400 (EDT) |
branch: emacs-29
commit 97b818a4fb91668f70bc9b298e10fd8ae600339b
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>
Fix doc strings of 'mark-sexp' and 'mark-word'
* lisp/emacs-lisp/lisp.el (mark-sexp):
* lisp/simple.el (mark-word): Clarify the doc strings in various
usage cases. (Bug#62892)
---
lisp/emacs-lisp/lisp.el | 22 ++++++++++++++++------
lisp/simple.el | 22 ++++++++++++++++------
2 files changed, 32 insertions(+), 12 deletions(-)
diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el
index e3ed28f097a..b91d56cfb4f 100644
--- a/lisp/emacs-lisp/lisp.el
+++ b/lisp/emacs-lisp/lisp.el
@@ -92,12 +92,22 @@ report errors as appropriate for this kind of usage."
(forward-sexp (- arg) interactive))
(defun mark-sexp (&optional arg allow-extend)
- "Set mark ARG sexps from point.
-The place mark goes is the same place \\[forward-sexp] would
-move to with the same argument.
-Interactively, if this command is repeated
-or (in Transient Mark mode) if the mark is active,
-it marks the next ARG sexps after the ones already marked.
+ "Set mark ARG sexps from point or move mark one sexp.
+When called from Lisp with ALLOW-EXTEND ommitted or nil, mark is
+set ARG sexps from point.
+With ARG and ALLOW-EXTEND both non-nil (interactively, with prefix
+argument), the place to which mark goes is the same place \\[forward-sexp]
+would move to with the same argument; if the mark is active, it moves
+ARG sexps from its current position, otherwise it is set ARG sexps
+from point.
+When invoked interactively without a prefix argument and no active
+region, mark moves one sexp forward.
+When invoked interactively without a prefix argument, and region
+is active, mark moves one sexp away of point (i.e., forward
+if mark is at or after point, back if mark is before point), thus
+extending the region by one sexp. Since the direction of region
+extension depends on the relative position of mark and point, you
+can change the direction by \\[exchange-point-and-mark].
This command assumes point is not in a string or comment."
(interactive "P\np")
(cond ((and allow-extend
diff --git a/lisp/simple.el b/lisp/simple.el
index b6efb06fc27..959e28c7b75 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -8668,12 +8668,22 @@ node `(elisp) Word Motion' for details."
(forward-word (- (or arg 1))))
(defun mark-word (&optional arg allow-extend)
- "Set mark ARG words away from point.
-The place mark goes is the same place \\[forward-word] would
-move to with the same argument.
-Interactively, if this command is repeated
-or (in Transient Mark mode) if the mark is active,
-it marks the next ARG words after the ones already marked."
+ "Set mark ARG words from point or move mark one word.
+When called from Lisp with ALLOW-EXTEND ommitted or nil, mark is
+set ARG words from point.
+With ARG and ALLOW-EXTEND both non-nil (interactively, with prefix
+argument), the place to which mark goes is the same place \\[forward-word]
+would move to with the same argument; if the mark is active, it moves
+ARG words from its current position, otherwise it is set ARG words
+from point.
+When invoked interactively without a prefix argument and no active
+region, mark moves one word forward.
+When invoked interactively without a prefix argument, and region
+is active, mark moves one word away of point (i.e., forward
+if mark is at or after point, back if mark is before point), thus
+extending the region by one word. Since the direction of region
+extension depends on the relative position of mark and point, you
+can change the direction by \\[exchange-point-and-mark]."
(interactive "P\np")
(cond ((and allow-extend
(or (and (eq last-command this-command) (mark t))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- emacs-29 97b818a4fb9: Fix doc strings of 'mark-sexp' and 'mark-word',
Eli Zaretskii <=