Sacha Chua: YE16: Sacha and Prot talk Emacs

In this livestream, I showed Prot what I've been doing since our last conversation about Emacs configuration and livestreaming. I'll update this with chapter markers as I figure them out. In the meantime, here's the recording!

2026-04-16-01 Preparing for chat with Prot.jpeg

Questions I'm thinking about / areas I'm working on improving:

  • (Log) Getting more out of livestreams (for yourself or others)
    • You've mentioned that you don't really go back to your videos to listen to them. I was wondering what could make the livestreamed recordings more useful to either the person who made them, people who watched it live, or people who come across it later.
    • Tradeoffs for livestreaming:
      • Plus: debugging help, capturing your thinking out loud, conversation, sharing more practices/tips
      • Minus: Fitting less stuff on screen, distractability
    • A few types of livestreams:
    • (Log) Announcing livestreams
      • You add a post for scheduled/spontaneous livestreams and then you update it with the description; probably fine considering RSS readers - people can visit the page if it's finished
      • Debating whether to embed the channel livestream (picks next public scheduled stream, I think) or embed the specific livestream

      • Now on https://yayemacs.com (also https://sach.ac/live, https://sachachua.com/live)
      • Added timestamp translation to Embark keymap for timestamps, sacha-org-timestamp-in-time-zones
      • TODO: Post template
      • TODO: ical file
      • TODO: Easier workflow for embedding streams
      • TODO: Google API for scheduling a livestream
    • (Log) Processing the recordings
      • I like editing transcripts because that also helps me quickly split up chapters
      • Tracking chapters on the fly
      • Extracting screenshots and clips
      • Turning videos into blog posts (or vice versa)
      • TODO: Automate more of the downloading/transcription, common edits, Internet Archive uploads
  • (Log) Do you sometimes find yourself copying non-packaged code from other people? How do you like to integrate it into your config, keep references to the source, check for updates?
    • convert defvar to defcustom
    • Current approach: autoload if possible; if not, add a note to the docstring

         (use-package prot-comment                ; TODO 2026-04-16:
          :load-path "~/vendor/prot-dotfiles/emacs/.emacs.d/prot-lisp"
                :commands (prot-comment-timestamp-keyword)
                :bind
                (:map prog-mode-map
                                        ("C-x M-;" . prot-comment-timestamp-keyword)))
      
         ;;;###autoload
      (defun sacha-org-capture-region-contents-with-metadata (start end parg)
        "Write selected text between START and END to currently clocked `org-mode' entry.
      
         With PARG, kill the content instead.
         If there is no clocked task, create it as a new note in my inbox instead.
      
         From https://takeonrules.com/2022/10/16/adding-another-function-to-sacha-workflow/, modified slightly so that it creates a new entry if we are not currently clocked in."
        (interactive "r\nP")
        (let ((text (sacha-org-region-contents-get-with-metadata start end)))
          (if (car parg)
              (kill-new text)
            (org-capture-string (concat "-----\n" text)
                                (if (org-clocking-p) "c"
                                  "r")))))
      
    • prot-window: run a command in a new frame
    • Look into using keyd for tap and hold space?
    • header line format with common tips
View Org source for this post

You can e-mail me at sacha@sachachua.com.

-1:-- YE16: Sacha and Prot talk Emacs (Post Sacha Chua)--L0--C0--2026-04-16T16:44:19.000Z

Irreal: LaTeX Preview In Emacs

Over at the Emacs subreddit, _DonK4rma shows an example of his mathematical note taking in Emacs. It’s a nice example of how flexible Org mode is even for writing text with heavy mathematical content but probably not too interesting to most Emacs users.

What should be interesting is this comment, which points to Dan Davison’s Xenops, which he describes as a “LaTeX editing environment for mathematical documents in Emacs.” The idea is that with Xenops when you leave a math mode block it is automatically rendered as the final mathematics, which replaces the original input. If you move the cursor onto the output text and type return, the original text is redisplayed.

It’s an excellent system that lets you catch any errors you make in entering mathematics as you’re entering them rather than at LaTeX compile time. So far it only works on .tex files but Davison says he will work on getting it to work with Org too.

He has a six minute video that shows the system in action. It gives a good idea of how it works but Xenops can do a lop more; see the repository’s detailed README at the above link for details.

-1:-- LaTeX Preview In Emacs (Post Irreal)--L0--C0--2026-04-16T15:03:07.000Z

Dave Pearson: boxquote.el v2.4

boxquote.el is another of my oldest Emacs Lisp packages. The original code itself was inspired by something I saw on Usenet, and writing my own version of it seemed like a great learning exercise; as noted in the thanks section in the commentary in the source:

Kai Grossjohann for inspiring the idea of boxquote. I wrote this code to mimic the "inclusion quoting" style in his Usenet posts. I could have hassled him for his code but it was far more fun to write it myself.

While I never used this package to quote text I was replying to in Usenet posts, I did use it a lot on Usenet, and in mailing lists, and similar places, to quote stuff.

The default use is to quote a body of text; often a paragraph, or a region, or perhaps even Emacs' idea of a defun.

,----
| `boxquote.el` provides a set of functions for using a text quoting style
| that partially boxes in the left hand side of an area of text, such a
| marking style might be used to show externally included text or example
| code.
`----

Where the package really turned into something fun and enduring, for me, was when I started to add the commands that grabbed information from elsewhere in Emacs and added a title to explain the content of the quote. For example, using boxquote-describe-function to quote the documentation for a function at someone, while also showing them how to get at that documentation:

,----[ C-h f boxquote-text RET ]
| boxquote-text is an autoloaded interactive native-comp-function in
| ‘boxquote.el’.
|
| (boxquote-text TEXT)
|
| Insert TEXT, boxquoted.
`----

Or perhaps getting help with a particular key combination:

,----[ C-h k C-c b ]
| C-c b runs the command boxquote (found in global-map), which is an
| interactive native-comp-function in ‘boxquote.el’.
|
| It is bound to C-c b.
|
| (boxquote)
|
| Show a transient for boxquote commands.
|
|   This function is for interactive use only.
|
| [back]
`----

Or figuring out where a particular command is and how to get at it:

,----[ C-h w fill-paragraph RET ]
| fill-paragraph is on fill-paragraph (M-q)
`----

