all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: bojohan+news@dd.chalmers.se (Johan Bockgård)
To: help-gnu-emacs@gnu.org
Subject: Re: abbrev-expand-functions
Date: Fri, 13 Mar 2009 21:24:37 +0100	[thread overview]
Message-ID: <yoij7i2tqigq.fsf@remote2.student.chalmers.se> (raw)
In-Reply-To: xbaisklhr7bx.fsf@cam.ac.uk

Leo <sdl.web@gmail.com> 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)
      (and
       ;; The normal expansion.
       (funcall expander)
       ;; Return a symbol whose symbol-function has a non-nil
       ;; `no-self-insert' property.
       'my-no-self-insert))

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


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





  reply	other threads:[~2009-03-13 20:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-04 15:22 abbrev-expand-functions Leo
2009-03-13 11:27 ` abbrev-expand-functions Leo
2009-03-13 20:24   ` Johan Bockgård [this message]
2009-03-15 13:05     ` abbrev-expand-functions Leo
2009-03-15 16:34       ` abbrev-expand-functions Johan Bockgård
2009-03-15 19:41         ` abbrev-expand-functions Leo

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=yoij7i2tqigq.fsf@remote2.student.chalmers.se \
    --to=bojohan+news@dd.chalmers.se \
    --cc=help-gnu-emacs@gnu.org \
    /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.