Ar an seachtú lá de mí Méan Fómhair, scríobh Robert Pluim:
On Fri, Sep 3, 2010 at 7:04 PM, Aidan Kehoe
<kehoea(a)parhasard.net> wrote:
>
> Ar an triú lá de mí Méan Fómhair, scríobh Robert Pluim:
>
> > So I was reading the latest org manual, and got to the section
> > about speed-keys, tried them out, and discovered they didn't
> > work in XEmacs since our this-command-keys returns a vector,
> > not a string. I've come up with the following, but surely
> > There Is a Better Way?
>
> They appear to have reinvented keymaps! I love human ingenuity. Here’s
> an ugly and fast equivalent, but really, org-speed-commands-default and
> org-speed-commands-user should be keymaps, not alists.
With lookups done lookup-key, unsurprisingly. I'll look at rewriting
that when I get a chance.
On a related note, is there any concept of having keymaps either
attached to a specific buffer position (overriding the default keymap
for the buffer) or with a precondition applied to see whether the
keymap should be used for lookup at all? That would allow you to do
things only at eg the start of lines without having to write a bunch
of boiler-plate code.
#'set-extent-keymap is what you want for that:
`set-extent-keymap' is a compiled Lisp function
-- loaded from "/home/aidan/xemacs-21.5-checked-out/lisp/extents.elc"
(set-extent-keymap EXTENT KEYMAP)
Documentation:
Set EXTENT's `keymap' property to KEYMAP.
and from the #'set-extent-property documentation:
[...]
keymap This keymap is consulted for mouse clicks on this
extent, or keypresses made while point is within the
extent.
--
“Apart from the nine-banded armadillo, man is the only natural host of
Mycobacterium leprae, although it can be grown in the footpads of mice.”
-- Kumar & Clark, Clinical Medicine, summarising improbable leprosy research
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/mailman/listinfo/xemacs-beta