diff options
| author | Eli Zaretskii | 2016-11-25 11:44:24 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2016-11-25 11:44:24 +0200 |
| commit | a6213ce4b3ab8435de80e01f6df7de261a0a8c87 (patch) | |
| tree | 1a509c5788614848f2391b7e34b9569d5e700e79 | |
| parent | 0828126934c89039383de845910c20f50e973837 (diff) | |
| download | emacs-a6213ce4b3ab8435de80e01f6df7de261a0a8c87.tar.gz emacs-a6213ce4b3ab8435de80e01f6df7de261a0a8c87.zip | |
Improve documentation of 'current-word'
* lisp/simple.el (current-word): Clarify and improve the doc
string. (Bug#24979)
| -rw-r--r-- | lisp/simple.el | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index dd2f0659220..295f8c63867 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -6832,13 +6832,18 @@ With argument ARG, do this that many times." | |||
| 6832 | (kill-word (- arg))) | 6832 | (kill-word (- arg))) |
| 6833 | 6833 | ||
| 6834 | (defun current-word (&optional strict really-word) | 6834 | (defun current-word (&optional strict really-word) |
| 6835 | "Return the symbol or word that point is on (or a nearby one) as a string. | 6835 | "Return the word at or near point, as a string. |
| 6836 | The return value includes no text properties. | 6836 | The return value includes no text properties. |
| 6837 | If optional arg STRICT is non-nil, return nil unless point is within | 6837 | |
| 6838 | or adjacent to a symbol or word. In all cases the value can be nil | 6838 | If optional arg STRICT is non-nil, return nil unless point is |
| 6839 | if there is no word nearby. | 6839 | within or adjacent to a word, otherwise look for a word within |
| 6840 | The function, belying its name, normally finds a symbol. | 6840 | point's line. If there is no word anywhere on point's line, the |
| 6841 | If optional arg REALLY-WORD is non-nil, it finds just a word." | 6841 | value is nil regardless of STRICT. |
| 6842 | |||
| 6843 | By default, this function treats as a single word any sequence of | ||
| 6844 | characters that have either word or symbol syntax. If optional | ||
| 6845 | arg REALLY-WORD is non-nil, only characters of word syntax can | ||
| 6846 | constitute a word." | ||
| 6842 | (save-excursion | 6847 | (save-excursion |
| 6843 | (let* ((oldpoint (point)) (start (point)) (end (point)) | 6848 | (let* ((oldpoint (point)) (start (point)) (end (point)) |
| 6844 | (syntaxes (if really-word "w" "w_")) | 6849 | (syntaxes (if really-word "w" "w_")) |