<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>notes from /dev/null - anju</title><link href="http://yummymelon.com/devnull/" rel="alternate"/><link href="http://yummymelon.com/devnull/feeds/tags/anju.atom.xml" rel="self"/><id>http://yummymelon.com/devnull/</id><updated>2026-06-04T09:35:00-07:00</updated><entry><title>Revisiting Emacs Keyboard Macros with a Mouse</title><link href="http://yummymelon.com/devnull/revisiting-emacs-keyboard-macros-with-a-mouse.html" rel="alternate"/><published>2026-06-04T09:35:00-07:00</published><updated>2026-06-04T09:35:00-07:00</updated><author><name>Charles Choi</name></author><id>tag:yummymelon.com,2026-06-04:/devnull/revisiting-emacs-keyboard-macros-with-a-mouse.html</id><summary type="html">&lt;p&gt;Yes, recording an Emacs keyboard macro with a mouse is a thing.&lt;/p&gt;</summary><content type="html">&lt;p&gt;“No-code automation” has been in Emacs far longer than its usage as a term of art. Better known as &lt;em&gt;keyboard macros&lt;/em&gt;, this feature has allowed Emacs users to achieve their bespoke needs for decades, all without needing to know a whit about Lisp. I can testify to this personally: though I’ve been using Emacs since the early 90’s, only in the past three years has writing Elisp played any part in it. For most of my Emacs journey, I got by with just making keyboard macros.&lt;/p&gt;
&lt;p&gt;If you’re unfamiliar with them, here are two links you should get to know:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.gnu.org/software/emacs/manual/html_node/emacs/Keyboard-Macros.html"&gt;The official Emacs manual for keyboard macros&lt;/a&gt; ((emacs) Keyboard Macros)&lt;/li&gt;
&lt;li&gt;Mickey Petersen’s post - &lt;a href="https://www.masteringemacs.org/article/keyboard-macros-are-misunderstood"&gt;“Keyboard Macros are Misunderstood”&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;My addition to the knowledge of those posts is to boost this fact: &lt;strong&gt;mouse events can also be captured by a keyboard macro&lt;/strong&gt;. If you know where a command &lt;em&gt;is&lt;/em&gt; in a menu, you can also record clicking on it. I think the ability to combine both keyboard and mouse events in a keyboard macro is compelling, so much so that I decided to emphasize this in Anju.&lt;/p&gt;
&lt;p&gt;The recent &lt;a href="https://github.com/kickingvegas/anju"&gt;Anju&lt;/a&gt; v1.5.0 release added the menu “Tools › Macro Recorder” to the menu bar as shown below.&lt;/p&gt;
&lt;p&gt;&lt;img alt="img" src="images/anju-kmacros/anju-main-menu-tools-kmacro.png"&gt;&lt;/p&gt;
&lt;p&gt;With this, mouse enthusiasts can create and run keyboard macros without need to recall keybindings or deal with inconsistent command naming, as observed in Petersen’s post.&lt;/p&gt;
&lt;p&gt;One thing that I TILed about keyboard macros in building this menu was the command &lt;code&gt;list-keyboard-macros&lt;/code&gt; (see &lt;a href="https://www.gnu.org/software/emacs/manual/html_node/emacs/Kmacro-Menu.html"&gt;(emacs) Kmacro menu&lt;/a&gt;). This command is available in the “Macro Recorder” menu as the item “List macros”. This lets you manage multiple keyboard macros that have been defined during a session.&lt;/p&gt;
&lt;p&gt;If this interests you, I invite you install &lt;a href="https://melpa.org/#/anju"&gt;Anju from MELPA&lt;/a&gt; and give it a try. Let me know &lt;a href="https://github.com/kickingvegas/anju/discussions/121"&gt;what you think&lt;/a&gt;!&lt;/p&gt;</content><category term="misc"/><category term="emacs"/><category term="anju"/></entry><entry><title>Anju v1.5.0 Update</title><link href="http://yummymelon.com/devnull/anju-v150-update.html" rel="alternate"/><published>2026-05-28T10:00:00-07:00</published><updated>2026-05-28T10:00:00-07:00</updated><author><name>Charles Choi</name></author><id>tag:yummymelon.com,2026-05-28:/devnull/anju-v150-update.html</id><summary type="html">&lt;p&gt;Anju v1.5.0 update out in the wild. Lots of goodies in it.&lt;/p&gt;</summary><content type="html">&lt;p&gt;Heads up for readers of this blog who are using &lt;a href="https://github.com/kickingvegas/anju"&gt;Anju&lt;/a&gt; or are mouse-curious Emacs users. I’ve recently released the &lt;a href="https://github.com/kickingvegas/anju/discussions/121"&gt;v1.5.0 update&lt;/a&gt; for it, now available on &lt;a href="https://melpa.org/#/anju"&gt;MELPA&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Many new features and enhancements are in this update as outlined below:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Context Menus&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://kickingvegas.github.io/anju/Selected-Text-Commands.html"&gt;Enhancements to selected text&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;Query Replace (Regexp)…&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Enhancements to Org mode support&lt;ul&gt;
&lt;li&gt;&lt;a href="https://kickingvegas.github.io/anju/Org-Headline-Context-Menu.html"&gt;Headline&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;Change to Body&lt;/li&gt;
&lt;li&gt;Sort…&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://kickingvegas.github.io/anju/Org-Item-Context-Menu.html"&gt;Item&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;Cycle Bullet…&lt;/li&gt;
&lt;li&gt;Sort…&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://kickingvegas.github.io/anju/Org-Table-Context-Menu.html"&gt;Table&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;Sort…&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://kickingvegas.github.io/anju/Org-_201cCopy-as_2026_201d-Context-Menu.html"&gt;Copy as…&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://kickingvegas.github.io/anju/Org-Insert-Link.html"&gt;Link…&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Added support for &lt;a href="https://kickingvegas.github.io/anju/Makefile-Context-Menu.html"&gt;Makefile mode&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Added support for &lt;a href="https://kickingvegas.github.io/anju/Info-Context-Menu.html"&gt;Info mode&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Added support for &lt;a href="https://kickingvegas.github.io/anju/Compilation_002fGrep-Context-Menu.html"&gt;Compilation/Grep mode&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Main Menu&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Tools menu enhancements&lt;ul&gt;
&lt;li&gt;&lt;a href="https://kickingvegas.github.io/anju/Tools-Menu-Features.html"&gt;Global Org Commands&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://kickingvegas.github.io/anju/Macro-Recorder-Menu.html"&gt;Macro Recorder&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Edit › Delete menu enhancement&lt;ul&gt;
&lt;li&gt;&lt;a href="https://kickingvegas.github.io/anju/Edit-Menu-Features.html"&gt;Delete Duplicate Lines&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Users who work with both Org mode and Markdown formatted text should find interest in the &lt;a href="https://kickingvegas.github.io/anju/Org-_201cCopy-as_2026_201d-Context-Menu.html"&gt;Copy as…&lt;/a&gt; capability added to the Org mode context menu. This feature lets one use Org mode as the primary means of authoring text, exporting to Markdown (or another format) using a right-click mouse copy action.&lt;/p&gt;
&lt;p&gt;&lt;img alt="img" src="images/anju-1-5/anju-context-menu-org-copy-as.png"&gt;&lt;/p&gt;
&lt;p&gt;Thanks to Marcin Borkowski whose post &lt;a href="https://mbork.pl/2021-05-02_Org-mode_to_Markdown_via_the_clipboard"&gt;“Org-mode to Markdown via the clipboard”&lt;/a&gt;, inspired this feature.&lt;/p&gt;
&lt;p&gt;Anju also provides a complementary command “Paste Markdown as Org” for Org mode which lets one paste copied Markdown text into an Org file, doing the conversion of Markdown to Org under the hood using &lt;code&gt;pandoc&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt="img" src="images/anju-1-5/anju-paste-markdown-as-org.png"&gt;&lt;/p&gt;
&lt;p&gt;In summary, this is a big release with many changes. I invite you to explore all the links above to see what’s available in Anju.&lt;/p&gt;</content><category term="misc"/><category term="emacs"/><category term="org mode"/><category term="anju"/></entry><entry><title>Using the Mouse for Emacs Rectangle Commands</title><link href="http://yummymelon.com/devnull/using-the-mouse-for-emacs-rectangle-commands.html" rel="alternate"/><published>2026-05-18T09:45:00-07:00</published><updated>2026-05-18T09:45:00-07:00</updated><author><name>Charles Choi</name></author><id>tag:yummymelon.com,2026-05-18:/devnull/using-the-mouse-for-emacs-rectangle-commands.html</id><summary type="html">&lt;p&gt;Never look up Emacs rectangle commands in the manual again. Announcing support for rectangle commands in Anju v1.4.0 update.&lt;/p&gt;</summary><content type="html">&lt;p&gt;&lt;img alt="img" src="images/rectangle-mouse-commands/anju-main-menu-edit-rectangle.png"&gt;&lt;/p&gt;
&lt;p&gt;Of all the built-in editing commands in Emacs, the commands that work with &lt;a href="https://www.gnu.org/software/emacs/manual/html_node/emacs/Rectangles.html"&gt;rectangles&lt;/a&gt; delight me the most. Once understood, they can save effort in many situations.&lt;/p&gt;
&lt;p&gt;That said, the biggest downside to rectangles is the amount of setup it takes to &lt;em&gt;use&lt;/em&gt; them. As with many things Emacs, by default you have to memorize a bunch of keybindings to get anything done with them.&lt;/p&gt;
&lt;p&gt;In Casual, I addressed the above downside by providing a &lt;a href="https://kickingvegas.github.io/casual/Edit-commands.html#Rectangle_203a-_0028casual_002deditkit_002drectangle_002dtmenu_0029"&gt;Transient menu for rectangle commands&lt;/a&gt;. Since building that, I've come to use rectangle commands routinely. But even then, there is ceremony to set up a rectangle selection.&lt;/p&gt;
&lt;p&gt;With my recent work on mouse-driven interactions in Anju, I’ve learned that &lt;a href="http://yummymelon.com/devnull/some-nice-to-know-keybindings-when-using-the-mouse-in-emacs.html"&gt;rectangle selection&lt;/a&gt; is trivial via &lt;code&gt;C-M-&amp;lt;mouse-1&amp;gt;&lt;/code&gt; dragging. Once selected, having a menu of rectangle commands makes working with them even easier. So I made one for the latest &lt;a href="https://github.com/kickingvegas/anju/discussions/94"&gt;v1.4.0 update for Anju&lt;/a&gt;, now on &lt;a href="https://melpa.org/#/anju"&gt;MELPA&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The “Rectangle” sub-menu is available via the &lt;a href="https://kickingvegas.github.io/anju/Edit-Menu-Features.html"&gt;main menu bar “Edit” menu&lt;/a&gt; (as shown in the screenshot above) or via &lt;a href="https://kickingvegas.github.io/anju/Rectangle-Context-Menu.html"&gt;context menu&lt;/a&gt;. Using rectangle commands in conjunction with the &lt;code&gt;align-regexp&lt;/code&gt; (“Edit › Align Regexp…”) and &lt;code&gt;whitespace-cleanup&lt;/code&gt; (“Edit › Delete › Whitespace Cleanup”) can make short work of editing text that is laid out in columns. Anju makes both of these commands available from the main menu.&lt;/p&gt;
&lt;p&gt;Side note: on using &lt;code&gt;C-M-&amp;lt;mouse-1&amp;gt;&lt;/code&gt;, sometimes Emacs will only read &lt;code&gt;M-&amp;lt;mouse-1&amp;gt;&lt;/code&gt; and do a &lt;a href="https://www.gnu.org/software/emacs/manual/html_node/emacs/Secondary-Selection.html"&gt;secondary selection&lt;/a&gt;, leaving an unwanted highlight. Enter &lt;code&gt;M-&amp;lt;mouse-1&amp;gt;&lt;/code&gt; to dismiss the highlight.&lt;/p&gt;
&lt;p&gt;If you find Anju to be useful, please support its development by &lt;a href="https://buymeacoffee.com/kickingvegas"&gt;buying me a coffee&lt;/a&gt;. I’ve got a &lt;a href="https://github.com/kickingvegas/anju/issues"&gt;number of new features planned for it&lt;/a&gt;.&lt;/p&gt;</content><category term="misc"/><category term="emacs"/><category term="anju"/></entry><entry><title>Enhancing Elisp Development with Context Menus</title><link href="http://yummymelon.com/devnull/enhancing-elisp-development-with-context-menus.html" rel="alternate"/><published>2026-05-11T11:00:00-07:00</published><updated>2026-05-11T11:00:00-07:00</updated><author><name>Charles Choi</name></author><id>tag:yummymelon.com,2026-05-11:/devnull/enhancing-elisp-development-with-context-menus.html</id><summary type="html">&lt;p&gt;Announcing support for Elisp development in the Anju v1.3.0 update.&lt;/p&gt;</summary><content type="html">&lt;p&gt;As celebrated as Emacs is for its programmability, I find the actual process of developing Emacs Lisp (Elisp) to be quite underwhelming. Developing in Elisp has meant learning its libraries and idioms, which is to be expected. What I really don’t care for though are the arcane keybindings associated with doing basic things like evaluating, navigating (Xref), and debugging (especially debugging). While I’ve already committed to muscle memory most of said keybindings, I’d argue that having a mouse-based “point and click” interface is beneficial for both novice and experienced Elisp developers alike, as it lets one focus on the code and not on recalling the right key incantation &lt;em&gt;all the time&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;The addition of &lt;code&gt;context-menu-mode&lt;/code&gt; in Emacs 28 has provided the opportunity to build a mouse-based UI for Elisp development and I’m happy to announce the availability of one in the latest &lt;a href="https://github.com/kickingvegas/anju/discussions/84"&gt;v1.3.0 update to Anju&lt;/a&gt;, now on &lt;a href="https://melpa.org/#/anju"&gt;MELPA&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To get an idea of what’s available in the v1.3.0 update, here’s a screenshot of the context menu when normally editing an Elisp file where the point is on the symbol &lt;code&gt;foo&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt="img" src="images/elisp-context-menus/anju-context-menu-elisp.png"&gt;&lt;/p&gt;
&lt;p&gt;If &lt;code&gt;foo&lt;/code&gt; is instrumented for debugging and run, the context menu is adjusted to provide Edebug commands as shown below.&lt;/p&gt;
&lt;p&gt;&lt;img alt="img" src="images/elisp-context-menus/anju-context-menu-edebug.png"&gt;&lt;/p&gt;
&lt;p&gt;The context menu enhancements provided by Anju take full advantage of built-in functions that identify context at &lt;em&gt;point&lt;/em&gt;. Is the point on a symbol? In a function? In an ERT test? On a &lt;code&gt;lambda&lt;/code&gt;? The menu items added by Anju take these factors into account to provide a &lt;em&gt;relevant&lt;/em&gt; menu offering.&lt;/p&gt;
&lt;p&gt;Users can read more about Anju’s context menu enhancements for Elisp development at &lt;a href="https://kickingvegas.github.io/anju/Emacs-Lisp-Context-Menu.html"&gt;Emacs Lisp Context Menu (Anju User Guide)&lt;/a&gt;.&lt;/p&gt;
&lt;h1&gt;Some backstory with Edebug&lt;/h1&gt;
&lt;p&gt;Back in 2024, I did a deep dive into Edebug so as to &lt;a href="http://yummymelon.com/presentations/demystifying-edebug/demystifying-edebug.html"&gt;give a presentation on it&lt;/a&gt; at the &lt;a href="https://www.meetup.com/emacs-sf/events/301454544/?eventOrigin=group_events_list"&gt;EmacsSF meetup&lt;/a&gt;. In doing so, I realized that all the core features for having an Elisp IDE were there, but no good UI to present it. I set upon prototyping one using Transient, with decidedly mixed results due to both Edebug and Transient fighting each other over window management.&lt;/p&gt;
&lt;p&gt;A later &lt;a href="http://yummymelon.com/devnull/prototyping-a-toolbar-ui-for-edebug.html"&gt;Edebug UI prototype using the toolbar&lt;/a&gt; was attempted but it also had its issues, particularly with layout (or lack thereof) and toolbar-specific bugs in macOS. But a benefit of using the toolbar was that its UI interactions did not interfere with window management. The context menu also shares this benefit.&lt;/p&gt;
&lt;h1&gt;Closing Thoughts&lt;/h1&gt;
&lt;p&gt;The context menu has markedly improved my developer experience with Elisp, as I find myself using it more than typing out keybindings. Even with keybindings, I’ll use the &lt;a href="https://kickingvegas.github.io/casual/Elisp.html"&gt;Casual Elisp Transient&lt;/a&gt; to accomplish most Elisp interactions that don’t require Edebug.&lt;/p&gt;
&lt;p&gt;That said, I’m not here to eschew keybindings. I still use them, when convenient. But in many circumstances they are not. The context menu can provide an easier way to achieve the same thing. Isn’t that a good thing?&lt;/p&gt;</content><category term="misc"/><category term="emacs"/><category term="anju"/></entry><entry><title>Some nice to know keybindings when using the mouse in Emacs</title><link href="http://yummymelon.com/devnull/some-nice-to-know-keybindings-when-using-the-mouse-in-emacs.html" rel="alternate"/><published>2026-04-24T13:40:00-07:00</published><updated>2026-04-24T13:40:00-07:00</updated><author><name>Charles Choi</name></author><id>tag:yummymelon.com,2026-04-24:/devnull/some-nice-to-know-keybindings-when-using-the-mouse-in-emacs.html</id><summary type="html">&lt;p&gt;Some keybindings to know whenever you’re working with a mouse in Emacs.&lt;/p&gt;</summary><content type="html">&lt;p&gt;These keybindings are good to know when working with a mouse in Emacs.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;F10&lt;/code&gt; (&lt;code&gt;menu-bar-open&lt;/code&gt;) :: Start key navigation of the menu bar in FRAME.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;S-F10&lt;/code&gt; (&lt;code&gt;context-menu-open&lt;/code&gt;) :: Start key navigation of the context menu. This needs &lt;code&gt;context-menu-mode&lt;/code&gt; enabled.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;C-M-mouse-1&lt;/code&gt; :: Activate a rectangular region around the text selected by dragging. Useful for &lt;a href="https://www.gnu.org/software/emacs/manual/html_node/emacs/Rectangles.html"&gt;rectangle&lt;/a&gt; operations.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;M-Drag-mouse-1&lt;/code&gt; ::  Set the secondary selection, with one end at the place where you press down the button, and the other end at the place where you release it. See &lt;a href="https://www.gnu.org/software/emacs/manual/html_node/emacs/Secondary-Selection.html"&gt;Secondary Selection&lt;/a&gt; for more info.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;C-mouse-3&lt;/code&gt;:: Raise menu populated with the menu mode map of the current mode and if Imenu is enabled, &lt;a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Imenu.html"&gt;an index menu for that buffer&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;C-u&lt;/code&gt; &lt;em&gt;n (optional)&lt;/em&gt;  :: A &lt;a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Prefix-Command-Arguments.html"&gt;prefix argument&lt;/a&gt; can be passed to a menu item.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Keyboard Macro&lt;/em&gt; :: Commands issued via menu can be used when recording a &lt;a href="https://www.gnu.org/software/emacs/manual/html_node/emacs/Keyboard-Macros.html"&gt;keyboard macro&lt;/a&gt;.  (🤯 Who knew?)&lt;/p&gt;
&lt;p&gt;&lt;code&gt;C-x z&lt;/code&gt; (&lt;code&gt;repeat&lt;/code&gt;) :: Repeat most recently executed command. Yes, &lt;code&gt;repeat&lt;/code&gt; works also for commands issued via mouse too!&lt;/p&gt;
&lt;p&gt;Knowing that &lt;code&gt;repeat&lt;/code&gt; works with menu commands (both main and context) is particularly useful with the additions to the main menu made by the latest &lt;a href="https://github.com/kickingvegas/anju/discussions/63"&gt;Anju v1.2.0 update&lt;/a&gt;. Shown below is a demo of using “Duplicate” (&lt;code&gt;duplicate-dwim&lt;/code&gt;) from the Edit menu, then using &lt;code&gt;C-x z&lt;/code&gt; and then &lt;code&gt;z&lt;/code&gt; successively to repeat the duplication.&lt;/p&gt;
&lt;p&gt;&lt;br/&gt;&lt;/p&gt;
&lt;video controls  muted=true poster="http://yummymelon.com/devnull/images/mouse-keybindings/anju-duplicate-demo-thumb.png" width="75%"&gt;
&lt;source src="http://yummymelon.com/devnull/images/videos/anju-duplicate-demo-720.mov" type="video/mp4" /&gt;
&lt;p&gt;
Your browser does not support HTML video. &lt;a href="http://yummymelon.com/devnull/images/videos/anju-duplicate-demo-720.mov" download="{static}images/videos/anju-duplicate-demo-720.mov"&gt;Link to video&lt;/a&gt;.
&lt;/p&gt;
&lt;/video&gt;
&lt;p&gt;&lt;br/&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Amended 2026-04-25&lt;/em&gt;:  Added &lt;code&gt;C-M-mouse-1&lt;/code&gt;, &lt;code&gt;M-Drag-mouse-1&lt;/code&gt;, &lt;code&gt;C-mouse-3&lt;/code&gt;, &lt;code&gt;C-u n&lt;/code&gt;, &lt;em&gt;Keyboard Macro&lt;/em&gt; items.&lt;/p&gt;</content><category term="misc"/><category term="emacs"/><category term="anju"/></entry><entry><title>Calming Mouse Interaction in Dired</title><link href="http://yummymelon.com/devnull/calming-mouse-interaction-in-dired.html" rel="alternate"/><published>2026-04-07T13:25:00-07:00</published><updated>2026-04-07T13:25:00-07:00</updated><author><name>Charles Choi</name></author><id>tag:yummymelon.com,2026-04-07:/devnull/calming-mouse-interaction-in-dired.html</id><summary type="html">&lt;p&gt;Single click to open a file in Dired is too twitchy. This post shows how to change it.&lt;/p&gt;</summary><content type="html">&lt;p&gt;Conventional file managers have conditioned me to expect that a single left-button mouse click (&lt;code&gt;&amp;lt;mouse-1&amp;gt;&lt;/code&gt;) will select a file (or directory) and double-click will open it. This is not the default behavior of Dired, where a single click is an open action. I find this far too twitchy for my taste.&lt;/p&gt;
&lt;p&gt;This post shows how to make Dired mouse interaction align with a conventional file manager where:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Single-click on a file or directory will move the point to it, making it the implicit target for any subsequent Dired command.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Left double-click on file or directory will open it.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Selecting multiple files is emulated using Dired marking, in this case using the binding &lt;code&gt;M-&amp;lt;mouse-1&amp;gt;&lt;/code&gt; to toggle marking a file.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The first two points above can be addressed with the global variable &lt;code&gt;mouse-1-click-follows-link&lt;/code&gt;. Dired uses this variable to control its mouse behavior, but we don’t want to change it everywhere, just for Dired buffers. This can be implemented by setting &lt;code&gt;mouse-1-click-follows-link&lt;/code&gt; locally as a hook to &lt;code&gt;dired-mode-hook&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;table class="highlighttable"&gt;&lt;tr&gt;&lt;td class="linenos"&gt;&lt;div class="linenodiv"&gt;&lt;pre&gt;&lt;span class="normal"&gt;1&lt;/span&gt;
&lt;span class="normal"&gt;2&lt;/span&gt;
&lt;span class="normal"&gt;3&lt;/span&gt;
&lt;span class="normal"&gt;4&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class="code"&gt;&lt;div&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;add-hook&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ss"&gt;&amp;#39;dired-mode-hook&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;lambda&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;setq-local&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;mouse-1-click-follows-link&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ss"&gt;&amp;#39;double&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;To address multiple file selection, we can define a function &lt;code&gt;cc/dired-mouse-toggle-mark&lt;/code&gt; and bind it to &lt;code&gt;M-&amp;lt;mouse-1&amp;gt;&lt;/code&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;table class="highlighttable"&gt;&lt;tr&gt;&lt;td class="linenos"&gt;&lt;div class="linenodiv"&gt;&lt;pre&gt;&lt;span class="normal"&gt; 1&lt;/span&gt;
&lt;span class="normal"&gt; 2&lt;/span&gt;
&lt;span class="normal"&gt; 3&lt;/span&gt;
&lt;span class="normal"&gt; 4&lt;/span&gt;
&lt;span class="normal"&gt; 5&lt;/span&gt;
&lt;span class="normal"&gt; 6&lt;/span&gt;
&lt;span class="normal"&gt; 7&lt;/span&gt;
&lt;span class="normal"&gt; 8&lt;/span&gt;
&lt;span class="normal"&gt; 9&lt;/span&gt;
&lt;span class="normal"&gt;10&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class="code"&gt;&lt;div&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defun&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;cc/dired-mouse-toggle-mark&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s"&gt;&amp;quot;Toggle mark of a Dired item via mouse.&amp;quot;&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;interactive&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;unless&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;use-region-p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;mouse-set-point&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;last-input-event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;char-equal&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;char-after&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;line-beginning-position&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;dired-marker-char&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;call-interactively&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;#&amp;#39;&lt;/span&gt;&lt;span class="nv"&gt;dired-unmark&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;call-interactively&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;#&amp;#39;&lt;/span&gt;&lt;span class="nv"&gt;dired-mark&lt;/span&gt;&lt;span class="p"&gt;))))&lt;/span&gt;

