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

Notes from Adam Chen's Happy Town presentation at Civic Tech Toronto

| life, community, toronto

Feel free to use/share this sketch under the Creative Commons Attribution Licence.

I liked the reminder to organize events based on what you want, tuning in to what you need and what kind of life you want to have. I like learning about Emacs, so EmacsConf is right up my alley, and the fact that I get to tinker with code and processes is actually a large part of the fun. =)

I thought it was interesting that Happy Town is focused on building a collective of event hosts. Sometimes it's hard to find a venue (especially for free or low-cost non-commercial events), and it sounds like they have a few places that are happy to host small events. The next challenge is knowing that at least one other person is going to show up. That's one of the nice things about developing a community of hosts and regular participants who can show up for each other.

The thing Adam said about asset-based community development is also interesting. Many people pitching in a little bit of money each can often work out better than relying on one or two big grants or sponsorships, thanks to more of a sense of shared ownership. I tend to shy away from soliciting or managing donations. It gets complicated when transactions come into play, and I like keeping it gift-based. I prefer to offer whatever I'm comfortable funding by myself, and my attention is too limited to scale up much even if other people give money. People giving time, though… That's awesome.

I think I'm not actually looking for that many new things to add to my life at the moment, social-wise. The kiddo still wants to spend time with me, so I want to prioritize her since this time is so fleeting. I do a bit of volunteering, but it tends to either be things I can do mostly asynchronously, or things that she's also interested in and that she can contribute to, or low-commitment things that I can do or not do. I also tend to focus on opportunities to help out rather than hang out: we've cooked, we've sorted donated stuffed toys, we've picked up trash, we've delivered groceries and prepared meals.

I find the repetitive scripts and busy-ness of making hot chocolate for people at protests relaxing, too. ("Would you like dark chocolate, milk chocolate, or vegan? Half cup or full cup? Marshmallows, candy canes, both, neither?") I'm glad other people are figuring out what works well for them and building communities along the way.

Related links:

View Org source for this post

L'apprentissage du braille avec une tablette et un poinçon

| life, french

Ma fille est aveugle de l'œil gauche à cause d'une microphtalmie. Elle voit bien avec l'autre œil. Mon mari et moi sommes très myopes (lui plus myope que moi) et elle porte déjà des lunettes avec une forte correction, donc il est possible qu'elle devienne aveugle ou que sa vision soit limitée. Quand elle avait 1 ou 2 ans, j'avais demandé à l'ophtalmologue de nous orienter vers l'INCA (Institut national canadien pour les aveugles) pour nous informer sur les signes à surveiller et les ressources disponibles. Quelqu'un nous avait rendu visite pour mesurer sa vision et pour nous offrir un livre d'initiation au braille. Nous n'avions pas besoin d'aide supplémentaire parce que, comme je l'ai dit, elle voit bien ; elle peut faire du vélo, elle peut participer à l'école virtuelle, elle adore lire des livres imprimés. Le livre en braille était sur notre étagère depuis longtemps. Récemment, ma fille l'a découvert, et elle s'est intéressée au braille. Elle m'a demandé plusieurs fois de guider sa main en lisant des caractères aléatoires pour s'entraîner à les lire, et elle m'a demandé d'acheter une tablette et un poinçon pour écrire en braille.

La tablette et le poinçon sont arrivés aujourd'hui. Nous avons donc écrit et lu en alternance des messages avec une liste limitée de lettres. Nous avons commencé par des mots tels que « dog » et « good », puis « good dog, hide » et « bad dog dug food ». Si elle se réveille à temps pour l'école demain, je vais laisser un petit mot en braille dans sa boîte à lunch.

Je veux apprendre le braille depuis longtemps parce que je préfère me préparer à toute éventualité. Et c'est toujours notre philosophie de soutenir la curiosité de notre fille qui nous emmène vers de nouveaux horizons.

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

Planning logistics and support for safe streets protests and rallies

Posted: - Modified: | life, toronto

: Added more wrap-ups and upcoming events

