diff options
| author | Richard M. Stallman | 1998-06-14 18:46:20 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-06-14 18:46:20 +0000 |
| commit | dd81ca0dd846b284e7fea5351089d896e0c8d57c (patch) | |
| tree | 5a6b97e619073ca1bbe380f14f10b133f8db2835 | |
| parent | 9a69bda1ebc8bfed11e047e7bb67ebec58d2486d (diff) | |
| download | emacs-dd81ca0dd846b284e7fea5351089d896e0c8d57c.tar.gz emacs-dd81ca0dd846b284e7fea5351089d896e0c8d57c.zip | |
(tmm-get-keymap): Handle :filter.
| -rw-r--r-- | lisp/tmm.el | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/tmm.el b/lisp/tmm.el index e7ffce153f3..72438186391 100644 --- a/lisp/tmm.el +++ b/lisp/tmm.el | |||
| @@ -399,7 +399,7 @@ element of keymap, an `x-popup-menu' argument, or an element of | |||
| 399 | `x-popup-menu' argument (when IN-X-MENU is not-nil). | 399 | `x-popup-menu' argument (when IN-X-MENU is not-nil). |
| 400 | This function adds the element only if it is not already present. | 400 | This function adds the element only if it is not already present. |
| 401 | It uses the free variable `tmm-table-undef' to keep undefined keys." | 401 | It uses the free variable `tmm-table-undef' to keep undefined keys." |
| 402 | (let (km str cache (event (car elt))) | 402 | (let (km str cache plist filter (event (car elt))) |
| 403 | (setq elt (cdr elt)) | 403 | (setq elt (cdr elt)) |
| 404 | (if (eq elt 'undefined) | 404 | (if (eq elt 'undefined) |
| 405 | (setq tmm-table-undef (cons (cons event nil) tmm-table-undef)) | 405 | (setq tmm-table-undef (cons (cons event nil) tmm-table-undef)) |
| @@ -425,8 +425,12 @@ It uses the free variable `tmm-table-undef' to keep undefined keys." | |||
| 425 | (setq cache (cdr (car (cdr elt)))) | 425 | (setq cache (cdr (car (cdr elt)))) |
| 426 | cache (setq str (concat str cache)))) | 426 | cache (setq str (concat str cache)))) |
| 427 | ((eq (car-safe elt) 'menu-item) | 427 | ((eq (car-safe elt) 'menu-item) |
| 428 | (setq plist (cdr-safe (cdr-safe (cdr-safe elt)))) | ||
| 428 | (setq km (nth 2 elt)) | 429 | (setq km (nth 2 elt)) |
| 429 | (setq str (nth 1 elt)) | 430 | (setq str (nth 1 elt)) |
| 431 | (setq filter (plist-get plist :filter)) | ||
| 432 | (if filter | ||
| 433 | (setq km (funcall filter km))) | ||
| 430 | (and str | 434 | (and str |
| 431 | (consp (nth 3 elt)) | 435 | (consp (nth 3 elt)) |
| 432 | (stringp (cdr (nth 3 elt))) ; keyseq cache | 436 | (stringp (cdr (nth 3 elt))) ; keyseq cache |