June 9th 2026 - Things I Worked On

Found a bug in Elfeed

When using Emacs bookmarks to navigate to a position in an elfeed entry the pointer ends up in the wrong location.

Here's an example of my bookmark:

("elfeed entry \"2026-06-08 Emacs news\""
 (id "sachachua.com" . "https://sachachua.com/blog/2026/06/2026-06-08-emacs-news/")
 (location . "2026-06-08 Emacs news")
 (position . 6140)
 (handler . elfeed-show-bookmark-handler))

Instead of navigating to position 6140 it navigates to position 590.

I used git bisect (my favorite tool in the whole wide world) to find the bug. But this wasn't as straight forward as the issue I fixed in elfeed-summary. Some commits were "broken" in the sense that bookmarks wouldn't navigate to an elfeed-entry until that entry had already been opened in the current session.

I still used git bisect but I had to do a couple more manual steps. I had to open elfeed, remove the unread tag from the search filter, and then navigate to the entry referenced in my bookmark. After this, I could properly test if the current commit in the bisect had the issue.

Eventually I discovered the culprit was line 270 in elfeed-show.el:

(when-let* ((win (get-buffer-window buffer)))
  (set-window-start win (point-min))))))

This was introduced in commit 0228956 and removing these lines fixes the issue.

I submitted an issue here and a PR here. I knew this would probably cause side effects so I waited for someone more knowledgeable about the code to chime in.

After about an hour Minad, the new Elfeed maintainer, thanked me for submitted the issue but chose to look for a different solution. He feels the current scrolling logic is necessary which is understandable. He knows the codebase better so I'm sure there are edge cases I didn't test that will cause problems if we remove these lines. For now I'm keeping my patch on my local copy of the code.

A little later Minad submitted a fix. Turns out there was a bookmark handler in the elfeed-show code and it required a run-at-time call to delay the bookmark action until after elfeed-show-entry scrolled to the top.

Added restoring windows when magit closes

(setq magit-bury-buffer-function #'magit-restore-window-configuration)

Added keybindings for bookmarks

(defun my/bookmark-set ()
  "Set and save a bookmark"
  (interactive)
  (bookmark-set)
  (bookmark-save))

(evil-leader/set-key
  "m m" 'my/bookmark-set
  "m v" 'consult-bookmark
  "m e" 'list-bookmarks
  "m d" 'bookmark-delete)

Moved MacOS specific config to its own file

Added org-babel tangling in my config.org file for macOS specific stuff. This does a check in case the file doesn't exist. On a Linux system, for example, I probably wouldn't have macOS specific configurations:

(let ((org-file (expand-file-name "macos.org" "~/.emacs.d")))
  (if (file-exists-p org-file)
      (org-babel-load-file org-file)))

And the macos.org file:

Keyboard

(setq mac-command-modifier 'meta)
(setq ns-command-modifier 'meta)

(setq mac-option-modifier 'alt)
(setq ns-option-modifier 'alt)

Terminal

  • Open Mac Terminal
    (defun my/open-mac-terminal ()
      "Opens the macOS Terminal application in the current buffer's directory."
      (interactive)
      (let ((dir (expand-file-name default-directory)))
        (start-process "terminal-process" nil "open" "-F" "-a" "Terminal" dir)))
    
    (evil-leader/set-key
      "t m" 'my/open-mac-terminal)