diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ChangeLog | 6 | ||||
-rw-r--r-- | lisp/minibuffer.el | 28 | ||||
-rw-r--r-- | lisp/mouse.el | 17 |
3 files changed, 38 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4b2a1751813..2ec54b36d1d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,11 @@ 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca> + * minibuffer.el (minibuffer-inactive-mode-map): New var. + (minibuffer-inactive-mode): New major mode. + * mouse.el (mouse-drag-region): Remove the "mouse-1 pops up + the *Messages* buffer" hack. + (mouse-popup-menubar): Don't burp if the event is a normal key. + Miscellaneous tweaks. * emacs-lisp/cl-macs.el (dolist, dotimes): Use the same strategy for lexical scoping as in subr.el's dolist and dotimes. diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 972c65f62e3..3699f5bab02 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1657,6 +1657,34 @@ The completion method is determined by `completion-at-point-functions'." (define-key map "\t" 'exit-minibuffer) (define-key map "?" 'self-insert-and-exit)) +(defvar minibuffer-inactive-mode-map + (let ((map (make-keymap))) + (suppress-keymap map) + (define-key map "e" 'find-file-other-frame) + (define-key map "f" 'find-file-other-frame) + (define-key map "b" 'switch-to-buffer-other-frame) + (define-key map "i" 'info) + (define-key map "m" 'mail) + (define-key map "n" 'make-frame) + (define-key map [mouse-1] (lambda () (interactive) + (with-current-buffer "*Messages*" + (goto-char (point-max)) + (display-buffer (current-buffer))))) + ;; So the global down-mouse-1 binding doesn't clutter the execution of the + ;; above mouse-1 binding. + (define-key map [down-mouse-1] #'ignore) + map) + "Keymap for use in the minibuffer when it is not active. +The non-mouse bindings in this keymap can only be used in minibuffer-only +frames, since the minibuffer can normally not be selected when it is +not active.") + +(define-derived-mode minibuffer-inactive-mode nil "InactiveMinibuffer" + :abbrev-table nil ;abbrev.el is not loaded yet during dump. + ;; Note: this major mode is called from minibuf.c. + "Major mode to use in the minibuffer when it is not active. +This is only used when the minibuffer area has no active minibuffer.") + ;;; Completion tables. (defun minibuffer--double-dollars (str) diff --git a/lisp/mouse.el b/lisp/mouse.el index 124f84d7d73..f35069763bd 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -278,7 +278,7 @@ The contents are the items that would be in the menu bar whether or not it is actually displayed." (interactive "@e \nP") (run-hooks 'activate-menubar-hook 'menu-bar-update-hook) - (popup-menu (mouse-menu-bar-map) event prefix)) + (popup-menu (mouse-menu-bar-map) (unless (integerp event) event) prefix)) (make-obsolete 'mouse-popup-menubar 'mouse-menu-bar-map "23.1") (defun mouse-popup-menubar-stuff (event prefix) @@ -790,18 +790,9 @@ remains active. Otherwise, it remains until the next input event. If the click is in the echo area, display the `*Messages*' buffer." (interactive "e") - (let ((w (posn-window (event-start start-event)))) - (if (and (window-minibuffer-p w) - (not (minibuffer-window-active-p w))) - (save-excursion - ;; Swallow the up-event. - (read-event) - (set-buffer (get-buffer-create "*Messages*")) - (goto-char (point-max)) - (display-buffer (current-buffer))) - ;; Give temporary modes such as isearch a chance to turn off. - (run-hooks 'mouse-leave-buffer-hook) - (mouse-drag-track start-event t)))) + ;; Give temporary modes such as isearch a chance to turn off. + (run-hooks 'mouse-leave-buffer-hook) + (mouse-drag-track start-event t)) (defun mouse-posn-property (pos property) |