notes from /dev/null

by Charles Choi 최민수


18 May 2026

Using the Mouse for Emacs Rectangle Commands

img

Of all the built-in editing commands in Emacs, the commands that work with rectangles delight me the most. Once understood, they can save effort in many situations.

That said, the biggest downside to rectangles is the amount of setup it takes to use them. As with many things Emacs, by default you have to memorize a bunch of keybindings to get anything done with them.

In Casual, I addressed the above downside by providing a Transient menu for rectangle commands. Since building that, I've come to use rectangle commands routinely. But even then, there is ceremony to set up a rectangle selection.

With my recent work on mouse-driven interactions in Anju, I’ve learned that rectangle selection is trivial via C-M-<mouse-1> dragging. Once selected, having a menu of rectangle commands makes working with them even easier. So I made one for the latest v1.4.0 update for Anju, now on MELPA.

The “Rectangle” sub-menu is available via the main menu bar “Edit” menu (as shown in the screenshot above) or via context menu. Using rectangle commands in conjunction with the align-regexp (“Edit › Align Regexp…”) and whitespace-cleanup (“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.

Side note: on using C-M-<mouse-1>, sometimes Emacs will only read M-<mouse-1> and do a secondary selection, leaving an unwanted highlight. Enter M-<mouse-1> to dismiss the highlight.

If you find Anju to be useful, please support its development by buying me a coffee. I’ve got a number of new features planned for it.

emacs   anju

Past Articles

11
MAY
2026

Enhancing Elisp Development with Context Menus

Announcing support for Elisp development in the Anju v1.3.0 update.

read more
29
APR
2026

Bulk Search & Replace Commands for Files and Buffers in Emacs

An inventory of bulk commands to search and/or replace multiple files or buffers in Emacs.

read more
24
APR
2026

Some nice to know keybindings when using the mouse in Emacs

Some keybindings to know whenever you’re working with a mouse in Emacs.

read more
23
APR
2026

Call for Testing: Scrim v1.1.3 TestFlight on pre-release Emacs 31

Looking for folks who want to test a new pre-release build of Scrim v1.1.3 which fixes it for Emacs 31.

read more
8
APR
2026

Computing Days Until with Emacs

Countdown clocks are always useful. Here’s one for computing days until in Emacs.

read more
7
APR
2026

Calming Mouse Interaction in Dired

Single click to open a file in Dired is too twitchy. This post shows how to change it.

read more
30
MAR
2026

Announcing Anju

Announcing Anju, a project to align mouse interactions in Emacs with contemporary (circa 2026) expectations. Now available on MELPA.

read more
3
MAR
2026

Casual now available on NonGNU ELPA

Casual is now available on NonGNU ELPA.

read more
19
FEB
2026

Announcing Casual Org

At long last, announcing Casual support for Org Mode.

read more

Page 1 / 19   >

 

AboutMastodonBlueskyGitHub

Feeds & Tags
Get Scrim for macOSGet Captee for macOS

Powered by Pelican