Hi,
there was a recent change to how the tags table is initialized. I think that as a side effect, some tag functions like org-tags-expand don't work unless you open an org-mode buffer first. I have a small bash script that exports my agenda; right in the beginning (before opening any org-mode file) it collects some data by calling org-map-entries. org-map-entries needs org-tags-expand, which now fails because the syntax table hasn't been initialized yet.
Minimal case to reproduce this:
1. run: emacs -Q
2. load latest org:
(add-to-list 'load-path "/…/org-mode/lisp")
(require 'org)
3. eval:
(org-tags-expand "+sometag")
You'll see:
Debugger entered--Lisp error: (wrong-type-argument syntax-table-p "Syntax table including \"@\" and \"_\" as word constit...")
org-tags-expand("+sometag")
(progn (org-tags-expand "+sometag"))
elisp--eval-last-sexp(nil)
eval-last-sexp(nil)
funcall-interactively(eval-last-sexp nil)
If I open any .org file before step 3, then it will work.
I think the related commit is:
commit 6e6354c074a323780f103aabf45be74104ce3ecf
Author: Ihor Radchenko <
yantar92@posteo.net>
Date: Mon May 8 13:23:15 2023 +0200
org-tags-expand: Do no modify buffer's syntax table by side effect
* lisp/org.el (org-mode-tags-syntax-table): New variable holding
syntax table for tags.
(org-mode): Initialize tag syntax table.
(org-make-tags-matcher): Match tags using appropriate syntax table.
(org-tags-expand): Do no modify syntax table by side effect.
Reported-by: Mattias Engdegård <
mattias.engdegard@gmail.com>
Link:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63225#68
Of course I could make sure to open an org file (any file) before calling org-map-entries but that seems like a workaround to a bug. I would expect (org-map-entries … 'agenda) to also work before opening any .org file.