notes from /dev/null

by Charles Choi 최민수


Announcing Casual EditKit

23 Sep 2024  Charles Choi

An old joke of Emacs is that it’s a great operating system in need of a good text editor. In truth, Emacs is unmatched in its commands for editing, offering many different commands for editing words, sentences, paragraphs, balanced expressions (sexps) and functions (defuns). The problem is knowing beforehand that such a command that you could use exists.

Casual EditKit is an Emacs package designed to surface these editing commands in a usable way by organizing them into keyboard-driven menus. Casual EditKit is now available on MELPA.

Among the editing and editing-related menus Casual EditKit provides are those for:

  • Register commands
  • Rectangle commands
  • Editing commands for words, sentences, paragraphs, and balanced expressions, and functions
    • Marking
    • Copying
    • Killing
    • Moving
    • Transposing
    • Transforming
    • Deleting
    • Sorting
  • Window management
    • Creating
    • Moving
    • Deleting
  • Search & Replace commands
  • Open commands
  • Project commands
  • Bookmark commands
  • Tool commands
  • Macro commands

Shown below is a reference menu (casual-editkit-main-tmenu) designed to demonstrate all of the above menus. Use it to get an immediate feel for what Casual EditKit offers.

As editing is such a personal experience, Casual EditKit can be considered a library of menus from which a bespoke solution can be crafted. Motivated readers comfortable with Elisp are encouraged to review the Casual EditKit README file and study its source code to make their own customized menus.

Moving Text with Pinned Menus

In many ways, Casual EditKit can be seen as a continuation of my earlier work to move text elegantly. In that post, I posited that instrumenting mouse menus (both main and context) to access text movement commands was ideal for recognition. However, as mouse menus in Emacs cannot be "pinned" to stay persistent, this discourages repeated behavior. Transient menus however can be "pinned". This allows for behavior like moving text (word, sentence, paragraph, etc.) forwards or backwards in an interactive fashion.

Closing Thoughts

Knowing how to use the editing commands in Emacs is a superpower. That knowledge used to be hard won. Casual EditKit now makes this less so.

As Casual EditKit is new, feedback is welcome. Please share your thoughts on it at the discussion group.

Finally, if you have benefited from using Casual EditKit or any of the Casual packages (now counting at 12!), please consider buying me a coffee to help in their development and maintenance. It would be greatly appreciated.

emacs

 

AboutMastodonInstagramGitHub

Feeds & TagsGet Captee for macOS

Powered by Pelican