emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Unicode TODO keyword issues in agenda search leading to org-scan-tags re


From: Marcel Lauhoff
Subject: Unicode TODO keyword issues in agenda search leading to org-scan-tags regex
Date: Thu, 1 Sep 2022 10:17:13 +0200

Hello!

I use unicode characters as TODO keywords and noticed that the "M"
agenda view doesn't find all my TODO entries.

My TODO keywords:
┌────
│ org-todo-keywords '((sequence "≣(p)" "|" "∎(f)")
│                   (sequence "◇(t)" "★" "⌛(w)" "🔥(.)" "⚙(s)" "⎇(r)" "⏵(e)" "|" 
"✔(d)" "✘(c)")
│                   (sequence "⛱(m)" "|"))
│ 
└────

Digging a bit I found that the `re' regex at be beginning of
`org-scan-tags' is responsible:

┌────
│ (re (concat "^"
│                    (if start-level
│                        ;; Get the correct level to match
│                        (concat "\\*\\{" (number-to-string start-level) "\\} ")
│                      org-outline-regexp)
│                    " *\\(" (regexp-opt org-todo-keywords-1 'words) "\\)?"
│                    " *\\(.*?\\)\\([ \t]:\\(?:" org-tag-re ":\\)+\\)?[ \t]*$"))
└────

The `(regexp-opt org-todo-keywords-1 'words)' excludes most of my TODO
keywords (but not all). Changing `'words' to `'symbols' give me my
desired result.

Short reproducer for some TODO keywords:

┌────
│ (let* ((todo-keywords '("TODO" "DONE" "PROJECT" "≣" "∎" "◇" "★" "⌛" "🔥" "⚙" 
"⎇" "⏵" "✔" "✘"))
│        (re-words (regexp-opt todo-keywords 'words))
│        (re-symbols (regexp-opt todo-keywords 'symbols)))
│   (list
│    (-map (lambda (kw) (when (string-match-p re-words kw) kw)) todo-keywords)
│    (-map (lambda (kw) (when (string-match-p re-symbols kw) kw)) 
todo-keywords)))
│ (("TODO" "DONE" "PROJECT" nil nil nil nil nil "🔥" "⚙" nil nil "✔" "✘")
│  ("TODO" "DONE" "PROJECT" "≣" "∎" "◇" "★" "⌛" "🔥" "⚙" "⎇" "⏵" "✔" "✘"))
└────

I have no idea why "⚙" is a word and "⌛" isn't, but would you accept a
patch that changes `'words' to `'symbols'? Or is there another way
around my problem?

~marcel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]