aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2010-04-19 10:34:01 -0400
committerStefan Monnier2010-04-19 10:34:01 -0400
commitb5feea0feaf721c66ff34ee2728c76a4c028fa0f (patch)
treeb816c35e837b9bf943c6e2be08e2f8bec99e1800
parent9166b0f33fab2ff1aeb24ee349dd64744238348d (diff)
downloademacs-b5feea0feaf721c66ff34ee2728c76a4c028fa0f.tar.gz
emacs-b5feea0feaf721c66ff34ee2728c76a4c028fa0f.zip
* tmm.el: Add missing key-binding shortcuts.
(tmm-prompt): Remove obsolete call to x-popup-menu. (tmm-get-keymap): Add key-binding shortcuts now that they're not available in the "keyseq cache" any more.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/tmm.el40
2 files changed, 22 insertions, 22 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 78e2473e373..2cd1b4907bd 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,9 @@
12010-04-19 Stefan Monnier <monnier@iro.umontreal.ca> 12010-04-19 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * tmm.el (tmm-prompt): Remove obsolete call to x-popup-menu.
4 (tmm-get-keymap): Add key-binding shortcuts now that they're not
5 available in the "keyseq cache" any more.
6
3 * custom.el (defcustom): Add edebug spec. 7 * custom.el (defcustom): Add edebug spec.
4 8
52010-04-18 Juri Linkov <juri@jurta.org> 92010-04-18 Juri Linkov <juri@jurta.org>
diff --git a/lisp/tmm.el b/lisp/tmm.el
index e453dbde84b..0cbc72673a4 100644
--- a/lisp/tmm.el
+++ b/lisp/tmm.el
@@ -262,9 +262,6 @@ Its value should be an event that has a binding in MENU."
262 (condition-case nil 262 (condition-case nil
263 (require 'mouse) 263 (require 'mouse)
264 (error nil)) 264 (error nil))
265 (condition-case nil
266 (x-popup-menu nil choice) ; Get the shortcuts
267 (error nil))
268 (tmm-prompt choice)) 265 (tmm-prompt choice))
269 ;; We just handled a menu keymap and found a command. 266 ;; We just handled a menu keymap and found a command.
270 (choice 267 (choice
@@ -445,7 +442,7 @@ element of keymap, an `x-popup-menu' argument, or an element of
445`x-popup-menu' argument (when IN-X-MENU is not-nil). 442`x-popup-menu' argument (when IN-X-MENU is not-nil).
446This function adds the element only if it is not already present. 443This function adds the element only if it is not already present.
447It uses the free variable `tmm-table-undef' to keep undefined keys." 444It uses the free variable `tmm-table-undef' to keep undefined keys."
448 (let (km str cache plist filter visible enable (event (car elt))) 445 (let (km str plist filter visible enable (event (car elt)))
449 (setq elt (cdr elt)) 446 (setq elt (cdr elt))
450 (if (eq elt 'undefined) 447 (if (eq elt 'undefined)
451 (setq tmm-table-undef (cons (cons event nil) tmm-table-undef)) 448 (setq tmm-table-undef (cons (cons event nil) tmm-table-undef))
@@ -468,11 +465,7 @@ It uses the free variable `tmm-table-undef' to keep undefined keys."
468 (and (symbolp (cdr-safe (cdr-safe elt))) 465 (and (symbolp (cdr-safe (cdr-safe elt)))
469 (fboundp (cdr-safe (cdr-safe elt))))) 466 (fboundp (cdr-safe (cdr-safe elt)))))
470 (setq km (cddr elt)) 467 (setq km (cddr elt))
471 (and (stringp (car elt)) (setq str (car elt))) 468 (and (stringp (car elt)) (setq str (car elt))))
472 (and str
473 (stringp (cdr-safe (cadr elt))) ; keyseq cache
474 (setq cache (cdr (cadr elt)))
475 cache (setq str (concat str cache))))
476 469
477 ((eq (car-safe elt) 'menu-item) 470 ((eq (car-safe elt) 'menu-item)
478 ;; (menu-item TITLE COMMAND KEY ...) 471 ;; (menu-item TITLE COMMAND KEY ...)
@@ -489,13 +482,7 @@ It uses the free variable `tmm-table-undef' to keep undefined keys."
489 (setq km (and (eval visible) km))) 482 (setq km (and (eval visible) km)))
490 (setq enable (plist-get plist :enable)) 483 (setq enable (plist-get plist :enable))
491 (if enable 484 (if enable
492 (setq km (if (eval enable) km 'ignore))) 485 (setq km (if (eval enable) km 'ignore))))
493 (and str
494 (consp (nth 3 elt))
495 (stringp (cdr (nth 3 elt))) ; keyseq cache
496 (setq cache (cdr (nth 3 elt)))
497 cache
498 (setq str (concat str cache))))
499 486
500 ((if (listp (cdr-safe (cdr-safe (cdr-safe elt)))) 487 ((if (listp (cdr-safe (cdr-safe (cdr-safe elt))))
501 (or (keymapp (cdr-safe (cdr-safe (cdr-safe elt)))) 488 (or (keymapp (cdr-safe (cdr-safe (cdr-safe elt))))
@@ -504,16 +491,25 @@ It uses the free variable `tmm-table-undef' to keep undefined keys."
504 (fboundp (cdr-safe (cdr-safe (cdr-safe elt)))))) 491 (fboundp (cdr-safe (cdr-safe (cdr-safe elt))))))
505 ; New style of easy-menu 492 ; New style of easy-menu
506 (setq km (cdr (cddr elt))) 493 (setq km (cdr (cddr elt)))
507 (and (stringp (car elt)) (setq str (car elt))) 494 (and (stringp (car elt)) (setq str (car elt))))
508 (and str
509 (stringp (cdr-safe (car (cddr elt)))) ; keyseq cache
510 (setq cache (cdr (car (cdr (cdr elt)))))
511 cache (setq str (concat str cache))))
512 495
513 ((stringp event) ; x-popup or x-popup element 496 ((stringp event) ; x-popup or x-popup element
514 (if (or in-x-menu (stringp (car-safe elt))) 497 (if (or in-x-menu (stringp (car-safe elt)))
515 (setq str event event nil km elt) 498 (setq str event event nil km elt)
516 (setq str event event nil km (cons 'keymap elt)))))) 499 (setq str event event nil km (cons 'keymap elt)))))
500 (unless (eq km 'ignore)
501 (let ((binding (where-is-internal km nil t)))
502 (when binding
503 (setq binding (key-description binding))
504 ;; Try to align the keybindings.
505 (let ((colwidth (min 30 (- (/ (window-width) 2) 10))))
506 (setq str
507 (concat str
508 (make-string (max 2 (- colwidth
509 (string-width str)
510 (string-width binding)))
511 ?\s)
512 binding)))))))
517 (and km (stringp km) (setq str km)) 513 (and km (stringp km) (setq str km))
518 ;; Verify that the command is enabled; 514 ;; Verify that the command is enabled;
519 ;; if not, don't mention it. 515 ;; if not, don't mention it.