We attended the town hall on the topic "How are we going to protect our bike lanes?" It was wonderful to see hundreds of people thinking about concrete ways that they could help make things better. I loved seeing all sorts of people there, and even more that our 10-year-old daughter stood up to host a breakout session on a topic she cares about: supplies and repairs during protests.

Breakout topics

Here were the general topics for open space conversations and some notes on next steps (thanks to my husband for extra notes!):

  • rapid response: shift plan
  • organizing health care workers to protect our bike lanes: push media attention, union statements, op eds, journals
  • organizing parents to stand up for bike lanes: For Our Kids, virtual meeting, bike bus?
  • student organizing/University of Toronto Graduate Students’ Union (UTGSU): posters, stickers, town hall for students
  • Critical Mass organizing: new ride in May?
  • non-violent direct action: training on the 29th?
  • Bike Lanes 101: bring in new people, build people power, small group coffee chats, talk to the 905
  • engaging business: flip the script, owners, bia, consumers - be visible as cyclists, shopping passport
  • cycling winter: shovel bike lanes ourselves
  • connecting to opposition to highway 413
  • engineering reviews/critiques: will get drawings, make them public
  • future proofing: build few projects to high standards, accelerate construction, seamless network, push councillors, education, know what good infra is
  • federal level involvement: disallowance, cut bill 212, organize on ridings basis
  • website and digital infrastructure: Civic Tech Toronto
  • storytelling with data: isolate data for Bloor Yonge University lanes, bikeshare counts, ID core audience, biz owners, 905 drivers, common misconceptions, response, more data from city
  • guerrilla postering: creating a repository of art, setting up a mailing list
  • supplies and repairs during protest: coordinating supplies at the next protests/events
  • engaging drivers
  • organizing non-cyclists allies: open letter
  • safe complete streets: stop saying bike lanes, say complete streets, beautify, personal stories over stats
  • how to organize provincially
  • pressuring the city to not police protests: strategic mtg with councillors, pressure mayor, reduce police budget, testimonials from arrested
  • transit: TTC integration, free bike share pass?

More wrap-ups:

Here are more notes on the parenting breakout and the supplies breakout that the kiddo hosted.

Parenting, families

I participated in the conversation on organizing parents to stand up for bike lanes. We talked about making protests and rallies friendlier for families and kids through hot chocolate, popsicles, bubbles, stickers, bike decoration stations, and other activities. People also exchanged ideas about organizing bike buses to help kids bike to school, meeting up with other cyclists at bike-friendly cafes during parental leave, and promoting bike education. We talked about widening the conversation from a focus on bike lanes to safety for everyone and connecting to what people care about, especially through personal stories and concrete life changes.

One of the triggers for the shift towards a stronger cycling culture in the Netherlands was collective outrage over so many child deaths in traffic accidents. I would like to get to that point without as many individual tragedies.

It's challenging to go to protests and rallies when you have to consider kids in tow. They get cold and hungry and bored and tired. They need to go to the bathroom. They need to be safe, especially when there's anger or aggression from people on the road or online. I wonder what can make it easier for families to come.

My husband and I have been going to quite a few of these events together with our 10-year-old. She likes offering people hot chocolate, snacks, and hand warmers: little ways to care for people who care about everyone's safety. I want to connect with other people so that we can figure out together how to make it easier for families to get involved. I am totally willing to start with hot chocolate and stickers. =)

Resources:

Supplies and repairs for supporting protests

I was surprised when our normally quite reserved 10-year-old suggested this open space breakout session herself, standing up in front of hundreds of people to invite them to a conversation about how to support protests through supplies and bike repairs. When she talked to the coordinator, she opted for a small space for about 5 people, but we ended up with about 10. She reported the results back to the main audience herself, too.

It's surprising how little things can go a long way to helping people feel more supported and taken care of. Our experience started by going to protests and offering people water refills, because it's important to stay hydrated. Most people have their own water bottles, but they might run out over the course of a few hours. We have cargo bikes, so my husband brings this huge container of water and refills people's bottles. As the weather got colder, we shifted to bringing warm water too. We're used to making hot chocolate for a crowd because it's a good way to keep kids warm during an outdoor play date. It's actually pretty delightful to see even adults light up when you offer them marshmallows with their cocoa. My husband's also been bringing bike repair tools, since quite a few people had to deal with flat tires from debris in contested bike lanes. Other people have even set up bike stands for check-ups and repairs. Other people have brought hand warmers and snacks. They pitched in with a variety of masks when the machines were grinding up the road surface. Little things help.

