[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-25 9a73707 2/2: Fix docstring of dabbrev-abbrev-char
From: |
Noam Postavsky |
Subject: |
[Emacs-diffs] emacs-25 9a73707 2/2: Fix docstring of dabbrev-abbrev-char-regexp |
Date: |
Sun, 26 Mar 2017 09:23:08 -0400 (EDT) |
branch: emacs-25
commit 9a7370796455b87cebb1177eecc6fa985f61f6a8
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>
Fix docstring of dabbrev-abbrev-char-regexp
* lisp/dabbrev.el (dabbrev-abbrev-char-regexp): Using a value of nil
is equivalent to "\\sw\\|\\s_", and has no special behavior. If the
previous character doesn't match, we search backwards for one that
does, not throw an error. Replace Lisp example with C based one to
make it clear that "symbol" means a sequence of word and symbol
constituent characters, not a Lisp symbol (Bug#358).
---
lisp/dabbrev.el | 32 +++++++++++++++-----------------
1 file changed, 15 insertions(+), 17 deletions(-)
diff --git a/lisp/dabbrev.el b/lisp/dabbrev.el
index 3550d75..9c9dc8a 100644
--- a/lisp/dabbrev.el
+++ b/lisp/dabbrev.el
@@ -191,23 +191,21 @@ This variable has an effect only when the value of
This regexp will be surrounded with \\\\( ... \\\\) when actually used.
Set this variable to \"\\\\sw\" if you want ordinary words or
-\"\\\\sw\\\\|\\\\s_\" if you want symbols (including characters whose
-syntax is \"symbol\" as well as those whose syntax is \"word\".
-
-The value nil has a special meaning: the abbreviation is from point to
-previous word-start, but the search is for symbols.
-
-For instance, if you are programming in Lisp, `yes-or-no-p' is a symbol,
-while `yes', `or', `no' and `p' are considered words. If this
-variable is nil, then expanding `yes-or-no-' looks for a symbol
-starting with or containing `no-'. If you set this variable to
-\"\\\\sw\\\\|\\\\s_\", that expansion looks for a symbol starting with
-`yes-or-no-'. Finally, if you set this variable to \"\\\\sw\", then
-expanding `yes-or-no-' signals an error because `-' is not part of a word;
-but expanding `yes-or-no' looks for a word starting with `no'.
-
-The recommended value is nil, which will make dabbrev default to
-using \"\\\\sw\\\\|\\\\s_\"."
+\"\\\\sw\\\\|\\\\s_\" if you want symbols (including characters
+whose syntax is \"symbol\" as well as those whose syntax is
+\"word\"). The abbreviation is from point to the start of the
+previous sequence of characters matching this variable.
+
+The default value of nil is equivalent to \"\\\\sw\\\\|\\\\s_\".
+
+For instance, suppose the current buffer is in `c-mode'. If this
+variable is nil or \"\\\\sw\\\\|\\\\s_\", then expanding
+`debug_print_in_' looks for a symbol starting with
+`debug_print_in_'. If you set this variable to \"\\\\sw\", that
+expansion looks for a word prefixed with `in_' (e.g., it would
+match `in_range', but not `in_close_range'). If expanding
+`debug_print_in' it would look for a word starting with
+`in' (e.g. `integer')."
:type '(choice (const nil)
regexp)
:group 'dabbrev)