[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-25 a6213ce: Improve documentation of 'current-word'
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] emacs-25 a6213ce: Improve documentation of 'current-word' |
Date: |
Fri, 25 Nov 2016 09:45:28 +0000 (UTC) |
branch: emacs-25
commit a6213ce4b3ab8435de80e01f6df7de261a0a8c87
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>
Improve documentation of 'current-word'
* lisp/simple.el (current-word): Clarify and improve the doc
string. (Bug#24979)
---
lisp/simple.el | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/lisp/simple.el b/lisp/simple.el
index dd2f065..295f8c6 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -6832,13 +6832,18 @@ With argument ARG, do this that many times."
(kill-word (- arg)))
(defun current-word (&optional strict really-word)
- "Return the symbol or word that point is on (or a nearby one) as a string.
+ "Return the word at or near point, as a string.
The return value includes no text properties.
-If optional arg STRICT is non-nil, return nil unless point is within
-or adjacent to a symbol or word. In all cases the value can be nil
-if there is no word nearby.
-The function, belying its name, normally finds a symbol.
-If optional arg REALLY-WORD is non-nil, it finds just a word."
+
+If optional arg STRICT is non-nil, return nil unless point is
+within or adjacent to a word, otherwise look for a word within
+point's line. If there is no word anywhere on point's line, the
+value is nil regardless of STRICT.
+
+By default, this function treats as a single word any sequence of
+characters that have either word or symbol syntax. If optional
+arg REALLY-WORD is non-nil, only characters of word syntax can
+constitute a word."
(save-excursion
(let* ((oldpoint (point)) (start (point)) (end (point))
(syntaxes (if really-word "w" "w_"))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-25 a6213ce: Improve documentation of 'current-word',
Eli Zaretskii <=