Sometimes having a list of ideas makes it easier for people to find one or two things they can contribute. We brainstormed a lot of little things that could help at these events:

  • table with snacks & info
  • warmth, water, and food
    • hot cocoa
    • hand warmers
    • popsicles in summer
    • water: water bottles, refills, hot water
    • pizza, samosas, etc.
  • tools
    • nametags? totally optional
    • signs, flyers, sign-making station
    • masks, PPE, first aid
    • bike repairs: tubes, tools → reach out to bike shops
  • info
    • info, contact, sign up
    • zines
    • sign-ups to coordinate with Bike Lane Watch?
    • nearby support sites: where to find bathrooms, nearby bike-friendly businesses to recommend
  • fun
    • kid activities, games, fidgets
    • stickers, sticker trading
  • other ideas
    • music
    • candles
    • someone to lock up and retrieve a bike if people get arrested
    • glow sticks, lights, batteries, chargers - Green P: power?
    • introvert corner
    • camp chairs, mats, tables
    • ways to reduce packaging, trash
    • moral support
  • $ funds
    • individuals sharing
    • tip jar?
    • that GoFundMe?

It might be nice to figure out how we can coordinate with other people who are thinking of bringing things or ordering things so that for example, if we're picking up pizza, we don't end up with too much pizza. Maybe the Telegram chat?

Sometimes the protest is on a sidewalk where there's not a lot of space to set up a table or cargo bikes. It might be a good idea to identify beforehand a park or a side street where we can set up some more support, so that people can go there to take a break before they go back into the fray. For example, when the protests were at Islington, we stayed at Tom Riley Park, and people came by to refuel as needed.

Is there funding? Quite a few people have offered, although it feels a little complicated. There has been some kind of fundraiser, but we haven't coordinated anything with them. People have also offered donations or suggested having a tip jar. For us, I think we're more comfortable just sharing what we can share as a gift (and avoiding liability! =) ). I love how other people have, on their own initiative, brought samosas and naan bread and pizza and sesame crisps and Timbits. More potluck than catering.

People suggested putting together some pre-packed boxes so that they're easy to grab and go as part of a rapid response to the anticipated bike lane removals next spring. Maybe that's like how we keep a large bag with cups, marshmallows, stir sticks, and hot chocolate mix, so that could be a starting point.

Upcoming events

Tomorrow (Sunday), Friends and Families for Safe Streets is organizing a memorial at 4:30 PM at Tom Riley Park on Nov 15 (parking lot near Bloor and Aberfoyle Crescent) as part of the World Day of Remembrance for Road Traffic Victims. We hope to be there. If you want to come and help figure out the logistics of caring for people at these rallies and events, drop by, say hi, and have some cocoa!

Protect Our Bike Lanes! Basic Action Training! Tickets, Sunday, November 29  •  10 AM - 4 PM | Eventbrite

7th Annual Cycling Good Cheer — Toronto Community Bikeways Coalition

See https://showuptoronto.ca/ for more upcoming events

View Org source for this post

Notes from "An Evening with Valérie Plante" (Nov 13, 2026) - climate action, Montréal, municipalities

| life, toronto

I went to An Evening with Valérie Plante to learn about her experience in prioritizing the environment during her two terms as the mayor of Montréal. It was interesting to hear about the sponge parks that they built in order to absorb excess rainwater, designing pedestrian streets for beauty and comfort, the importance of connecting with public transit, and how they built an express bike network as part of improving safety for everyone, including the data they collected in order to make the case.

Her key tips were:

  1. Build partnerships
  2. Support citizens' initiatives
  3. Connect with what people care about

Here are my notes:

Feel free to use/share them!

More about Valérie Plante

View Org source for this post