* abbrev and escapes
@ 2009-11-23 10:24 harven
2009-11-24 3:25 ` Stefan Monnier
0 siblings, 1 reply; 2+ messages in thread
From: harven @ 2009-11-23 10:24 UTC (permalink / raw
To: help-gnu-emacs
Here is a sample code that works with emacs22 in fundamental or tex mode.
It expands \med into \medskip.
(progn
(clear-abbrev-table my-table)
(define-abbrev-table 'my-table '(
("success" "success again")
("\\med" "\\medskip")))
(setq local-abbrev-table my-table)
(setq abbrev-mode t)
(setq words-include-escapes t))
Unfortunately, it does not work anymore with emacs23.
I tried tweaking the new :regexp property to no avail.
(abbrev-table-put my-table :regexp "\\<?\\(\\\\?\\w+\\)\\W*")
I also tried
"\\(\\(\\\\\\|\\<\\)\\w+\\)\\W*"
"\\(\\(\\<\\|\w\\)\\w+\\)\\W*"
"\\(\\<?\\\\?\\w+\\)\\W*"
"\\(\\\\?\\w+\\)\\W*"
The closest I came is "\\(\\\\\\w+\\)\\W*"
that expands \med but, of course, not success.
What am I doing wrong here ?
BTW, isn't there a typo in the manual ?
The default regexp given there (36.8 Abbrev Table Properties)
is "\\<\\(\\w+\\)\\W" and does not seem to work, but the one that comes with
the definition of define-abbrev-table is "\\<\\(\\w+\\)\\W*" (and it works)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: abbrev and escapes
2009-11-23 10:24 abbrev and escapes harven
@ 2009-11-24 3:25 ` Stefan Monnier
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2009-11-24 3:25 UTC (permalink / raw
To: help-gnu-emacs
> Unfortunately, it does not work anymore with emacs23.
Try M-x report-emacs-bug.
Stefan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-11-24 3:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-23 10:24 abbrev and escapes harven
2009-11-24 3:25 ` Stefan Monnier
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.