Org Mode requests: [FR] images yanked with 'yank-media' does not show up after an invocation of 'org-link-preview' [9.8.7 (release_9.8.7 @ /usr/share/emacs/31.1/lisp/org/)]

[request] flags:--- replies:2
-1:-- Org Mode requests: [FR] images yanked with 'yank-media' does not show up after an invocation of 'org-link-preview' [9.8.7 (release_9.8.7 @ /usr/share/emacs/31.1/lisp/org/)] (Post Planet Emacslife)--L0--C0--2026-11-23T23:48:37.000Z

Sacha Chua: 2026-11-23 Emacs news

: Fixed link to nfdn: Opening Texinfo Web Pages in Emacs Info

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

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

-1:-- Sacha Chua: 2026-11-23 Emacs news (Post Planet Emacslife)--L0--C0--2026-11-23T14:24:11.000Z

TAONAW - Emacs and Org Mode: Dired: Classic Technique for Manual-Visual Search

Here’s a Dired thing that most Emacs veterans know well, but only clicked for me yesterday: searching for specific words and terms in different files while narrowing the results down until you find exactly what you need.

There are many ways to do this, some in Emacs and some outside, but I find that the manual-visual process in the middle makes this especially powerful, as you get to see the files selected each time and decide what to keep as you keep narrowing down your search.

Let’s say you want to find journal entries where you wrote about a vacation that involved going out of state, and maybe get an idea of where you stayed, say a hotel vs. an Airbnb.

  1. In Dired, go to the folder where the words are (say your journal notes directory) and enter % g for a regex search for term 1 — in our case, “vacation”.
  2. Dired will mark the files containing “vacation” somewhere in the text.
  3. You now start the manual narrowing process:
    1. Enter t to mark all the opposite files, the ones that were not included in the results before. What you have now are all the files that do not have the word “vacation” in them.
    2. Enter k to remove the marked lines from view (don’t worry, this just hides the files. They are still there, just hit g). You now have the files you don’t need — those that do not have the word “vacation” in them — out of the way.
  4. You can now go back to step 1, running another search on those narrowed results. In our example, enter % g again for term 2 — “airport” (maybe you drive, but you get the idea) — and narrow again. Because we are now only working with the files that remained after our first round of narrowing, these files (by deductive logic of what we did) now contain the word “vacation” already. The files we are now narrowing (steps 3.1 and 3.2) will contain the word “vacation” and the word “airport”. When you’re done narrowing a second time and have the files that contain “vacation” and “airport”:
  5. Mark all the files you have left (or the one you decide you want from what’s left, looking at the list of files), and enter A1. This works on the file at point unless you have a couple marked, so that’s why we need to mark those first. This runs a fresh regex search over the full contents of the marked files, and will show the results in a dedicated buffer, so you see all the results from all the files in a list, showing you which file they are from and on what lines you can find them. Since this is a regex search, you can get fancy here. For me, I found that at this point the selection is small enough to find what I need: I can run one search for “hotel”, another for “Airbnb”, no problem.

As I said above, there are many ways to run something automatic and not go through these steps, but the fact that you see the files in front of you is powerful.

For example, in step 5, when you look at what you have left, you might find an old packing list template that somehow snuck into your journal folder (this never happens to me though! I’m way too organized… uhm…), or maybe you have an idea of what time of year you went on a particular vacation you’re looking for (say if it was a vacation during the summer), so you can manually take out files that contain the above words but have a timestamp of December and February.


  1. A runs the command dired-do-find-regexp, for searching, so it’s worth noting that in Dired it has a sibling: Q for dired-do-find-regexp-and-replace, which replaces the searched term with your choice. Great for fixing a mistake you may have in a couple of files, like a misspelled name you keep getting wrong. ↩︎

-1:-- TAONAW - Emacs and Org Mode: Dired: Classic Technique for Manual-Visual Search (Post Planet Emacslife)--L0--C0--2026-11-20T15:06:23.000Z

Protesilaos: Emacs live Org custom link type and more today 2026-11-17 at 16:00 Europe/Athens

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

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

Today I will implement some new features for my Emacs configuration. I will include the final code on my website, as an update to this publication.

As usual, I will keep the chat open and shall answer all questions.

UPDATE 2026-11-17 18:52 +0200: Pasting the code.

UPDATE 2026-11-17 19:24 +0200: I forgot the prot-text part.

UPDATE 2026-11-20 11:04 +0200: I decided to remove the rgrep call because I never liked its behaviour.

The code I wrote during the livestream

Custom Org link types

;;;; Custom link types

(defcustom prot-org-grep-directory org-directory
  "Directory where prot-grep links search in with `rgrep'."
  :type 'directory)

(defun prot-org-grep-follow (query &rest _)
  "Use QUERY to `rgrep' the `prot-org-grep-directory'."
  (let* ((current-file (file-name-nondirectory buffer-file-name))
         (grep-find-ignored-files (append (list current-file) grep-find-ignored-files))
         (heading (format "\\*+[\s\t]+\\<%s\\>" query)))
    (compilation-start
     (concat
      "find " prot-org-grep-directory
      " -path " (shell-quote-argument "*/.git") " -prune "
      " -o -type f "
      " -iname \"*.org\""
      " -exec grep -inHER --color=auto " (shell-quote-argument heading) " "
      (shell-quote-argument "{}")
      " " (shell-quote-argument "+"))
     'grep-mode
     (lambda (_mode) (format "*prot-dired-grep-marked for `%s'*" query))
     t)))

(defvar prot-org-grep-complete-history nil
  "Minibuffer history for `prot-org-grep-complete'.")

(defun prot-org-grep-complete (&rest _)
  "Complete prot-grep link types using `prot-org-grep-complete-history'."
  (let* ((default (car prot-org-grep-complete-history))
         (input (completing-read
                 (format-prompt "Text to search in `prot-org-grep-directory'" default)
                 prot-org-grep-complete-history nil nil nil
                 'prot-org-grep-complete-history default)))
    (format "prot-grep:%s" input)))

(defun prot-org-grep-export (query &rest _)
  "Export prot-grep link types."
  (format "[ Prot Grep for: %s ]" (or query "")))

(defface prot-org-grep-link
  '((t :inherit success :underline t))
  "Face for prot-grep link type links.")

(org-link-set-parameters
 "prot-grep"
 :follow #'prot-org-grep-follow
 :complete #'prot-org-grep-complete
 :export #'prot-org-grep-export
 :face 'prot-org-grep-link)

;;;###autoload
(defun prot-org-insert-grep-link (query)
  "Insert prot-grep link for QUERY.
When called interactively, prompt for QUERY.  Else QUERY is a string."
  (interactive (list (prot-org-grep-complete)))
  (when (or (null query)
            (string-blank-p query))
    (error "The QUERY cannot be nil or an empty string"))
  (insert (format "[[%s]]" query)))

;; TODO 2026-11-17: I want to add an "until" logic.
(defvar prot-org-meetings-link-regexp
  "\\`\\([A-Za-z]+\\) since \\([0-9]\\{,4\\}-[0-9]\\{,2\\}-[0-9]\\{,2\\}\\)"
  "Regular expression for the contents of prot-meetings links.")

(defun prot-org-meetings-sort (entries)
  "Sort the ENTRIES from oldest to newest.
ENTRIES is a list of plists of the following form:

    (list
     :heading HEADING
     :text TEXT
     :time HEADING-TIME-OBJECT)"
  (sort
   entries
   (lambda (entry1 entry2)
     (< (plist-get entry1 :time)
        (plist-get entry2 :time)))))

(defun prot-org-meetings-display-buffer (entries title)
  "Display ENTRIES of `prot-org-meetings-follow'.
ENTRIES is a list of plists of the following form:

    (list
     :heading HEADING
     :text TEXT
     :time HEADING-TIME-OBJECT)

Sort ENTRIES with `prot-org-meetings-sort'."
  (let ((buffer (get-buffer-create "*prot-org-meetings*")))
    (with-current-buffer buffer
      (save-excursion
        (erase-buffer)
        (unless (eq major-mode 'org-mode)
          (org-mode))
        (insert (format "#+title: %s" title))
        (insert "\n\n")
        (setq entries (prot-org-meetings-sort entries))
        (dolist (entry entries)
          (insert (format "* %s\n%s"
                          (plist-get entry :heading)
                          (plist-get entry :text)))
          (insert "\n\n"))))
    (display-buffer buffer)))

(defcustom prot-org-meetings-file org-default-notes-file
  "The path to the file where prot-meetings links search in."
  :type 'file)

(defun prot-org-meetings-follow (query &rest _)
  "Find headings with meetings that match QUERY.
QUERY matches `prot-org-meetings-link-regexp'."
  (if (string-match prot-org-meetings-link-regexp query)
      ;; TODO 2026-11-17: I want an "until" logic which will also go
      ;; into the `prot-org-meetings-link-regexp'.
      (let* ((name (match-string 1 query))
             (since (match-string 2 query))
             (since-timestamp (format "[%s]" since))
             (since-time-object (prot-org--timestamp-to-time since-timestamp))
             (title (format "Meetings with %s" query))
             (entries nil))
        (with-temp-buffer
          (unless (file-exists-p prot-org-meetings-file)
            (error "The file `%s' does not exist" prot-org-meetings-file))
          (insert-file-contents prot-org-meetings-file)
          (org-mode)
          ;; TODO 2026-11-17: I want to match only DONE headings.
          ;; TODO 2026-11-17: I want to get the CLOSED timestamp as well.
          (org-map-entries
           (lambda ()
             (when-let* ((heading (org-get-heading :no-tags :no-todo :no-priority :no-comment))
                         (_ (string-match-p name heading))
                         (heading-timestamp (or (org-entry-get nil "DEADLINE")
                                                (org-entry-get nil "SCHEDULED")))
                         (heading-time-object (prot-org--timestamp-to-time heading-timestamp))
                         (_ (>= heading-time-object since-time-object))
                         (text (org-get-entry))
                         (entry (list
                                 :heading heading
                                 :text text
                                 :time heading-time-object)))
               (push entry entries))))
          (if entries
              (prot-org-meetings-display-buffer entries title)
            (user-error "There are no matching entries"))))
    (error "The query `%s' does not match `prot-org-meetings-link-regexp'" query)))

(defface prot-org-meetings-link
  '((t :inherit warning :underline t))
  "Face for prot-meetings link type links.")

;; TODO 2026-11-17: I want to implement a `:complete' and an `:export' parameter.
(org-link-set-parameters
 "prot-meetings"
 :follow #'prot-org-meetings-follow
 :face 'prot-org-meetings-link)

(defvar prot-org-meetings-person-prompt-history nil
  "Minibuffer history for `prot-org-meetings-person-prompt'.")

(defun prot-org-meetings-person-prompt ()
  "Prompt for a person for prot-meetings link type."
  (let ((default (car prot-org-meetings-person-prompt-history)))
    (completing-read
     (format-prompt "Meetings with PERSON" default)
     prot-org-meetings-person-prompt-history nil nil nil
     'prot-org-meetings-person-prompt-history default)))

;;;###autoload
(defun prot-org-meetings-insert (person date)
  "Insert prot-meetings link for PERSON since DATE."
  (interactive
   (list
    (prot-org-meetings-person-prompt)
    (org-read-date)))
  (when (or (null person)
            (string-blank-p person))
    (error "The PERSON cannot be nil or an empty string"))
  (when (or (null date)
            (string-blank-p date))
    (error "The DATE cannot be nil or an empty string"))
  (insert (format "[[prot-meetings:%s since %s]]" person date)))

Indent text-mode region

(defun prot-text-insert-prefix (prefix string)
  "Prepend PREFIX to every line of STRING."
  (with-temp-buffer
    (insert string)
    (goto-char (point-min))
    (insert prefix)
    (while (and (forward-line 1)
                (not (eobp)))
      (goto-char (line-beginning-position))
      (insert prefix))
    (buffer-string)))

(defmacro prot-text-define-prefix-command (scope prefix)
  "Define command with SCOPE to insert PREFIX to string.
SCOPE is a string that describes what the command will do.  PREFIX is
the prefix as a string.

The command will target the text between `region-beginning' and
`region-end'.  It will produce and error if the region is not active."
  `(defun ,(intern (format "prot-text-prefix-%s" scope)) (beginning end)
     ,(format
       "Add prefix `%s' to text between BEGINNING and END positions.
Report an error if the region is not active."
       prefix)
     (interactive
      (if (use-region-p)
          (list (region-beginning) (region-end))
        (error "The region is not active")))
     (when (= beginning end)
       (error "The BEGINNING and END cannot be equal"))
     (let* ((text (buffer-substring beginning end))
            (replacement (prot-text-insert-prefix ,prefix text)))
       (replace-region-contents beginning end replacement))))

;;;###autoload (autoload 'prot-text-prefix-blockquote "prot-text" nil t)
;;;###autoload (autoload 'prot-text-prefix-indent "prot-text" nil t)
(prot-text-define-prefix-command blockquote "> ")
(prot-text-define-prefix-command indent "    ")

(defvar-keymap prot-text-prefix-leader-map
  :doc "Commands to insert prefix to the active region text."
  :prefix 'prot-text-prefix-leader
  "b" #'prot-text-prefix-blockquote
  "i" #'prot-text-prefix-indent)

Emacs configuration

My personal Emacs configuration. It is comprehensive, both in terms of the [custom] code it contains as well as the documentation on what each piece of functionality does.


🔷 Consider making a donation.

-1:-- Protesilaos: Emacs live Org custom link type and more today 2026-11-17 at 16:00 Europe/Athens (Post Planet Emacslife)--L0--C0--2026-11-17T00:00:00.000Z

Sacha Chua: 2026-11-16 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

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

-1:-- Sacha Chua: 2026-11-16 Emacs news (Post Planet Emacslife)--L0--C0--2026-11-16T13:07:30.000Z

Matt Maguire: My AI Teaching Setup, Part 3: The Organs

Part 2 was about models and harnesses. But a model in a harness is still just a clever voice. What turned the setup into a system was the organs: the memory, the senses, and the reflexes bolted on around it. This is the final part, and it starts with a full circle.

The knowledge base that was already ten years old

People ask how I got my teaching knowledge into the AI. The answer is anticlimactic: I didn’t. I had spent a decade writing it in plain text — Org-mode notes, syllabus annotations, lesson reflections, the whole zettelkasten from Part 0 .

-1:-- Matt Maguire: My AI Teaching Setup, Part 3: The Organs (Post Planet Emacslife)--L0--C0--2026-11-16T00:00:00.000Z

Sacha Chua: EmacsConf: recording and re-recording introductions

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

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

-1:-- Sacha Chua: EmacsConf: recording and re-recording introductions (Post Planet Emacslife)--L0--C0--2026-11-13T02:17:31.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!