Improve documentation of 'current-word'
* lisp/simple.el (current-word): Clarify and improve the doc string. (Bug#24979)
This commit is contained in:
parent
0828126934
commit
a6213ce4b3
1 changed files with 11 additions and 6 deletions
|
@ -6832,13 +6832,18 @@ With argument ARG, do this that many times."
|
||||||
(kill-word (- arg)))
|
(kill-word (- arg)))
|
||||||
|
|
||||||
(defun current-word (&optional strict really-word)
|
(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.
|
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 optional arg STRICT is non-nil, return nil unless point is
|
||||||
if there is no word nearby.
|
within or adjacent to a word, otherwise look for a word within
|
||||||
The function, belying its name, normally finds a symbol.
|
point's line. If there is no word anywhere on point's line, the
|
||||||
If optional arg REALLY-WORD is non-nil, it finds just a word."
|
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
|
(save-excursion
|
||||||
(let* ((oldpoint (point)) (start (point)) (end (point))
|
(let* ((oldpoint (point)) (start (point)) (end (point))
|
||||||
(syntaxes (if really-word "w" "w_"))
|
(syntaxes (if really-word "w" "w_"))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue