Function: msb
msb is an interactive and byte-compiled function defined in msb.el.gz.
Signature
(msb EVENT)
Documentation
Pop up several menus of buffers for selection with the mouse.
This command switches buffers in the window that you clicked on, and selects that window.
See the function mouse-select-buffer and the variable
msb-menu-cond for more information about how the menus are split.
Probably introduced at or before Emacs version 19.29.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/msb.el.gz
;;;
;;; msb
;;
;; This function can be used instead of (mouse-buffer-menu EVENT)
;; function in "mouse.el".
;;
(defun msb (event)
"Pop up several menus of buffers for selection with the mouse.
This command switches buffers in the window that you clicked on, and
selects that window.
See the function `mouse-select-buffer' and the variable
`msb-menu-cond' for more information about how the menus are split."
(interactive "e")
(let ((old-window (selected-window))
(window (posn-window (event-start event)))
early-release)
(unless (framep window) (select-window window))
;; This `sit-for' magically makes the menu stay up if the mouse
;; button is released within 0.1 second.
(setq early-release (not (sit-for 0.1 t)))
(let ((buffer (mouse-select-buffer event)))
(if buffer
(switch-to-buffer buffer)
(select-window old-window)))
;; If the above `sit-for' was interrupted by a mouse-up, avoid
;; generating a drag event.
(if (and early-release (memq 'down (event-modifiers last-input-event)))
(discard-input)))
nil)