From: Noam Postavsky <npostavs@users.sourceforge.net>
To: Drew Adams <drew.adams@oracle.com>
Cc: 358@debbugs.gnu.org
Subject: bug#358: dabbrev-abbrev-char-regexp
Date: Fri, 24 Mar 2017 11:19:23 -0400 [thread overview]
Message-ID: <CAM-tV-9007U9BN92w=KGU0EAm1TES6BKAi5ZNsK=Tmpr8m25eg@mail.gmail.com> (raw)
In-Reply-To: <264f932c-e112-42d7-bb9d-d3b26b8b6d7b@default>
[-- Attachment #1: Type: text/plain, Size: 195 bytes --]
On Thu, Mar 23, 2017 at 5:49 PM, Drew Adams <drew.adams@oracle.com> wrote:
>>
>> As in, use a C example instead?
>
> Yep. Thx.
Here's the final patch, I'll push to emacs-25 in a couple of days.
[-- Attachment #2: 0001-Fix-docstring-of-dabbrev-abbrev-char-regexp.patch --]
[-- Type: application/octet-stream, Size: 2785 bytes --]
From 1a7a483c36be3e7bdaf71315032782bff356e247 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs@gmail.com>
Date: Fri, 24 Mar 2017 10:47:19 -0400
Subject: [PATCH] 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 @@ dabbrev-abbrev-char-regexp
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)
--
2.6.2.windows.1
next prev parent reply other threads:[~2017-03-24 15:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-04 13:30 bug#358: dabbrev-abbrev-char-regexp Otto Maddox
2008-10-14 1:07 ` Glenn Morris
2008-10-23 1:28 ` Glenn Morris
2011-07-06 17:46 ` Lars Magne Ingebrigtsen
2017-03-23 18:28 ` Noam Postavsky
2017-03-23 19:42 ` Drew Adams
2017-03-23 20:07 ` Noam Postavsky
2017-03-23 20:24 ` Drew Adams
2017-03-23 20:50 ` Noam Postavsky
2017-03-23 20:58 ` Drew Adams
2017-03-23 21:37 ` Noam Postavsky
2017-03-23 21:49 ` Drew Adams
2017-03-24 15:19 ` Noam Postavsky [this message]
2017-03-26 13:25 ` npostavs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAM-tV-9007U9BN92w=KGU0EAm1TES6BKAi5ZNsK=Tmpr8m25eg@mail.gmail.com' \
--to=npostavs@users.sourceforge.net \
--cc=358@debbugs.gnu.org \
--cc=drew.adams@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.