summaryrefslogtreecommitdiff
path: root/lisp/tmm.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2021-08-09 15:19:45 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2021-08-09 15:19:45 +0200
commit872ca0ff8e0a6f61dc9399fa65788d87c83c8ef6 (patch)
treeb33bac4211cbd1c0e5821ae02bdc7ee886636902 /lisp/tmm.el
parentfbd3207bb2d73eacda336d48d7b0509f9ebcbb1c (diff)
downloademacs-872ca0ff8e0a6f61dc9399fa65788d87c83c8ef6.tar.gz
emacs-872ca0ff8e0a6f61dc9399fa65788d87c83c8ef6.tar.bz2
emacs-872ca0ff8e0a6f61dc9399fa65788d87c83c8ef6.zip
Fix tmm-get-keymap under native-compile
* lisp/tmm.el (tmm-get-keymap): Make this work under natively-compiled Emacsen (and with lexical binding, too) (bug#49953).
Diffstat (limited to 'lisp/tmm.el')
-rw-r--r--lisp/tmm.el23
1 files changed, 6 insertions, 17 deletions
diff --git a/lisp/tmm.el b/lisp/tmm.el
index 71082bd2f4b..0d8c22d8717 100644
--- a/lisp/tmm.el
+++ b/lisp/tmm.el
@@ -410,23 +410,15 @@ It uses the free variable `tmm-table-undef' to keep undefined keys."
(if (eq elt 'undefined)
(setq tmm-table-undef (cons (cons event nil) tmm-table-undef))
(unless (assoc event tmm-table-undef)
- (cond ((if (listp elt)
- (or (keymapp elt) (eq (car elt) 'lambda))
- (and (symbolp elt) (fboundp elt)))
+ (cond ((or (functionp elt) (keymapp elt))
(setq km elt))
- ((if (listp (cdr-safe elt))
- (or (keymapp (cdr-safe elt))
- (eq (car (cdr-safe elt)) 'lambda))
- (and (symbolp (cdr-safe elt)) (fboundp (cdr-safe elt))))
+ ((or (keymapp (cdr-safe elt)) (functionp (cdr-safe elt)))
(setq km (cdr elt))
(and (stringp (car elt)) (setq str (car elt))))
- ((if (listp (cdr-safe (cdr-safe elt)))
- (or (keymapp (cdr-safe (cdr-safe elt)))
- (eq (car (cdr-safe (cdr-safe elt))) 'lambda))
- (and (symbolp (cdr-safe (cdr-safe elt)))
- (fboundp (cdr-safe (cdr-safe elt)))))
+ ((or (keymapp (cdr-safe (cdr-safe elt)))
+ (functionp (cdr-safe (cdr-safe elt))))
(setq km (cddr elt))
(and (stringp (car elt)) (setq str (car elt))))
@@ -447,11 +439,8 @@ It uses the free variable `tmm-table-undef' to keep undefined keys."
(if enable
(setq km (if (eval enable) km 'ignore))))
- ((if (listp (cdr-safe (cdr-safe (cdr-safe elt))))
- (or (keymapp (cdr-safe (cdr-safe (cdr-safe elt))))
- (eq (car (cdr-safe (cdr-safe (cdr-safe elt)))) 'lambda))
- (and (symbolp (cdr-safe (cdr-safe (cdr-safe elt))))
- (fboundp (cdr-safe (cdr-safe (cdr-safe elt))))))
+ ((or (keymapp (cdr-safe (cdr-safe (cdr-safe elt))))
+ (functionp (cdr-safe (cdr-safe (cdr-safe elt)))))
; New style of easy-menu
(setq km (cdr (cddr elt)))
(and (stringp (car elt)) (setq str (car elt))))