;;; tmm.el --- text mode access to menu-bar
;; Copyright (C) 1994, 1995, 1996, 2000, 2001, 2002, 2003,
-;; 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;; 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
;; Author: Ilya Zakharevich <ilya@math.mps.ohio-state.edu>
;; Maintainer: FSF
(defun tmm-shortcut ()
"Choose the shortcut that the user typed."
(interactive)
- (let ((c last-command-char) s)
+ (let ((c last-command-event) s)
(if (symbolp tmm-shortcut-style)
(setq c (funcall tmm-shortcut-style c)))
(if (memq c tmm-short-cuts)
(or (keymapp (cdr-safe (cdr-safe elt)))
(eq (car (cdr-safe (cdr-safe elt))) 'lambda))
(fboundp (cdr-safe (cdr-safe elt))))
- (setq km (cdr (cdr elt)))
+ (setq km (cddr elt))
(and (stringp (car elt)) (setq str (car elt)))
(and str
- (stringp (cdr (car (cdr elt)))) ; keyseq cache
- (setq cache (cdr (car (cdr elt))))
+ (stringp (cdr-safe (cadr elt))) ; keyseq cache
+ (setq cache (cdr (cadr elt)))
cache (setq str (concat str cache))))
((eq (car-safe elt) 'menu-item)
(eq (car (cdr-safe (cdr-safe (cdr-safe elt)))) 'lambda))
(fboundp (cdr-safe (cdr-safe (cdr-safe elt)))))
; New style of easy-menu
- (setq km (cdr (cdr (cdr elt))))
+ (setq km (cdr (cddr elt)))
(and (stringp (car elt)) (setq str (car elt)))
(and str
- (stringp (cdr (car (cdr (cdr elt))))) ; keyseq cache
+ (stringp (cdr-safe (car (cddr elt)))) ; keyseq cache
(setq cache (cdr (car (cdr (cdr elt)))))
cache (setq str (concat str cache))))
((stringp event) ; x-popup or x-popup element
(if (or in-x-menu (stringp (car-safe elt)))
(setq str event event nil km elt)
- (setq str event event nil km (cons 'keymap elt))
- ))))
+ (setq str event event nil km (cons 'keymap elt))))))
(and km (stringp km) (setq str km))
;; Verify that the command is enabled;
;; if not, don't mention it.