[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Testing new abbrev tables in elisp
From: |
Juri Linkov |
Subject: |
Re: Testing new abbrev tables in elisp |
Date: |
Wed, 31 Oct 2007 18:09:32 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) |
>> Beside of case-sensitivity another theme is in the
>> pipe: to allow multi-word abbrevs.
>
> Since I've installed my code this is now possible. Just set the :regexp
> property of the abbrev table accordingly.
It's easy to write such code now to do this indeed, thanks.
For example,
(defvar dict
'(("multi-word abbrev" "multi-word expansion")
;; ...
))
(dolist (d dict)
(define-abbrev global-abbrev-table (car d) (cadr d)))
(abbrev-table-put global-abbrev-table
:regexp (regexp-opt (mapcar 'car dict) 'words))
But maybe abbrev-mode should try to update :regexp automatically when the
user interactively defines a new multi-word abbrev? So instead of giving
the error message "Some abbrev characters are not word constituents" it
could run something like:
(let ((abbrevs ()))
(mapatoms (lambda (sym)
(if (symbol-value sym) (push (symbol-name sym) abbrevs)))
global-abbrev-table)
(abbrev-table-put global-abbrev-table :regexp (regexp-opt abbrevs
'words)))
to rebuild :regexp from all abbrevs when at least one of them is not
word constituent?
--
Juri Linkov
http://www.jurta.org/emacs/
- Re: Abbrev tables in elisp with some extra stuff, (continued)
- Re: Abbrev tables in elisp with some extra stuff, Richard Stallman, 2007/10/17
- Re: Abbrev tables in elisp with some extra stuff, Stefan Monnier, 2007/10/23
- Re: Abbrev tables in elisp with some extra stuff, Richard Stallman, 2007/10/24
- Testing new abbrev tables in elisp, Stefan Monnier, 2007/10/26
- Re: Testing new abbrev tables in elisp, Andreas Röhler, 2007/10/26
- Re: Testing new abbrev tables in elisp, Stefan Monnier, 2007/10/26
- Re: Testing new abbrev tables in elisp, Andreas Röhler, 2007/10/28
- Re: Testing new abbrev tables in elisp, Stefan Monnier, 2007/10/28
- Re: Testing new abbrev tables in elisp, Andreas Röhler, 2007/10/30
- Re: Testing new abbrev tables in elisp, Richard Stallman, 2007/10/31
- Re: Testing new abbrev tables in elisp,
Juri Linkov <=
- Re: Testing new abbrev tables in elisp, Stefan Monnier, 2007/10/31