;;; 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
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to
-;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; along with GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
-;;; Commentary ============================================================
+;;; Commentary:
-;;; To use this package add
+;; To use this package add
-;;; (autoload 'tmm-menubar 'tmm "Text mode substitute for menubar" t)
-;;; (global-set-key [f10] 'tmm-menubar)
+;; (autoload 'tmm-menubar 'tmm "Text mode substitute for menubar" t)
+;; (global-set-key [f10] 'tmm-menubar)
+;; to your .emacs file. You can also add your own access to different
+;; menus available in Window System Emacs modeling definition after
+;; tmm-menubar.
-;;; to your .emacs file. You can also add your own access to different
-;;; menus available in Window System Emacs modeling definition after
-;;; tmm-menubar.
+;;; Code:
(require 'electric)
;; 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)))))
(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)
(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
(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
(add-hook 'calendar-load-hook (lambda () (require 'cal-menu)))
-
(provide 'tmm)
-
;;; tmm.el ends here