Categories: geek

RSS - Atom - Subscribe via email

Extract PDF highlights into an Org file with Python

| org

I've been trying to find a good workflow for highlighting interesting parts of PDFs, and then getting that into my notes as images and text in Emacs. I think I've finally figured out something that works well for me that feels natural (marking things.

I wanted to read through Prot's Emacs configuration while the kiddo played with her friends at the playground. I saved the web page as a PDF and exported it to Noteful. The PDF has 481 pages. Lots to explore! It was a bit chilly, so I had my gloves on. I used a capacitative stylus in my left hand to scroll the document and an Apple Pencil in my right hand to highlight the parts I wanted to add to my config or explore further.

Back at my computer, I used pip install pymupdf to install the PyMuPDF library. I poked around the PDF in the Python shell to see what it had, and I noticed that the highlights were drawings with fill 0.5. So I wrote this Python script to extract the images and text near that rectangle:

import fitz
import pathlib
import sys
import os

BUFFER = 5

def extract_highlights(filename, output_dir):
    doc = fitz.open(filename)
    s = "* Excerpts\n"
    for page_num, page in enumerate(doc):
        page_width = page.rect.width
        page_text = ""
        for draw_num, d in enumerate(page.get_drawings()):
            if d['fill_opacity'] == 0.5:
               rect = d['rect']
               clip_rect = fitz.Rect(0, rect.y0 - BUFFER, page_width, rect.y1 + BUFFER)
               img = page.get_pixmap(clip=clip_rect)
               img_filename = "page-%03d-%d.png" % (page_num + 1, draw_num + 1)
               img.save(os.path.join(output_dir, img_filename))
               text = page.get_text(clip=clip_rect)
               page_text = (page_text
                            + "[[file:%s]]\n#+begin_quote\n[[pdf:%s::%d][p%d]]: %s\n#+end_quote\n\n"
                            % (img_filename,
                               os.path.join("..", filename),
                               page_num + 1,
                               page_num + 1, text))
        if page_text != "":
            s += "** Page %d\n%s" % (page_num + 1, page_text)
    pathlib.Path(os.path.join(output_dir, "index.org")).write_bytes(s.encode())

if __name__ == '__main__':
    if len(sys.argv) < 3:
        print("Usage: list-highlights.py pdf-filename output-dir")
    else:
        extract_highlights(sys.argv[1], sys.argv[2])

After I opened the resulting index.org file, I used C-u C-u C-c C-x C-v (org-link-preview) to make the images appear inline throughout the whole buffer. There's a little extra text from the PDF extraction, but it's a great starting point for cleaning up or copying. The org-pdftools package lets me link to specific pages in PDFs, neat!

2026-04-02-08-14-23.png
Figure 1: Screenshot of Org Mode file with link previews

To set up org-pdftools, I used:

(use-package org-pdftools
  :hook (org-mode . org-pdftools-setup-link))

Here's my quick livestream about the script with a slightly older version that had an off-by-one bug in the page numbers and didn't have the fancy PDF links. =)

View Org source for this post

Thinking about Emacs coaching goals with Prot

| emacs, community

: Hooray for learning out loud! Prot has already posted his responses.

Following up on Emacs Carnival March 2026: Mistakes and learning to reach out: I want to get better at learning with other people's help, so I'm going to experiment with engaging Prot as an Emacs coach. Our first session is this week. Time to lay the groundwork!

If I meet with Prot twice a month for three months, that's a budget of €60 (~CAD 100), which is a reasonable size for an experiment especially since I still have the budget set aside from the Google Open Source Peer Bonus and lovely folks already donated to cover the costs for EmacsConf. When I schedule something with someone, the accountability makes it easier to get stuff done and out the door. For this, a real person is much better than AI because:

  • I get to take advantage of Prot's very large context window, and he knows stuff about the Emacs, the community, and me that I might not remember to mention
  • He can ask real questions and prod at things that are unclear or contradictory, unlike the confirmation bias of LLMs
  • He might point out things that wouldn't occur to me to ask about
  • It triggers my "I promised someone I'd do this" thing
  • I get to support an individual worth supporting rather than contributing to the concentration of wealth and information in for-profit entities

