emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Testing new abbrev tables in elisp


From: Stefan Monnier
Subject: Re: Testing new abbrev tables in elisp
Date: Wed, 31 Oct 2007 13:44:33 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux)

> 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?

Indeed it could.  It could even rebuild it dynamically from the abbrev
table's :enable-function by looking at the :abbrev-table-modiff value to
detect changes.


        Stefan


PS: I believe I've provided enough hooks to do most such crazy things.
My own personal interest in improving abbrevs was in their use for
skeletons, so I'll let other people work on other aspects.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]