Categories: geek » emacs

View topic page - RSS - Atom - Subscribe via email
Recommended links:

Fixing commonly-misrecognized words in dictation, voice commands, and regular text

| audio, subed, emacs, speech-recognition

I edit a lot of transcripts, and I've also been dictating to my computer more and more for both prose and voice commands. Speech recognition is pretty accurate, but there are some terms that it tends to get wrong. There are also some terms that I find hard to say, like sometimes my brain will just hiccup and I'll end up saying "start screaming" instead of "start streaming". I want to make it really easy to correct a misrecognized word throughout my current buffer and save it for future edits.

One of the advantages of doing this kind of replacement within Emacs instead of a separate dictation tool is that I can use it for both editing text (like transcripts of other people's presentations) as well as pre-process the speech recognition results when I dictate or use voice commands to control Emacs. I can even use it to start gradually getting my transcripts to follow Emacs keybinding conventions, like C-c instead of "control c", and for finicky capitalization like LaTeX.

1. Description and demo

You can watch a description and a demo here. The dictionary part starts at about 00:37:01.403.

Full video and transcript

If you prefer a clip,

2. Saving the dictionary

First, we define a variable that we're going to save the changes to.

;; Use the saved version of this instead of forcing the reevaluation
;;;###autoload
(defcustom sacha-subed-common-edits
  '("I"
    "I've"
    "I'm"
    "Mendeley"
    "JavaScript"
    "RSS"
    ("stop section" "subsection")
    ("EmacsConf" "EmacsCon" "EmacsConf" "imaxconf")
    ("going to" "gonna")
    ("want to" "wanna")
    ("transient" "transit")
    ("C-c" "control c" "Ctrl+C")
    ("C-x" "control x" "Ctrl+X")
    ("C-f" "control f")
    ("" "uh" "um")
    ("Magit" "maggot")
    ("Emacs" "e-max" "emex" "emax" "bmx" "imax")
    ("Emacs News" "emacs news")
    ("Emacs Lisp" "emacs list")
    ("ivy" "iv")
    ("UI" "ui")
    ("TECO" "tico")
    ("org-roam" "orgrim" "orgrom" "Org Rome")
    ("non-nil" "non-nail")
    ("commits" "comets")
    "SQL"
    "arXiv"
    "Montessori"
    "SVG"
    "YouTube" "GitHub" "GitLab" "OmegaT" "Linux" "SourceForge"
    "LaTeX"
    "Lisp"
    "Org"
    "IRC"
    "Reddit"
    "PowerPoint"
    "SQLite"
    "SQL"
    "I'll"
    ("<f9>" "F-9" "f9")
    "I'd"
    "PDFs"
    "PDF"
    "ASCII"
    ("Spacemacs" "spacemax")
    "Elisp"
    "Reddit"
    "TextMate"
    "macOS"
    "API"
    "IntelliSense"
    ("EXWM" "axwm")
    ("Emacs's" "emax's")
    ("BIDI" "bd")
    ("Perso-Arabic" "personal arabic")
    "Persian"
    "URL"
    "HTML"
    ("vdo.ninja" "Video Ninja"))
  "Commonly-misrecognized words or words that need special capitalization."
  :group 'sachac
  :type '(repeat (choice string
                         (repeat string))))

3. Making changes with substitute.el

I like using Prot's substitute.el. I bind substitute-target-in-buffer to C-; . I can either replace the current word or select a couple of words if I think I need to be more specific. I ignore "SPEAKER_…" because then I can use the same shortcut to easily change speaker identification in transcripts.

