[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Eval keymapp in a macros
From: |
Arthur Miller |
Subject: |
Eval keymapp in a macros |
Date: |
Mon, 02 Aug 2021 14:16:56 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
I am not sure what I missunderstand here, but something I do. I am
trying to test if an object is a keymap, with keymapp in a
macro. Nothing fancy, just a small wrapper around define-key function.
However, I have to use eval to actually get keymapp to do something,
while I don't need to use eval with a listp or functionp predicate.
I am not so happy about using eval in there, so I would appreciate if
someone can enlighten me what I do wrong here (probably everything :)):
#+begin_src emacs-lisp
(defmacro with-key-map (mapname &rest body)
`(let ((map ,mapname))
(dolist (def '(,@body))
(define-key map
(if (vectorp (car def)) (car def)
(read-kbd-macro (car def)))
(if (or (listp (cdr def))
(functionp (cdr def)))
(cdr def)
(if (eval `(keymapp ,(cdr def)))
(eval (cdr def))))))))
#+end_src
- Eval keymapp in a macros,
Arthur Miller <=
- Re: Eval keymapp in a macros, Michael Heerdegen, 2021/08/02
- RE: [External] : Re: Eval keymapp in a macros, Drew Adams, 2021/08/02
- Re: Eval keymapp in a macros, Arthur Miller, 2021/08/03
- Re: Eval keymapp in a macros, Michael Heerdegen, 2021/08/03
- Re: Eval keymapp in a macros, Arthur Miller, 2021/08/04
- Re: Eval keymapp in a macros, Michael Heerdegen, 2021/08/04
- Re: Eval keymapp in a macros, Arthur Miller, 2021/08/05
- Re: Eval keymapp in a macros, Michael Heerdegen, 2021/08/05
- Re: Eval keymapp in a macros, Arthur Miller, 2021/08/12
- Re: Eval keymapp in a macros, Yuri Khan, 2021/08/04