forked from colonelpanic/dotfiles
more prefix-alternatives fixes
This commit is contained in:
parent
348d2d1fa6
commit
d849f8fc5f
@ -208,8 +208,6 @@
|
|||||||
(interactive "p")
|
(interactive "p")
|
||||||
(message "%s" arg))
|
(message "%s" arg))
|
||||||
|
|
||||||
(imalison:prefix-alternatives multi-line multi-line multi-line)
|
|
||||||
|
|
||||||
(defmacro imalison:prefix-alternatives (name &rest alternatives)
|
(defmacro imalison:prefix-alternatives (name &rest alternatives)
|
||||||
`(defun ,name (arg)
|
`(defun ,name (arg)
|
||||||
(interactive "p")
|
(interactive "p")
|
||||||
@ -218,7 +216,7 @@
|
|||||||
,@(progn
|
,@(progn
|
||||||
(let ((last-power 1))
|
(let ((last-power 1))
|
||||||
(cl-loop for alternative in alternatives
|
(cl-loop for alternative in alternatives
|
||||||
collect `((eq prefix-value ,last-power) (quote ,alternative))
|
collect `((eq arg ,last-power) (quote ,alternative))
|
||||||
do (setq last-power (* last-power 4)))))))
|
do (setq last-power (* last-power 4)))))))
|
||||||
(setq function (or function (car alternatives))) ; Set a default value for function
|
(setq function (or function (car alternatives))) ; Set a default value for function
|
||||||
(setq current-prefix-arg nil)
|
(setq current-prefix-arg nil)
|
||||||
|
Loading…
Reference in New Issue
Block a user