(defvar sacha-substitute-save-changes "SPEAKER_"
  "Non-nil means save changes to `sacha-subed-common-edits'.
If this is a string, it is treated as a regular expression, and only
strings that do NOT match this regular expression will get saved.
If this is a function, call it with the target string. It should return
non-nil if the substitution should be saved.")

(defun sacha-substitute-save-common-edits (target sub count scope)
  "Keep track of changes so I can add them to `sacha-subed-common-edits'."
  (when (cond
         ((functionp sacha-substitute-save-changes)
          (funcall sacha-substitute-save-changes target))
         ((stringp sacha-substitute-save-changes)
          (not (string-match sacha-substitute-save-changes target)))
         (t
          sacha-substitute-save-changes))
    (customize-save-variable
     'sacha-subed-common-edits
     (cons (list sub target)
           sacha-subed-common-edits))))
(use-package substitute
:bind ("C-;" . substitute-target-in-buffer)
      :config
      (setq substitute-fixed-letter-case t)
      (add-hook 'substitute-post-replace-functions #'substitute-report-operation)
      (add-hook 'substitute-post-replace-functions #'sacha-substitute-save-common-edits))

customize-save-variable is in charge of saving the changes after I replace something with susbtitute.el. If I want to remove or edit entries, I can use M-x customize-variable to change sacha-subed-common-edits.

4. Correcting the errors

Then I have some functions that make the changes automatically or interactively.

;;;###autoload
(defun sacha-subed-fix-common-errors ()
  (interactive )
  (let (done entry correction)
    (while (and
            (not done)
            (setq entry (sacha-subed-find-next-fix-point)))
      (setq correction (if (listp entry) (car entry) entry))
      (if (let ((case-fold-search nil))
            (looking-at (regexp-quote correction)))
          (forward-word 1)
        (if (called-interactively-p 'any)
            (let* ((c (read-char (format "%s (yn.): " correction))))
              (cond
               ((= c ?y) (replace-match correction t t))
               ((= c ?n) (goto-char (match-end 0)))
               ((= c ?j) (subed-mpv-jump-to-current-subtitle))
               ((= c ?.) (setq done t))))
          (replace-match correction t t))))))

;;;###autoload
(defun sacha-subed-fix-common-errors-from-start ()
  "Change common errors in this buffer."
  (interactive)
  (goto-char (point-min))
  (sacha-subed-fix-common-errors))

;;;###autoload
(defun sacha-subed-fix-common-errors-in-text (text)
  "Change common errors in TEXT."
  (interactive)
  (with-temp-buffer
    (insert text)
    (goto-char (point-min))
    (sacha-subed-fix-common-errors)
    (buffer-string)))

;;;###autoload
(defun sacha-subed-find-next-fix-point ()
  (when (re-search-forward
         (format "\\_<\\(%s\\)\\_>"
                 (downcase
                  (string-join
                   (seq-mapcat
                    (lambda (o)
                      (if (listp o)
                          (if (string= (car o) "") (cdr o) o)
                        (list o)))
                    sacha-subed-common-edits)
                   "\\|")))
         nil t)
    (goto-char (match-beginning 0))
    (seq-find
     (lambda (o)
       (if (listp o)
           (seq-find (lambda (s)
                       (save-match-data
                         (string-match
                          (format "\\_<%s\\>" (downcase s))
                          (downcase (match-string 0))))) o)
         (string= (downcase o) (downcase (match-string 0)))))
     sacha-subed-common-edits)))

;;;###autoload
(defun sacha-subed-fix-common-error ()
  (interactive)
  (let ((entry (sacha-subed-find-next-fix-point)))
    (replace-match (if (listp entry) (car entry) entry) t t)))

Then I can call sacha-subedf-fix-common-errors-in-text from my whisper-insert-text-at-point functions, and sacha-subed-fix-common-errors-from-start from sacha-stream-prepare-transcript-for-editing.

5. Other ways to define the correction

Here's another function to define a correction if you don't want to use substitute.el.

;;;###autoload
(defun sacha-subed-add-common-edit (beg end replacement)
  "Add this word to the misrecognized words."
  (interactive
   (let ((beg (if (region-active-p) (min (point) (mark))
                (skip-syntax-backward "w")
                (point)))
         (end (if (region-active-p) (max (point) (mark))
                (save-excursion (forward-word 1) (point)))))
     (list beg end
           (completing-read
            (format "Replacement (%s): " (buffer-substring beg end))
            (mapcar (lambda (o) (if (stringp o) o (car o))) sacha-subed-common-edits)))))
  (customize-set-variable
   'sacha-subed-common-edits
   (cond
    ((member replacement sacha-subed-common-edits)
     (cons (list replacement (buffer-substring-no-properties beg end))
           (delete replacement sacha-subed-common-edits)))
    ((assoc replacement sacha-subed-common-edits)
     (setcdr (assoc replacement sacha-subed-common-edits)
             (append (list replacement) (cdr (assoc replacement sacha-subed-common-edits))))
     sacha-subed-common-edits)
    (t
     (push (list replacement (buffer-substring-no-properties beg end))
           sacha-subed-common-edits))))
  (delete-region beg end)
  (insert replacement))

At some point, I really should abstract this out to its own package, because it's just so useful. Other people have actually managed to get it to work, which is always a nice milestone. Anyway, here it is, in case it's helpful for you too!

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

2026-11-23 Emacs news

| emacs, emacs-news

I really liked two things in this week's newsletter. First, Ihor Radchenko has posted his talk on task management, Which he prepared for EmacsConf 2026, coming up this Dec 12 and 13. He's okay with posting it early so that people can start thinking about the ideas in advance and make the most of the live Q&A during the conference itself, so check out how he deals with tens of thousands of items. Similarly, the panel that he organized on Emacs community is now public, so you can take a look at it too. That one is a long one, and I'd love to hear your thoughts.

The second thing that I thought was really fun was Ethermacs, which uses web sockets for synchronous editing, so now people who aren't using Emacs and people who are can still edit the same Etherpad together. (And using Emacs means no JavaScript needed, which is good news for our non-JS community members!) And after a little bit of tweaking, I've been able to use it to edit the etherpads that we have for EmacsConf. Whee!

(You might be able to tell that I have EmacsConf on the brain. =) )

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-11-16 Emacs news

Posted: - Modified: | emacs, emacs-news

: Added OrgDevMeetup on Nov 21

I liked reading the Emacs Carnival posts about how people discover new features and what things they've tried lately. Feel free to share your story.

Also, the Emacs 31.1.90 pretest is available (note Irreal's post about typos). Please help test it if you can!

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

EmacsConf: recording and re-recording introductions

| emacs, emacsconf, subed

I record brief introductions for all the EmacsConf talks so that they can be played automatically. That way, hosts don't have to worry about pronunciations on air, and there's one less changeover that might introduce technical issues. We can cut to the next talk a bit abruptly because everything runs off a crontab-powered schedule to keep things running on time on multiple tracks, so it helps to have a little transition between Q&A and the next talk. It's also nice having some kind of pronunciation reference so that when people discuss the talks or even just think about them with their internal monologues, they might have a better sense of how to say the speakers' names. We ask speakers to say their names at the beginning of their presentation, but people don't often include their last names, so the intro gets that consistently. The intro videos are available on the talk pages after the conference, and I've occasionally used them to remember how someone's name is pronounced.

Here's an example intro from EmacsConf 2025:

Here's my process for preparing those intros with Emacs.

First, I create all the intro slides with LaTeX and TikZ using the function emacsconf-stream-generate-in-between-pages from emacsconf-stream.el. This year, the template I'm using is _template.tex and the background image is _template_bg.pdf. I used to use an SVG and just replace the elements within it (template.svg, emacsconf-stream-generate-in-between-page-svg). This year, some of the talk titles are very long and SVG doesn't have widespread support for wrapping. LaTeX handles wrapping and positioning beautifully. This even allows me to have ligatures like the "ff" in Jeff Trull's name. I noticed those ligatures disappeared when I used Inkscape to convert to PNG, so I needed this command instead: inkscape --pdf-poppler --export-type=png -w 1280 -h 720 --export-background-opacity=0 --export-text-to-path

This is the function that generates the individual intro slide:

emacsconf-stream-generate-in-between-page: Use LaTeX to generate the intro slide for TALK based on assets/in-between/_template.tex.
(defun emacsconf-stream-generate-in-between-page (talk &optional prev info force)
  "Use LaTeX to generate the intro slide for TALK based on assets/in-between/_template.tex."
  (interactive (list (emacsconf-complete-talk-info)))
  (let* ((prev (or prev (emacsconf-previous-talk talk info)))
         (dir (expand-file-name "in-between" emacsconf-stream-asset-dir))
         (template
          (with-temp-buffer
            (insert-file-contents
             (expand-file-name "_template.tex" dir))
            (buffer-string)))
         (default-directory dir))
    (write-region
     (emacsconf-replace-plist-in-string
      (list
       :current-title
       (or (plist-get talk :title) "")
       :current-speakers
       (or (plist-get talk :speakers) "")
       :current-details
       (format "%s\\\\\n%s"
               (or (plist-get talk :absolute-url) "")
               (pcase (plist-get talk :q-and-a)
                 ((rx "live") "Live Q\\&A after talk")
                 ((rx "pad") "Etherpad")
                 ((rx "IRC") "IRC Q\\&A after talk")
                 (_ "")))
       :previous-title
       (or (plist-get prev :title) "")
       :conf-name emacsconf-name
       :conf-year emacsconf-year
       :previous-speakers
       (or (plist-get prev :speakers) "")
       :previous-details
       (format "%s\\\\\n%s"
               (or (plist-get prev :absolute-url) "")
               (pcase (plist-get prev :q-and-a)
                 ((rx "live") "Live Q\\&A after talk")
                 ((rx "pad") "Etherpad")
                 ((rx "IRC") "IRC Q\\&A after talk")
                 (_ ""))))
      template)
     nil
     (expand-file-name (concat (plist-get talk :slug) ".tex") dir))
    (shell-command
     (format "lualatex -shell-escape %s && inkscape --pdf-poppler --export-type=png -w 1280 -h 720 --export-background-opacity=0 --export-text-to-path %s"
             (expand-file-name (concat (plist-get talk :slug) ".tex")
                               dir)
             (expand-file-name (concat (plist-get talk :slug) ".pdf")
                               dir)))))

and here's an example slide it creates:

listen.png

Once I had the intro slides, I prepared my script. I called emacsconf-subed-intro-subtitles from emacsconf-subed.el to create a VTT captions file that starts like this:

WEBVTT


NOTE
#+OUTPUT: emacsconf-2026-sat-open--saturday-opening-remarks--sacha-chua--intro.webm
[[file:/home/sacha/proj/emacsconf/2026/assets/in-between/sat-open.png]]

00:00:00.000 --> 00:00:00.000
Next, we have "Saturday opening remarks",
by Sacha Chua.
You can ask questions via Etherpad.

NOTE
#+OUTPUT: emacsconf-2026-planning--the-emacs-planning-habits-of-a-questionably-effective-person-my-40year-journey-of-planning-with-emacs-org-mode-paper-journals-etc--george-jones--intro.webm
[[file:/home/sacha/proj/emacsconf/2026/assets/in-between/planning.png]]

00:00:00.000 --> 00:00:00.000
Next, we have "The Emacs Planning Habits of a Questionably Effective Person: My 40-year journey of planning with Emacs, Org Mode, paper journals, etc.",
by George Jones.
You can ask questions via web conference by joining from the talk page
or ask questions through Etherpad or IRC.

The text is based on the Org entry properties for each talk in our conf.org file. It used subed-record directives to define the output files and the visuals.

Then I used subed-record to start recording each segment. I pressed <left> (subed-record-retry) to re-record a segment as many times as I needed to. This adds or updates an #+AUDIO directive that points to the current recording and it also updates the timestamps. When I was satisfied, I pressed <right> (subed-record-accept-segment) to update the ending timestamp and move on to the next segment to record. Whenever I needed to take a break from recording, I used RET (subed-record-accept-and-stop) to accept the last segment and stop. After recording, I used subed-waveform-show-all to see the waveforms for each segment. I left- and right-clicked on the waveforms to refine the start and end timestamp, getting rid of the sound from the keyboard shortcuts, and I used subed-split-subtitle to split each long cue into the proper lines for the subtitles.

Here's the livestream where I worked on some of the intros.

After editing the audio this way, I used subed-record-compile-video (C-c C-c after subed-record-set-up) to create all the videos by using compile-media and FFmpeg. I could also regenerate just one or two videos by selecting the region and then using the same function..

Once the videos finished, I uploaded them to our password-protected backstage area, and emacsconf-publish-backstage-index added them to the page.

2026-11-12_09-25-45.png
Figure 1: Backstage links to intro

Then I used emacsconf-mail-intro-to-all to send emails to all the speakers with the links to the intros for review. Many speakers confirmed that their pronunciations were fine, and some replied with a recording of their name so that I could use it for reference. I added those in the comments so that I could replay them while recording with R (learn-lang-subed-record-play-current-reference) or learn-lang-subed-record-play-reference-and-current-subtitle. I also copied and pasted the relevant part of the caption file so that I could record different variations with subed-record. It's just text, after all, so it's easy to do all sorts of things the way that you would do them normally in Emacs. For example, here's what it looked like when I was editing the versions for Erik's name:

2026-11-12_14-48-14.png
Figure 2: Screenshot showing reference comments

Erik said option B sounds closest. It's not quite perfect, but it's closer than the pronunciation I started with. I might circle back around to this and try again sometime. =) Anyway, to use option B in the final video, I can just delete the cues for the other versions and remove the part where I said option B. Then I can select that part of the subtitles and compile just his video.

2026-11-12_21-14-47.png
Figure 3: After selecting the audio for Erik's intro

This makes it easy to update the intros whenever something changes. For example, if a speaker turns out to be available during the conference for a live Q&A session, I can update the Org entry for their talk (set :Q_AND_A: live), regenerate the intro slide, and re-record the Q&A explanation or even copy-and-paste one from a different intro. They can also change their talk title and that's totally okay. Yay Emacs!

View Org source for this post

2026-11-09 Emacs news

| emacs, emacs-news

: Added EmacsSF this Saturday.

The Emacs Carnival theme for November 2026 is Discovering Emacs features. Thanks to Raymond Zeitler for hosting. Looking forward to reading your thoughts!

There is a very long discussion about Human Emacs and LLM-assisted contributions on emacs-devel. It is a lot. I don't want to throw fuel on the fire. I'm mentioning it because it's a topic that a lot of people care very strongly about, and because there's a subdiscussion about slavery that might ripple out into the wider community. If you do decide to weigh in, please be kind and thoughtful. Thank you!

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

EmacsConf: Thinking about the community panel

| emacs, community, emacsconf

We have a recording session for the EmacsConf 2026 panel on community tomorrow. I want to get my thoughts together so that I can answer concisely, saving the details for this post so that people can dig into it before or after the conversation. So here are some rough notes:

  1. What made you start using Emacs, and what kept you using it?
  2. What took you from using Emacs to actively contributing to the community - participating in forums, writing Elisp, organizing meetups, answering questions?
    • I tend to respond well to specific people's specific needs/requests/suggestions rather than abstract ideas.
      • The main things I do all started out as someone else's suggestion. Aside from my blog, that is; that I do because otherwise I'll forget. But John Wiegley asked me to do Emacs News, so I did. Amin Bandali suggested reviving EmacsConf, so here we are. Tess O'Connor's planet.emacsen.org server went down, so now I run planet.emacslife.com. I don't take everything on, just the things that suit me well, but suggestions are welcome.
      • It's a lot easier for me to help when someone else is concretely involved. For example:
        • scheduling a conversation with someone and making it open to other people to join is easier for me than just talking out loud by myself
        • "have an IRC channel for my livestream" is a bit abstract; it's hard to pay attention to it when it's empty. "Sacha, can we use this channel to discuss the current livestream" works better for me because there is a specific person who's already there.
        • It's hard to make my code more generic, but it's more motivating when someone reaches out in the process of trying to get my code to work for them.
      • Sometimes in the process of putting together Emacs News, I'll come across people's questions on Mastodon, and I will write some Emacs Lisp for their question because I think it's a good idea and I'm curious too.
    • Tinkering keeps me going. Ex: building lots of automations for EmacsConf because I'm curious about what's possible.
      • I'm not a starter, I'm not a finisher, I just like tinkering and making things better.
    • Takeaway: suggest things to me and figure out time so we can get the ball rolling together. Things are more likely to happen if there's another person on the other end of the line. Don't take it personally if I pick something else to focus on instead; there's only so much time at the moment. =)
  3. How does Emacs show up for you in real life - colleagues, meetups, friends? How did those connections form?
    • I'm busy with family stuff and we still keep COVID precautions, so I don't go to tech meetups and conferences like I used to. I prefer connecting with people virtually. I like reading people's blog posts, watching their videos, attending virtual meetups, chatting with people during my livestreams, and organizing this conference. This gives me a sense of other people working in this space.
    • I feel warm and fuzzy about many people in the community. There are a lot of people I appreciate. Positive when I see people helping out and sharing, negative when people are being grumpy.
  4. If you know other software communities, what's one thing Emacs could learn from them?
    • The Neovim community does the YouTube/Twitch thing very well. I want to learn from their community cultivation and production processes. If we have more conversations and videos, maybe that will help people learn by looking over other people's shoulders. If we have more cool demos, that might draw more people in.
    • Python and Debian do really cool things in terms of mentorship, community, and outreach. They're a lot bigger than we are, though. I wonder how we can do those things on a much smaller scale without burning people out.
    • The communities around large language models and AI are also dealing with the Lisp curse (ease of making your own solution means less sharing), so it might be interesting to see what evolves from them. Right now it's a bit of a mess; there's even more cargo-culting there.
  5. What's one concrete thing you wish existed in the Emacs community a year from now?
    • Hah, I don't necessarily want to add to someone else's TODOs. Here's what's on my list:
      • Maybe an OrgModeConf for outside-Emacs collaboration, depending on whether we're at the point of being able to share workflow ideas with other people? More cross-pollination, maybe?
      • I want to get better at connecting with subcommunities so that people can bump into each other. Maybe that looks like checking the mailing lists / chats myself, or maybe someone can blog updates once in a while.
      • I'd like to experiment with office hours and video calls so that people can share their screen if they want help with something. This could be an additional meetup. I might start with speech recognition / speech synthesis, since that's what I'm interested in these days.
      • I also want to work on my clipping/transcription workflow to more easily share videos. This looks like more videos and blog posts.

If you want to reflect on the questions, please feel free to do so and to share your responses with me or on your blog. (You don't have to be one of the panelists. =) )

View Org source for this post

2026-11-02 Emacs news

| emacs, emacs-news

Belated happy 50th birthday, Emacs!

In other news, you can now reach Emacs News at https://emacs.news. 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