diff options
| author | Noam Postavsky | 2017-03-24 10:47:19 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2017-03-26 09:14:15 -0400 |
| commit | 9a7370796455b87cebb1177eecc6fa985f61f6a8 (patch) | |
| tree | 0414bbab234e7a0d61ba1b4f9f94b076e00e6afc | |
| parent | afe8849bac1ec228680bcb590da6313800067d34 (diff) | |
| download | emacs-9a7370796455b87cebb1177eecc6fa985f61f6a8.tar.gz emacs-9a7370796455b87cebb1177eecc6fa985f61f6a8.zip | |
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).
| -rw-r--r-- | lisp/dabbrev.el | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/lisp/dabbrev.el b/lisp/dabbrev.el index 3550d75c46a..9c9dc8a4f38 100644 --- a/lisp/dabbrev.el +++ b/lisp/dabbrev.el | |||
| @@ -191,23 +191,21 @@ This variable has an effect only when the value of | |||
| 191 | This regexp will be surrounded with \\\\( ... \\\\) when actually used. | 191 | This regexp will be surrounded with \\\\( ... \\\\) when actually used. |
| 192 | 192 | ||
| 193 | Set this variable to \"\\\\sw\" if you want ordinary words or | 193 | Set this variable to \"\\\\sw\" if you want ordinary words or |
| 194 | \"\\\\sw\\\\|\\\\s_\" if you want symbols (including characters whose | 194 | \"\\\\sw\\\\|\\\\s_\" if you want symbols (including characters |
| 195 | syntax is \"symbol\" as well as those whose syntax is \"word\". | 195 | whose syntax is \"symbol\" as well as those whose syntax is |
| 196 | 196 | \"word\"). The abbreviation is from point to the start of the | |
| 197 | The value nil has a special meaning: the abbreviation is from point to | 197 | previous sequence of characters matching this variable. |
| 198 | previous word-start, but the search is for symbols. | 198 | |
| 199 | 199 | The default value of nil is equivalent to \"\\\\sw\\\\|\\\\s_\". | |
| 200 | For instance, if you are programming in Lisp, `yes-or-no-p' is a symbol, | 200 | |
| 201 | while `yes', `or', `no' and `p' are considered words. If this | 201 | For instance, suppose the current buffer is in `c-mode'. If this |
| 202 | variable is nil, then expanding `yes-or-no-' looks for a symbol | 202 | variable is nil or \"\\\\sw\\\\|\\\\s_\", then expanding |
| 203 | starting with or containing `no-'. If you set this variable to | 203 | `debug_print_in_' looks for a symbol starting with |
| 204 | \"\\\\sw\\\\|\\\\s_\", that expansion looks for a symbol starting with | 204 | `debug_print_in_'. If you set this variable to \"\\\\sw\", that |
| 205 | `yes-or-no-'. Finally, if you set this variable to \"\\\\sw\", then | 205 | expansion looks for a word prefixed with `in_' (e.g., it would |
| 206 | expanding `yes-or-no-' signals an error because `-' is not part of a word; | 206 | match `in_range', but not `in_close_range'). If expanding |
| 207 | but expanding `yes-or-no' looks for a word starting with `no'. | 207 | `debug_print_in' it would look for a word starting with |
| 208 | 208 | `in' (e.g. `integer')." | |
| 209 | The recommended value is nil, which will make dabbrev default to | ||
| 210 | using \"\\\\sw\\\\|\\\\s_\"." | ||
| 211 | :type '(choice (const nil) | 209 | :type '(choice (const nil) |
| 212 | regexp) | 210 | regexp) |
| 213 | :group 'dabbrev) | 211 | :group 'dabbrev) |