&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;keymap-set&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;dired-mode-map&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;quot;M-&amp;lt;mouse-1&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;#&amp;#39;&lt;/span&gt;&lt;span class="nv"&gt;cc/dired-mouse-toggle-mark&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Coupled with &lt;a href="https://melpa.org/#/anju"&gt;Anju&lt;/a&gt; support for a &lt;a href="https://kickingvegas.github.io/anju/Dired-Mode-Context-Menu.html"&gt;Dired specific context menu&lt;/a&gt; and many basic file manager operations can be done in Dired via mouse with minimal fuss.&lt;/p&gt;</content><category term="misc"/><category term="emacs"/><category term="anju"/></entry><entry><title>Announcing Anju</title><link href="http://yummymelon.com/devnull/announcing-anju.html" rel="alternate"/><published>2026-03-30T08:45:00-07:00</published><updated>2026-03-30T08:45:00-07:00</updated><author><name>Charles Choi</name></author><id>tag:yummymelon.com,2026-03-30:/devnull/announcing-anju.html</id><summary type="html">&lt;p&gt;Announcing Anju, a project to align mouse interactions in Emacs with contemporary (circa 2026) expectations. Now available on MELPA.&lt;/p&gt;</summary><content type="html">&lt;p&gt;The recent post “&lt;a href="https://meanwhiling.com/you-dont-not-need-the-mouse.html"&gt;You don’t not need the mouse&lt;/a&gt;” by noa ks speaks to a sentiment that I’ve had for some time. Using the mouse in Emacs can be a good, daresay &lt;em&gt;delightful&lt;/em&gt;, experience. Unfortunately though, Emacs has antiquated default settings that presume we’re all still using a &lt;a href="https://upload.wikimedia.org/wikipedia/commons/thumb/e/ea/Sun_optical_mouse.jpg/960px-Sun_optical_mouse.jpg"&gt;90’s style 3-button workstation mouse&lt;/a&gt;. In addition, the overreliance on reusing menu keymaps for both the main &lt;em&gt;and&lt;/em&gt; context menus results in poor user experience. I feel strongly that context menus populated this way feel more like an inventory than a thoughtful selection of commands relevant to &lt;em&gt;context&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Thankfully, Emacs offers the mechanisms to sculpt mouse interactions to contemporary (circa 2026) expectations. Over the past three years, I’ve taken advantage of them to implement the following features:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Mode Line&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Right mouse click on blank space to pop-up a window management menu&lt;/li&gt;
&lt;li&gt;Left mouse click on buffer name to pop-up a customizable list of buffers&lt;/li&gt;
&lt;li&gt;Double click on blank space to toggle current window to maximize or return to prior window configuration&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Context Menu&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Context-aware commands for selected text (&lt;code&gt;use-region-p&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Context-aware commands for Org and Dired mode&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Main Menu&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Add Bookmarks menu&lt;/li&gt;
&lt;li&gt;Reorganize Help menu&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Several months ago, I decided these mouse interaction changes should be generalized into a package that others could use. So began the &lt;em&gt;Anju&lt;/em&gt; project.&lt;/p&gt;
&lt;p&gt;Today I’m happy to announce that &lt;a href="https://github.com/kickingvegas/anju"&gt;Anju v1.0&lt;/a&gt; is now available on &lt;a href="https://melpa.org/#/anju"&gt;MELPA&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Learn more details about Anju in its &lt;a href="https://kickingvegas.github.io/anju/"&gt;User Guide&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;As Anju is new, I’m always open to constructive feedback on it. Let me know &lt;a href="https://github.com/kickingvegas/anju/discussions/33"&gt;what you think&lt;/a&gt;. Work on Anju is ongoing with the plan to keep adding improvements to it over time, in particular with supporting more context menus for different modes.&lt;/p&gt;</content><category term="misc"/><category term="emacs"/><category term="anju"/></entry></feed>