[Top][All Lists]

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

Re: abbrev-expand-functions

From: Johan Bockgård
Subject: Re: abbrev-expand-functions
Date: Fri, 13 Mar 2009 21:24:37 +0100
User-agent: Gnus/5.110009 (No Gnus v0.9) Emacs/23.0.90 (gnu/linux)

Leo <address@hidden> writes:

> On 2009-03-04 15:22 +0000, Leo wrote:
>> But according to the manual, it seems this is only possible by defining
>> the abbreviation with a 'no-self-insert hook. This is not an option to
>> me as I want my function to be general for all abbreviations.
>> Any idea how to get this done?
> Any elisp gurus that can offer some help to question? Thank you.

    ;;; For Emacs 23

    (fset 'my-no-self-insert 'my-no-self-insert-hook)
    (put 'my-no-self-insert-hook 'no-self-insert t)

    (defun my-abbrev-expand-function (expander)
       ;; The normal expansion.
       (funcall expander)
       ;; Return a symbol whose symbol-function has a non-nil
       ;; `no-self-insert' property.

    (add-hook 'abbrev-expand-functions 'my-abbrev-expand-function)

Note that no-self-insert interacts strangely with RET.

reply via email to

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