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.
(cond
((and org-use-speed-commands
(or (and (bolp) (looking-at outline-regexp))
(and (functionp org-use-speed-commands)
(funcall org-use-speed-commands)))
(let* ((cons '(?a))
(lookup (if (setcar cons last-command-char) (concat cons nil))))
(when lookup
(setq
org-speed-command
(or (cdr (assoc lookup org-speed-commands-user))
(cdr (assoc lookup org-speed-commands-default)))))))
...
diff --git a/lisp/org.el b/lisp/org.el
index 7be1443..316f50e 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -16535,7 +16535,7 @@ overwritten, and the table is not marked as
requiring realignment."
(setq
org-speed-command
(or (cdr (assoc (this-command-keys) org-speed-commands-user))
- (cdr (assoc (this-command-keys) org-speed-commands-default)))))
+ (cdr (assoc (char-to-string (event-to-character (elt
(this-command-keys) 0))) org-speed-commands-default)))))
(cond
((commandp org-speed-command)
(setq this-command org-speed-command)
--
“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