From: Leo <sdl.web@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: abbrev-expand-functions
Date: Sun, 15 Mar 2009 13:05:52 +0000 [thread overview]
Message-ID: <xbai3adfq6kv.fsf@cam.ac.uk> (raw)
In-Reply-To: yoij7i2tqigq.fsf@remote2.student.chalmers.se
On 2009-03-13 20:24 +0000, Johan Bockgård wrote:
> 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.
This is brilliant!
Since the return value has a symbol-function, how is that
symbol-function being used in abbrev? I am asking this in hope to
understand better the consequences of setting it to a real function.
Is the following understanding correct?
Internally, each abbrev symbol is like an uninterned variable with a
structure like this:
(ABBREVNAME EXPANSION [HOOK] [PROPS...])
the symbol's each property maps to a slot in that structure, for
example, symbol-function maps to [HOOK] etc.
If the above is correct, where to find an exhaustive list of these
mappings? This will allow me to adjust other properties that may come up
in future.
Thank you very much.
--
.: Leo :. [ sdl.web AT gmail.com ] .: I use Emacs :.
www.git-scm.com
git - the one true version control system
next prev parent reply other threads:[~2009-03-15 13:05 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 ` abbrev-expand-functions Johan Bockgård
2009-03-15 13:05 ` Leo [this message]
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=xbai3adfq6kv.fsf@cam.ac.uk \
--to=sdl.web@gmail.com \
--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.