While I seldom have use for this package these days (mainly because I don't write on Usenet or in mailing lists any more) I did keep carrying it around (always pulling it down from melpa) and had all the various commands bound to some key combination.

(use-package boxquote
  :ensure t
  :bind
  ("<f12> b i"   . boxquote-insert-file)
  ("<f12> b M-w" . boxquote-kill-ring-save)
  ("<f12> b y"   . boxquote-yank)
  ("<f12> b b"   . boxquote-region)
  ("<f12> b t"   . boxquote-title)
  ("<f12> b h f" . boxquote-describe-function)
  ("<f12> b h v" . boxquote-describe-variable)
  ("<f12> b h k" . boxquote-describe-key)
  ("<f12> b h w" . boxquote-where-is)
  ("<f12> b !"   . boxquote-shell-command))

Recently, with the creation of blogmore.el, I moved the boxquote commands off the b prefix (because I wanted that for blogging) and onto an x prefix. Even then... that's a lot of commands bound to a lot of keys that I almost never use but still can't let go of.

Then I got to thinking: I'd made good use of transient in blogmore.el, why not use it here too? So now boxquote.el has acquired a boxquote command which uses transient.

The boxquote transient in action

Now I can have:

(use-package boxquote
  :ensure t
  :bind
  ("C-c b" . boxquote))

and all the commands are still easy to get to and easy to (re)discover. I've also done my best to make them context-sensitive too, so only applicable commands should be usable at any given time.

-1:-- boxquote.el v2.4 (Post Dave Pearson)--L0--C0--2026-04-16T07:29:35.000Z

Bicycle for Your Mind: Outlining with OmniOutliner Pro 6

OmniOutliner Pro 6OmniOutliner Pro 6

Product: OmniOutliner Pro 6
Price: $99 for new users and $50 for upgrade price. They have a $49.99/year subscription price.

Rationale or the Lack of One

There was no good reason to buy OmniOutliner Pro 6.

I don’t need this program. I have the outlining abilities of Org-mode in Emacs. And dedicated outlining programs in Opal, Zavala and TaskPaper.

They had a good upgrade price and I hadn’t tried out any new software in a while. I know that is not a good reason to spend $50. It was my birthday, and I love outlining programs.

I had used the Pro version in version 3 and had bought the Essentials edition for OmniOutliner 5. A lot of what I see in version 6 is new to me.

Themes

Customizing ThemesCustomizing Themes

OmniOutliner Pro 6 comes with themes. I wanted to make my own or customize the existing ones. It is easy to do. Didn’t do much. Changed the line spacing and the font. The themes it ships with are nice. I am using the blank one and Solarized.

Writing Environment

Writing in OOPWriting in OOP

The best thing about OmniOutliner Pro 6 is the writing environment it provides. There are touches around the program which make it a pleasure to write in. Two of them which stick out to me are:

  1. Typewriter scrolling. I have no idea why more programs don’t give you this feature. I use it all the time. Looking at the bottom of the document is boring and it hurts my neck.
  2. Full screen focus. This is well implemented and another feature which helps me concentrate on the document I am in.

Linking Documents

LinkingLinking

You can link to a document or to a block in the document. Clicking on the space left of the Heading gives you a drop-down menu. Choose the Copy Omni Link and paste it to where you want the link to appear. Useful in linking documents or sections when you have a block of outlines which relate to each other in some way.

Keyboard Commands

keyboard commandskeyboard commands

Keyboard commands are what make an outlining program. OmniOutliner Pro 6 comes with the ability to customize and change every keyboard command that is in the program. It makes the learning curve smoother when you can use the commands you are used to for every task you perform in an outliner. I love this ability to make the outliner my own.

Using OmniOutliner Pro 6

This is the best outliner in the macOS space. OmniOutliner Pro 6 cements that position. It is a pleasure to use. It does everything you need from an outliner and does it with style. It does more than you need. Columns? I have never found the need for columns in an outliner. Other users love this feature. I am not interested. Maybe I am missing something, or I don’t use outlines which need columns. In spite of my lack of enthusiasm for columns, this is the best outlining program available on the macOS.

Comparison with Org-mode

I use Emacs and within it Org-mode. I write in outlines in Emacs all the time.

Org-mode is a strange mix of OmniOutliner and OmniFocus. It does outlines and does task management. All in one application. In plain text. The only problem? You have to deal with the complexity of Emacs. It is a steep learning curve which gives you benefits over the long term but there is pain in the short term. Let’s be honest, there is a ton of pain in the short term. OmniOutliner on the other hand, is easy to pick up and use. You are going to be competent in the program with little effort. The learning curve is minimal. The program is usable and useful. Doesn’t do most of the things Org-mode does, but it is not designed for that. They have a product called OmniFocus to sell you, for that.

Conclusion

If you are looking for an outlining program, you cannot go wrong with OmniOutliner Pro 6. It is fantastic to live in and work with. It gives you a great writing environment. I love writing in it.

There are two things which give me pause when it comes to OmniOutliner Pro 6. The first is the price. I think $99 for an outlining program is steep. That is a function of my retired-person price sensitivity. You might have a different view. The second is the incomplete documentation. They are working on it, slowly. If I am paying for the most expensive outlining program in the marketplace, I want the documentation to be complete and readily available on sale of the product. Not something I have been waiting a few months for. That is negligent.

If you are looking at outlining programs there are competitors in the marketplace. Zavala is a competitive product which is free. Opal is another product which is free and although it doesn’t have all the features of OmniOutliner, is a competent outliner. Or, you can always learn how to use Emacs and adopt Org-mode as the main driver of all your writing.

OmniOutliner Pro 6 is recommended with some reservations.

macosxguru at the gmail thingie.

-1:-- Outlining with OmniOutliner Pro 6 (Post Bicycle for Your Mind)--L0--C0--2026-04-16T07:00:00.000Z

James Endres Howell: Embedding a Mastodon thread as comments to a blog post

I wrote org-static-blog-emfed, a little Emacs package that extends org-static-blog with the ability to embed a Mastodon thread in a blog post to serve as comments. The root of the Mastodon thread also serves as an announcement of the blog post to your followers. It’s based on Adrian Sampson’s Emfed, and of course Bastian Bechtold’s org-static-blog.

I had shared it before, but alas, after changing Mastodon instances the comments from old posts were lost, so I disabled them on this blog. Just over the past few days I’ve found time to get it all working again.

It also seems, at least in #Emacs on Mastodon, that org-static-blog has gained in popularity recently.

Prompted as I was to make a few improvements, I thought I would update the README and share it again. Hope it’s useful for someone!

-1:-- Embedding a Mastodon thread as comments to a blog post (Post James Endres Howell)--L0--C0--2026-04-15T22:17:00.000Z

James Dyer: Emacs-DIYer: A Built-in dired-collapse Replacement

I have been slowly chipping away at my Emacs-DIYer project, which is basically my ongoing experiment in rebuilding popular Emacs packages using only what ships with Emacs itself, no external dependencies, no MELPA, just the built-in pieces bolted together in a literate README.org that tangles to init.el. The latest addition is a DIY version of dired-collapse from the dired-hacks family, which is one of those packages I did not realise I leaned on until I started browsing a deeply-nested Java project and felt the absence immediately.

If you have ever opened a dired buffer on something like a Maven project, or node_modules, or a freshly generated resource bundle, you will know the pain, src/ contains a single main/ which contains a single java/ which contains a single com/ which contains a single example/, and you are pressing RET four times just to get to anything interesting. The dired-collapse minor mode from dired-hacks solves this beautifully, it squashes that whole single-child chain into one dired line so src/main/java/com/example/ shows up as a single row and one RET drops you straight into the deepest directory.

So, as always with the Emacs-DIYer project, I wondered, can I implement this in a few elisp defuns?

Right, so what is the plan?, dired already draws a nice listing with permissions, sizes, dates and filenames, all I really need to do is walk each line, look at the directory, figure out the deepest single-child descendant, and then rewrite the filename column in place with the collapsed path. The trick, and this is the bit that took me a minute to convince myself of, is that dired uses a dired-filename text property to know where the filename lives on the line, and dired-get-filename happily accepts relative paths containing slashes. So if I can rewrite the text and reapply the property, everything else, RET, marking, copying, should just work without me having to touch the rest of dired at all!

First function, my/dired-collapse--deepest, which just walks the directory chain as long as each directory contains exactly one accessible child directory. I added a 100-iteration guard so a pathological symlink cycle cannot wedge the whole thing, which, you know, future me might thank present me for:

(defun my/dired-collapse--deepest (dir)
 "Return the deepest single-child descendant directory of DIR.
Walks the directory chain as long as each directory contains exactly
one entry which is itself an accessible directory. Stops after 100
iterations to guard against symlink cycles."
 (let ((current dir)
 (depth 0))
 (catch 'done
 (while (< depth 100)
 (let ((entries (condition-case nil
 (directory-files current t
 directory-files-no-dot-files-regexp
 t)
 (error nil))))
 (if (and entries
 (null (cdr entries))
 (file-directory-p (car entries))
 (file-accessible-directory-p (car entries)))
 (setq current (car entries)
 depth (1+ depth))
 (throw 'done current)))))
 current))

directory-files-no-dot-files-regexp is one of those lovely little built-in constants I keep forgetting exists, it filters out . and .. but keeps dotfiles, which is exactly what you want if you are deciding whether a directory is truly single-child.

Second function does the actual buffer surgery, my/dired-collapse iterates each dired line, grabs the filename with dired-get-filename, asks the walker how deep the chain goes, and if there is anything to collapse it replaces the displayed filename with the collapsed relative path:

(defun my/dired-collapse ()
 "Collapse single-child directory chains in the current dired buffer.
A DIY replacement for `dired-collapse-mode' from the dired-hacks
package. Rewrites the filename portion of each line in place and
reapplies the `dired-filename' text property so that standard dired
navigation still resolves to the deepest directory."
 (when (derived-mode-p 'dired-mode)
 (let ((inhibit-read-only t))
 (save-excursion
 (goto-char (point-min))
 (while (not (eobp))
 (condition-case nil
 (let ((file (dired-get-filename nil t)))
 (when (and file
 (file-directory-p file)
 (not (member (file-name-nondirectory
 (directory-file-name file))
 '("." "..")))
 (file-accessible-directory-p file))
 (let ((deepest (my/dired-collapse--deepest file)))
 (unless (string= deepest file)
 (when (dired-move-to-filename)
 (let* ((start (point))
 (end (dired-move-to-end-of-filename t))
 (displayed (buffer-substring-no-properties
 start end))
 (suffix (substring deepest
 (1+ (length file))))
 (new (concat displayed "/" suffix)))
 (delete-region start end)
 (goto-char start)
 (insert (propertize new
 'face 'dired-directory
 'mouse-face 'highlight
 'dired-filename t))))))))
 (error nil))
 (forward-line))))))

The key bit is the propertize call at the end, the new filename text has to carry dired-filename t so that dired-get-filename picks it up, and dired-directory on face keeps the collapsed entry looking the same as a normal directory line. Because dired-get-filename will happily glue a relative path like main/java/com/example onto the dired buffer’s directory, pressing RET on a collapsed line takes you straight to src/main/java/com/example with no extra work from me.

A while back I added a little unicode icon overlay thing to dired (my/dired-add-icons, which puts a little symbol in front of each filename via a zero-length overlay), and I did not want the collapse to fight with it. The icons hook into dired-after-readin-hook as well, so I just gave collapse a negative depth when attaching its hook:

(add-hook 'dired-after-readin-hook #'my/dired-collapse -50)

Lower depth runs earlier, so collapse rewrites the line first, then the icon overlay attaches to the final collapsed filename position. Without this, the icons would happily sit in front of a stub directory that was about to be rewritten, which is, well, fine I suppose, but it felt tidier to have them anchor on the post-collapse text.

Before, a typical Maven project root might look something like this:

drwxr-xr-x 3 jdyer users 4096 Apr 9 08:12 ▶ src
drwxr-xr-x 2 jdyer users 4096 Apr 9 08:11 ▶ target
-rw-r--r-- 1 jdyer users 812 Apr 9 08:10 ◦ pom.xml

After collapse kicks in:

drwxr-xr-x 3 jdyer users 4096 Apr 9 08:12 ▶ src/main/java/com/example
drwxr-xr-x 2 jdyer users 4096 Apr 9 08:11 ▶ target
-rw-r--r-- 1 jdyer users 812 Apr 9 08:10 ◦ pom.xml

One RET and you are in com/example, which is where all the actual code lives anyway. Marking, copying, deleting, renaming, all of it still behaves because the dired-filename text property points at the real deepest path.

One thing that initially bit me, is navigating out of a collapsed chain. If I hit RET on a collapsed src/main/java/com/example line I land in the deepest directory, which is great, but then pressing my usual M-e to go back up was doing the wrong thing. M-e in my config has always been bound to dired-jump, and dired-jump called from inside a dired buffer does a “pop up a level” thing that ended up spawning a fresh dired for com/, bypassing the collapsed view entirely and leaving me staring at a directory I never wanted to see.

My first attempt at fixing this was to put some around-advice on dired-jump so that if an existing dired buffer already had a collapsed line covering the jump target, it would switch to that buffer and land on the collapsed line instead of splicing in a duplicate subdir. It worked, sort of, but dired-jump in general felt a bit janky inside dired, it does a lot of “refresh the buffer and try again” under the hood and the in-dired pop-up-a-level path was always the weak link. So I stepped back and split the two cases apart with a tiny dispatch wrapper:

(defun my/dired-jump-or-up ()
 "If in Dired, go up a directory; otherwise dired-jump for current buffer."
 (interactive)
 (if (derived-mode-p 'dired-mode)
 (dired-up-directory)
 (dired-jump)))

(global-set-key (kbd "M-e") #'my/dired-jump-or-up)

From a file buffer, dired-jump is still exactly the right thing as you want the directory the file is in of course. From inside a dired buffer, dired-up-directory is just a much cleaner operation, it walks up one real level, no refresh, no splicing, nothing weird. But on its own that would lose the collapsed round-trip, so I gave dired-up-directory its own bit of advice that looks for a collapsed-ancestor buffer before falling through to the default behaviour.

(defun my/dired-collapse--find-hit (target-dir)
 "Return (BUFFER . POS) of a dired buffer with a collapsed line covering TARGET-DIR."
 (let ((target (file-name-as-directory (expand-file-name target-dir)))
 hit)
 (dolist (buf (buffer-list))
 (unless hit
 (with-current-buffer buf
 (when (and (derived-mode-p 'dired-mode)
 (stringp default-directory))
 (let ((buf-dir (file-name-as-directory
 (expand-file-name default-directory))))
 (when (and (string-prefix-p buf-dir target)
 (not (string= buf-dir target)))
 (save-excursion
 (goto-char (point-min))
 (catch 'found
 (while (not (eobp))
 (let ((line-file (ignore-errors
 (dired-get-filename nil t))))
 (when (and line-file
 (file-directory-p line-file))
 (let ((line-dir (file-name-as-directory
 (expand-file-name line-file))))
 (when (string-prefix-p target line-dir)
 (setq hit (cons buf (point)))
 (throw 'found nil)))))
 (forward-line))))))))))
 hit))

The dired-up-directory only fires when the literal parent is not already open as a dired buffer, which keeps normal upward navigation completely unchanged:

(defun my/dired-collapse--up-advice (orig-fn &optional other-window)
 "Around-advice for `dired-up-directory' restoring collapsed round-trip."
 (let* ((dir (and (derived-mode-p 'dired-mode)
 (stringp default-directory)
 (expand-file-name default-directory)))
 (up (and dir (file-name-directory (directory-file-name dir))))
 (parent-buf (and up (dired-find-buffer-nocreate up)))
 (hit (and dir (null parent-buf)
 (my/dired-collapse--find-hit dir))))
 (if hit
 (let ((buf (car hit))
 (pos (cdr hit)))
 (if other-window
 (switch-to-buffer-other-window buf)
 (pop-to-buffer-same-window buf))
 (goto-char pos)
 (dired-move-to-filename))
 (funcall orig-fn other-window))))

(advice-add 'dired-up-directory :around #'my/dired-collapse--up-advice)

If /proj/src/main/java/com/ happens to already exist as a dired buffer, dired-up-directory does its usual thing and just goes there, the up-advice never fires. It is only when the literal parent is absent that the advice kicks in and hands you back to the collapsed ancestor, which I think is the right tradeoff, the advice never surprises you when you were going to get the standard behaviour anyway, it only steps in when the standard behaviour would throw away context you clearly still had in a buffer somewhere.

End result, RET into a collapsed chain drops me deep, M-e walks me back out to the original collapsed line, and none of it requires doing anything clever with dired-jump’s “pop up a level” path, which I am increasingly convinced I should not have been using in the first place.

Everything lives in the Emacs-DIYer project on GitHub, in the literate README.org. If you just want the snippet to drop into your own init file, the two functions and the add-hook line above are the whole thing, no require, no use-package, no MELPA, just built-in dired and a bit of buffer shenanigans, and thats it!, phew, and breathe!

-1:-- Emacs-DIYer: A Built-in dired-collapse Replacement (Post James Dyer)--L0--C0--2026-04-15T18:20:00.000Z

Dave Pearson: slstats.el v1.11

Yet another older Emacs Lisp package that has had a tidy up. This one is slstats.el, a wee package that can be used to look up various statistics about the Second Life grid. It's mainly a wrapper around the API provided by the Second Life grid survey.

When slstats is run, you get an overview of all of the information available.

An overview of the grid

There are also various commands for viewing individual details about the grid in the echo area:

  • slstats-signups - Display the Second Life sign-up count
  • slstats-exchange-rate - Display the L$ -> $ exchange rate
  • slstats-inworld - Display how many avatars are in-world in Second Life
  • slstats-concurrency - Display the latest-known concurrency stats for Second Life
  • slstats-grid-size - Display the grid size data for Second Life

There is also slstats-region-info which will show information and the object and terrain maps for a specific region.

Region information for Da Boom

As with a good few of my older packages: it's probably not that useful, but at the same time it was educational to write it to start with, and it can be an amusement from time to time.

-1:-- slstats.el v1.11 (Post Dave Pearson)--L0--C0--2026-04-15T14:52:55.000Z

Irreal: Switching Between Dired Windows With TAB

Just a quickie today. Marcin Borkowski (mbork) has a very nice little post on using Tab with Dired. By default, Tab isn’t defined in Dired but mbork suggests an excellent use for it and provides the code to implement his suggestion.

If there are two Dired windows open, the default destination for Dired commands is “the other window”. That’s a handy thing that not every Emacs user knows. Mbork’s idea is to use Tab to switch between Dired windows.

It’s a small thing, of course, but it’s a nice example of reducing friction in your Emacs workflow. As Mbork says, it’s yet another example of how easy it is to make small optimizations like this in Emacs.

Update [2026-04-16 Thu 11:06]: Added link to mbork’s post.

-1:-- Switching Between Dired Windows With TAB (Post Irreal)--L0--C0--2026-04-15T14:42:10.000Z

Gal Buki: Clipboard in terminal Emacs with WezTerm

Although TRAMP allows access to files on remote servers using the local Emacs instance I usually prefer to open Emacs using a running daemon session on the remote server.

The issue with Emacs in the terminal is that kill and yank (aka copy and paste) don't work the same way as with the GUI. Using WezTerm I have found that it is

SSH clipboard support

My terminal emulator of choice is WezTerm which already supports bidirectional kill & yank out of the box.

But I can't bring my muscle memory to remember to use Ctrl+Shift+V to yank text in Emacs. I want Ctrl+y​/​C-y, like I'm used to.

Luckily .wezterm.lua lets us catch Ctrl+y and yank the clipboard contents into the terminal and with that into Emacs.

local wezterm = require 'wezterm'

local config = wezterm.config_builder()

config.keys = {
    -- Paste in Emacs using regular key bindings
    {
      key = "y",
      mods = "CTRL",
      action = wezterm.action.PasteFrom "Clipboard",
    },
}

return config

Local clipboard support

For those wanting to run Emacs in a local terminal WezTerm provides yank out of the box but not kill. To kill text from Emacs into the local clipboard we need to use xclip.

The xclip package has an auto-detect function but it has some issues.

  • if it finds xclip or xsel it will use them even if we are on Wayland
  • it can't detect MacOS (darwin)

So I decided to set the xclip-method manually. In addition I use the :if option of use-package to limit loading the package only when we are in the terminal, an xclip-method was found and we aren't using ssh.

(defun tjkl/xclip-method ()
  (cond
   ((eq system-type 'darwin) 'pbpaste)
   ((getenv "WAYLAND_DISPLAY") 'wl-copy)
   ((getenv "DISPLAY") 'xsel)
   ((getenv "WSLENV") 'powershell)
   (t nil)))

(use-package xclip
  :if (and (not (display-graphic-p))
           (not (getenv "SSH_CONNECTION"))
           (tjkl/xclip-method))
  :custom
  (xclip-method (tjkl/xclip-method))
  :config
  (xclip-mode 1))

Local clipboard without xclip

It is possible to use OSC-52 (Output/Escape Sequences) in a local WezTerm terminal without the xclip package and cli tool.
The problem with this approach is that we can't work with terminal and GUI Emacs using the same session. Since interprogram-cut-function is global it will also try to use OSC52 in the GUI Emacs and fail with the message progn: Device 1 is not a termcap terminal device.

I have not yet found a good way to restore GUI yank functionality once interprogram-cut-function is set. So the following should only be used if the GUI instance doesn't use the same session or if the GUI is never opened after terminal Emacs.

(unless (display-graphic-p)
  (defun tjkl/osc52-kill (text)
    (when (and text (stringp text))
      (send-string-to-terminal
       (format "\e]52;c;%s\a"
               (base64-encode-string text t)))))
  (setq interprogram-cut-function #'tjkl/osc52-kill))
-1:-- Clipboard in terminal Emacs with WezTerm (Post Gal Buki)--L0--C0--2026-04-15T10:50:00.000Z

Sacha Chua: Org Mode: JS for translating times to people's local timezones

I want to get back into the swing of doing Emacs Chats again, which means scheduling, which means timezones. Let's see first if anyone happens to match up with the Thursday timeslots (10:30 or 12:45) that I'd like to use for Emacs-y video things, but I might be able to shuffle things around if needed.

I want something that can translate times into people's local timezones. I use Org Mode timestamps a lot because they're so easy to insert with C-u C-c ! (org-timestamp-inactive), which inserts a timestamp like this:

By default, the Org HTML export for it does not include the timezone offset. That's easily fixed by adding %z to the time specifier, like this:

(setq org-html-datetime-formats '("%F" . "%FT%T%z"))

Now a little bit of Javascript code makes it clickable and lets us toggle a translated time. I put the time afterwards so that people can verify it visually. I never quite trust myself when it comes to timezone translations.

function translateTime(event) {
  if (event.target.getAttribute('datetime')?.match(/[0-9][0-9][0-9][0-9]$/)) {
    if (event.target.querySelector('.translated')) {
      event.target.querySelectorAll('.translated').forEach((o) => o.remove());
    } else {
      const span = document.createElement('span');
      span.classList.add('translated');
      span.textContent = ' → ' + (new Date(event.target.getAttribute('datetime'))).toLocaleString(undefined, {
        month: 'short',  
        day: 'numeric',  
        hour: 'numeric', 
        minute: '2-digit',
        timeZoneName: 'short'
      });
      event.target.appendChild(span);
    }
  }
}
function clickForLocalTime() {
  document.querySelectorAll('time').forEach((o) => {
    if (o.getAttribute('datetime')?.match(/[0-9][0-9][0-9][0-9]$/)) {
      o.addEventListener('click', translateTime);
      o.classList.add('clickable');
    }
  });
}

And some CSS to make it more obvious that it's now clickable:

.clickable {
    cursor: pointer;
    text-decoration: underline dotted;
}

Let's see if this is useful.

Someday, it would probably be handy to have a button that translates all the timestamps in a table, but this is a good starting point.

View Org source for this post

You can e-mail me at sacha@sachachua.com.

-1:-- Org Mode: JS for translating times to people's local timezones (Post Sacha Chua)--L0--C0--2026-04-14T18:44:16.000Z

Irreal: Alfred Snippets

Today while I was going through my feed, I saw this this post from macosxguru over at Bicycle For Your Mind. It’s about his system for using snippets on his system. The TL;DR is that he has settled on Typinator and likes it a lot.

I use snippets a lot but use several systems—YASnippet, abbrev mode, and the macOS text expansion facility—but none of them work everywhere I need them to so I have to negotiate three different systems. YASnippet is different from the other two in that its snippets can accept input instead of just making a text substation like the others.

In his post, macosxguru mentions that his previous system for text substitutions was based on the Alfred snippet functions. I’ve been using Alfred for a long time and love it. A one time purchase of the power pack makes your Mac much more powerful. Still, even though I was vaguely aware of it, I’d never used Alfred’s snippet function.

After seeing it mentioned on macosxguru’s post I decided to try it out. It’s easy to specify text substitutions. I couldn’t immediately figure out how to trigger the substitutions manually so I just set them to trigger automatically. I usually don’t like that but so far it’s working out well.

Up til now, I haven’t found anywhere that the substitutions don’t work. That can’t be said of any of the other systems I was using. It’s particularly hard to find one that works with both Emacs and other macOS applications.

If you’re using Emacs on macOS, you should definitely look into Alfred. It plays very nicely with Emacs and my newfound snippets ability makes the combination even better.

-1:-- Alfred Snippets (Post Irreal)--L0--C0--2026-04-14T14:59:57.000Z

Dave Pearson: wordcloud.el v1.4

I think I'm mostly caught up with the collection of Emacs Lisp packages that need updating and tidying, which means yesterday evening's clean-up should be one of the last (although I would like to revisit a couple and actually improve and extend them at some point).

As for what I cleaned up yesterday: wordcloud.el. This is a package that, when run in a buffer, will count the frequency of words in that buffer and show the results in a fresh window, complete with the "word cloud" differing-font-size effect.

Word cloud in action

This package is about 10 years old at this point, and I'm struggling to remember why I wrote it now. I know I was doing something -- either writing something or reviewing it -- and the frequency of some words was important. I also remember this doing the job just fine and solving the problem I needed to solve.

Since then it's just sat around in my personal library of stuff I've written in Emacs Lisp, not really used. I imagine that's where it's going back to, but at least it's cleaned up and should be functional for a long time to come.

-1:-- wordcloud.el v1.4 (Post Dave Pearson)--L0--C0--2026-04-14T07:47:39.000Z

Dave's blog: Posframe for everything

An Emacser recently posted about popterm, which can use posframe to toggle a terminal visible and invisible in Emacs. I tried it out, and ran into problems with it, so abandoned it for now.

However, this got me thinking about other things that can use posframe, which pops up a frame at point. I’ve seen other Emacsers use posframe when they show off their configurations in meetups. I thought about what I use often that might benefit from a posframe.

  • magit
  • vertico
  • which-key
  • company
  • flymake

Which of these has something I can use to enable posframes?

Of course, there are plenty of other packages that have add-on packages to enable posframes.

Magit

magit doesn’t have anything directly, but it makes heavy use of transient. And there’s a package transient-posframe that can enable posframes for transients. When I use magit’s transients, the transient pops up as a frame in the middle of my Emacs frame.

vertico

Install vertico-posframe to use posframes with vertico.

which-key

Yep, there’s which-key-posframe.

company

See company-posframe.

flymake

I needed a bit of web searching to find this. flymake-popon can use a posframe in the GUI and popon in a terminal.

-1:-- Posframe for everything (Post Dave's blog)--L0--C0--2026-04-14T00:00:00.000Z

Marcin Borkowski: Binding TAB in Dired to something useful

I’m old enough to remember Norton Commander for DOS. Despite that, I never used Midnight Commander nor Sunrise Commander – Dired is still my go-to file manager these days. In fact, Dired has a feature which seems to be inspired by NC: when there are two Dired windows, the default destination for copying, moving and symlinking is “the other” window. Surprisingly, another feature which would be natural in an orthodox file manager is absent from Dired
-1:-- Binding TAB in Dired to something useful (Post Marcin Borkowski)--L0--C0--2026-04-13T18:56:07.000Z

Irreal: Some Config Hacks

Bozhidar Batsov has an excellent post that collects several configuration hacks from a variety of people and distributions. It’s a long list and rather than list them all, I’m going to mention just a few that appeal to me. Some of them I’m already using. Other’s I didn’t know about but will probably adopt.

  • Save the clipboard before killing: I’ve been using this for years. What it does is to make sure that the contents of the system clipboard aren’t lost if you do a kill in Emacs. This is much more useful than it sounds, especially if, like me, your do a lot of cutting and pasting from other applications.
  • Save the kill ring across sessions: I’m not sure I’ll adopt this but it’s easy to see how it could be useful.
  • Auto-Chmod spripts: Every time I see this one I resolve to add it to my config but always forget. What it does is automatically make scripts (files beginning with #!) executable when they’re saved.
  • Proportional window resizing: When a window is split, this causes all the windows in the frame to resize proportionally.
  • Faster mark popping. It’s sort of like repeat mode for popping the mark ring. After the first Ctrl+u Ctrl+Space you can continue popping the ring with a simple Ctrl+Space
  • Auto-select Help window: This is my favorite.When I invoke help, I almost always want to interact with the Help buffer if only to quit and delete it with a q. Unfortunately, the Help buffer doesn’t get focus so I have to do a change window to it. This simple configuration gives the Help buffer focus when you open it.

Everybody’s needs and preferences are different, of course, so be sure to take a look at Bastov’s post to see which ones might be helpful to you.

-1:-- Some Config Hacks (Post Irreal)--L0--C0--2026-04-13T14:56:38.000Z

Sacha Chua: 2026-04-13 Emacs news

Lots of little improvements in this one! I'm looking forward to borrowing the config tweaks that bbatsov highlighted and also trying out popterm for quick-access shells. Also, the Emacs Carnival for April has a temporary home at Newbies/starter kits - feel free to write and share your thoughts!

Links from reddit.com/r/emacs, r/orgmode, r/spacemacs, Mastodon #emacs, Bluesky #emacs, Hacker News, lobste.rs, programming.dev, lemmy.world, lemmy.ml, planet.emacslife.com, YouTube, the Emacs NEWS file, Emacs Calendar, and emacs-devel. Thanks to Andrés Ramírez for emacs-devel links. Do you have an Emacs-related link or announcement? Please e-mail me at sacha@sachachua.com. Thank you!

View Org source for this post

You can comment on Mastodon or e-mail me at sacha@sachachua.com.

-1:-- 2026-04-13 Emacs news (Post Sacha Chua)--L0--C0--2026-04-13T13:43:00.000Z

Protesilaos Stavrou: Emacs: new modus-themes-exporter package live today @ 15:00 Europe/Athens

Raw link: https://www.youtube.com/watch?v=IVTqn9IgBN4

UPDATE 2026-04-13 18:00 +0300: I wrote the package during the stream: https://github.com/protesilaos/modus-themes-exporter.


[ The stream will be recorded. You can watch it later. ]

Today, the 13th of April 2026, at 15:00 Europe/Athens I will do a live stream in which I will develop the new modus-themes-exporter package for Emacs.

The idea for this package is based on an old experiment of mine: to get the palette of a Modus theme and “export” it to another file format for use in supported terminal emulators or, potentially, other applications.

My focus today will be on writing the core functionality and testing it with at least one target application.

Prior work of mine from my pre-Emacs days is the tempus-themes-generator, which was written in Bash: https://gitlab.com/protesilaos/tempus-themes-generator.

-1:-- Emacs: new modus-themes-exporter package live today @ 15:00 Europe/Athens (Post Protesilaos Stavrou)--L0--C0--2026-04-13T00:00:00.000Z

Irreal: Days Until

Charles Choi recently saw a Mastodon post showing the days until the next election and started wondering how one would compute that with Emacs. He looked into it and, of course, the answer turned out to be simple. Org mode has a function, org-time-stamp-to-now that does exactly that. It takes a date string and calculates the number of days until that date.

Choi wrote an internal function that takes a date string and outputs a string specifying the number of days until that date. The default is x days until <date string> but you can specify a different output string if you like. That function, cc/--days-until, serves as a base for other functions.

Choi shows two such functions. One that allows you to specify a date from a date picker and computes the number of days until that date. The other—following the original question—computers the number of days until the next midterm and general elections in the U.S. for 2006. It’s a simple matter to change it for other election years. Nobody but the terminally politically obsessed would care about that but it’s a nice example of how easy it is to use cc/--days-until to find the number of days until some event.

Finally, in the comments to Choi’s reddit announcement ggxx-sdf notes that you can also use calc-eval for these sorts of calculations.

As Choi says, it’s a human characteristic to want to know how long something is going to take. If you have some event that you want a countdown clock for, take a look at Choi’s post.

-1:-- Days Until (Post Irreal)--L0--C0--2026-04-12T14:50:16.000Z

Bicycle for Your Mind: Expanding with Typinator 10

TypinatorTypinator

Product: Typinator
Price: $49.99 (one time for macOS only) or $29.99/yearly (for macOS and iOS version)

I was a TextExpander user and switched from it to aText when TextExpander went to a subscription model. Been using Alfred for snippet expansions for well over… Actually I have no idea how long. Every since Alfred added that feature I suppose. There are expansions which require input, and those are handled by Keyboard Maestro. I wanted to see what was available in this space. There was no good reason for the change, I was perfectly happy with the setup. But I saw that Typinator 10 had been released and I got curious. Approached the developer and they were kind enough to provide me with a license. So, this is the review.

What Does a Text Expansion Program Do?

A text expansion program makes it easy to type content you use regularly. For instance, I have an expansion where I type ,bfym and [Bicycle For Your Mind](http://bicycleforyourmind.com) is pasted into the text. It lessens your typing load, stops you from making mistakes and makes typing easy. Expansions include corrections of common mistakes that you or other people make while typing. It includes emojis and symbols. It can be simple or complex depending on your needs.

macOS has a built in mode for text expansions, but it is limited and like a lot of things macOS does, they include it without giving it much attention or developer love. It is lacking in features or finesse. If you are serious about making your writing comfortable and easy, you need to consider third party solutions. The macOS marketplace has a fair number of programs which tackle this task. The two main products are TextExpander and Typinator. Both Alfred and Keyboard Maestro have this feature built into the program.

Typinator 1Typinator 1

iOS

The main feature in this version of Typinator is the iOS integration. I am not interested in that, I am not going to talk about that. As far as I know, TextExpander was the only other product which had that integration. Typinator is now matching them. For some people, this is a crucial feature. Going by my experience with this developer, I am sure Typinator works as well on iOS.

Surprises

Typinator lets me use regex to define expansions. One of the ones which gets used all the time lets me type a period and then the first letter of the next sentence gets capitalized automatically. You have no idea how much I like that. Apple has that as a setting but it is temperamental. Not Typinator. Works like a charm. Thanks to its regex support it does interesting things with dates. I love that feature although I haven’t used it enough to make it super useful. I see the potential there.

Observations

Converting my Alfred snippets to Typinator was easy. Save the snippets in Alfred as a CSV file and then import those into Typinator.

Typinator keeps a record of the number of times you use a particular expansion and the last time you used it. Gives me the ability to monitor the usage of the expansions. Alfred doesn’t do that. I use abbrev.mode in Emacs, and that keeps a running count too. I love that feature.

Typinator 2Typinator 2

Typinator is easy to interact with. It has a menu-bar icon which you can click on to get the main window or you can assign a system wide keyboard command to bring the window up. You have the ability to highlight something in any editor you are using and press a keyboard command to bring up a dialog box to set up an expansion based on the content you have highlighted. Easy. I find myself using this to increase the number of expansions I have available.

Typinator gives you minute control over the expansions. You have the ability to trigger the expansions immediately upon matching the expansion trigger or after a word break. In other words, you can expand as soon as you match or expand after you type a space or any punctuation after your match. This setting is available on every individual snippet. Every individual snippet can be set for ignoring case or expand on exact match. Another level of fine control which is useful.

This is a mature program. It has been available for a long while now. It is a full-featured expansion program. They have been at it for a while and they are good at it.

Conclusion

If you are looking for a text expansion program, you cannot go wrong with Typinator. It is great at what it does and is full of features which will make you smile. I love it.

I recommend Typinator with enthusiasm.

macosxguru at the gmail thingie.

-1:-- Expanding with Typinator 10 (Post Bicycle for Your Mind)--L0--C0--2026-04-12T07:00:00.000Z

Tim Heaney: Computing Days Until with Perl and Rust

The other day Charles Choi wrote about Computing Days Until with Emacs. I decided to try it in Perl and Rust. Perl In Perl, we could do it with just the standard library like so. #!/usr/bin/env perl use v5.42; use POSIX qw(ceil); use Time::Piece; use Time::Seconds; my $target_date = shift // die "\nUsage: $0 YYYY-MM-DD\n"; my $target = Time::Piece->strptime($target_date, "%Y-%m-%d"); my $today = localtime; my $delta = $target - $today; say ceil $delta->days; Subtracting two Time::Piece objects gives a Time::Seconds object, which has a days method.
-1:-- Computing Days Until with Perl and Rust (Post Tim Heaney)--L0--C0--2026-04-12T00:00:00.000Z

Irreal: Magit Support

Just about everyone agrees that the two Emacs packages considered “killer apps” by those considering adopting the editor are Org mode and Magit. I’ve seen several people say they use Emacs mainly for one or the other.

Their development models are completely different. Org has a development team with a lead developer in much the same way that Emacs does. Magit is basically a one man show, although there are plenty of contributors offering pull requests and even fixing bugs. That one man is Jonas Bernoulli (tarsius) who develops Magit full time and earns his living from doing so.

Like most nerds, he hates marketing and would rather be writing code than seeking funding. Still, that thing about earning a living from Magit means that he must occasionally worry about raising money. Now is one such time. Some of his funding pledges have expired and the weakening U.S. dollar is also contributing to his dwindling income.

Virtually every Emacs user is also a Magit user and many of us depend on it so now would be a propitious moment to chip in some money to keep the good times rolling. The best thing, of course, is to get your employer to make a more robust contribution than would be feasible for an individual developer but even if every developer chips in a few dollars (or whatever) we can support tarsius and allow him to continue working on Magit and its associated packages.

His support page is here. Please consider contributing a few dollars. Tarsius certainly deserves it and we’ll be getting our money’s worth.

-1:-- Magit Support (Post Irreal)--L0--C0--2026-04-11T14:24:14.000Z

Sacha Chua: Org Mode: Tangle Emacs config snippets to different files and add boilerplate

I want to organize the functions in my Emacs configuration so that they are easier for me to test and so that other people can load them from my repository. Instead of copying multiple code blogs from my blog posts or my exported Emacs configuration, it would be great if people could just include a file from the repository. I don't think people copy that much from my config, but it might still be worth making it easier for people to borrow interesting functions. It would be great to have libraries of functions that people can evaluate without worrying about side effects, and then they can copy or write a shorter piece of code to use those functions.

In Prot's configuration (The custom libraries of my configuration), he includes each library as in full, in a single code block, with the boilerplate description, keywords, and (provide '...) that make them more like other libraries in Emacs.

I'm not quite sure my little functions are at that point yet. For now, I like the way that the functions are embedded in the blog posts and notes that explain them, and the org-babel :comments argument can insert links back to the sections of my configuration that I can open with org-open-at-point-global or org-babel-tangle-jump-to-org.

Thinking through the options...

Org tangles blocks in order, so if I want boilerplate or if I want to add require statements, I need to have a section near the beginning of my config that sets those up for each file. Noweb references might help me with common text like the license. Likewise, if I want a (provide ...) line at the end of each file, I need a section near the end of the file.

If I want to specify things out of sequence, I could use Noweb. By setting :noweb-ref some-id :tangle no on the blocks I want to collect later, I can then tangle them in the middle of the boilerplate. Here's a brief demo:

#+begin_src emacs-lisp :noweb yes :tangle lisp/sacha-eshell.el :comments no
;; -*- lexical-binding: t; -*-
<<sacha-eshell>>
(provide 'sacha-eshell)
#+end_src

However, I'll lose the comment links that let me jump back to the part of the Org file with the original source block. This means that if I use find-function to jump to the definition of a function and then I want to find the outline section related to it, I have to use a function that checks if this might be my custom code and then looks in my config for "defun …". It's a little less generic.

I wonder if I can combine multiple targets with some code that knows what it's being tangled to, so it can write slightly different text. org-babel-tangle-single-block currently calculates the result once and then adds it to the list for each filename, so that doesn't seem likely.

Alternatively, maybe I can use noweb or my own tangling function and add the link comments from org-babel-tangle-comments.

Aha, I can fiddle with org-babel-post-tangle-hook to insert the boilerplate after the blocks have been written. Then I can add the lexical-binding: t cookie and the structure that makes it look more like the other libraries people define and use. It's always nice when I can get away with a small change that uses an existing hook. For good measure, let's even include a list of links to the sections of my config that affect that file.

(defvar sacha-dotemacs-url "https://sachachua.com/dotemacs/")

;;;###autoload
(defun sacha-dotemacs-link-for-section-at-point (&optional combined)
  "Return the link for the current section."
  (let* ((custom-id (org-entry-get-with-inheritance "CUSTOM_ID"))
         (title (org-entry-get (point) "ITEM"))
         (url (if custom-id
                  (concat "dotemacs:" custom-id)
                (concat sacha-dotemacs-url ":-:text=" (url-hexify-string title)))))
    (if combined
        (org-link-make-string
         url
         title)
      (cons url title))))

(eval-and-compile
  (require 'org-core nil t)
  (require 'org-macs nil t)
  (require 'org-src nil t))
(declare-function 'org-babel-tangle--compute-targets "ob-tangle")
(defun sacha-org-collect-links-for-tangled-files ()
  "Return a list of ((filename (link link link link)) ...)."
  (let* ((file (buffer-file-name))
         results)
    (org-babel-map-src-blocks (buffer-file-name)
      (let* ((info (org-babel-get-src-block-info))
             (link (sacha-dotemacs-link-for-section-at-point)))
        (mapc
         (lambda (target)
           (let ((list (assoc target results #'string=)))
             (if list
                 (cl-pushnew link (cdr list) :test 'equal)
               (push (list target link) results))))
         (org-babel-tangle--compute-targets file info))))
    ;; Put it back in source order
    (nreverse
     (mapcar (lambda (o)
               (cons (car o)
                     (nreverse (cdr o))))
             results))))
(defvar sacha-emacs-config-module-links nil "Cache for links from tangled files.")

;;;###autoload
(defun sacha-emacs-config-update-module-info ()
  "Update the list of links."
  (interactive)
  (setq sacha-emacs-config-module-links
        (seq-filter
         (lambda (o)
           (string-match "sacha-" (car o)))
         (sacha-org-collect-links-for-tangled-files)))
  (setq sacha-emacs-config-modules-info
        (mapcar (lambda (group)
                  `(,(file-name-base (car group))
                    (commentary
                     .
                     ,(replace-regexp-in-string
                       "^"
                       ";; "
                       (concat
                        "Related Emacs config sections:\n\n"
                        (org-export-string-as
                         (mapconcat
                          (lambda (link)
                            (concat "- " (cdr link) "\\\\\n  " (org-link-make-string (car link)) "\n"))
                          (cdr group)
                          "\n")
                         'ascii
                         t))))))
                sacha-emacs-config-module-links)))

;;;###autoload
(defun sacha-emacs-config-prepare-to-tangle ()
  "Update module info if tangling my config."
  (when (string-match "Sacha.org" (buffer-file-name))
    (sacha-emacs-config-update-module-info)))

Let's set up the functions for tangling the boilerplate.

(defvar sacha-emacs-config-modules-dir "~/sync/emacs/lisp/")
(defvar sacha-emacs-config-modules-info nil "Alist of module info.")
(defvar sacha-emacs-config-url "https://sachachua.com/dotemacs")

;;;###autoload
(defun sacha-org-babel-post-tangle-insert-boilerplate-for-sacha-lisp ()
  (when (file-in-directory-p (buffer-file-name) sacha-emacs-config-modules-dir)
    (goto-char (point-min))
    (let ((base (file-name-base (buffer-file-name))))
      (insert (format ";;; %s.el --- %s -*- lexical-binding: t -*-

;; Author: %s <%s>
;; URL: %s

;;; License:
;;
;; This file is not part of GNU Emacs.
;;
;; This is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;;
;; This is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING.  If not, write to the
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.

;;; Commentary:
;;
%s
;;; Code:

\n\n"
                      base
                      (or
                       (assoc-default 'description
                                      (assoc-default base sacha-emacs-config-modules-info #'string=))
                       "")
                      user-full-name
                      user-mail-address
                      sacha-emacs-config-url
                      (or
                       (assoc-default 'commentary
                                      (assoc-default base sacha-emacs-config-modules-info #'string=))
                       "")))
      (goto-char (point-max))
      (insert (format "\n(provide '%s)\n;;; %s.el ends here\n"
                      base
                      base))
      (save-buffer))))
(setq sacha-emacs-config-url "https://sachachua.com/dotemacs")
(with-eval-after-load 'org
  (add-hook 'org-babel-pre-tangle-hook #'sacha-emacs-config-prepare-to-tangle)
  (add-hook 'org-babel-post-tangle-hook #'sacha-org-babel-post-tangle-insert-boilerplate-for-sacha-lisp))

You can see the results at .emacs.d/lisp. For example, the function definitions in this post are at lisp/sacha-emacs.el.

This is part of my Emacs configuration.
View Org source for this post

You can view 2 comments or e-mail me at sacha@sachachua.com.

-1:-- Org Mode: Tangle Emacs config snippets to different files and add boilerplate (Post Sacha Chua)--L0--C0--2026-04-11T14:13:19.000Z

Listful Andrew: Phones-to-Words Challenge IV: Clojure as an alternative to Java

There's an old programming challenge where the digits in a list of phone numbers are converted to letters according to rules and a given dictionary file. The results of the original challenge suggested that Lisp would be a potentially superior alternative to Java, since Lisper participants were able to produce solutions in, on average, fewer lines of code and less time than Java programmers. Some years ago I tackled it in Emacs Lisp and Bash. I've now done it in Clojure.
-1:-- Phones-to-Words Challenge IV: Clojure as an alternative to Java (Post Listful Andrew)--L0--C0--2026-04-10T11:24:00.000Z

Erik L. Arneson: Emacs as the Freelancer's Command Center

Freelancing for small businesses and organizations leads to a position where you are juggling a number of projects for multiple clients. You need to keep track of a number of tasks ranging from software development to sending emails to project management. This is a lot easier when you have a system that can do a bunch of the work for you, which is why I use Emacs as my freelancer command center.

I would like to share some of the tools and workflows I use in Emacs to help me keep on top of multiple clients’ needs and expectations.

Organization with org-mode

It should be no surprise that at the center of my Emacs command center is org-mode. I have already written about it a lot. Every org-mode user seems to have their own way of keeping track of things, so please don’t take my organizational scheme as some kind of gospel. A couple of years ago, I wrote about how I handle to-do lists in org-mode, and I am still using that method for to-do keywords. However, file structure is also important. I have a number of core files.

Freelance.org

This top-level file contains all of my ongoing business tasks, such as tracking potential new clients, recurring tasks like website maintenance and checking my MainWP dashboard. I also have recurring tasks for invoicing, tracking expenses, and other important business things.

This file is also where I have my primary time tracking and reporting. Org-mode already supports this pretty nicely, I just use the built-in clocktable feature.

Clients/*.org

Clients that have large projects or ongoing business get their own file. This makes organization a lot easier. All tasks associated with a client and their various projects end up in these individual files. The important part is making sure that these files are included in the time-tracking clock table and your org-mode agenda, so you can see what is going on every week.

References and Linking

I have C-c l bound to org-store-link and use it all the time to link to various files, directories, URLs, and even emails. I can then use those links in my client notes, various tasks in my to-do list, and so on. This helps me keep my agenda organized even when my filesystem and browser bookmarks are a bit of a mess.

Email with mu4e

I have been reading and managing my email in Emacs for over 25 years. There have been a few breaks here and there where I have tried out other software or even web mail clients, but it has always been a headache. I return to Emacs! Long ago, I used VM (which seems to have taken on new life!), but currently I use mu4e.

This gives me a ton of power and flexibility when dealing with email. I have custom functions to help me compose and organize my email, and I can use org-store-link to keep track of individual emails from clients as they relate to agenda items. I even have a function to convert emails that I have written in Markdown into HTML email, and one that searches for questions in a client email to make sure I haven’t missed anything.

The ability to write custom code to both process and create email is extremely powerful and a great time saver.

Writing Code

I don’t know what else to say about this, I use Emacs for doing all of my software development. I make sure to use Eglot whenever there is a language server available, and I try to leverage all the fancy features offered by Emacs whenever possible. The vast majority of projects for clients are PHP (thanks WordPress), Go, JavaScript, and TypeScript.

Writing Words

Previously, I have shared quite a bit about writing in Emacs. I like to start everything in org-mode, but I also write quite a bit in Markdown. Emacs has become a powerful tool for writing. I use the Harper language server along with Eglot to check grammar and spelling.

Track All Changes with Magit

Version control is essential, a lesson I have learned over 30+ years of software development. While Git is not part of Emacs, the software I use to interface with Git is. Magit is a Git user interface that runs entirely in Emacs. I use it to track my writing, my source code, and even all of my org-mode files. Using version control is so essential that I have a weekly repeating agenda task reminding me to check all of my everyday files to make sure I have checked-in my changes for the week.

Thinking Music with EMMS

I like to have some soothing background music when I am programming, writing, or otherwise working on my computer. However, if that background music has lyrics, it can be really distracting. It is easy to make a playlist for various suitable SomaFM channels to load into EMMS (the Emacs Multimedia System) using the command M-x emms-play-playlist.

Try saving the following into playlist.el somewhere, and using it the next time you are writing:

 ;;; This is an EMMS playlist file Play it with M-x emms-play-playlist
 ((*track* (type . url) (name . "https://somafm.com/synphaera.pls"))
  (*track* (type . url) (name . "https://somafm.com/gsclassic.pls"))
  (*track* (type . url) (name . "https://somafm.com/sonicuniverse.pls"))
  (*track* (type . url) (name . "https://somafm.com/groovesalad.pls")))

And make sure to check out SomaFM’s selection to find some good background music that suits your tastes!

And the tools I have missed

There are undoubtedly Emacs tools that I have missed in this brief overview. I have been wracking my brain as I write, trying to see what I have forgotten or overlooked. Frankly, Emacs has become such a central part of the organization for my freelancing that there are probably many tools, packages, and processes that I use every day without thinking about it too much.

Emacs makes it possible for me to freelance for multiple clients and small businesses without losing my mind with organization and task management. The tools it provides allow me to stay on top of multiple projects, handle client relationships, and keep track of years worth of tasks, communications, and projects. Without it, I’d be sunk!

What Emacs tools are you using to manage your freelance business? I am always looking for ways to improve or streamline my process.

The featured image for this post comes from Agostino Ramelli’s Le diverse et artificiose machine (1588). Read more about it on the Public Domain Review.

-1:-- Emacs as the Freelancer's Command Center (Post Erik L. Arneson)--L0--C0--2026-04-10T00:00:00.000Z

Protesilaos Stavrou: Emacs modus-themes live stream today @ 14:00 Europe/Athens

Raw link: https://www.youtube.com/watch?v=xFQDYTCS1os

[ The stream will be recorded. You can watch it later. ]

At 14:00 Europe/Athens I will hold a live stream about Emacs. Specifically, I will work on my modus-themes package.

The idea is to write more tests and refine the relevant functions along the way.

I am announcing this -45 minutes before I go live. I will keep the chat open in case there are any questions.

-1:-- Emacs modus-themes live stream today @ 14:00 Europe/Athens (Post Protesilaos Stavrou)--L0--C0--2026-04-10T00:00:00.000Z

James Dyer: Wiring Flymake Diagnostics into a Follow Mode

Flymake has been quietly sitting in my config for years doing exactly what it says on the tin, squiggly lines under things that are wrong, and I mostly left it alone. But recently I noticed I was doing the same little dance over and over: spot a warning, squint at the modeline counter, run `M-x flymake-show-buffer-diagnostics`, scroll through the list to find the thing I was actually looking at, then flip back. Two windows, zero connection between them.

So I wired it up properly, and while I was in there I gave it a set of keybindings that feel right to my muscle memory.

The obvious bindings for stepping through errors are `M-n` and `M-p`, and most people using flymake bind exactly those. The problem is that in my config `M-n` and `M-p` are already taken, they step through simply-annotate annotations (which is itself a very handy thing and I am not giving it up!). So I shifted a key up and went with the shifted variants: `M-N` for next, `M-P` for previous, and `M-M` to toggle the diagnostics buffer.

 (setq flymake-show-diagnostics-at-end-of-line nil)
 (with-eval-after-load 'flymake
 (define-key flymake-mode-map (kbd "M-N") #'flymake-goto-next-error)
 (define-key flymake-mode-map (kbd "M-P") #'flymake-goto-prev-error))

With M-M I wanted it to be a bit smarter than just “open the buffer”. If it is already visible I want it gone, if it is not I want it up. The standard toggle pattern:

 (defun my/flymake--diag-buffer ()
 "Return the visible flymake diagnostics buffer, or nil."
 (seq-some (lambda (b)
 (and (with-current-buffer b
 (derived-mode-p 'flymake-diagnostics-buffer-mode))
 (get-buffer-window b)
 b))
 (buffer-list)))

 (defun my/flymake-toggle-diagnostics ()
 "Toggle the flymake diagnostics buffer."
 (interactive)
 (let ((buf (my/flymake--diag-buffer)))
 (if buf
 (quit-window nil (get-buffer-window buf))
 (flymake-show-buffer-diagnostics)
 (my/flymake-sync-diagnostics))))

Now the interesting bit. What I really wanted was a follow mode, something like how the compilation buffer tracks position or how Occur highlights the current hit. When my point lands on an error in the source buffer, the corresponding row in the diagnostics buffer should light up. That way the diagnostics window becomes a live index of where I am rather than a static dump and think in general this is how a lot of other IDEs work.

I tried the lazy route first, turning on hl-line-mode in the diagnostics buffer and calling hl-line-highlight from a post-command-hook in the source buffer. The line lit up once and then refused to move. Nothing I did would shift it. This is because hl-line-highlight is really only designed to be driven from the window whose line is being highlighted, and I was firing it from afar.

Ok, so why not just manage my own overlay:

 (defvar my/flymake--sync-overlay nil
 "Overlay used to highlight the current entry in the diagnostics buffer.")

 (defun my/flymake-sync-diagnostics ()
 "Highlight the diagnostics buffer entry matching the error at point."
 (when-let* ((buf (my/flymake--diag-buffer))
 (win (get-buffer-window buf))
 (diag (or (car (flymake-diagnostics (point)))
 (car (flymake-diagnostics (line-beginning-position)
 (line-end-position))))))
 (with-current-buffer buf
 (save-excursion
 (goto-char (point-min))
 (let ((found nil))
 (while (and (not found) (not (eobp)))
 (let ((id (tabulated-list-get-id)))
 (if (and (listp id) (eq (plist-get id :diagnostic) diag))
 (setq found (point))
 (forward-line 1))))
 (when found
 (unless (overlayp my/flymake--sync-overlay)
 (setq my/flymake--sync-overlay (make-overlay 1 1))
 (overlay-put my/flymake--sync-overlay 'face 'highlight)
 (overlay-put my/flymake--sync-overlay 'priority 100))
 (move-overlay my/flymake--sync-overlay
 found
 (min (point-max) (1+ (line-end-position)))
 buf)
 (set-window-point win found)))))))

My first pass at the walk through the tabulated list did not work. I was comparing (tabulated-list-get-id) directly against the diagnostic returned by flymake-diagnostics using eq, and it was always false, which meant found stayed nil forever and the overlay never moved. A dive into flymake.el revealed why. Each row in the diagnostics buffer stores its ID as a plist, not as the diagnostic itself:

 (list :diagnostic diag
:line line
:severity ...)

So I need to pluck out :diagnostic before comparing. Obvious in hindsight, as these things always are. With plist-get in place the comparison lines up and the overlay moves exactly where I want it, tracking every navigation command.

The fallback lookup using line-beginning-position and line-end-position is there because flymake-diagnostics (point) only returns something if point is strictly inside the diagnostic span. When I land between errors or on the same line as an error but a few columns off, I still want the diagnostics buffer to track, so I widen the search to the whole line.

Finally, wrap the hook in a minor mode so I can toggle it per buffer and enable it automatically whenever flymake comes up:

 (define-minor-mode my/flymake-follow-mode
 "Sync the diagnostics buffer to the error at point."
 :lighter nil
 (if my/flymake-follow-mode
 (add-hook 'post-command-hook #'my/flymake-sync-diagnostics nil t)
 (remove-hook 'post-command-hook #'my/flymake-sync-diagnostics t)))

 (add-hook 'flymake-mode-hook #'my/flymake-follow-mode)
 (define-key flymake-mode-map (kbd "M-M") #'my/flymake-toggle-diagnostics)

The end result is nice. M-M pops the diagnostics buffer, M-N and M-P walk through the errors, and as I navigate the source the matching row in the diagnostics buffer highlights in step with me. If I close the buffer with another M-M everything goes quiet, and I can still step through with M-N/M-P on their own.

Three little keybindings and twenty lines of elisp, but they turn flymake from a static reporter into something that actually feels connected to where I am in the buffer.

-1:-- Wiring Flymake Diagnostics into a Follow Mode (Post James Dyer)--L0--C0--2026-04-09T05:13:00.000Z

Charles Choi: Computing Days Until with Emacs

A recent Mastodon post showing the days until the next U.S. election got me to wonder, “how can I compute that in Emacs?” Turns out, this is trivial with the Org mode function org-time-stamp-to-now doing the timestamp computation for you.

We can wrap org-time-stamp-to-now in an internal function cc/--days-until that generates a formatted string of the days until a target date.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
(defun cc/--days-until (target &optional template)
  "Formatted string of days until TARGET.

- TARGET: date string that conforms to `parse-time-string'.
- TEMPLATE : format string that includes ‘%d’ specifier.

If TEMPLATE is nil, then a predefined format string will be
used."
  (let* ((template (if template
                       template
                     (concat "%d days until " target)))
         (days (org-time-stamp-to-now target))
         (msg (format template days)))
    msg))

From there we can then start defining commands that use cc/--days-until. The command cc/days-until shown below will prompt you with a date picker to enter a date. Note that you can enter a date value (e.g. “Dec 25, 2026”) in the mini-buffer prompt for org-read-date.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
(defun cc/days-until (arg)
  "Prompt user for date and show days until in the mini-buffer.

Use `org-read-date' to compute days until to display in the mini-buffer.

If prefix ARG is non-nil, then the computed result is stored in the
 `kill-ring'."
  (interactive "P")
  (let* ((target (org-read-date))
         (msg (cc/--days-until target)))
    (if arg
        (kill-new msg))
    (message msg)))

Going back to the original motivator for this post, here’s an implementation of days until the next two major U.S. election dates with the command cc/days-until-voting.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
(defun cc/days-until-voting (arg)
  "Days until U.S. elections in 2026 and 2028.

If prefix ARG is non-nil, then the computed result is stored in the
 `kill-ring'."
  (interactive "P")
  (let* ((midterms (cc/--days-until "2026-11-03" "%d days until 2026 midterms"))
         (election (cc/--days-until "2028-11-07" "%d days until 2028 presidential election"))
         (msg (format "%s, %s" midterms election)))
    (if arg
        (kill-new msg))
    (message msg)))

The result of M-x cc/days-until-voting as of 8 April 2026 is:

209 days until 2026 midterms, 944 days until 2028 presidential election

It’s so human to want to know how long it’s going to take. Feel free to build your own countdown clocks using the code above. May your journey to whatever you plan be a happy one!

-1:-- Computing Days Until with Emacs (Post Charles Choi)--L0--C0--2026-04-08T23:00:00.000Z

Dave Pearson: quiz.el v1.7

I wondered yesterday:

...those question headers are displaying differently, with the background colour no longer spanning the width of the window. I'd like to understand why.

Turns out it was pretty straightforward:

diff --git a/quiz.el b/quiz.el
index 2dbe45d..c1ba255 100644
--- a/quiz.el
+++ b/quiz.el
@@ -40,7 +40,8 @@
 (defface quiz-question-number-face
   '((t :height 1.3
        :background "black"
-       :foreground "white"))
+       :foreground "white"
+       :extend t))
   "Face for the question number."
   :group 'quiz)

and so v1.7 has happened.

Quiz with reinstated header look

It looks like, perhaps, at some point in the past, :extend was t by default, but it no longer is? Either way, explicitly setting it to t has done the trick.

-1:-- quiz.el v1.7 (Post Dave Pearson)--L0--C0--2026-04-08T15:54:38.000Z

Irreal: Tolerance For Repetition

Floofcode over that the Emacs subreddit asks a question that resonates with me. He notes that he often has a repetitive task and wonders whether it would be worthwhile writing some Elisp to automate it. Usually, he has to repeat the task several times before he gets fed up and fixes it for good. He wonders how other people deal with this. Do they have to repeat the task a certain number of times before automating it or is the criterion more subjective.

I can relate. This happens to me all the time. I keep doing the same task over and over until one day I realize that I’m being stupid and spend a few minutes dashing off a bit of Elisp that solves the problem once and for all. Every time, I tell myself, “Well, I won’t that mistake again. Next time I’m going to get this type of task automated right away.” Of course, the next time the same thing happens.

As to floofcode’s question, I would guess that it depends on the person. For me, it’s a subjective matter. The amount of time I’ll spend repeating the same boring task over and over varies but it always ends in a fit of anger when I ask myself why I’m still doing things manually. The thing is, when I’m repeatedly doing the task manually, I’m not wondering whether I should automate it. That happens at the end when I realize I’ve been stupid.

I guess the answer is something of the sort that after you’ve repeated the task twice, just automate it. Sure sometimes you’ll lose and waste time but in my experience it will most often be a win. I wish I could learn this.

-1:-- Tolerance For Repetition (Post Irreal)--L0--C0--2026-04-08T14:33:12.000Z

Dave Pearson: fasta.el v1.1

Today's Emacs Lisp package tidy-up is of a package I first wrote a couple of employers ago. While working on code I often found myself viewing FASTA files in an Emacs buffer and so I thought it would be fun to use this as a reason to knock up a simple mode for highlighting them.

fasta.el was the result.

An example FASTA file

While I doubt it was or is of much use to others, it helped me better understand simple font-locking in Emacs Lisp, and also made some buffers look a little less boring when I was messing with test data.

As for this update: it's the usual stuff of cleaning up deprecated uses of setf, mostly.

If bioinformatics-related Emacs Lisp code written by a non-bioinformatician is your thing, you might also find 2bit.el of interest too. Much like fasta.el it too probably doesn't have a practical use, but it sure was fun to write and taught me a few things along the way; it also sort of goes hand-in-hand with fasta.el too.

-1:-- fasta.el v1.1 (Post Dave Pearson)--L0--C0--2026-04-08T10:25:43.000Z

Charles Choi: Calming Mouse Interaction in Dired

Conventional file managers have conditioned me to expect that a single left-button mouse click (<mouse-1>) 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.

This post shows how to make Dired mouse interaction align with a conventional file manager where:

  • Single-click on a file or directory will move the point to it, making it the implicit target for any subsequent Dired command.

  • Left double-click on file or directory will open it.

  • Selecting multiple files is emulated using Dired marking, in this case using the binding M-<mouse-1> to toggle marking a file.

The first two points above can be addressed with the global variable mouse-1-click-follows-link. 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 mouse-1-click-follows-link locally as a hook to dired-mode-hook:

1
2
3
4
(add-hook
 'dired-mode-hook
 (lambda ()
   (setq-local mouse-1-click-follows-link 'double)))

To address multiple file selection, we can define a function cc/dired-mouse-toggle-mark and bind it to M-<mouse-1>.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
(defun cc/dired-mouse-toggle-mark ()
  "Toggle mark of a Dired item via mouse."
  (interactive)
  (unless (use-region-p)
    (mouse-set-point last-input-event)
    (if (char-equal (char-after (line-beginning-position)) dired-marker-char)
        (call-interactively #'dired-unmark)
      (call-interactively #'dired-mark))))

(keymap-set dired-mode-map "M-<mouse-1>" #'cc/dired-mouse-toggle-mark)

Coupled with Anju support for a Dired specific context menu and many basic file manager operations can be done in Dired via mouse with minimal fuss.

-1:-- Calming Mouse Interaction in Dired (Post Charles Choi)--L0--C0--2026-04-07T20:25:00.000Z

Irreal: Karthik On Repeat Mode

The other day, I wrote about repeat mode. My take was that it was a way repeating certain commands without having to retype their, possibly, complex prefixes. All of that is true but as Karthik informed me in a comment, there is much, much more to repeat mode than simply repeating commands.

It is a way, he says, of grouping a set of related commands together into a sort of mode. Thus, there is more to Ctrl+x } than simply repeating the enlarge window command. Once you type Ctrl+x you can type any of {, }, ^, v to resize the window in any direction. The Ctrl+x enables a keymap with those four single keys to resize the current window, defining, in effect, a “resize window mode”.

Four years ago, Karthik wrote a long post that explains all this and, at least on an intuitive level, how it works. My first thought was to add an update to my post that pointed to Karthik’s and I did that but then I thought that his post was so good that I should devote a new post to it so that anyone who missed it the first time would see it.

Repeat mode really is an excellent facility—Karthik says it’s a cornerstone of his Emacs usage—and every Emacser should be familiar with it. If nothing else, it’s worth enabling repeat mode so that you can use the built in repeat maps. You can see what they are by running the command describe-repeat-maps.

-1:-- Karthik On Repeat Mode (Post Irreal)--L0--C0--2026-04-07T15:59:32.000Z

Dave Pearson: quiz.el v1.6

A quick little refresh of one of my old packages, this time quiz.el. This is a nice little distraction when you're working in Emacs, letting you spin up a quick trivia quiz in a buffer.

Quiz in action

It's backed by the Open Trivia Database, so there's a good few subjects, questions, and levels of difficulty to play with.

The only changes I've made to it in this release are the usual clean-ups of the deprecated uses of setf, plus I've added q as a binding to the quiz window to quickly quit the quiz.

I might have to come back and revisit it soon, as it looks like the default face choices could probably do with a rethink, and I can see at the moment that the attempt at a window-wide "header" for each question isn't working any longer. For comparison, here's how the package looked when running back when I first wrote it back in 2017:

How it originally looked

Leaving aside the fact that I was still running a very light Emacs then, those question headers are displaying differently, with the background colour no longer spanning the width of the window. I'd like to understand why.

-1:-- quiz.el v1.6 (Post Dave Pearson)--L0--C0--2026-04-07T08:18:23.000Z

Emacs Redux: Stealing from the Best Emacs Configs

Good artists borrow, great artists steal.

– Pablo Picasso

After spending the past couple of weeks updating Prelude and my personal Emacs config, I figured it wouldn’t hurt to see what the competition has been up to. I hadn’t done a proper survey of other people’s configs in years, and the Emacs landscape has changed quite a bit since the last time I looked.

So I went through Doom Emacs, Purcell’s emacs.d, Centaur Emacs, Prot’s dotfiles, and a handful of others. Here are some of the most interesting things I found – settings and tricks that I either didn’t know about or had forgotten about entirely.

Performance Tweaks

Disable Bidirectional Text Scanning (Doom Emacs)

If you don’t edit right-to-left languages (Arabic, Hebrew, etc.), Emacs is doing a bunch of work on every redisplay cycle for nothing. These settings tell Emacs to assume left-to-right text everywhere and skip the bidirectional parenthesis algorithm:

(setq-default bidi-display-reordering 'left-to-right
              bidi-paragraph-direction 'left-to-right)
(setq bidi-inhibit-bpa t)

The difference is hard to measure in small buffers, but in large files (think multi-thousand-line JSON or log files) it adds up. Doom enables this unconditionally and I’ve never seen anyone complain about it.

Skip Fontification During Input (Doom Emacs)

Emacs normally fontifies (syntax-highlights) text even while you’re actively typing. This can cause micro-stutters, especially in tree-sitter modes or large buffers. One setting fixes it:

(setq redisplay-skip-fontification-on-input t)

Emacs will defer fontification until you stop typing. In practice you never notice the delay – the highlighting catches up instantly – but scrolling and typing may feel smoother.

Increase Process Output Buffer for LSP (Doom, Purcell, Centaur)

The default read-process-output-max is 64KB, which is still quite conservative. Modern LSP servers like rust-analyzer or clangd routinely send multi-megabyte responses. Bumping this reduces the number of read calls Emacs has to make:

(setq read-process-output-max (* 4 1024 1024)) ; 4MB

If you use eglot (or lsp-mode), this is basically free performance. Three of the most popular configs out there all set it – that should tell you something.

Note: I’m really surprised I didn’t discover this one sooner. Probably that’s because I rarely work on big projects these days.

Don’t Render Cursors in Non-Focused Windows (Doom Emacs)

If you have several windows visible, Emacs draws a cursor in each of them – even the ones you’re not working in. It also highlights selections in non-focused windows. Two settings to stop that:

(setq-default cursor-in-non-selected-windows nil)
(setq highlight-nonselected-windows nil)

This is mostly a visual preference (I don’t mind the phantom cursors but I know some people find them distracting), but it also reduces rendering work.

All four of these performance settings are safe to add unconditionally – they have no downsides for the vast majority of users.

Kill Ring (Emacs’s Clipboard History) and Clipboard

Save the Clipboard Before Killing (Purcell, Prot, Centaur)

Here’s a scenario: you copy a URL from your browser, switch to Emacs, kill a line with C-k, and then try to yank the URL you copied earlier with C-y. Gone. The kill replaced it on the clipboard.

This setting makes Emacs save the existing clipboard content into the kill ring before overwriting it:

(setq save-interprogram-paste-before-kill t)

Now C-y gets the kill, and M-y gets you back to the URL. Such a small thing, but it eliminates a genuinely annoying problem.

No Duplicates in the Kill Ring (Doom, Prot)

Kill the same line three times and you get three identical entries in the kill ring, wasting slots. This deduplicates them:

(setq kill-do-not-save-duplicates t)

Persist the Kill Ring Across Sessions (Doom, Prot)

Most configs that use savehist-mode only persist search rings. But savehist can save any variable – including the kill ring. Add it and you get clipboard history that survives restarts:

(setq savehist-additional-variables
      '(search-ring regexp-search-ring kill-ring))

One thing to watch out for: the kill ring can accumulate text properties (fonts, overlays, etc.) that bloat the savehist file. Doom strips them before saving:

(add-hook 'savehist-save-hook
          (lambda ()
            (setq kill-ring
                  (mapcar #'substring-no-properties
                          (cl-remove-if-not #'stringp kill-ring)))))

Probably overkill for most people, but it’s good to be aware of if your savehist file starts growing suspiciously large.

Editing

Auto-Chmod Scripts on Save (Multiple Configs)

If you create a file that starts with #! (a shebang line), it should be executable. But you always forget to chmod +x it, run the script, get “Permission denied”, curse, go back, chmod, try again. This hook does it automatically:

(add-hook 'after-save-hook
          #'executable-make-buffer-file-executable-if-script-p)

Save a file with a shebang, and Emacs chmod +xes it for you. One of those things that should arguably be a default.

Note: Okay, I have to admit I’ve always known this one, but seeing it in so many configs made me want to include it here.

Sane Syntax in re-builder (Multiple Configs)

re-builder (M-x re-builder) is an interactive tool for developing regexps – you type a pattern and see matches highlighted live in the target buffer. The problem is the default syntax: read. In read syntax, you have to double-escape everything, so a word boundary is \\< and a group is \\(...\\). It’s the regexp equivalent of trying to type with oven mitts on.

Switch to string syntax and things look like normal Emacs regexps:

(setq reb-re-syntax 'string)

Now \< is \< and \(foo\) is \(foo\). Much less painful.

See also: If you want live feedback on the regexp structure as you type it (color-coded groups, character classes, etc.), check out minibuffer-regexp-mode – a new built-in mode in Emacs 30.

Prevent ffap from Pinging Hostnames (Centaur Emacs)

Ever had Emacs freeze for a few seconds when you ran find-file-at-point (or a command that uses it internally)? If the text under point looks like a hostname – say, something.com in a comment – ffap tries to ping it to check if it’s reachable. On a slow or firewalled network, that’s a multi-second hang.

(setq ffap-machine-p-known 'reject)

This tells ffap to never try network lookups. If you actually want to open a remote file, you can type the path explicitly.

Windows

Proportional Window Resizing (Purcell, Prot)

When you split a window with C-x 2 or C-x 3, Emacs halves the current window. If you already have a multi-window layout, this can produce one awkwardly tiny window while others stay large. With this setting, all windows in the frame resize proportionally:

(setq window-combination-resize t)

The difference is subtle but makes multi-window layouts feel more balanced without manual resizing.

Reversible C-x 1 (Purcell)

C-x 1 (delete-other-windows) is the nuclear option – it nukes your entire window layout to focus on one buffer. Then you spend the next minute recreating the layout you just destroyed.

With winner-mode and a small wrapper, you can make C-x 1 toggle: press it once to go single-window, press it again to restore the previous layout:

(winner-mode +1)

(defun toggle-delete-other-windows ()
  "Delete other windows in frame if any, or restore previous window config."
  (interactive)
  (if (and winner-mode
           (equal (selected-window) (next-window)))
      (winner-undo)
    (delete-other-windows)))

(global-set-key (kbd "C-x 1") #'toggle-delete-other-windows)

Just drop this into your config as-is – it’s self-contained. This is one of those tricks where once you have it, you can’t imagine going back.

Misc

Faster Mark Popping (Purcell, Centaur, Prot)

The mark ring is one of Emacs’s most underused navigation features. Every time you jump somewhere – isearch, M-<, M->, goto-line, imenu, and many more – Emacs pushes your old position onto the mark ring. C-u C-SPC pops it, jumping you back.

The annoyance: you need C-u C-SPC every single time. With this setting, after the first C-u C-SPC you can keep pressing just C-SPC to continue popping:

(setq set-mark-command-repeat-pop t)

This pairs beautifully with repeat-mode if you have it enabled (and you should – see my earlier post on repeat-mode).

Recenter After save-place Restores Position (Doom Emacs)

save-place-mode is great – it remembers where you were in each file and jumps back there when you reopen it. The problem is that it can leave your cursor on the last visible line of the window, which is disorienting. This advice recenters the view after the jump:

(advice-add 'save-place-find-file-hook :after
            (lambda (&rest _)
              (when buffer-file-name (ignore-errors (recenter)))))

Small thing, but it makes reopening files feel much more natural.

Auto-Select Help Windows (Prot)

When you press C-h f or C-h v, Emacs opens the help buffer but leaves your cursor in the original window. You almost always want to read the help right away, so you end up pressing C-x o every single time. This fixes it:

(setq help-window-select t)

Bonus: Many of the configs I surveyed also use built-in lazy isearch counting (showing “match N of M” in the minibuffer) instead of third-party packages like anzu. I recently wrote about that in a dedicated post.


The funny thing about all of this is how much overlap there is between configs. Half of these tricks appear in three or four of the configs I surveyed. At this point I’m convinced there are about 200 essential Emacs settings floating around in the collective unconscious, and every serious config independently converges on roughly the same subset. Picasso was right – we all steal from each other, and the kill ring makes it embarrassingly easy. M-w and move on.

That’s all I have for you today! Keep hacking!

-1:-- Stealing from the Best Emacs Configs (Post Emacs Redux)--L0--C0--2026-04-07T06:00:00.000Z

Dave Pearson: expando.el v1.5

While I have been doing a lot of hacking on blogmore.el, I haven't forgotten my plan to revisit and refresh some of my older personal packages. This evening I've paid some attention to expando.el.

This started life a long time ago, as part of my grab-bag of handy functions that got carried around and copied from machine to machine, until I did a big tidy-up of everything back in 2017 and turned various things into packages that I managed via a self-hosted (well, GitHub pages hosted) package index.

It's a pretty simple but very useful bit of code that lets me quickly macroexpand a sexp at point and pretty print it into a display window. I've often found it indispensable when it came to writing my own macros.

expando in action

This release simply adds a lexical-binding header to the file, and also adds a q key binding to the resulting view window so that it can be quickly and easily closed.

Also, as with all my other personal packages, I've swapped away from using delpa to simply using :vc to pull it in.

(use-package expando
  :vc (:url "https://github.com/davep/expando.el" :rev :newest)
  :bind
  ("C-c e" . expando-macro))

Or perhaps I should say...

(progn
  (use-package-vc-install
   '(expando (:url "https://github.com/davep/expando.el") nil) nil)
  (defvar use-package--warning69
    #'(lambda (keyword err)
        (let
            ((msg
              (format "%s/%s: %s" 'expando keyword
                      (error-message-string err))))
          (display-warning 'use-package msg :error))))
  (condition-case err
      (progn
        (if (fboundp 'expando-macro) nil
          (autoload #'expando-macro "expando" nil t))
        (let*
            ((name "C-c e") (key [3 101])
             (kmap
              (or (if (and nil (symbolp nil)) (symbol-value nil) nil)
                  global-map))
             (kdesc
              (cons (if (stringp name) name (key-description name))
                    (if (symbolp nil) nil 'nil)))
             (binding (lookup-key kmap key)))
          (require 'bind-key)
          (let
              ((entry (assoc kdesc personal-keybindings))
               (details
                (list #'expando-macro (if (numberp binding) nil binding))))
            (if entry (setcdr entry details)
              (add-to-list 'personal-keybindings (cons kdesc details))))
          (define-key kmap key #'expando-macro)))
    ((debug error) (funcall use-package--warning69 :catch err))))
-1:-- expando.el v1.5 (Post Dave Pearson)--L0--C0--2026-04-06T19:43:29.000Z

Dave Pearson: blogmore.el v4.0

Despite having bumped it from 2.x to 3.x yesterday, I'm calling v4.0 on blogmore.el today. There's a good reason for this though. While tinkering with some of the configuration yesterday, and also answering a configuration question last night, I realised that it made sense to make some of the internals into public utility functions.

Now, sure, Emacs Lisp doesn't really have internals in the private function sense, but I've always liked the approach that a package-- prefix communicates "internal, might go away" vs package- which tells me "this is a stable part of the API of this package". With this in mind I've always tried to write my code using this convention. I did this with blogmore.el too and a lot of the code had the blogmore-- prefix.

There's plenty of code in there that someone might want to make use of, if they wanted to add their own commands, or do fun things with the configuration. So with this in mind I've "promoted" a bunch of code to being "public" and, in that case, I feel this deserves another major version bump1.

Things that are now part of the "public" interface include:

  • blogmore-clean-time-string
  • blogmore-get-frontmatter
  • blogmore-remove-frontmatter
  • blogmore-set-frontmatter
  • blogmore-slug
  • blogmore-toggle-frontmatter
  • blogmore-with-post

Each one is documented via its docstring (just a quick Ctrl+h f function-name RET away) and hopefully is pretty self-explanatory.

blogmore-with-post is especially handy as it provides a quick and easy way of pulling information from a post file. So something like this:

(blogmore-with-post "~/write/davep.github.com/content/posts/2026/04/2026-04-05-blogmore-el-v3-1.md"
  (list
   (blogmore-get-frontmatter "title")
   (blogmore-get-frontmatter "date")))

resulting in:

("blogmore.el v3.1" "2026-04-05 20:04:44+0100")

Meaning that this snippet from yesterday's post:

(with-temp-buffer
  (insert-file-contents-literally file)
  (parse-iso8601-time-string
   (blogmore--clean-time-string (blogmore--get-frontmatter-property "date"))))

becomes:

(blogmore-with-post file
  (parse-iso8601-time-string
   (blogmore-clean-time-string (blogmore-get-frontmatter "date"))))

Not massively different, but it reads better and now all the calls are to the "public API" of the package.

Not all the changes are "promoted internals". I've also added a blogmore-remove-tag command (and also added it to the transient menu).

Removing a tag

I've also changed the way that blogmore-add-tag works so that, now, if it's called from the transient, it immediately goes back to the tag input prompt, allowing for another tag to be immediately selected (you can quit out of this with Ctrl+g). Removal of a tag works in a similar way, making things a lot quicker.

I've also added some extra tests too, which makes it even easier for me to make future changes with confidence. The more I work with it the more I appreciate that ERT is available.


  1. Ordinarily it shouldn't matter as the public interface isn't changing, but some of the "internal" functions had been mentioned as options for configuration. 

-1:-- blogmore.el v4.0 (Post Dave Pearson)--L0--C0--2026-04-06T16:04:16.000Z

Chris Maiorana: The Emacs Way: Deleting Files

I know it’s scary, but sometimes you have to delete files, and once they’re gone—they’re gone. I guess that was why GUI systems invented the trash folder. The trash is a safe place to store files you want to delete, just in case you made a mistake.

In the UNIXy and Emacs worlds, once you delete that file, it’s gone, so you better have your story straight.

UNIXy Way

In UNIXy world, you can delete files with the trusty rm (remove) command, as follows:

rm file.txt
rm -rf directory/

Of course, once you have run that command, the file will be totally obliterated with no trace.

While you should never do this, you should be aware of the dreaded nuclear solution to delete your whole filesystem from the root level:

rm -rf /*

Emacs Way

The Emacs way of deleting files will also obliterate files entirely, but with dired you get the added safety of marking files first with the d key. Once you have made your selections, you can use the x key to execute the deletion operation

You can also use capital D for immediate deletion.

Likewise, if you wanted to run deletions interactively, you can run the functions directly:

  • M-x delete-file
  • M-x delete-directory

So that’s how you can delete files using your command line, in UNIXy world, or your “dired” directory editor in Emacs.

The post The Emacs Way: Deleting Files appeared first on Chris Maiorana.

-1:-- The Emacs Way: Deleting Files (Post Chris Maiorana)--L0--C0--2026-04-06T16:00:30.000Z

Sacha Chua: YE12: Categorizing Emacs News, epwgraph, languages

View in the Internet Archive, watch or comment on YouTube, or email me.

Chapters:

  • 00:41:21 epwgraph
  • 00:54:56 learning languages

Thanks for your patience with the audio issues! At some point, I need to work out the contention between all the different processes that I want to be listening to the audio from my mic. =)

In this livestream, I categorize Emacs News for 2026-04-06, show epwgraph for managing Pipewire connections from Emacs, and share some of my language learning workflows.

View Org source for this post

You can e-mail me at sacha@sachachua.com.

-1:-- YE12: Categorizing Emacs News, epwgraph, languages (Post Sacha Chua)--L0--C0--2026-04-06T14:36:57.000Z

Irreal: Read Extended Command Predicate

Bozhidar Batsov has a post that mentions how M-x shows a lot of commands many of which make no sense in the current context. This has never bothered me because after inputting a few (fuzzy) letters, the display converges on the command I’m looking for. Others, are not so sanguine and find the long list annoying.

It turns out that there’s an easy fix for this: read-extended-command-predicate. As of Emacs 28, You can set this variable to one of 3 values—or nil​—to control the filtering of commands in the candidate list. These are:

command-completion-default-include-p
Exclude on those commands tagged for a different mode.
command-completion-using-modes-and-keymaps-p
Include only commands tagged for the current buffer and those commands that have a keybinding active in the current buffer.
command-completion-using-modes-p
Show only commands tagged for the current mode.

The first option is the most conservative and general and is what Batsov recommends for everyday use.

Batsov also explains how functions can declare what mode or modes they’re appropriate for. That’s simply a matter of listing them in the interactive declaration. There are a lot more details in Batsov’s post so be sure to take a look. The read-extended-command-predicate mechanism is similar to the execute-extended-command-for-buffer mechanism that I wrote about previously.

As I said, the long list doesn’t bother me but if it annoys you, this may be the answer.

Update [2026-04-07 Tue 12:05]: prefix → predicate

-1:-- Read Extended Command Predicate (Post Irreal)--L0--C0--2026-04-06T14:22:46.000Z

Emacs Redux: The Many Faces of flet: cl-flet, cl-labels, and cl-letf

Way back in 2013 I wrote about the deprecation of flet and how noflet could fill the gap. Thirteen years later, it’s probably time for a proper overview of what replaced flet in cl-lib and when to use each option.

Emacs Lisp doesn’t have a built-in way to define local functions (the way let defines local variables), so cl-lib provides several macros for this. If you’ve ever been confused by cl-flet, cl-labels, and cl-letf – you’re not alone. The naming doesn’t make the distinctions obvious, and the documentation is a bit dry. Let’s try to fix that.

A Bit of History

The original flet (from the old cl package) let you temporarily override a function’s definition. It worked by swapping out the function’s symbol-function cell and restoring it when the body finished – essentially a dynamic let for functions:

;; Old-style flet (deprecated since Emacs 24.3)
(flet ((some-function () "overridden result"))
  ;; Everything here, including called functions, sees the override
  (some-function))

This was very handy for testing (stubbing impure functions), but it conflated two different things into one macro:

  1. Defining local helper functions (a lexical concept)
  2. Temporarily overriding a global function (a dynamic concept)

When cl was reorganized into cl-lib in Emacs 24.3, flet was split into separate macros for each use case. This also brought the lexical variants in line with Common Lisp semantics, where flet and labels are lexically scoped.

The Three Replacements

cl-flet: Local Functions (No Recursion)

cl-flet binds function names lexically within its body. The key thing to understand is that the binding is only visible in the body forms – not inside the function’s own definition, and not to any functions you call:

(cl-flet ((double (n) (* n 2)))
  (double 21)) ; => 42

Because it’s lexical, cl-flet cannot override functions seen by other code:

(defun my-helper () (+ 1 2))
(defun my-caller () (my-helper))

(cl-flet ((my-helper () 999))
  (my-caller))  ; => 3, NOT 999!

my-caller still sees the original my-helper. This is the fundamental difference from the old flet.

There’s also cl-flet*, which is to cl-flet what let* is to let – each binding can reference the ones before it.

Use cl-flet when you just need a simple local helper and don’t need recursion. Think of it as let for functions.

cl-labels: Local Functions (With Recursion)

cl-labels is like cl-flet, but the function is visible inside its own body and inside the bodies of sibling bindings. This makes recursion and mutual recursion possible:

(cl-labels ((factorial (n)
              (if (<= n 1) 1
                (* n (factorial (- n 1))))))
  (factorial 10)) ; => 3628800

This would blow up with cl-flet because factorial wouldn’t be defined inside its own body.

Mutual recursion works too:

(cl-labels ((my-even-p (n) (if (= n 0) t (my-odd-p (- n 1))))
            (my-odd-p (n) (if (= n 0) nil (my-even-p (- n 1)))))
  (list (my-even-p 4) (my-odd-p 3))) ; => (t t)

Use cl-labels when your local functions need to call themselves or each other.

Note: cl-labels requires lexical-binding to be t in the file (which it really should be for any modern Emacs Lisp code).

cl-letf: Temporary Global Override

This is the one that actually replaces the old flet’s dynamic behavior. cl-letf temporarily rebinds a generalized place (anything setf can handle) and restores it on exit:

(defun my-helper () (+ 1 2))
(defun my-caller () (my-helper))

(cl-letf (((symbol-function 'my-helper) (lambda () 999)))
  (my-caller))  ; => 999

Now my-caller does see the override, because cl-letf modifies the actual symbol-function cell of my-helper – just like the old flet did. The original definition is restored when the body exits, even on error.

The syntax is a bit verbose because cl-letf isn’t specific to functions – it’s a general-purpose temporary binding macro for any setf-able place. (symbol-function 'name) is a “generalized variable” that refers to the function stored in a symbol’s function cell – it’s just one of many places cl-letf can bind. For example:

;; Temporarily silence messages
(cl-letf (((symbol-function 'message) #'ignore))
  (do-something-noisy))

Use cl-letf when you need the old dynamic flet behavior – typically for testing (stubbing functions) or temporarily suppressing/redirecting behavior.

Quick Reference

  Scope Recursion Overrides global?
cl-flet Lexical No No
cl-labels Lexical Yes No
cl-letf Dynamic N/A Yes

In other words:

  • Default to cl-flet for local helpers. It’s the simplest and most predictable.
  • Reach for cl-labels when you need recursion or mutual recursion in local functions.
  • Use cl-letf only when you genuinely need dynamic override – mainly in tests. Modifying global function cells is a sharp tool and it’s not thread-safe, so keep it contained.

That’s all I have for you today. Keep hacking!

-1:-- The Many Faces of flet: cl-flet, cl-labels, and cl-letf (Post Emacs Redux)--L0--C0--2026-04-06T12:00:00.000Z

Sacha Chua: 2026-04-06 Emacs news

There's a lot of buzz around the remote code execution thing that involves Git, but it seems to be more of a Git issue than an Emacs one. This might be a workaround if you want, and in the meantime, don't check out git repositories you don't trust. There's no page for the Emacs Carnival for April yet, but you can start thinking about the theme of "newbies/starter kits" already, and I'm sure Cena or someone will round things up afterwards. Enjoy!

Links from reddit.com/r/emacs, r/orgmode, r/spacemacs, Mastodon #emacs, Bluesky #emacs, Hacker News, lobste.rs, programming.dev, lemmy.world, lemmy.ml, planet.emacslife.com, YouTube, the Emacs NEWS file, Emacs Calendar, and emacs-devel. Thanks to Andrés Ramírez for emacs-devel links. Do you have an Emacs-related link or announcement? Please e-mail me at sacha@sachachua.com. Thank you!

View Org source for this post

You can e-mail me at sacha@sachachua.com.

-1:-- 2026-04-06 Emacs news (Post Sacha Chua)--L0--C0--2026-04-06T12:00:00.000Z

Emacs Redux: Live Regexp Feedback with minibuffer-regexp-mode

This is the third article in a small series inspired by my recent cleanup of Prelude and my personal Emacs configuration, following the ones on repeat-mode and read-extended-command-predicate. I’ve been going through the Emacs 28-30 changelogs for features I had ignored so far, and this one from Emacs 30 immediately caught my eye.

Writing Emacs regexps has always been a bit of a dark art. Between the double-escaped backslashes and the various group syntaxes (\(...\), \(?:...\), \(?N:...\)), it’s easy to lose track of what you’re actually matching. You type something into query-replace-regexp, press RET, and hope for the best.

Emacs 30 added minibuffer-regexp-mode, a minor mode that gives you live visual feedback as you compose a regexp in the minibuffer:

(minibuffer-regexp-mode 1)

When active, the mode highlights the structure of your regexp as you type it in the minibuffer. Capture groups, character classes, and other constructs get color-coded so you can see at a glance whether your grouping is right.

I find this particularly useful when building a regexp with multiple groups for query-replace-regexp, where you need to get the group numbering right for the replacement string (e.g., \1, \2). The visual feedback makes it obvious which group is which.

How Does This Compare to re-builder?

You might be wondering how this compares to re-builder (M-x re-builder). They’re complementary, really. re-builder shows matches in the buffer as you type a regexp in a dedicated editing window – great for developing complex patterns against actual text. minibuffer-regexp-mode, on the other hand, highlights the regexp itself in the minibuffer. It kicks in automatically whenever you’re prompted for a regexp (e.g., isearch-forward-regexp, query-replace-regexp, keep-lines, etc.).

One helps you see what your regexp matches; the other helps you see what your regexp says. I’d suggest using both.

That’s all I have for you today. Keep hacking!

-1:-- Live Regexp Feedback with minibuffer-regexp-mode (Post Emacs Redux)--L0--C0--2026-04-06T09:00:00.000Z

Protesilaos Stavrou: Emacs live stream for writing Denote tests and more on Monday 6 April @ 20:00 Europe/Athens

Raw link: https://www.youtube.com/watch?v=Vunpn7ovEOc

[ The stream will be recorded. You can watch it later. ]

Tonight I will work on my denote package. There is a feature branch I implemented this morning and am now ready to continue refining the code. The immediate goals:

  • Update unit tests that are still calling deprecated functions.
  • Write new tests, starting with the denote-dired command and all its ancillary functions.
  • Review all the commands that filter the query buffers (which are produced by commands such as denote-grep, denote-backlinks, denote-query-contents-link).
  • Edit the manual accordingly.

I expect the stream to go on for 2-3 hours, but we will see.

I will keep the chat open in case there are any comments. I am happy to respond to them.

-1:-- Emacs live stream for writing Denote tests and more on Monday 6 April @ 20:00 Europe/Athens (Post Protesilaos Stavrou)--L0--C0--2026-04-06T00:00:00.000Z

Sacha Chua: YE11: Fix find-function for Emacs Lisp from org-babel or scratch

Watch on Internet Archive, watch/comment on YouTube, download captions, or email me

Where can you define an Emacs Lisp function so that you can use find-function to jump to it again later?

  • A: In an indirect buffer from Org Mode source block with your favorite eval function like eval-defun (hint)nope
    • C-c ' (org-edit-special) inside the block; execute the defun with C-M-x (eval-defun), C-x C-e (eval-last-sexp), or eval-buffer.

          (defun my-test-1 () (message "Hello"))
      
  • B: In an Org Mode file by executing the block with C-c C-c (hint)nope

      (defun my-test-2 () (message "Hello"))
    
  • C: In a .el file (hint)yup

    file:///tmp/test-search-function.el : execute the defun with C-M-x (eval-defun), C-x C-e (eval-last-sexp), or eval-buffer

  • D: In a scratch buffer, other temporary buffer, or really any buffer thanks to eval-last-sexp (hint)nope

    (defun my-test-4 () (message "Hello"))

Only option C works - it's gotta be in an .el file for find-function to find it. But I love jumping to function definitions using find-function or lispy-goto-symbol (which is bound to M-. if you use lispy and set up lispy-mode) so that I can look at or change how something works. It can be a little frustrating when I try to jump to a definition and it says, "Don't know where blahblahblah is defined." I just defined it five minutes ago! It's there in one of my other buffers, don't make me look for it myself. Probably this will get fixed in Emacs core someday, but no worries, we can work around it today with a little bit of advice.

I did some digging around in the source code. Turns out that symbol-file can't find the function definition in the load-history variable if you're not in a .el file, so find-function-search-for-symbol gets called with nil for the library, which causes the error. (emacs:subr.el)

I wrote some advice that searches in any open emacs-lisp-mode buffers or in a list of other files, like my Emacs configuration. This is how I activate it:

(setq sacha-elisp-find-function-search-extra '("~/sync/emacs/Sacha.org"))
(advice-add 'find-function-search-for-symbol :around #'sacha-elisp-find-function-search-for-symbol)

Now I should be able to jump to all those functions wherever they're defined.

(my-test-1)
(my-test-2)
(my-test-3)
(my-test-4)

Note that by default, M-. in emacs-lisp-mode uses xref-find-definitions, which seems to really want files. I haven't figured out a good workaround for that yet, but lispy-mode makes M-. work and gives me a bunch of other great shortcuts, so I'd recommend checking that out.

Here's the source code for the find function thing:

(defvar sacha-elisp-find-function-search-extra
  nil
  "List of filenames to search for functions.")

;;;###autoload
(defun sacha-elisp-find-function-search-for-symbol (fn symbol type library &rest _)
  "Find SYMBOL with TYPE in Emacs Lisp buffers or `sacha-find-function-search-extra'.
Prioritize buffers that do not have associated files, such as Org Src
buffers or *scratch*. Note that the fallback search uses \"^([^ )]+\" so that
it isn't confused by preceding forms.

If LIBRARY is specified, fall back to FN.

Activate this with:

(advice-add 'find-function-search-for-symbol
 :around #'sacha-org-babel-find-function-search-for-symbol-in-dotemacs)"
  (if (null library)
      ;; Could not find library; search my-dotemacs-file just in case
      (progn
        (while (and (symbolp symbol) (get symbol 'definition-name))
          (setq symbol (get symbol 'definition-name)))
        (catch 'found
          (mapc
           (lambda (buffer-or-file)
             (with-current-buffer (if (bufferp buffer-or-file)
                                      buffer-or-file
                                    (find-file-noselect buffer-or-file))
               (let* ((regexp-symbol
                       (or (and (symbolp symbol)
                                (alist-get type (get symbol 'find-function-type-alist)))
                           (alist-get type find-function-regexp-alist)))
                      (form-matcher-factory
                       (and (functionp (cdr-safe regexp-symbol))
                            (cdr regexp-symbol)))
                      (regexp-symbol (if form-matcher-factory
                                         (car regexp-symbol)
                                       regexp-symbol))

                      (case-fold-search)
                      (regexp (if (functionp regexp-symbol) regexp-symbol
                                (format (symbol-value regexp-symbol)
                                        ;; Entry for ` (backquote) macro in loaddefs.el,
                                        ;; (defalias (quote \`)..., has a \ but
                                        ;; (symbol-name symbol) doesn't.  Add an
                                        ;; optional \ to catch this.
                                        (concat "\\\\?"
                                                (regexp-quote (symbol-name symbol)))))))
                 (save-restriction
                   (widen)
                   (with-syntax-table emacs-lisp-mode-syntax-table
                     (goto-char (point-min))
                     (if (if (functionp regexp)
                             (funcall regexp symbol)
                           (or (re-search-forward regexp nil t)
                               ;; `regexp' matches definitions using known forms like
                               ;; `defun', or `defvar'.  But some functions/variables
                               ;; are defined using special macros (or functions), so
                               ;; if `regexp' can't find the definition, we look for
                               ;; something of the form "(SOMETHING <symbol> ...)".
                               ;; This fails to distinguish function definitions from
                               ;; variable declarations (or even uses thereof), but is
                               ;; a good pragmatic fallback.
                               (re-search-forward
                                (concat "^([^ )]+" find-function-space-re "['(]?"
                                        (regexp-quote (symbol-name symbol))
                                        "\\_>")
                                nil t)))
                         (progn
                           (beginning-of-line)
                           (throw 'found
                                   (cons (current-buffer) (point))))
                       (when-let* ((find-expanded
                                    (when (trusted-content-p)
                                      (find-function--search-by-expanding-macros
                                       (current-buffer) symbol type
                                       form-matcher-factory))))
                         (throw 'found
                                 (cons (current-buffer)
                                       find-expanded)))))))))
           (delq nil
                 (append
                  (sort
                   (match-buffers '(derived-mode . emacs-lisp-mode))
                   :key (lambda (o) (or (buffer-file-name o) "")))
                  sacha-elisp-find-function-search-extra)))))
    (funcall fn symbol type library)))

I even figured out how to write tests for it:

(ert-deftest sacha-elisp--find-function-search-for-symbol--in-buffer ()
  (let ((sym (make-temp-name "--test-fn"))
        buffer)
    (unwind-protect
        (with-temp-buffer
          (emacs-lisp-mode)
          (insert (format ";; Comment\n(defun %s () (message \"Hello\"))" sym))
          (eval-last-sexp nil)
          (setq buffer (current-buffer))
          (with-temp-buffer
            (let ((pos (sacha-elisp-find-function-search-for-symbol nil (intern sym) nil nil)))
              (should (equal (car pos) buffer))
              (should (equal (cdr pos) 12)))))
      (fmakunbound (intern sym)))))

(ert-deftest sacha-elisp--find-function-search-for-symbol--in-file ()
  (let* ((sym (make-temp-name "--test-fn"))
         (temp-file (make-temp-file
                     "test-" nil ".org"
                     (format
                      "#+begin_src emacs-lisp\n;; Comment\n(defun %s () (message \"Hello\"))\n#+end_src"
                      sym)))
         (sacha-elisp-find-function-search-extra (list temp-file))
         buffer)
    (unwind-protect
        (with-temp-buffer
          (let ((pos (sacha-elisp-find-function-search-for-symbol nil (intern sym) nil nil)))
            (should (equal (buffer-file-name (car pos)) temp-file))
            (should (equal (cdr pos) 35))))
      (delete-file temp-file))))
This is part of my Emacs configuration.
View Org source for this post

You can comment on Mastodon or e-mail me at sacha@sachachua.com.

-1:-- YE11: Fix find-function for Emacs Lisp from org-babel or scratch (Post Sacha Chua)--L0--C0--2026-04-05T21:03:48.000Z

Dave Pearson: blogmore.el v3.1

When I first started writing blogmore.el it was just going to be a handful of commands that let me spin up a new blog post, and insert the odd link here and there when needed. Initially it only handled a single blog, and everything it did was based around how I lay my personal blog out, and was also very much geared to how I'd made BlogMore work.

But then I wanted to use it to edit both my personal blog and my photoblog. So then I had to add support for configuring different ways of laying out posts for different blogs, etc.

Still, it was mostly written as a personal tool that worked for my stuff. I tried to make it so that it was easy enough to configure (and let's be fair: it's for Emacs and written in Emacs Lisp, it's kind of hard to not be very configurable if you're happy to get your hands dirty with some coding), but there were still some parts of it that weren't as easy to change as I'd have liked.

Also, when I'd originally added the multi-blog configuration, I'd chosen a format for the list of blogs that was an assoc-list of pure lists wrapped by a cl-defstruct to make for easier access. It worked well but was very positional in its nature.

So when the request came in to be able to have better control over the name of the file when starting a new post, which meant I was going to need to rearrange the structure again, it was time to try and do something about it.

Which is how I'm now on v3.1 (yes, there was a v3.0 but I quickly found something in that that needed fixing1). It's a major version bump because I've totally changed how the blogmore-blogs variable holds the data.

From now on I'm using EIEIO to create a class that holds all of the data for a given blog. This, I believe, makes the code easier to read and should also make it more resilient to the addition of any new properties. Also thanks to how such classes can work with the customize system the customize experience remains pretty much the same too.

Personally I don't use the customize UI, instead I declare everything via use-package. As of the time of writing my declaration for blogmore looks like this:

(use-package blogmore
  :ensure t
  :defer t
  :vc (:url "https://github.com/davep/blogmore.el" :rev :newest)
  :init
  (add-hook 'blogmore-new-post-hook #'end-it)
  (blogmore-work-on "blog.davep.org")
  :custom
  (blogmore-blogs
   (list
    (blogmore-blog
     :title "blog.davep.org"
     :posts-directory "~/write/davep.github.com/content/posts/"
     :post-subdirectory-function (lambda () (format-time-string "%Y/%m/")))
    (blogmore-blog
     :title "seen-by.davep.dev"
     :posts-directory "~/write/seen-by/content/posts/")))
  :bind
  ("<f12> b" . blogmore))

There's a bunch of other changes and tweaks under the hood in this release too. All of these should come together to make blogmore.el a little more configurable than it was before. I think, to get the best out of it, anyone wanting to configure it "just so" for their purposes will still have to do a little bit of work, which makes me want to spend some time soon writing some proper documentation, complete with examples of how you might achieve different things.

One big change I've made under the hood is to the code that is used when you insert a link to a post (blogmore-link-post). When this runs it lets me pick a file in your filesystem that is a post from my currently-active blog. Once it has the filename it needs to turn it into a root-relative link. So this:

~/write/davep.github.com/content/posts/2026/04/01/2026-04-01-foo.md

needs to become:

/2026/04/01/foo.html

Until now I just did some regexp faffing that took the 2026-04-01- at the start of the filename and swapped each - for /. Nice and easy. Simple enough to code up and get things working a few weeks back. Not at all flexible.

So as a proof-of-concept of how sophisticated someone could get with configuring this I've changed blogmore-default-post-maker-function from this:

(defcustom blogmore-default-post-maker-function
  (lambda (file)
    (replace-regexp-in-string
     (rx bos (group (+ digit)) "-" (group (+ digit)) "-" (group (+ digit)) "-")
     "\\1/\\2/\\3/"
     (file-name-base (file-name-sans-extension file))))
  "Default function to generate a link for a blog post from its filename."
  :type 'function
  :group 'blogmore)

and turned it into this:

(defcustom blogmore-default-post-maker-function
  (lambda (file)
    (format
     "%s/%s"
     (format-time-string
      "%Y/%m/%d"
      (with-temp-buffer
        (insert-file-contents-literally file)
        (parse-iso8601-time-string
         (blogmore--clean-time-string (blogmore--get-frontmatter-property "date")))))
     (replace-regexp-in-string
      (rx bol (= 4 digit) "-" (= 2 digit) "-" (= 2 digit) "-")
      ""
      (file-name-base file))))
  "Default function to generate a link for a blog post from its filename."
  :type 'function
  :group 'blogmore)

So whereas before I was simply messing with the file's name, now I'm loading the date frontmatter from the chosen file and using that to create the date portion of the path in the URL that I use on my blog. The benefit here is that someone might want to keep the date portion of the path in the URL, but never want it as part of the Markdown source file's name, and so this change means they can call the file anything they want; it doesn't look at that but instead uses the actual date from the post's frontmatter.

I think this nicely demonstrates that, especially thanks to how powerful Emacs and Emacs Lisp are, it's fairly easy to make blogmore.el work just the way you want. I think I've provided almost all the hooks necessary to configure it all sorts of ways, but if you do happen to use it and run into something I might have missed, let me know.


  1. I have at least two slightly different date formats going on in my Markdown and Emacs' parse-iso8601-time-string is kind of picky. So I added a function to try and clean that up

-1:-- blogmore.el v3.1 (Post Dave Pearson)--L0--C0--2026-04-05T19:04:44.000Z

Irreal: Repeat Mode

As many you know, I was a Vim user for a couple of decades before I found the one true editor. One of the things I miss from Vim is the easy to use repeat command. If you’re in command mode and perform some command, you can repeat that command by simply pressing .. Sadly, Emacs doesn’t have anything similar. There are a couple of repeat commands: one for simple commands and another for “complex” commands but I was never able to internalize them.

Happily, there is repeat mode that allows you to repeat a command by omitting the prefix and pressing the last key. For example, if you want to repeat the command to enlarge a window horizontally (Ctrl+x }) you can simply repeat the } as many times as needed.

As Bozhidar Batsov explains, this doesn’t work with every key sequence but it is easy to add the functionality to multikey sequences. The TL;DR is that you have to provide a special keymap that maps the last key(s) to their action(s). Batsov has a worked example to show you how to do it. It’s not very hard. But, it turns out, it can be even easier. Omar Antolín explains in a comment that there is also a macro, defvar-keymap that abstracts all the boilerplate away and makes it really easy to define and install a new repeat map.

Repeat mode still isn’t as nice as Vim’s repeat but it can reduce the friction of repeating certain commands. Take a look at Batsov’s post for the details.

Update [2026-04-06 Mon 11:05]:

Karthik Chikmagalur has an excellent write-up on repeat mode that shows it’s useful for much more than simply repeating a command. See his comment below.

-1:-- Repeat Mode (Post Irreal)--L0--C0--2026-04-05T14:31:14.000Z

James Endres Howell: My first advice! (in Emacs Lisp)

It was really fun to learn about advising Lisp functions to extend functionality in Emacs. My first use case was to run a custom function every time a certain function in Bastian Bechtold’s org-static-blog is called. Of course, I could customize that function directly in my own fork, but Lisp advice allows you to modify functions without clobbering them directly. This approach has aesthetic and practical advantages.

But I’ve struggled to understand the concepts and implementation of advice. Today I posted to Mastodon about how excited I was to get my first working use, and Philip asked me to share the code.

My problem was specifying HTML boilerplate that org-static-blog puts in each post when it publishes all the static files, using string variables like org-static-blog-page-header. These strings are complex enough that I put them in their own files, like these lines in the #header.html file that specifies the page metadata:

<script type="module" src="https://esm.sh/emfed@"></script>
<meta name="author" content="James Endres Howell">
<meta name="referrer" content="no-referrer">
<link href="static/style.css" rel="stylesheet" type="text/css" />
<meta name="fediverse:creator" content="@jameshowell@fediscience.org">
<meta property="og:image" 
      content="https://jamesendreshowell.com/static/education-of-james-endres-howell.png">

First, Stack Exchange and I solved the problem of reading a file into a string. (?! How is this not a native function!? Maybe I missed something obvious.)

(defun jeh/file-to-string (file)
  "Return a string that is the contents of FILE."
  (with-temp-buffer
    (insert-file-contents file)
    (buffer-string)))

And then, for example:

(setq org-static-blog-page-header
      (jeh/file-to-string 
       (expand-file-name "#header.html" org-static-blog-template-blocks-directory)))

The unscratched itch was that every time I edit one of these files, I always, but always, forget to update the appropriate variable with the contents of the file! And so publishing doesn’t reflect the changes, and I get confused, and then I remember….

Here is the solution:

(defun jeh/org-static-blog-read-templates (&rest ignore)
  "Set org-static-blog-page -header, -preamble, -postamble variables
by reading files from `org-static-blog-template-blocks-directory'."
  (setq org-static-blog-page-header             ;;; HTML to put in the <head> of each page.
        (jeh/file-to-string 
         (expand-file-name "#header.html" org-static-blog-template-blocks-directory)))
  (setq org-static-blog-page-preamble           ;;; HTML to put before the content of each page.
        (jeh/file-to-string 
         (expand-file-name "#preamble.html" org-static-blog-template-blocks-directory)))
  (setq org-static-blog-page-postamble          ;;; HTML to put after the content of each page.
        (format (jeh/file-to-string 
                 (expand-file-name "#postamble.html" org-static-blog-template-blocks-directory))
                (number-to-string emacs-major-version)
                (number-to-string emacs-minor-version)
                org-version)))

;;; Re-read the template files before publishing,
;;; so changes will be included in output.
(advice-add #'org-static-blog-publish :before #'jeh/org-static-blog-read-templates)

The function jeh/org-static-blog-read-templates sets the variables org-static-blog-page-header, org-static-blog-page-preamble, and org-static-blog-page-postamble to the contents of the appropriate files. Making that function a hook to the function which generates all the static pages, org-static-blog-publish, solves my problem. But there is no hook for it! I had a suspicion that add-advice could give me the same result, and—I hope you’re sitting down—I read the fine manual and learned that the syntax of the last line accomplishes that very thing.

Of course, advice-add (and related functions) can do much more! Maybe as I learn I will be able to customize functions from other packages without just banging on a local fork.

-1:-- My first advice! (in Emacs Lisp) (Post James Endres Howell)--L0--C0--2026-04-04T22:41:00.000Z

Dave Pearson: blogmore.el v2.7

There's no question that the experiment that is BlogMore has resulted in me blogging more. Although my previous setup wasn't exactly all friction, there's something about "owning" most of the tools and really knowing how they work, and being able to quickly modify them so they work "just so", that makes me more inclined to quickly write something up.

I can see this if I look at the numbers in the archive for this blog. In March alone I wrote 43 posts; that's more than I wrote in any whole year, other than 2023. While I suspect this will start to calm down as work on BlogMore and blogmore.el settles down, I sense I'll be writing a bit more often for some time to come.

Because of this I decided to do a little bit of housekeeping on the posts directory in the blog's source repository. Originally I had the Markdown source for every post all in one directory. Then last month I broke those down by year. Then earlier today, seeing how this year is going, I decided to break 2026 down by month.

Then I realised I had a problem in blogmore.el. It assumed that the Markdown file for a new post (blogmore-new) would always be created in a subdirectory named after the year, underneath the defined posts directory. Until today that was the case1, but now I wanted it to work differently.

So this is why I'm making a second release in one day: I added the ability to configure the subdirectory where a new post is created. I've changed the default now so that it assumes the user wants the subdirectory to be YYYY/MM/DD (because more granular feels like the right default). In my case I don't want that, I just want YYYY/MM, but now I can configure that. The value that is set is a function that returns the name of the subdirectory, so in the case of my blog I have it as:

(lambda () (format-time-string "%Y/%m/"))

On the other hand, for my photoblog I want the full date as a subdirectory so I can leave it as the default. The whole use-package for blogmore now looks like:

(use-package blogmore
  :ensure t
  :defer t
  :vc (:url "https://github.com/davep/blogmore.el" :rev :newest)
  :init
  (add-hook 'blogmore-new-post-hook #'end-it)
  (blogmore-work-on "blog.davep.org")
  :custom
  (blogmore-blogs
   '(("blog.davep.org"
      ;; Root directory for posts.
      "~/write/davep.github.com/content/posts/"
      ;; Subdirectory for new posts, relative to the root.
      (lambda () (format-time-string "%Y/%m/")))
     ("seen-by.davep.dev"
      ;; Root directory for posts.
      "~/write/seen-by/content/posts/")))
  :bind
  ("<f12> b" . blogmore))

Technically this is a breaking change because it bumps the meaning of each "position" in the values within blogmore-blogs. However, in my case, because I was only ever defining the blog name and the top-level directory for the posts (both mandatory), this didn't break anything; I also strongly suspect nobody else is using this so I very much doubt I'm messing with someone else's setup2. If I have I apologise; do let me know.

Anyway, all of this goes to explain why the heck I made two releases of the same package back to back in the same day. This is what happens when my namesake is having fun outside and so I just want to sit on the sofa, hack on some code, and watch the chaos in the garden.


  1. For my blog, which again shows that blogmore.el started as a quick hack for getting work done on my blog, but I also want to make it as configurable as possible. 

  2. Even if someone else is using this I would suspect they hadn't configured anything more than I have. 

-1:-- blogmore.el v2.7 (Post Dave Pearson)--L0--C0--2026-04-04T18:24:39.000Z

Dave Pearson: blogmore.el v2.6

Like most people, I imagine, I first ran into transient when first using magit. I took to it pretty quickly and it's always made sense to me as a user interface. But... I've never used it for any code I've ever written.

I think, incorrectly, I'd half assumed it was going to be some faff to set up, and of course for a good while it wasn't part of Emacs anyway. Given this, I'd always had it filed under the heading "that's so neat I'll give it a go one day but not at the moment".

Meanwhile... ever since I did the last big revamp of my Emacs configuration, I found myself leaning into a command binding approach that does the whole prefix-letter-letter thing. For reasons I can't actually remember I fell into the habit of using F121 as my chosen prefix key. As such, over the past 10 or so years (since I greatly overhauled my Emacs setup), I've got into setting up bindings for commands that follow this prefix convention.

So when I created blogmore.el I set up the commands following this pattern.

(use-package blogmore
  :ensure t
  :defer t
  :vc (:url "https://github.com/davep/blogmore.el" :rev :newest)
  :init
  (add-hook 'blogmore-new-post-hook #'end-it)
  (blogmore-work-on "blog.davep.org")
  :custom
  (blogmore-blogs
   '(("blog.davep.org" "~/write/davep.github.com/content/posts/")
     ("seen-by.davep.dev" "~/write/seen-by/content/posts/")))
  :bind
  ("<f12> b b" . blogmore-work-on)
  ("<f12> b n" . blogmore-new)
  ("<f12> b e" . blogmore-edit)
  ("<f12> b d" . blogmore-toggle-draft)
  ("<f12> b s c" . blogmore-set-category)
  ("<f12> b a t" . blogmore-add-tag)
  ("<f12> b u d" . blogmore-update-date)
  ("<f12> b u m" . blogmore-update-modified)
  ("<f12> b l p" . blogmore-link-post)
  ("<f12> b l c" . blogmore-link-category)
  ("<f12> b l t" . blogmore-link-tag))

It works well, it makes it nice and easy to remember the bindings, etc. Nobody needs me to sell them on the merits of this approach.

Then I got to thinking last night: why am I setting up all those bindings when I could probably do it all via a transient? So that was the moment to actually RTFM and get it going. The first version was incredibly quick to get up and running and I was kicking myself that I'd taken so long to actually look at the package properly.

This morning I've worked on it a little more and the final form is still pretty straightforward.

(transient-define-prefix blogmore ()
  "Show a transient for BlogMore commands."
  [:description
   (lambda ()
     (format "BlogMore: %s\n"
             (if (blogmore--chosen-blog-sans-error)
                 (blogmore--blog-title)
               "No blog selected")))
   ["Blog"
    ("b"  "Select blog" blogmore-work-on)]
   ["Post"
    ("n" "New post" blogmore-new :inapt-if-not blogmore--chosen-blog-sans-error)
    ("e" "Edit post" blogmore-edit :inapt-if-not blogmore--chosen-blog-sans-error)
    ("d" "Toggle draft status" blogmore-toggle-draft :inapt-if-not blogmore--blog-post-p)
    ("c" "Set post category" blogmore-set-category :inapt-if-not blogmore--blog-post-p)
    ("t" "Add tag" blogmore-add-tag :inapt-if-not blogmore--blog-post-p)
    ("u d" "Update date" blogmore-update-date :inapt-if-not blogmore--blog-post-p)
    ("u m" "Update modified date" blogmore-update-modified :inapt-if-not blogmore--blog-post-p)]
   ["Links"
    ("l c" "Link to a category" blogmore-link-category :inapt-if-not blogmore--blog-post-p)
    ("l p" "Link to a post" blogmore-link-post :inapt-if-not blogmore--blog-post-p)
    ("l t" "Link to a tag" blogmore-link-tag :inapt-if-not blogmore--blog-post-p)]])

With this in place I can simplify my use-package quite a bit, just binding a single key to run blogmore.

(use-package blogmore
  :ensure t
  :defer t
  :vc (:url "https://github.com/davep/blogmore.el" :rev :newest)
  :init
  (add-hook 'blogmore-new-post-hook #'end-it)
  (blogmore-work-on "blog.davep.org")
  :custom
  (blogmore-blogs
   '(("blog.davep.org" "~/write/davep.github.com/content/posts/")
     ("seen-by.davep.dev" "~/write/seen-by/content/posts/")))
  :bind
  ("<f12> b" . blogmore))

Now, when I'm working on a blog post, I can just hit F12 b and I get a neat menu:

BlogMore with all commands available

Better still, because of how transient works, I can ensure that only applicable commands are available, while still showing them all. So if I've not even got a blog selected yet:

With no commands available

Or with a blog selected but not actually working on a post yet:

With some commands available

So far I'm really liking this approach, and I'm tempted to lean into transient more with some of my packages now. While on the surface it does seem that it has the downside of the binding choices being dictated by me, the fact is that the commands are all still there and anyone can use their own bindings, or I guess override the transient itself and do their own thing.


  1. Yes, it is a bit out of the way on the keyboard, but so is Esc. I find my muscle memory has no problem with it. 

-1:-- blogmore.el v2.6 (Post Dave Pearson)--L0--C0--2026-04-04T10:48:21.000Z

Emacs Redux: Declutter M-x with read-extended-command-predicate

This is another article inspired by my recent cleanup of Prelude and my personal Emacs config, following the one on repeat-mode. I’ve been going through the Emacs 28-30 changelogs looking for features I had overlooked, and this small one from Emacs 28 turned out to be a real gem.

Ever noticed how M-x shows you every command, including ones that make no sense in your current buffer? Org commands while editing Ruby, Magit commands in a shell buffer, that sort of thing. It’s not a huge deal if you know what you’re looking for, but it adds noise to the candidate list – especially if you’re using a completion framework like Vertico or Ivy that shows everything at a glance.

Emacs 28 added a simple way to fix this:

(setq read-extended-command-predicate
      #'command-completion-default-include-p)

With this setting, M-x hides commands that declare themselves inapplicable to the current major mode from the completion candidates. So if you’re in a Python buffer, you won’t see dired-do-rename or clojure-align cluttering your results.

How does the filtering actually work? command-completion-default-include-p looks at the modes a command declares it belongs to (via the interactive form) or checks its completion-predicate symbol property. If no modes are declared and there’s no completion predicate, the command is included as usual – so existing commands that haven’t been updated are not affected.

Emacs actually ships with three predicates you can choose from (plus nil for no filtering):

  • command-completion-default-include-p – the safe default. Excludes commands tagged for other modes, includes everything else.
  • command-completion-using-modes-and-keymaps-p – more aggressive. Shows commands tagged for the current mode plus any command that has a keybinding in the buffer’s active keymaps. Also always includes customize-* commands. Untagged commands without keybindings are hidden.
  • command-completion-using-modes-p – the strictest option. Only shows commands explicitly tagged for the current mode. Untagged commands are hidden too, so this can be quite aggressive.

I’d recommend starting with command-completion-default-include-p since it’s the most conservative – it won’t hide anything that hasn’t explicitly opted in to the filtering.

Package authors can declare mode affiliation by adding a mode specification to the interactive form:

(defun my-foo-command ()
  "Do something useful in foo-mode."
  (interactive nil foo-mode)
  ...)

The nil is the interactive spec (no arguments in this case), and foo-mode tells Emacs this command is only relevant in foo-mode buffers. If a command applies to multiple modes, just list them all:

(defun cider-eval-defun-at-point ()
  "Evaluate the top-level form at point."
  (interactive nil clojure-mode clojure-ts-mode)
  ...)

This is handy for packages like CIDER that need to work in both the classic clojure-mode and the newer Tree-sitter-based clojure-ts-mode.

As for how well this works in practice – many built-in commands already declare their applicable modes, so you’ll see a noticeably cleaner M-x right away. Third-party package adoption is growing but uneven. Commands that haven’t been updated will simply continue to show up everywhere, same as before – so there’s no downside to enabling this.

A Note for Vertico/Orderless Users

If you followed the Vertico sample configuration, you’ll find this setting already there – commented out. It was shipped that way because it was new at the time and some users found the disappearing commands surprising. It’s been stable for years now and works great with Vertico, Orderless, and Marginalia. Just uncomment it and enjoy a less noisy M-x.

Commands that are filtered out aren’t gone – the filtering only affects completion candidates. If you type the full command name at the M-x prompt it will still execute just fine.

That’s all I have for you today. Keep hacking!

-1:-- Declutter M-x with read-extended-command-predicate (Post Emacs Redux)--L0--C0--2026-04-04T08:00:00.000Z

Emacs Redux: Repeat Mode: Stop Repeating Yourself

I’ve been going through the Emacs 28-30 changelogs recently as part of a big update to Prelude and my personal config, looking for features I never got around to trying. repeat-mode is one I wish I’d adopted sooner.

How many times have you typed C-x o C-x o C-x o to cycle through a few windows? Or C-x { C-x { C-x { to keep shrinking one? All that prefix repetition is pure friction.

repeat-mode is a built-in minor mode (Emacs 28+) that lets you drop the prefix after the first invocation and just keep pressing the final key. Enable it with one line:

(repeat-mode 1)

One important thing to understand – this doesn’t magically work for every key sequence. A command is only “repeatable” if it has been explicitly added to a repeat map. Emacs ships with repeat maps for a bunch of common built-in commands, though, so you get a decent experience out of the box. Here are some of the highlights:

  • C-x o o o – keep cycling windows
  • C-x { { { / C-x } } } – shrink/grow window horizontally
  • C-x ^ ^ ^ – grow window vertically
  • C-x u u u – keep undoing
  • C-x <left> <left> / C-x <right> <right> – cycle through buffer history
  • M-g n n n / M-g p p p – jump through next-error results

The transient state ends as soon as you press any key that isn’t part of the repeat map.

If you’d prefer it to time out automatically, there’s a setting for that:

(setq repeat-exit-timeout 5) ;; exit after 5 seconds of inactivity

Defining Your Own Repeat Maps

The real power comes from defining repeat maps for your own commands. For instance, if you use expreg for expand-region, you can set things up so that C-= = = = - expands three times then contracts once:

(defvar expreg-repeat-map
  (let ((map (make-sparse-keymap)))
    (define-key map "=" #'expreg-expand)
    (define-key map "-" #'expreg-contract)
    map))

(put 'expreg-expand 'repeat-map 'expreg-repeat-map)
(put 'expreg-contract 'repeat-map 'expreg-repeat-map)

The pattern is simple: create a keymap, then attach it to the relevant commands via the repeat-map symbol property. Any command with that property becomes “repeatable” after first invocation.

That’s all there is to it. One line to enable, and a lot less C-x mashing in your future.

Are you using repeat-mode? Have you defined any custom repeat maps that you find particularly useful? I’d love to hear about them in the comments!

Keep hacking!

-1:-- Repeat Mode: Stop Repeating Yourself (Post Emacs Redux)--L0--C0--2026-04-04T07:00:00.000Z

Protesilaos Stavrou: Emacs live stream with Sacha Chua on 2026-04-16 17:30 Europe/Athens

Raw link: https://www.youtube.com/watch?v=djE_pVlgDHg

The other day I had a coaching session with Sacha Chua. Sacha asked me if she could record and publish it, to which I agreed. More here: https://sachachua.com/blog/2026/04/yayemacs-10-emacs-coaching-with-prot-packaging-emacs-lisp//.

Our next meeting will be done live on the 16th of April 2026 at 10:30 America/Toronto, 17:30 Europe/Athens time: https://youtube.com/live/djE_pVlgDHg.

I will check with Sacha how she imagines doing this. Though I am the laissez faire type, so will adapt as we go.

[ Note that all my coaching sessions are private: I never share details of my meetings. This is an exception because Sacha asked me about it. ]

-1:-- Emacs live stream with Sacha Chua on 2026-04-16 17:30 Europe/Athens (Post Protesilaos Stavrou)--L0--C0--2026-04-04T00:00:00.000Z

Thanos Apollo: Bringing jabber.el Back From the Dead

jabber.el is an XMPP client for Emacs, originally written in 2003. Development slowed over the years, though contributors kept the package working across Emacs releases.

I took over as maintainer with the goal of modernizing the protocol support.

Now, jabber.el is the most XEP-complete text-based client in existence.

What Changed

For those, like me, who count XEPs like Pokemon:

  • OMEMO encryption (XEP-0384) via a C dynamic module wrapping picomemo
  • OMEMO media sharing (XEP-0454)
  • OpenPGP for XMPP (XEP-0373) using Emacs’ built-in EPG
  • Stream Management (XEP-0198) with session resume
  • Message Archive Management (XEP-0313)
  • Message Carbons (XEP-0280)
  • Delivery Receipts (XEP-0184) and Chat Markers (XEP-0333)
  • Message Correction (XEP-0308), Replies (XEP-0461), Moderation (XEP-0424/0425)
  • Chat State Notifications (XEP-0085)
  • Client State Indication (XEP-0352)
  • Blocking Command (XEP-0191)
  • HTTP File Upload (XEP-0363)
  • Direct TLS (XEP-0368) with dual SRV lookup
  • Real Time Text (XEP-0301)
  • PubSub (XEP-0060)
  • Bookmarks (XEP-0402 with XEP-0048 fallback)
  • SQLite message storage replacing flat-file history
  • MUC Self-Ping (XEP-0410)

Almost caught them all

No other text-based XMPP client has this level of protocol coverage. jabber.el now rivals Dino and Gajim, the major graphical clients.

OMEMO

OMEMO requires a Signal Protocol implementation. That means C.

jabber-omemo-core.c is 763 lines wrapping picomemo through Emacs' dynamic module API. The Elisp layer handles XMPP integration: PubSub bundle publishing, stanza encryption, session persistence in SQLite, and trust management.

It also provides AES-256-GCM for OMEMO media sharing (XEP-0454).

Why Emacs

Emacs is not just the editor I write jabber.el in. It is the runtime, the test harness, and the application.

I develop in the same instance where I chat. Fix a bug, eval changes, and the fix is live in my running session. Seconds, not minutes.

Emacs provides most of what a chat client needs out of the box: SQLite for storage, GnuTLS for encryption, EPG for OpenPGP, EWOC for list display, Transient for menus.

Distribution is through NonGNU ELPA, which handles everything.

jabber.el is just an M-x package-install RET jabber RET away from install.

Why XMPP

XMPP is the only federated, open-standard messaging protocol that works in practice. I use it for all my daily communication. My friends are on WhatsApp, Discord and IRC – gateways bridge these networks transparently.

One client, one interface, every chat network I need.

More on the gateway setup I use in a future post.

What’s Next

  • XEP-0444 Message Reactions
  • OMEMO 0.8+ (picomemo supports both; the C layer is ready)
  • Roster rework – flat, query-based contact list sorted by activity
-1:-- Bringing jabber.el Back From the Dead (Post Thanos Apollo)--L0--C0--2026-04-03T21:00:00.000Z

Thanos Apollo: Gnosis 0.10: Import Anki, Merge Everything Into One

You can now import Anki decks into gnosis.

The entire Anki ecosystem, thousands of community-maintained decks across every subject, is accessible from Emacs. I can finally keep track of the AnKing deck changes.

If you can’t beat them, import them.

Anki import

gnosis-anki-import reads .apkg files and converts them into gnosis themata. It resolves Anki’s note type templates to extract question/answer pairs, normalizes tags, and strips Anki system tags like marked and leech.

Re-importing the same deck is safe. Each imported note keeps its Anki GUID, so gnosis detects duplicates and skips them. When AnKing pushes an update, I just re-import and only the new notes come in.

Tens of thousands of notes & themata, managed from a text editor. As it should be.

One package, one database

org-gnosis was merged into gnosis. Maintaining two packages with two databases for what is fundamentally one system was, in retrospect, an act of bureaucratic self-harm. Nodes, journal, and themata now share a single gnosis.db. The migration imports existing org-gnosis data automatically.

Export and import

The old org-file export format is gone. Exports are now .gnosis SQLite databases. Importing shows a diff buffer with NEW and CHANGED entries before applying, so you see exactly what will change before committing.

Combined with GUID tracking, this makes gnosis collections maintainable over time rather than one-shot imports. Share a deck with a friend, they modify it, you re-import. No data lost, no duplicates.

Other

  • Decks were removed. They were a restriction, not a feature. Existing deck names were converted into tags.
  • N+1 queries eliminated throughout the codebase.
  • Dashboard rendering is 3-4x faster via a custom gnosis-tl module.
  • Review dates stored as integers; due/overdue queries run in SQL.
  • Git operations are fully async.
  • Saving .org.gpg files no longer triggers redundant decryption.
  • Post-failure interval capped at 7 days.
  • Interval fuzz prevents review clustering.
  • Tag bulk operations: rename, regex rename, merge case duplicates.
  • Dropped emacsql for built-in sqlite.
-1:-- Gnosis 0.10: Import Anki, Merge Everything Into One (Post Thanos Apollo)--L0--C0--2026-04-03T21:00:00.000Z

Dave Pearson: nukneval.el v1.3

Back when I first really got into writing Emacs Lisp code, one of the first things I got very used to and really fell in love with was being able to eval-last-sexp (C-x C-e) the code I was writing, either to test it right there in the buffer, or to cause it to be bound so I could use it elsewhere. It was so different from any other mode of working I'd used before and it was really addictive as a way of hacking on code.

Also quite quickly I got used to the fact that eval-last-sexp wasn't so helpful with things like a defvar or a defconst, if I was changing them up to try out new ways of doing things with the code I was working on; there I had to remember to get used to using eval-defun (C-M-x). Hardly a great problem, but something to keep in mind1.

Pretty quickly, as I worked on longer packages, I found myself wanting to, in effect, unload a whole buffer of code and evaluate it again. From this desire came nukneval.el.

The original version of this has been sat around since 2002 or so, perhaps a little earlier, and has served me well every time I've been messing with a new package. While I suspect there is (now, perhaps was then too?) a better way of doing things, the approach used in nukneval helped me learn some things and served me well (and still does). Now it's muscle-memory to run it.

The way it works is quite simple: go to the start of a buffer, read each form, check if the car is of a given list of symbols, decide if it's something I want to unbind, and then pick either makunbound or fmakunbound and use that on the symbol. Finally, once the end of the buffer has been hit: eval-buffer.

I've just released v1.3 as part of my slow wander through my old Emacs Lisp packages, with this release cleaning up a deprecated use of setf to move point, and also rewriting the code so it's a bit cleaner and also gives better feedback.


  1. Bozhidar Batsov recently wrote a good post covering these sorts of issues

-1:-- nukneval.el v1.3 (Post Dave Pearson)--L0--C0--2026-04-03T14:09:19.000Z

Dave Pearson: make-phony.el v1.3

A wee bit over 5 years back I wrote a tiny package to quickly insert PHONY target markers into a Makefile. While it's far from my most-used package, it's one that gets a call on occasion, so it's one I still carry around in my Emacs configuration.

Given I'm currently engaging in a slow background process of cleaning up some of my Emacs Lisp packages, removing some obsoleted practices, I've given make-phony.el a little bit of attention.

As well as dropping the use of setf to set point to the start of a line, I also tweaked the code a little so that it only inserts a PHONY if there isn't already one there. While that's hardly been a problem for me, it just felt like a neat bit of cleaning up to how it works.

-1:-- make-phony.el v1.3 (Post Dave Pearson)--L0--C0--2026-04-03T09:23:40.000Z

Protesilaos Stavrou: Emacs: new sequence scheme for the ‘denote-sequence’ package

The denote-sequence package is an optional extension to denote that empowers users to write “sequence notes”, else “folgezettel”, in the style of Niklas Luhmann.

Sequence notes are created in relation to other notes, as parent, child, or sibling. denote-sequence communicates such relationships by writing a “sequence” to the file name, in accordance with the Denote file-naming scheme (technically, it uses the optional SIGNATURE component of the file name, which is defined as a free-form field for users to use as they see fit—so this is just one application of it).

The package supported two schemes before

The exact presentation of such sequences is subject to the user option denote-sequence-scheme. The package has hitherto supported two schemes, the numeric and alphanumeric.

In the numeric scheme, each level of depth is delimited by the equals sign. The sequence 1=2=3 thus has three levels of depth. It means “the third child of the second child of the first parent”.

By contrast, the alphanumeric scheme relies on the alternation between numbers and letters to communicate levels of depth. The above example is thus expressed as 1b3.

The new alphanumeric-delimited scheme

Many users have told me that the alphanumeric scheme looks cleaner. Though I think it is hard to read when sequences get really long, like 2a13c6d2a. To this end, the new sequence scheme augments the alphanumeric style with delimiters that are placed after the first level of depth and every third level of depth thereafter. Thus: 2=a13=c6d=2a.

Users may find this easier to work with.

Remember the denote-sequence-convert command

This command has been part of the package since its inception. It can convert from one sequence scheme to the others.

denote-sequence-convert has a “do what I mean behaviour” with regard to which file or files it should operate on:

  • When called from inside a file with a Denote sequence, it operates on the current file.

  • When called from a Dired buffer, it operates on all the marked files.

  • When there are no marked files in the Dired buffer, it operates on the file at point.

The target sequence scheme for the conversion is whatever is assigned to the user option denote-sequence-scheme. If, however, denote-sequence-convert is called with a prefix argument (C-u by default), then it will prompt for the target sequence scheme.

Coming in version 0.3.0

I just merged the code into trunk. Users who are building the package from source can try the new feature right away. Otherwise, it will be available in the next stable version of the package. I hope to have that ready some time in mid-April.

-1:-- Emacs: new sequence scheme for the ‘denote-sequence’ package (Post Protesilaos Stavrou)--L0--C0--2026-04-03T00:00:00.000Z

Alvaro Ramirez: …and then there were three (expect delays)

The other day, my partner and I went into the hospital as two and came out as three. This week, I became a father. From the second I cuddled this little fella, I felt like I'd known him my entire life. I love him so much.

Since going indie dev full-time, I've enjoyed a great degree of flexibility to work on personal projects. This has enabled me to share more via blog posts and YouTube videos, but also dedicate more time to projects like agent-shell. It is now my most popular Emacs package, receiving lots of attention from users (bug reports, pull requests, discussion, etc). If you've been in touch recently and haven't heard from me, now you know why. Fatherhood is new to me. I'll need a little time to adjust while finding my footing.

While my hope is to continue working on my indie projects, sustainability is now… errm, a tad more important. If you get value out of my work, please consider sponsoring. Better yet, if you use my tools at work, consider getting your employer to sponsor me instead. I also run a blogging service and offer a handful of iOS/macOS apps. If you're keen to journal or take quick notes on iOS, Journelly is my take on it. Bonus points for Emacs users, as it saves entries to an org file.

Now, please excuse me while I start crafting my son's first init.el

ps. This post was stitched up from a handful of seconds here and there, in between all the sleep-deprived but loving activities currently rocking my world.

-1:-- …and then there were three (expect delays) (Post Alvaro Ramirez)--L0--C0--2026-04-03T00:00:00.000Z

Dave Pearson: blogmore.el v2.5

Following on from yesterday's release, I've bumped blogmore.el to v2.5. The main change to the package is the thing I mentioned yesterday about the toggle of the draft status. The draft toggle yesterday was pretty simple, with it working like:

  • If there is no draft frontmatter, draft: true is added
  • If there is any draft frontmatter, it is removed

This meant that if you had draft: false set and you went to toggle, it would be removed, which is the same as setting it to draft: false.

Unlikely to generally be an issue, but I also couldn't let that stay like that. It bothered me.

So now it works as you'd expect:

  • If there is no draft frontmatter, draft: true is added
  • If draft: true is there, it is removed
  • If draft: false is there, it is set to draft: true

Much better.

Another change is that I fixed a problem with older supported versions of Emacs. I didn't know this was a problem because I'm running 30.2 everywhere. Meanwhile, thanks to package-lint-current-buffer from package-lint.el, I have:

Package-Requires: ((emacs "29.1"))

in the metadata for the package. Turns out though that sort used to require two parameters (the sequence and the predicate), whereas now it's fine with just one (it will accept just the sequence and will default the predicate). So of course blogmore.el was working fine for me, but would have crashed for someone with an earlier Emacs.

As for how I found this out... well I finally, for the first time ever, dived into using ERT to write some tests. While I've used testing frameworks in other languages, I'd never looked at this with Emacs Lisp. It works a treat and is great to work with; I think I'll be using this a lot more from now on.

Having got tests going I realised I should run them with GitHub actions, which then meant I managed to discover setup-emacs. Having found this the next logical step was to set up a matrix test for all the versions of Emacs I expect blogmore.el to work on. This worked fine, except... it didn't. While the tests worked locally, they were failing for some Emacsen over on GitHub.

And that's how I discovered the issue with sort on versions earlier than the one I'm using locally.

All in all, that was a good little period of hacking. New things discovered, the package improved, and a wider range of support for different versions of Emacs.

-1:-- blogmore.el v2.5 (Post Dave Pearson)--L0--C0--2026-04-02T19:53:09.000Z

Please note that planet.emacslife.com aggregates blogs, and blog authors might mention or link to nonfree things. To add a feed to this page, please e-mail the RSS or ATOM feed URL to sacha@sachachua.com . Thank you!