-;; Copyright (C) 1994, 1995, 1996, 2000 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1995, 1996, 2000, 2001, 2002
+;; Free Software Foundation, Inc.
-;; To use this package add
-
-;; (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.
+;; This package provides text mode access to the menu bar.
If nil, there will be no shortcuts. It should not consist only of spaces,
or else the correct item might not be found in the `*Completions*' buffer."
:type 'string
If nil, there will be no shortcuts. It should not consist only of spaces,
or else the correct item might not be found in the `*Completions*' buffer."
:type 'string
marked letters to pick up your choice. Type C-g or ESC ESC ESC to cancel.
"
"*Help text to insert on the top of the completion buffer.
marked letters to pick up your choice. Type C-g or ESC ESC ESC to cancel.
"
"*Help text to insert on the top of the completion buffer.
- "*What letters to use as menu shortcuts.
-Must be either one of the symbols `downcase' or `upcase',
+ "*What letters to use as menu shortcuts.
+Must be either one of the symbols `downcase' or `upcase',
(defcustom tmm-shortcut-words 2
"*How many successive words to try for shortcuts, nil means all.
(defcustom tmm-shortcut-words 2
"*How many successive words to try for shortcuts, nil means all.
;; We just did the inner level of a -popup menu.
choice)
;; We just did the outer level. Do the inner level now.
;; We just did the inner level of a -popup menu.
choice)
;; We just did the outer level. Do the inner level now.
(defsubst tmm-add-one-shortcut (elt)
;; uses the free vars tmm-next-shortcut-digit and tmm-short-cuts
(let* ((str (car elt))
(defsubst tmm-add-one-shortcut (elt)
;; uses the free vars tmm-next-shortcut-digit and tmm-short-cuts
(let* ((str (car elt))
(not (and paren (> pos paren)))) ; don't go past "(binding.."
(if (or (= pos 0)
(/= (aref str (1- pos)) ?.)) ; avoid file extensions
(not (and paren (> pos paren)))) ; don't go past "(binding.."
(if (or (= pos 0)
(/= (aref str (1- pos)) ?.)) ; avoid file extensions
(add-hook 'minibuffer-exit-hook 'tmm-delete-map nil t)
(let ((win (selected-window)))
(setq tmm-old-mb-map (tmm-define-keys t))
;; Get window and hide it for electric mode to get correct size
(add-hook 'minibuffer-exit-hook 'tmm-delete-map nil t)
(let ((win (selected-window)))
(setq tmm-old-mb-map (tmm-define-keys t))
;; Get window and hide it for electric mode to get correct size
(with-output-to-temp-buffer "*Completions*"
(display-completion-list completions))
(remove-hook 'completion-setup-hook 'tmm-completion-delete-prompt))
(with-output-to-temp-buffer "*Completions*"
(display-completion-list completions))
(remove-hook 'completion-setup-hook 'tmm-completion-delete-prompt))
- (if tmm-completion-prompt
- (progn
- (set-buffer "*Completions*")
- (goto-char 1)
- (insert tmm-completion-prompt)))
- )
+ (when tmm-completion-prompt
+ (set-buffer "*Completions*")
+ (let ((buffer-read-only nil))
+ (goto-char (point-min))
+ (insert tmm-completion-prompt))))
"Prepends (DOCSTRING EVENT BINDING) to free variable `tmm-km-list'.
The values are deduced from the argument ELT, that should be an
element of keymap, an `x-popup-menu' argument, or an element of
`x-popup-menu' argument (when IN-X-MENU is not-nil).
This function adds the element only if it is not already present.
It uses the free variable `tmm-table-undef' to keep undefined keys."
"Prepends (DOCSTRING EVENT BINDING) to free variable `tmm-km-list'.
The values are deduced from the argument ELT, that should be an
element of keymap, an `x-popup-menu' argument, or an element of
`x-popup-menu' argument (when IN-X-MENU is not-nil).
This function adds the element only if it is not already present.
It uses the free variable `tmm-table-undef' to keep undefined keys."
((if (listp (cdr-safe elt))
(or (keymapp (cdr-safe elt))
(eq (car (cdr-safe elt)) 'lambda))
(fboundp (cdr-safe elt)))
(setq km (cdr elt))
(and (stringp (car elt)) (setq str (car elt))))
((if (listp (cdr-safe elt))
(or (keymapp (cdr-safe elt))
(eq (car (cdr-safe elt)) 'lambda))
(fboundp (cdr-safe elt)))
(setq km (cdr elt))
(and (stringp (car elt)) (setq str (car elt))))
((if (listp (cdr-safe (cdr-safe elt)))
(or (keymapp (cdr-safe (cdr-safe elt)))
(eq (car (cdr-safe (cdr-safe elt))) 'lambda))
((if (listp (cdr-safe (cdr-safe elt)))
(or (keymapp (cdr-safe (cdr-safe elt)))
(eq (car (cdr-safe (cdr-safe elt))) 'lambda))
(stringp (cdr (car (cdr elt)))) ; keyseq cache
(setq cache (cdr (car (cdr elt))))
cache (setq str (concat str cache))))
(stringp (cdr (car (cdr elt)))) ; keyseq cache
(setq cache (cdr (car (cdr elt))))
cache (setq str (concat str cache))))
(setq km (nth 2 elt))
(setq str (eval (nth 1 elt)))
(setq filter (plist-get plist :filter))
(if filter
(setq km (funcall filter km)))
(setq km (nth 2 elt))
(setq str (eval (nth 1 elt)))
(setq filter (plist-get plist :filter))
(if filter
(setq km (funcall filter km)))
(and str
(consp (nth 3 elt))
(stringp (cdr (nth 3 elt))) ; keyseq cache
(setq cache (cdr (nth 3 elt)))
cache
(setq str (concat str cache))))
(and str
(consp (nth 3 elt))
(stringp (cdr (nth 3 elt))) ; keyseq cache
(setq cache (cdr (nth 3 elt)))
cache
(setq str (concat str cache))))
((if (listp (cdr-safe (cdr-safe (cdr-safe elt))))
(or (keymapp (cdr-safe (cdr-safe (cdr-safe elt))))
(eq (car (cdr-safe (cdr-safe (cdr-safe elt)))) 'lambda))
((if (listp (cdr-safe (cdr-safe (cdr-safe elt))))
(or (keymapp (cdr-safe (cdr-safe (cdr-safe elt))))
(eq (car (cdr-safe (cdr-safe (cdr-safe elt)))) 'lambda))
(stringp (cdr (car (cdr (cdr elt))))) ; keyseq cache
(setq cache (cdr (car (cdr (cdr elt)))))
cache (setq str (concat str cache))))
(stringp (cdr (car (cdr (cdr 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)
((stringp event) ; x-popup or x-popup element
(if (or in-x-menu (stringp (car-safe elt)))
(setq str event event nil km elt)
(progn
;; Otherwise, it is a prefix, so make a list of the subcommands.
;; Make a list of all the bindings in all the keymaps.
(progn
;; Otherwise, it is a prefix, so make a list of the subcommands.
;; Make a list of all the bindings in all the keymaps.
(setq allbind (cons (local-key-binding keyseq) allbind))
(setq allbind (cons (global-key-binding keyseq) allbind))
;; Merge all the elements of ALLBIND into one keymap.
(setq allbind (cons (local-key-binding keyseq) allbind))
(setq allbind (cons (global-key-binding keyseq) allbind))
;; Merge all the elements of ALLBIND into one keymap.