Skip to content

Smart Mouse Key Modeline Clicks

Smart Mouse Key clicks on a window’s modeline offer many powerful browsing features, including directory editing (dired), user manual browsing, and window, buffer and frame selection. Generally, only Hyperbole-specific modeline actions are discussed herein.

  • Leftmost Character

    Action Key clicks on the first (usually blank) character of the modeline bury the current buffer in the buffer list and display the next buffer in the list. Assist Key clicks do the reverse and unbury the bottom buffer.

    A similar effect can be achieved with the standard Emacs mouse 1 (left) and 3 (right) buttons on the Buffer ID element of modeline to cycle through previous and next buffers, respectively. This may be easier to use since you can click anywhere on the buffer identifier.

  • Buffer ID Element

    On the left part of the modeline is the buffer identification, generally the name of the buffer in use. An Action Key click on that switches the window to edit the buffer’s directory using dired. Then Action Key clicks on directory items in the dired buffer display the items selected in other windows. An Action Key drag from an item to another window displays the item in that window.

    An Action Key click on the first line in a dired buffer which contains the current directory path, specifically on any ancestor part of the path (the part to the left of the click point), starts another dired session on the ancestor directory. Click at the end of this line or on the last line to end the dired session (bury its buffer).

    If you use the Treemacs file viewer Emacs package, you can configure Hyperbole to use this instead of Dired when you click on a modeline buffer id.

    Since this is a customization option, it may be changed permanently like so. Use {M-x customize-set-variable RET action-key-modeline-buffer-id-function RET}. Change the value to smart-treemacs-modeline. Then press RET. To change it back to Hyperbole’s default, use the value, dired-jump.

  • Large Blank Area

    An Action Mouse Key click in a blank area of a window modeline (away from left and right edges) toggles between displaying and hiding a list of all buffers. Once displayed, an Action Key click on a buffer item will display it in another window. You can drag items to specific windows for display as well.

    Alternatively, you may (1) display the buffer menu, (2) use its {m} command to mark buffers, and (3) use the Hyperbole {@} command to display the marked buffers in a grid of popup windows whose number of rows and columns you specify at the prompt or via a prefix argument. This also works in ibuffer-menu and dired modes. See HyControl.

    An Assist Key click in the blank area of the modeline displays a quick access menu of display-oriented commands. You can jump to buffers categorized by major mode, jump to windows by buffer name, or to frames by name. Manage your windows and frames quickly with this menu as well. As always with Hyperbole, just try it and you’ll begin to wonder how you lived without it before.

  • Right Corner

    A click of the Action Mouse Key in the right corner of a window modeline (within the rightmost 3 characters) displays or hides the GNU Info Manual Browser, giving you quick point and click access to an amazing wealth of documentation, since the Action Key also browses through these manuals and follows their hyperlinked cross-references. A click of the Assist Key in the same location displays or hides the Smart Key summary, as noted earlier.

  • Customizable Variables

    Hyperbole modeline mouse click actions are controlled by the two functions, action-key-modeline and assist-key-modeline. If you know a little Emacs Lisp you can change these to do whatever you like. When a Smart Key press is on a blank part of a modeline but not at the left or right, the function given by one of these two variables is executed: action-key-modeline-function or assist-key-modeline-function. By default, the Action Key toggles between displaying and hiding the buffer menu. If you like the more advanced features of Ibuffer Mode, you can change the buffer menu to use that with the following in your Emacs initialization file: (setq action-key-modeline-function #'hmouse-context-ibuffer-menu). To set it back to the default use: (setq action-key-modeline-function #'hmouse-context-menu).

    The default assist-key-modeline-function is to pop up a menu of convenient screen commands that lets you select buffers grouped by major mode, use HyControl, or jump to specific windows, window configurations or frames.

    Since these are customization options, they may be change permanently like so. Use {M-x customize-set-variable RET assist-key-modeline-function RET}. Change the value to your desired command. Then press RET.