]> code.delx.au - gnu-emacs/blobdiff - lisp/tmm.el
(buffer-file-numbers-unique): New variable;
[gnu-emacs] / lisp / tmm.el
index ed5a93024c9aeec74b0ad6d330a79133578840ce..b648b9223187fc83d11b41462bf202bd2d40730e 100644 (file)
@@ -1,6 +1,6 @@
 ;;; tmm.el --- text mode access to menu-bar
 
-;; Copyright (C) 1994, 1995 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
 
 ;; Author: Ilya Zakharevich <ilya@math.mps.ohio-state.edu>
 ;; Maintainer: FSF
@@ -214,7 +214,9 @@ Its value should be an event that has a binding in MENU."
          ;; We just handled a menu keymap and found a command.
          (choice
           (if chosen-string
-              (call-interactively choice)
+              (progn
+                (setq last-command-event chosen-string)
+                (call-interactively choice))
             choice)))))
 
 
@@ -246,16 +248,18 @@ Stores a list of all the shortcuts in the free variable `tmm-short-cuts'."
                  (cons (concat f tmm-mid-prompt str) (cdr elt)))))
            (reverse list))))
 
-(defun tmm-define-keys ()
+(defun tmm-define-keys (minibuffer)
   (mapcar (lambda (str)
            (define-key (current-local-map) str 'tmm-shortcut)
            (define-key (current-local-map) (downcase str) 'tmm-shortcut))
          tmm-short-cuts)
-  (define-key (current-local-map) [pageup] 'tmm-goto-completions)
-  (define-key (current-local-map) [prior] 'tmm-goto-completions)
-  (define-key (current-local-map) "\ev" 'tmm-goto-completions)
-  (define-key (current-local-map) "\C-n" 'next-history-element)
-  (define-key (current-local-map) "\C-p" 'previous-history-element))
+  (if minibuffer
+      (progn
+       (define-key (current-local-map) [pageup] 'tmm-goto-completions)
+       (define-key (current-local-map) [prior] 'tmm-goto-completions)
+       (define-key (current-local-map) "\ev" 'tmm-goto-completions)
+       (define-key (current-local-map) "\C-n" 'next-history-element)
+       (define-key (current-local-map) "\C-p" 'previous-history-element))))
 
 (defun tmm-add-prompt ()
   (remove-hook 'minibuffer-setup-hook 'tmm-add-prompt)
@@ -264,7 +268,7 @@ Stores a list of all the shortcuts in the free variable `tmm-short-cuts'."
   (let ((win (selected-window)))
     (setq tmm-old-mb-map (current-local-map))
     (use-local-map (append (make-sparse-keymap) tmm-old-mb-map))
-    (tmm-define-keys)
+    (tmm-define-keys t)
     ;; Get window and hide it for electric mode to get correct size
     (save-window-excursion 
       (let ((completions
@@ -281,7 +285,7 @@ Stores a list of all the shortcuts in the free variable `tmm-short-cuts'."
       (set-buffer (window-buffer (Electric-pop-up-window "*Completions*")))
       (setq tmm-old-comp-map (current-local-map))
       (use-local-map (append (make-sparse-keymap) tmm-old-comp-map))
-      (tmm-define-keys)
+      (tmm-define-keys nil)
       (select-window win)              ; Cannot use
                                        ; save-window-excursion, since
                                        ; it restores the size