;ELC ;;; Compiled by cyd@localhost on Mon Apr 23 22:21:12 2007 ;;; from file /home/cyd/emacs/lisp/tmm.el ;;; in Emacs version 22.0.99 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. (if (and (boundp 'emacs-version) (< (aref emacs-version (1- (length emacs-version))) ?A) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19.29"))) (error "`tmm.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\301\302!\210\303\304\305\306\307\310\311\312&\210\313B\314\313!\204\315\313\305\"\210\316B\314\316!\204-\315\316\305\"\210\305\207" [current-load-list require electric custom-declare-group tmm nil "Text mode access to menu-bar." :prefix "tmm-" :group menu tmm-old-mb-map default-boundp set-default tmm-c-prompt] 8) #@252 Text-mode emulation of looking and choosing from a menubar. See the documentation for `tmm-prompt'. X-POSITION, if non-nil, specifies a horizontal position within the menu bar; we make that menu bar item (the one at that position) the default choice. (defalias 'tmm-menubar #[(&optional x-position) "\306\307!\210\310\311!\312\n\211\203( @\211 \236\313\314 \" C\"* A\211\204)\203\240 \315\312\211\211\211\203\234X\203\234@\211:\203\223 A:\203\223 A@;\203d A@\202\203\316 8;\205\203\317\320 \233\321\"\211\205|\322!??\205\203\316 8\211\203\223G\\\323\\A\211\204@ @-\324 \312#*\207" [menu-bar-item menu-bar menu-bar-final-items list item this-one run-hooks menu-bar-update-hook tmm-get-keybind [menu-bar] nil append delq 0 2 plist-get 4 :visible eval 1 tmm-prompt x-position visible name column tail] 6 (#$ . 890) nil]) #@225 Text-mode emulation of looking and choosing from a menubar. This command is used when you click the mouse in the menubar on a console which has no window system but does have a mouse. See the documentation for `tmm-prompt'. (defalias 'tmm-menubar-mouse #[(event) "\302\211:\203\3038\202\304 `\305\306F)\307 8)@!\207" [event position tmm-menubar 1 selected-window (0 . 0) 0 2] 6 (#$ . 1774) "e"]) #@200 *String to insert between shortcut and menu item. 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. (custom-declare-variable 'tmm-mid-prompt '"==>" '(#$ . -2185) :type 'string :group 'tmm) #@34 A place to store minibuffer map. (defvar tmm-mb-map nil (#$ . 2479)) #@160 *Help text to insert on the top of the completion buffer. To save space, you can set this to nil, in which case the standard introduction text is deleted too. (custom-declare-variable 'tmm-completion-prompt '"Press PageUp key to reach this buffer from the minibuffer.\nAlternatively, you can use Up/Down keys (or your History keys) to change\nthe item in the minibuffer, and press RET when you are done, or press the\nmarked letters to pick up your choice. Type C-g or ESC ESC ESC to cancel.\n" '(#$ . -2555) :type '(choice string (const nil)) :group 'tmm) #@150 *What letters to use as menu shortcuts. Must be either one of the symbols `downcase' or `upcase', or else a list of the two in the order you prefer. (custom-declare-variable 'tmm-shortcut-style ''(downcase upcase) '(#$ . -3120) :type '(choice (const downcase) (const upcase) (repeat (choice (const downcase) (const upcase)))) :group 'tmm) #@168 *How many successive words to try for shortcuts, nil means all. If you use only one of `downcase' or `upcase' for `tmm-shortcut-style', specify nil for this variable. (custom-declare-variable 'tmm-shortcut-words '2 '(#$ . -3466) :type '(choice integer (const nil)) :group 'tmm) (custom-declare-face 'tmm-inactive '((t :inherit shadow)) "Face used for inactive menu items." :group 'tmm) #@546 Text-mode emulation of calling the bindings in keymap. Creates a text-mode menu of possible choices. You can access the elements in the menu in two ways: *) via history mechanism from minibuffer; *) Or via completion-buffer that is automatically shown. The last alternative is currently a hack, you cannot use mouse reliably. MENU is like the MENU argument to `x-popup-menu': either a keymap or an alist of alists. DEFAULT-ITEM, if non-nil, specifies an initial default choice. Its value should be an event that has a binding in MENU. (defalias 'tmm-prompt #[(menu &optional in-popup default-item) "\306\307\211\211\211\211\211\211\211\211\211\211\310!?/012%345\311\312!\210\313\314\"\210 \203B4G\315U\203B4@A\202d4\204K\316\317!\2104\203\32067\203^\3214!48\203\265\3079\211:\203\264:@\2428=\204\264:@:\203\253:@A\242;\204\246:@A\242\322=\203\253\323\324:@\233\325\"\2119\203\246\3269!\203\2536T6:A\211:\204m*\327\3307!P;\331\332\307\333\3344\"\"!%)%G2\335%\211\211\211$%26Z\315Z%80\336\337\340\"\2108\203\371648@3\202\212\341\216\3425\343P4\307\344\307\3452\211\\\320\\6ZB&3*)\34634\"A\211\204K3G0GV\203K3\3200GO0\230\203K30G\307O3\34634\"A\n\204d3\203d\34734\"3\34634\"A\n@\nA<\203s\n\202\257 \203~\350\n\344\"\202\257\310\n!\203\235\n9\203\215\351\n!\307\352\353\217\210\307\354\355\217\210\350\n!\202\257\n\205\257 \203\256 =\356\n!\202\257\n. \207" [menu not-menu choice chosen-string tmm-short-cuts tmm-old-comp-map "Menu bar" nil keymapp run-hooks activate-menubar-hook mapc #[(elt) ";\203 \211\207<\205\303\n\"\207" [elt gl-str not-menu tmm-get-keymap] 3] 1 error "Empty menu reached" 0 tmm-add-shortcuts menu-item plist-get 4 :visible eval "^." regexp-quote reverse delq mapcar #[(elt) "\302 @\"\205\n @\207" [prompt elt string-match] 3] append add-hook minibuffer-setup-hook tmm-add-prompt ((byte-code "\212\301\302\303\"\210\304\305!\203\305q\210\306!\210\307p!\210)\301\207" [tmm-old-comp-map remove-hook minibuffer-setup-hook tmm-add-prompt get-buffer "*Completions*" use-local-map bury-buffer] 3)) completing-read " (up/down to change, PgUp to menu): " t history assoc try-completion tmm-prompt indirect-function (byte-code "\300\301!\207" [require mouse] 2) ((error)) (x-popup-menu nil choice) ((error)) call-interactively tmm-old-mb-map tmm-c-prompt tmm-table-undef history-len out tmm-km-list gl-str index-of-default tmm-mid-prompt default-item visible tail prompt in-popup last-command-event] 15 (#$ . 3859)]) #@216 Adds shortcuts to cars of elements of the list. Takes a list of lists with a string as car, returns list with shortcuts added to these cars. Stores a list of all the shortcuts in the free variable `tmm-short-cuts'. (defalias 'tmm-add-shortcuts #[(list) "\302\303\304\305 !\")\207" [tmm-next-shortcut-digit list 48 mapcar tmm-add-one-shortcut reverse] 4 (#$ . 6439)]) (defalias 'tmm-add-one-shortcut #[(elt) "\211AA)\306=\203\307\310\nG\311\"@QAB\207@\312\313 \"\314\211\315\316\317\215\210\2038B\203F\320!\nP\202L\310\nGT\321\" PA-B\207" [elt x tmm-mid-prompt str paren pos ignore " " make-string 45 string-match "(" 0 nil done (byte-code "\203\n W\203g\306\307\n #\211\203g\f\203 \fV\204g \310U\204-\n SH\311U\204^ <\2036 \2028 C\211\203]@\n H!\211>\204T\312\313\"\210A\211\204>) T\310\225\202\314X\203\210T>\204g\312\313\"\210\202g\315\211\207" [tmm-shortcut-words word str pos paren tmm-shortcut-style string-match "\\w+" 0 46 throw done 57 nil shortcut-style char tmm-short-cuts tmm-next-shortcut-digit] 5) char-to-string 32 word char tmm-short-cuts] 5]) (put 'tmm-add-one-shortcut 'byte-optimizer 'byte-compile-inline-expand) (defalias 'tmm-define-keys #[(minibuffer) "\303 \304\305\"\210\306\307 \"\210\n\203/\310\311\312#\210\310\313\312#\210\310\314\312#\210\310\315\316#\210\310\317\320#\210\321 \322\323\321 \"!\210)\207" [map tmm-short-cuts minibuffer make-sparse-keymap suppress-keymap t mapc #[(c) "<\203 \303 \304\n!\305#\207\303 \304\n\227!\305#\210\303 \304\n\226!\305#\207" [tmm-shortcut-style map c define-key char-to-string tmm-shortcut] 4] define-key [pageup] tmm-goto-completions [prior] "v" "" next-history-element "" previous-history-element current-local-map use-local-map append] 5]) (defalias 'tmm-completion-delete-prompt #[nil "q\210\301b\210\301\302\303!|\207" [standard-output 1 search-forward "Possible completions are:\n"] 3]) #@58 Remove the mouse-face property from inactive menu items. (defalias 'tmm-remove-inactive-mouse-face #[nil "\304\305\306G\307\"P\310\212eb\210m\2041\311`\312\"\313\n!\203+\314` \315#\210\316` \317#\210 b\210\202)\320\310!+\207" [tmm-mid-prompt next inactive-string inhibit-read-only t " " make-string 45 nil next-single-char-property-change mouse-face looking-at remove-text-properties (mouse-face) add-text-properties (face tmm-inactive) set-buffer-modified-p] 5 (#$ . 8405)]) (defalias 'tmm-add-prompt #[nil "\306\307\310\"\210\311\312\313\314\315$\210\204\316\317!\210\320 \321\315!\322\213\210\320 \323\324\325 \"r\326\216\327\330!\210\331\332!\210r\332q\210\321\314!-c)\207" [tmm-c-prompt win tmm-old-mb-map save-selected-window-alist save-selected-window-window tmm-old-comp-map remove-hook minibuffer-setup-hook tmm-add-prompt add-hook minibuffer-exit-hook tmm-delete-map nil t error "No active menu entries" selected-window tmm-define-keys ((byte-code "\304\305\"\n\204\306\307\310\311#\210\312\220\313 !\221\210\314\307\310\"\210)\312q\210\315 \210\n\203/\316eb\210\nc\210)\316\207" [minibuffer-completion-table completions tmm-completion-prompt buffer-read-only mapcar car add-hook completion-setup-hook tmm-completion-delete-prompt append "*Completions*" display-completion-list remove-hook tmm-remove-inactive-mouse-face nil] 4)) mapcar #[(frame) "\301!D\207" [frame frame-selected-window] 3] frame-list ((byte-code "\305\211\203/\n@\306 @!\203(\307 \211A@)!\203(\310 @ \211A@)\"\210\nA\211\204*\307\f!\203:\311\f!\210\305\207" [save-selected-window-alist elt #1=#:--cl-dolist-temp-- x save-selected-window-window nil frame-live-p window-live-p set-frame-selected-window select-window] 4)) other-window 1 Electric-pop-up-window "*Completions*"] 5]) (defalias 'tmm-delete-map #[nil "\301\302\303\304#\210\205 \305!\207" [tmm-old-mb-map remove-hook minibuffer-exit-hook tmm-delete-map t use-local-map] 4]) #@42 Choose the shortcut that the user typed. (defalias 'tmm-shortcut #[nil "\306 9\203 \n!\n\f>\205;\307 \310\232\203+eb\210\311\312\313\n! Q!\210\314 \202;\315 d|\210\316\317\"\210 c\210\320 *\207" [last-command-char s c tmm-shortcut-style tmm-short-cuts tmm-mid-prompt nil buffer-name "*Completions*" re-search-forward "\\(^\\|[ ]\\)" char-to-string choose-completion minibuffer-prompt-end mapc #[(elt) "@\304 GT@G^O\305\n! P\230\205@\211\207" [elt tmm-mid-prompt c s 0 char-to-string] 4] exit-minibuffer tmm-km-list] 4 (#$ . 10367) nil]) (defalias 'tmm-goto-completions #[nil "\302 \211d{d|\210)\303\304!\210\305 !\210\306 !\207" [prompt-end tmm-c-prompt minibuffer-prompt-end switch-to-buffer-other-window "*Completions*" search-forward search-backward] 3 nil nil]) #@383 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. (defalias 'tmm-get-keymap #[(elt &optional in-x-menu) "\306\211\211\211\211\211\211@A\211\307=\203) \306BB\211\202+\310 \"\204\331<\203C\311!\204I@\312=\202F\313!\203O\202\331\243<\203d\311\243!\204k\243@\312=\202h\313\243!\203|A@;\203\331@\202\331\243\243<\203\224\311\243\243!\204\234\243\243@\312=\202\231\313\243\243!\203\321AA@;\203\253@\203\331A@A;\203\331A@A\211\203\331\203\331P\202\331\242\314=\203X\243\243\243\211\242:\203\346 \243\3158\316A@!\317 \320\"\211\203\f!\317 \321\"\211\203\316 !\205\317 \322\"\211\203+\316\n!\203(\202)\323\203\331\3248:\203\331\3248A;\203\331\3248A\211\203\331\203\331P\202\331\243\243\243<\203s\311\243\243\243!\204|\243\243\243@\312=\202y\313\243\243\243!\203\264AAA@;\203\214@\203\331AA@A;\203\331AA@A\211\203\331\203\331P\202\331 ;\203\331\204\304\242;\203\317 \306\202\331 \306\325B\203\350;\203\350\203 9\203 \326N\203 \316\326N!\203\202 \323\205+\205+\310\"\206+ BBB\211.\207" [elt event enable visible filter plist nil undefined assoc keymapp lambda fboundp menu-item 2 eval plist-get :filter :visible :enable ignore 3 keymap menu-enable cache str km tmm-table-undef in-x-menu tmm-km-list] 9 (#$ . 11161)]) #@299 Return the current binding of KEYSEQ, merging prefix definitions. If KEYSEQ is a prefix key that has local and global bindings, we merge them into a single keymap which shows the proper order of the menu. However, for the menu bar itself, the value does not take account of `menu-bar-final-items'. (defalias 'tmm-get-keybind #[(keyseq) "\306\211\211\211\211\307 !\310 !\203\306 \206\227\311\312\313 !\"\314 !\315\316 !A!\n\306\211\203e@\211A\306\211\203[@\317\242\"A\211\204F*A\211\2046* A\306\211\203\206@\317\242\"A\211\204q*\320B\211 \nBB\321\322\f\"\210 -\207" [globalbind localbind minorbind bind allbind keyseq nil key-binding keymapp mapcar cdr minor-mode-key-binding local-key-binding copy-sequence global-key-binding assq-delete-all keymap mapc #[(in) "9\203\302!\203K\205,\302!\205,\302 !\203' \303A!\244\211\207\303!\211\207" [in bind keymapp copy-sequence] 3] minor #1=#:--cl-dolist-temp-- item #2=#:--cl-dolist-temp-- #3=#:--cl-dolist-temp--] 6 (#$ . 12952)]) (byte-code "\300\301\302\"\210\303\304!\207" [add-hook calendar-load-hook #[nil "\300\301!\207" [require cal-menu] 2] provide tmm] 3)