My motivations:

  • I want to make better use of my focused time during the rest of the schoolyear. For the next three months, my schedule will be fairly predictable and I'll have regular chunks of focused time. Over the past two months, I've averaged around 10 hours of Emacs-related stuff per week (including 1.5 hours or so for Emacs News). I'm currently thinking about language learning and speech input. EmacsConf is on the horizon and will probably ramp up after September, but I can also think ahead of workflow improvements or ways to collaborate with other people. I might put together an Emacs News Highlights presentation. Also, I'm always looking out for ways to build the community.

    Summer break during July and August will shake things up again, but I might be able to find some focused time early morning or evening. I'd like to be in a good position to make the most of those time fragments.

  • I want to improve my Emacs Lisp development workflow and learn more about libraries and techniques that might be useful. I'm beginning to have more time to sharpen the saw and I'm curious about all the cool stuff that I missed or skimmed over the past ten years. What are some useful setups for completion, debugging, navigation, etc.?
    • Current: I sporadically use the extra awesomeness in seq, pcase, lispy, erefactor, ert, buttercup, and undercover, but not consistently. I'd like to reduce the friction and make these habitual.
    • Areas of friction / improvement:
      • writing tests, especially for things that are more interactive
      • navigating code that might be scattered in literate config files or in Emacs Lisp files
      • forgetting to restart or to make sure all code is saved; running tests via Emacs batch mode will help, as will package-isolate and restart-emacs
  • I want to improve my workflows for writing, making videos, and streaming. If I get better at sharing what I'm working on, I might be able to connect with more people and bounce ideas around. Also, accountability might help me nudge this over the threshold. I probably still need to work in stops and starts, so I want to reduce the friction. I'm curious about other people's workflows for sharing. I like joining meetups, but I tend to share stuff only if no one else has anything planned, because I have my blog and my YouTube channel in case I want to share anything with a wider group of people. I just have to actually post things.
    • Current: ~1.5 Emacs posts a week aside from Emacs News, attending meetups, sporadically adding short video demos to posts

      Average number of Emacs-related posts that aren't Emacs News
      (let* ((start "2026-02-01")
             (end "2026-03-31")
             (posts (my-blog-posts
                     start end
                     (lambda (o)
                       (and (member "emacs" (alist-get 'categories o))
                            (not (member "emacs-news" (alist-get 'categories o)))))))
             (count (length posts)))
        (my-weekly-average count start end))
      
    • Goal: 2-3 non-News posts a week, one video a month, one stream or meetup a month; maybe also beyond looking at the numbers, it might be interesting to build more momentum around a topic, set up trails/navigation, cultivate more of a digital garden
    • Areas of friction / improvement:
      • Resisting "one more tweak"
      • Streaming: Still need to get the hang of talking to myself or having half-conversations with chat: can be worked around by scheduling a session with Prot and opening it to the public
      • Hiding private information or setting up a separate Emacs for demonstration
      • Harvesting videos/clips/notes afterwards
  • I want to move more of my configuration into files and libraries that other people can reuse, like sachac/learn-lang and sachac/speech-input. I can also separate the function definitions from the configuration in my code so that people can reuse the functions if they want.
    • Areas of friction / improvement
      • renaming things when I want to move them to a library
      • duplicating small functions (ex: simplify string)
      • figuring out how to make it possible for someone else to start using my stuff

Starting questions for Prot:

  • Meta: what are people finding useful for coaching and behaviour change, like learning new keyboard shortcuts or workflows?
  • Your literate config exports to individual .el files. I could probably do something similar to separate my functions from my personal config in order to make it easier for people to reuse parts of my config. Is it worth doing so? Do people tell you that they use those private Emacs Lisp files by loading them, or do they mostly rely on your published packages?
  • Does the division into multiple .el files work fine if you need to bisect your configuration?
  • Do you have some tweaks to make it easier to jump to function definitions considering a literate configuration?
  • What's your general process for migrating things from your config to a repository or package?

Could be fun. Let's experiment!

View Org source for this post

2026-03-30 Emacs news

| emacs, emacs-news

It's not too late to write about mistakes and misconceptions as part of the Emacs Carnival for March and not too early to think about the theme of "Newbies/Starter Kits" which Cena will be hosting for April. Who knows, maybe those ideas can become part of the newcomers presets. It could be fun to explore something like notes for Emacs beginners and see where you end up.

Also, I'm looking forward to seeing if these tips for reloading Emacs Lisp code can help me avoid little bugs from leftover code.

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

Emacs Carnival March 2026: Mistakes and learning to reach out

| community, emacs

Mostly-similar versions follow: I started with French, translated it to English, and then tweaked some details. Thanks to Philip Kaludercic for hosting this month's carnival!

In English

The theme for this month's Emacs Carnival is Mistakes and Misconceptions. It’s difficult to pinpoint one thing that is clearly a mistake, but there are certainly things I could do more effectively.

My configuration is very large because I assume my little modifications are only useful to me. They feel too specific, too idiosyncratic. I think people who create libraries or even packages used by lots of other people are awesome. I don't know if I could quite do that myself, though! Even submitting patches upstream and participating in the ensuing discussions sometimes requires more persistence than I have.

The advantage of keeping my changes in my config is that even if I'm unsure, I can try something out, develop a rough prototype, and change my mind if necessary. When I publish them in a library or a package, I feel like I have to polish my ideas. It's hard to stick to just one idea long enough to refine it.

My favorite situation is when I write about my attempt in a post, and it inspires someone else to implement their own version (or even a new library or package). On the other hand, if I learn to share my code, I can help more people, and I can also learn from more people and more conversations.

Many of my modifications are short and easy to copy from my posts, but there are a few collections that depend on other functions, making them difficult to copy. These functions are scattered across several posts on my blog. For example, my functions for learning a language (I'm learning French at the moment) and for controlling Emacs by voice are becoming quite complex. The functions are also exported to my configuration, but the Emacs Lisp file is difficult to navigate if someone wants to copy them. I can extract the code into a file now that Org Mode can tangle to multiple files, but if I spend a little time replacing the "my-" prefix with a library prefix and move them to a repository, people could clone it and download updates. Even if no one uses it, the act of polishing and documenting it will probably be useful to me one day.

So, it's possible that this is a mistake I often make in Emacs: thinking my functions are too idiosyncratic and too rough, so I leave them in my config. If I dedicate time to extracting the code into a library, I might benefit in the long run. I know lots of people are interested in using Emacs for language learning or by voice. There have been so many other libraries and workflows over the years, so I'm sure people are out there. I want to practice learning more with others. To start, I can make sure interested people can follow my progress through RSS feeds or Mastodon, I can respond when people send me messages, and I can collect contact info and send them a message when I post about the subject.

I can write more if I reread the changes in my configuration each week, or if I reread my complete configuration for sections which I haven't yet written about. If I participate in virtual meetups or even livestream, I can find out what interests other people. If I submit patches and create tasks in my Org Mode inbox to track the discussions, I can practice refining my work.

Prot has lowered his coaching prices to €10 /hour. He's quite prolific when it comes to package development, so he can probably help me figure out how to get stuff out of my config and into a form that other people might be able to use. I've been enjoying learning with my French tutor. It might be worth experimenting with spending some money and time to improve my Emacs skills as well. Sure, it's totally just for fun, but I think it's valuable to practice learning with the help of others instead of stumbling around on my own.

There's always more to learn, which is wonderful. So this is not really a mistake, just something that could be good to work on. Onward and upward!

Check out Emacs Carnival March 2026: Mistakes and Misconceptions to see other people's takes on the topic.

En français

Le thème du Carnaval d'Emacs ce mois-ci est « les erreurs et les idées reçues ». C'est difficile d'identifier une chose qui soit clairement une erreur, mais il y a certainement des choses que je ne fais pas efficacement.

Ma configuration est très volumineuse car je pense que mes petites modifications ne sont utiles que pour moi. Elles sont trop spécifiques, trop particulières. J'apprécie ceux qui créent des bibliothèques ou même des paquets que beaucoup d'autres utilisent, mais de mon côté, je ne me sens pas capable de le faire pour l'instant. Même soumettre des correctifs en amont et participer à la discussion qui s'ensuit parfois demande plus de persévérance que je n'en ai.

L'avantage de garder mes modifications dans ma configuration est que, même si je ne suis pas sûre, je peux essayer quelque chose, développer un prototype préliminaire, et changer d'avis si nécessaire. Quand je les publie dans une bibliothèque ou un paquet, j'ai l'impression que je dois peaufiner mes idées. C'est difficile de s'en tenir à une seule idée assez longtemps.

Ma situation préférée est quand je partage mes essais sur mon blog, et qu'ils inspirent une autre personne qui implémentera sa propre version, voire une nouvelle bibliothèque ou un nouveau paquet.

En revanche, si j'apprends à partager mon code, je peux aider plus de personnes, et je peux aussi apprendre de plus de personnes et de plus de conversations.

Beaucoup de mes modifications sont brèves et faciles à copier de mes articles, mais il y a quelques collections qui dépendent d'autres fonctions, ce qui les rend difficiles à copier. Les fonctions sont dispersées dans plusieurs articles sur mon blog. Par exemple, mes fonctions pour apprendre une langue (particulièrement le français) et pour contrôler Emacs par commande vocale deviennent plutôt complexes. Elles sont aussi exportées vers ma configuration, mais le fichier Emacs Lisp est difficile à parcourir si on veut les copier. Je peux extraire le code dans un fichier maintenant que Org Mode peut le tangler vers plusieurs fichiers, mais si je consacre un peu de temps à remplacer le préfixe « my- » par celui de la bibliothèque et à le pousser sur le dépôt, les gens pourraient le cloner et récupérer les mises à jour. Même si personne ne l'utilise, le fait de les peaufiner et de le documenter me sera utile un jour.

Donc il est possible que ce soit une erreur que je commets souvent dans Emacs : je pense que mes fonctions sont trop idiosyncratiques et trop brutes, je les laisse donc dans ma configuration. Mais si je consacre du temps à extraire le code vers une bibliothèque, j'en bénéficierai peut-être à long terme. Je sais que beaucoup de gens sont intéressés par l'utilisation d'Emacs pour apprendre une langue ou pour la commande vocale. Il y a eu de nombreuses autres bibliothèques et flux de travail au fil des ans, donc je suis sûre qu'il y a du monde. Je veux m'entraîner à apprendre auprès de plus de personnes. Pour commencer, je peux m'assurer que les gens intéressés peuvent suivre mon progrès via les flux RSS ou sur Mastodon, je peux répondre quand on m'envoie des messages, et je peux recueillir les coordonnées et leur envoyer un message lorsque je publie un article à ce sujet.

Je peux écrire davantage si je relis les modifications dans ma configuration chaque semaine, ou si je relis ma configuration entière pour les sections dont je n'ai pas encore parlé. Si je participe à des réunions virtuelles ou même si je diffuse en direct, je vais voir ce qui intéresse les autres. Si je soumets des correctifs et crée des tâches dans ma boîte de réception Org Mode pour suivre les discussions, je m'entraîne à affiner mon travail.

Prot a baissé ses tarifs de coaching à 10 euros de l'heure. Il est très prolifique en matière de développement de paquets. J'apprends bien avec mon tuteur en français, donc cela vaut peut-être la peine de consacrer de l'argent et du temps à améliorer mes compétences sur Emacs. Certes, c'est juste pour le plaisir, mais c'est aussi important pour moi de m'entraîner à apprendre avec l'aide des autres au lieu de trébucher toute seule.

J'ai toujours plus de choses à apprendre, ce qui est merveilleux. Ce n'est pas vraiment une erreur, mais plutôt un point à améliorer. En avant !

Consultez Emacs Carnival March 2026: Mistakes and Misconceptions pour d'autres perspectives sur le sujet.

View Org source for this post

Categorizing Emacs News items by voice in Org Mode

| speech, speech-recognition, emacs, org

I'm having fun exploring which things might actually be easier to do by voice than by typing. For example, after I wrote some code to expand yasnippets by voice, I realized that it was easier to:

  1. press my shortcut,
  2. say "okay, define interactive function",
  3. and then press my shortcut again,

than to:

  1. mentally say it,
  2. get the first initials,
  3. type in "dfi",
  4. and press Tab to expand.

Another area where I do this kind of mental translation for keyboard shortcuts is when I categorize dozens of Emacs-related links each week for Emacs News. I used to do this by hand. Then I wrote a function to try to guess the category based on regular expressions (my-emacs-news-guess-category in emacs-news/index.org, which is large). Then I set up a menu that lets me press numbers corresponding to the most frequent categories and use tab completion for the rest. 1 is Emacs Lisp, 2 is Emacs development, 3 is Emacs configuration, 4 is appearance, 5 is navigation, and so on. It's not very efficient, but some of it has at least gotten into muscle memory, which is also part of why it's hard to change the mapping. I don't come across that many links for Emacs development or Spacemacs, and I could probably change them to something else, but… Anyway.

2026-03-23_20-38-33.png
Figure 1: Screenshot of my menu for categorizing links

I wanted to see if I could categorize links by voice instead. I might not always be able to count on being able to type a lot, and it's always fun to experiment with other modes of input. Here's a demonstration showing how Emacs can automatically open the URLs, wait for voice input, and categorize the links using a reasonably close match. The *Messages* buffer displays the recognized output to help with debugging.

Screencast with audio: categorizing links by voice

This is how it works:

  1. It starts an ffmpeg recording process.
  2. It starts Silero voice activity detection.
  3. When it detects that speech has ended, it use curl to send the WAV to an OpenAI-compatible server (in my case, Speaches with the Systran/faster-whisper-base.en model) for transcription, along with a prompt to try to influence the recognition.
  4. It compares the result with the candidates using string-distance for an approximate match. It calls the code to move the current item to the right category, creating the category if needed.

Since this doesn't always result in the right match, I added an Undo command. I also have a Delete command for removing the current item, Scroll Up and Scroll Down, and a way to quit.

Initial thoughts

I used it to categorize lots of links in this week's Emacs News, and I think it's promising. I loved the way my hands didn't have to hover over the number keys or move between those and the characters. Using voice activity detection meant that I could just keep dictating categories instead of pressing keyboard shortcuts or using the foot pedal I recently dusted off. There's a slight delay, of course, but I think it's worth it. If this settles down and becomes a solid part of my workflow, I might even be able to knit or hand-sew while doing this step, or simply do some stretching exercises.

What about using streaming speech recognition? I've written some code to use streaming speech recognition, but the performance wasn't good enough when I tried it on my laptop (Lenovo P52 released in 2018, no configured GPU under Linux). The streaming server dropped audio segments in order to try to catch up. I'd rather have everything transcribed at the level of the model I want, even if I have to wait a little while. I also tried using the Web Speech API in Google Chrome for real-time speech transcription, but it's a little finicky. I'm happy with the performance I get from either manually queueing speech segments or using VAD and then using batch speech recognition with a model that's kept in memory (which is why I use a local server instead of a command-line tool). Come to think of it, I should try this with a higher-quality model like medium or large, just in case the latency turns out to be not that much more for this use case.

What about external voice control systems like Talon Voice or Cursorless? They seem like neat ideas and lots of people use them. I think hacking something into Emacs with full access to its internals could be lots of fun too.

A lot of people have experimented with voice input for Emacs over the years. It could be fun to pick up ideas for commands and grammars. Some examples:

What about automating myself out of this loop? I've considered training a classifier or sending the list to a large language model to categorize links in order to set more reasonable defaults, but I think I'd still want manual control, since the fun is in getting a sense of all the cool things that people are tinkering around with in the Emacs community. I found that with voice control, it was easier for me to say the category than to look for the category it suggested and then say "Okay" to accept the default. If I display the suggested category in a buffer with very large text (and possibly category-specific background colours), then I can quickly glance at it or use my peripheral vision. But yeah, it's probably easier to look at a page and say "Org Mode" than to look at the page, look at the default text, see if it matches Org Mode, and then say okay if it is.

Ideas for next steps

I wonder how to line up several categories. I could probably rattle off a few without waiting for the next one to load, and just pause when I'm not sure. Maybe while there's a reasonably good match within the first 1-3 words, I'll take candidates from the front of the queue. Or I could delimit it with another easily-recognized word, like "next".

I want to make a more synchronous version of this idea so that I can have a speech-enabled drop-in replacement that I can use as my y-or-n-p while still being able to type y or n. This probably involves using sit-for and polling to see if it's done. And then I can use that to play Twenty Questions, but also to do more serious stuff. It would also be nice to have replacements for read-string and completing-read, since those block Emacs until the user enters something.

I might take a side-trip into a conversational interface for M-x doctor and M-x dunnet, because why not. Naturally, it also makes sense to voice-enable agent-shell and gptel interactions.

I'd like to figure out a number- or word-based completion mechanism so that I can control Reddit link replacement as well, since I want to select from a list of links from the page. Maybe something similar to the way voicemacs adds numbers to helm and company or how flexi-choose.el works.

I'm also thinking about how I can shift seamlessly between typing and speaking, like when I want to edit a link title. Maybe I can check if I'm in the minibuffer and what kind of minibuffer I'm in, perhaps like the way Embark does.

It would be really cool to define speech commands by reusing the keymap structure that menus also use. This is how to define a menu in Emacs Lisp:

(easy-menu-define words-menu global-map
  "Menu for word navigation commands."
  '("Words"
     ["Forward word" forward-word]
     ["Backward word" backward-word]))

and this is how to set just one binding:

(keymap-set-after my-menu "<drink>"
  '("Drink" . drink-command) 'eat)

That makes sense to reuse for speech commands. I'd also like to be able to specify aliases while hiding them or collapsing them for a "What can I say" help view… Also, if keymaps work, then maybe minor modes or transient maps could work? This sort of feels like it should be the voice equivalent of a transient map.

The code so far

(defun my-emacs-news-categorize-with-voice (&optional skip-browse)
  (interactive (list current-prefix-arg))
  (unless skip-browse
    (my-spookfox-browse))
  (speech-input-cancel-recording)
  (let ((default (if (fboundp 'my-emacs-news-guess-category) (my-emacs-news-guess-category))))
    (speech-input-from-list
     (if default
         (format "Category (%s): " default)
       "Category: ")
     '(("Org Mode" "Org" "Org Mode")
       "Other"
       "Emacs Lisp"
       "Coding"
       ("Emacs configuration" "Config" "Configuration")
       ("Appearance" "Appearance")
       ("Default" "Okay" "Default")
       "Community"
       "AI"
       "Writing"
       ("Reddit" "Read it" "Reddit")
       "Shells"
       "Navigation"
       "Fun"
       ("Dired" "Directory" "Dir ed")
       ("Mail, news, and chat" "News" "Mail" "Chat")
       "Multimedia"
       "Scroll down"
       "Scroll up"
       "Web"
       "Delete"
       "Skip"
       "Undo"
       ("Quit" "Quit" "Cancel" "All done"))
     (lambda (result text)
       (message "Recognized %s original %s" result text)
       (pcase result
         ("Undo"
          (undo)
          (my-emacs-news-categorize-with-voice t))
         ("Skip"
          (forward-line)
          (my-emacs-news-categorize-with-voice))
         ("Quit"
          (message "All done.")
          (speech-input-cancel-recording))
         ("Reddit"
          (my-emacs-news-replace-reddit-link)
          (my-emacs-news-categorize-with-voice t))
         ("Scroll down"
          (my-spookfox-scroll-down)
          (my-emacs-news-categorize-with-voice t))
         ("Scroll up"
          (my-spookfox-scroll-up)
          (my-emacs-news-categorize-with-voice t))
         ("Delete"
          (delete-line)
          (undo-boundary)
          (my-emacs-news-categorize-with-voice))
         ("Default"
          (my-org-move-current-item-to-category
           (concat default ":"))
          (undo-boundary)
          (my-emacs-news-categorize-with-voice))
         (_
          (my-org-move-current-item-to-category
           (concat result ":"))
          (undo-boundary)
          (my-emacs-news-categorize-with-voice))))
     t)))

It uses Spookfox to control Firefox from Emacs:

(defun my-spookfox-scroll-down ()
  (interactive)
  (spookfox-js-injection-eval-in-active-tab "window.scrollBy(0, document.documentElement.clientHeight);" t))

(defun my-spookfox-scroll-up ()
  (interactive)
  (spookfox-js-injection-eval-in-active-tab "window.scrollBy(0, -document.documentElement.clientHeight);"))

(defun my-spookfox-background-tab (url &rest args)
  "Open URL as a background tab."
  (if spookfox--connected-clients
      (spookfox-tabs--request (cl-first spookfox--connected-clients) "OPEN_TAB" `(:url ,url))
    (browse-url url)))

It also uses these functions for categorizing Org Mode items:

(defun my-org-move-current-item-to-category (category)
    "Move current list item under CATEGORY earlier in the list.
  CATEGORY can be a string or a list of the form (text indent regexp).
  Point should be on the next line to process, even if a new category
  has been inserted."
    (interactive (list (completing-read "Category: " (my-org-get-list-categories))))
    (when category
      (let* ((col (current-column))
             (item (point-at-bol))
             (struct (org-list-struct))
             (category-text (if (stringp category) category (elt category 0)))
             (category-indent (if (stringp category) 2 (+ 2 (elt category 1))))
             (category-regexp (if (stringp category) category (elt category 2)))
             (end (elt (car (last struct)) 6))
             (pos (point))
             s)
        (setq s (org-remove-indentation (buffer-substring-no-properties item (org-list-get-item-end item struct))))
        (save-excursion
          (if (string= category-text "x")
              (org-list-send-item item 'delete struct)
            (goto-char (caar struct))
            (if (re-search-forward (concat "^ *- +" category-regexp) end t)
                (progn
                  ;; needs a patch to ol.el to check if stringp
                  (org-list-send-item item (point-at-bol) struct)
                  (org-move-item-down)
                  (org-indent-item))
              (goto-char end)
              (org-list-insert-item
               (point-at-bol)
               struct (org-list-prevs-alist struct))
              (let ((old-struct (copy-tree struct)))
                (org-list-set-ind (point-at-bol) struct 0)
                (org-list-struct-fix-bul struct (org-list-prevs-alist struct))
                (org-list-struct-apply-struct struct old-struct))
              (goto-char (point-at-eol))
              (insert category-text)
              (org-list-send-item item 'end struct)
              (org-indent-item)
              (org-indent-item))
            (recenter))))))

(defun my-org-guess-list-category (&optional categories)
  (interactive)
  (require 'cl-lib)
  (unless categories
    (setq categories
          (my-helm-org-list-categories-init-candidates)))
  (let* ((beg (line-beginning-position))
         (end (line-end-position))
         (string (buffer-substring-no-properties beg end))
         (found
          (cl-member string
                     categories
                     :test
                     (lambda (string cat-entry)
                       (unless (string= (car cat-entry) "x")
                         (string-match (regexp-quote (downcase (car cat-entry)))
                                       string))))))
    (when (car found)
      (my-org-move-current-item-to-category
       (cdr (car found)))
      t)))

For the speech-input functions, experimental code is at https://codeberg.org/sachac/speech-input .

View Org source for this post

2026-03-23 Emacs news

| emacs, emacs-news

: Removed elecxzy comment-dwim, whoops.

Might be a good opportunity to set up better auto-saves, with buffer-guardian.el inspiring an update to super-save 0.5. Also, there were a couple of interesting experiments embedding Chromium (Reddit) or native macOS views in Emacs (Reddit), and one about embedding Emacs in a webpage (Reddit).

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

2026-03-16 Emacs news

| emacs, emacs-news

Security reminder: If you use kubernetes-el, don't update for now, and you might want to check your installation if you updated it recently. The repo was compromised. (Analysis, Reddit discussion, lobste.rs) If you use Emacs 31, please consider enabling package-review-policy.

There were a number of lively conversations around Emacs Solo (142 comments on HN), Emacs and Vim in the age of AI (52 comments on Reddit, 138 on HN), and agent-shell 0.47 (62 on Reddit). Also, Prot has posted the video and text of his talk Computing in freedom with GNU Emacs (YouTube 42:40, Video with Q&A, more links in the community section).

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