;; This file is part of GNU Emacs.
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; 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, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
(defvar tmm-table-undef)
;;;###autoload (define-key global-map "\M-`" 'tmm-menubar)
-;;;###autoload (define-key global-map [f10] 'tmm-menubar)
;;;###autoload (define-key global-map [menu-bar mouse-1] 'tmm-menubar-mouse)
;;;###autoload
(tmm-menubar (car (posn-x-y (event-start event)))))
(defcustom tmm-mid-prompt "==>"
- "*String to insert between shortcut and menu item.
+ "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."
:type 'string
the item in the minibuffer, and press RET when you are done, or press the
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.
+ "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."
:type '(choice string (const nil))
:group 'tmm)
(defcustom tmm-shortcut-style '(downcase upcase)
- "*What letters to use as menu shortcuts.
+ "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."
:type '(choice (const downcase)
:group 'tmm)
(defcustom tmm-shortcut-words 2
- "*How many successive words to try for shortcuts, nil means all.
+ "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."
:type '(choice integer (const nil))
tmm-km-list nil t nil
(cons 'history
(- (* 2 history-len) index-of-default))))
- (save-excursion
- (remove-hook 'minibuffer-setup-hook 'tmm-add-prompt)
- (if (get-buffer "*Completions*")
- (progn
- (set-buffer "*Completions*")
- (use-local-map tmm-old-comp-map)
- (bury-buffer (current-buffer))))))))))
+ (remove-hook 'minibuffer-setup-hook 'tmm-add-prompt)
+ (if (get-buffer "*Completions*")
+ (with-current-buffer "*Completions*"
+ (use-local-map tmm-old-comp-map)
+ (bury-buffer (current-buffer)))))))))
(setq choice (cdr (assoc out tmm-km-list)))
(and (null choice)
(> (length out) (length tmm-c-prompt))
(defun tmm-completion-delete-prompt ()
(set-buffer standard-output)
- (goto-char 1)
- (delete-region 1 (search-forward "Possible completions are:\n")))
+ (goto-char (point-min))
+ (delete-region (point) (search-forward "Possible completions are:\n")))
(defun tmm-remove-inactive-mouse-face ()
"Remove the mouse-face property from inactive menu items."
(or tmm-completion-prompt
(add-hook 'completion-setup-hook
'tmm-completion-delete-prompt 'append))
- (with-output-to-temp-buffer "*Completions*"
- (display-completion-list completions))
- (remove-hook 'completion-setup-hook 'tmm-completion-delete-prompt))
+ (unwind-protect
+ (with-output-to-temp-buffer "*Completions*"
+ (display-completion-list completions))
+ (remove-hook 'completion-setup-hook 'tmm-completion-delete-prompt)))
(set-buffer "*Completions*")
(tmm-remove-inactive-mouse-face)
(when tmm-completion-prompt
;; Return that keymap.
bind))))
+;; Huh? What's that about? --Stef
(add-hook 'calendar-load-hook (lambda () (require 'cal-menu)))
(provide 'tmm)
-;;; arch-tag: e7ddbdb6-4b95-4da3-afbe-ad6063d112f4
+;; arch-tag: e7ddbdb6-4b95-4da3-afbe-ad6063d112f4
;;; tmm.el ends here