diff options
| author | Karl Heuer | 1998-04-13 18:55:05 +0000 |
|---|---|---|
| committer | Karl Heuer | 1998-04-13 18:55:05 +0000 |
| commit | 42d140b44bae98c137eafcd77ab539e24266ddce (patch) | |
| tree | 64ca7fe28e292eccef7f4829c7e6da47dc96b873 | |
| parent | 73635959b6404a1cd8b37099d319ca1cf459ca6b (diff) | |
| download | emacs-42d140b44bae98c137eafcd77ab539e24266ddce.tar.gz emacs-42d140b44bae98c137eafcd77ab539e24266ddce.zip | |
(tmm-get-keymap): Handle `menu-item' menu items.
| -rw-r--r-- | lisp/tmm.el | 84 |
1 files changed, 45 insertions, 39 deletions
diff --git a/lisp/tmm.el b/lisp/tmm.el index c532ec18f1f..5f96450dc5d 100644 --- a/lisp/tmm.el +++ b/lisp/tmm.el | |||
| @@ -401,45 +401,51 @@ It uses the free variable `tmm-table-undef' to keep undefined keys." | |||
| 401 | (setq elt (cdr elt)) | 401 | (setq elt (cdr elt)) |
| 402 | (if (eq elt 'undefined) | 402 | (if (eq elt 'undefined) |
| 403 | (setq tmm-table-undef (cons (cons event nil) tmm-table-undef)) | 403 | (setq tmm-table-undef (cons (cons event nil) tmm-table-undef)) |
| 404 | (or | 404 | (unless (assoc event tmm-table-undef) |
| 405 | (assoc event tmm-table-undef) | 405 | (cond ((if (listp elt) |
| 406 | (and (if (listp elt) | 406 | (or (keymapp elt) (eq (car elt) 'lambda)) |
| 407 | (or (keymapp elt) (eq (car elt) 'lambda)) | 407 | (fboundp elt)) |
| 408 | (fboundp elt)) | 408 | (setq km elt)) |
| 409 | (setq km elt)) | 409 | ((if (listp (cdr-safe elt)) |
| 410 | (and (if (listp (cdr-safe elt)) | 410 | (or (keymapp (cdr-safe elt)) |
| 411 | (or (keymapp (cdr-safe elt)) | 411 | (eq (car (cdr-safe elt)) 'lambda)) |
| 412 | (eq (car (cdr-safe elt)) 'lambda)) | 412 | (fboundp (cdr-safe elt))) |
| 413 | (fboundp (cdr-safe elt))) | 413 | (setq km (cdr elt)) |
| 414 | (setq km (cdr elt)) | 414 | (and (stringp (car elt)) (setq str (car elt)))) |
| 415 | (and (stringp (car elt)) (setq str (car elt)))) | 415 | ((if (listp (cdr-safe (cdr-safe elt))) |
| 416 | (and (if (listp (cdr-safe (cdr-safe elt))) | 416 | (or (keymapp (cdr-safe (cdr-safe elt))) |
| 417 | (or (keymapp (cdr-safe (cdr-safe elt))) | 417 | (eq (car (cdr-safe (cdr-safe elt))) 'lambda)) |
| 418 | (eq (car (cdr-safe (cdr-safe elt))) 'lambda)) | 418 | (fboundp (cdr-safe (cdr-safe elt)))) |
| 419 | (fboundp (cdr-safe (cdr-safe elt)))) | 419 | (setq km (cdr (cdr elt))) |
| 420 | (setq km (cdr (cdr elt))) | 420 | (and (stringp (car elt)) (setq str (car elt))) |
| 421 | (and (stringp (car elt)) (setq str (car elt))) | 421 | (and str |
| 422 | (or (and str | 422 | (stringp (cdr (car (cdr elt)))) ; keyseq cache |
| 423 | (stringp (cdr (car (cdr elt)))) ; keyseq cache | 423 | (setq cache (cdr (car (cdr elt)))) |
| 424 | (setq cache (cdr (car (cdr elt)))) | 424 | cache (setq str (concat str cache)))) |
| 425 | cache (setq str (concat str cache))) str)) | 425 | ((eq (car-safe elt) 'menu-item) |
| 426 | (and (if (listp (cdr-safe (cdr-safe (cdr-safe elt)))) | 426 | (setq km (nth 2 elt)) |
| 427 | (or (keymapp (cdr-safe (cdr-safe (cdr-safe elt)))) | 427 | (setq str (nth 1 elt)) |
| 428 | (eq (car (cdr-safe (cdr-safe (cdr-safe elt)))) 'lambda)) | 428 | (and str |
| 429 | (fboundp (cdr-safe (cdr-safe (cdr-safe elt))))) | 429 | (stringp (cdr (car (nth 3 elt)))) ; keyseq cache |
| 430 | ; New style of easy-menu | 430 | (setq cache (cdr (car (nth 3 elt)))) |
| 431 | (setq km (cdr (cdr (cdr elt)))) | 431 | cache |
| 432 | (and (stringp (car elt)) (setq str (car elt))) | 432 | (setq str (concat str cache)))) |
| 433 | (or (and str | 433 | ((if (listp (cdr-safe (cdr-safe (cdr-safe elt)))) |
| 434 | (stringp (cdr (car (cdr (cdr elt))))) ; keyseq cache | 434 | (or (keymapp (cdr-safe (cdr-safe (cdr-safe elt)))) |
| 435 | (setq cache (cdr (car (cdr (cdr elt))))) | 435 | (eq (car (cdr-safe (cdr-safe (cdr-safe elt)))) 'lambda)) |
| 436 | cache (setq str (concat str cache))) | 436 | (fboundp (cdr-safe (cdr-safe (cdr-safe elt))))) |
| 437 | str)) | 437 | ; New style of easy-menu |
| 438 | (and (stringp event) ; x-popup or x-popup element | 438 | (setq km (cdr (cdr (cdr elt)))) |
| 439 | (if (or in-x-menu (stringp (car-safe elt))) | 439 | (and (stringp (car elt)) (setq str (car elt))) |
| 440 | (setq str event event nil km elt) | 440 | (and str |
| 441 | (setq str event event nil km (cons 'keymap elt)) | 441 | (stringp (cdr (car (cdr (cdr elt))))) ; keyseq cache |
| 442 | ))) | 442 | (setq cache (cdr (car (cdr (cdr elt))))) |
| 443 | cache (setq str (concat str cache)))) | ||
| 444 | ((stringp event) ; x-popup or x-popup element | ||
| 445 | (if (or in-x-menu (stringp (car-safe elt))) | ||
| 446 | (setq str event event nil km elt) | ||
| 447 | (setq str event event nil km (cons 'keymap elt)) | ||
| 448 | )))) | ||
| 443 | (and km (stringp km) (setq str km)) | 449 | (and km (stringp km) (setq str km)) |
| 444 | ;; Verify that the command is enabled; | 450 | ;; Verify that the command is enabled; |
| 445 | ;; if not, don't mention it. | 451 | ;; if not, don't mention it. |