make-repeat-command/toggle functions
11 years, 4 months
Uwe Brauer
Hello
Years ago the following code was posted to Xemacs
;; by Adrian Kubala Adrian Kubala <adrian(a)sixfingeredman.net>
(defun make-repeat-command (symbol command-list)
"Command changes with each repetition.
SYMBOL is a symbol unique to this command."
(if (eq last-command symbol)
(set symbol (+ (eval symbol) 1))
(set symbol 0))
(if (>= (eval symbol) (length command-list))
(set symbol 0))
(call-interactively (nth (eval symbol) command-list))
(setq this-command symbol))
I find it extremely useful since it allows me to toggle functions and
bind them on one key like in
(defun my-home ()
(interactive "_")
(make-repeat-command 'my-home '(beginning-of-line-text
beginning-of-line
beginning-of-buffer)))
I asked the author whether he would mind if the code is included in
xemacs. But maybe meanwhile we have some similar functionality?
thanks
Uwe Brauer
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta