emacs-orgmode
[Top][All Lists]
Advanced

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

Re: Unicode TODO keyword issues in agenda search leading to org-scan-tag


From: Marcel Lauhoff
Subject: Re: Unicode TODO keyword issues in agenda search leading to org-scan-tags regex
Date: Mon, 5 Sep 2022 11:53:42 +0200


> On 2022-09-03, at 10:14, Ihor Radchenko <yantar92@gmail.com> wrote:
> 
> Marcel Lauhoff <ml@irq0.org> writes:
> 
>> My TODO keywords:
>> ┌────
>> │ org-todo-keywords '((sequence "≣(p)" "|" "∎(f)")
>> │                (sequence "◇(t)" "★" "⌛(w)" "🔥(.)" "⚙(s)" "⎇(r)" "⏵(e)" "|" 
>> "✔(d)" "✘(c)")
>> │                (sequence "⛱(m)" "|"))
>> │ 
>> └────
>> ...
>> 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.
> 
> Thanks for reporting!
> Fixed on main via a1c923afd.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=a1c923afda22089cbf14c7b7a175cee10bfd297b

┌────
│ -                  " *\\(" (regexp-opt org-todo-keywords-1 'words) "\\)?"
│ +                  " *\\(" (regexp-opt org-todo-keywords-1 'words) " \\)?"
└────

That change doesn't seem to work for me, but maybe I'm holding it wrong or 
missed a follow up commit.

The following snippet tries some regex variations matched to one of `("TODO" 
"≣" "TODO " "≣ ")'. a1c923afd does seem to require a space after the keyword 
now:

┌────
│ (let* ((kwds '("TODO" "DONE" "PROJECT" "≣" "∎" "◇" "★" "⌛" "🔥" "⚙" "⎇" "⏵" 
"✔" "✘"))
│        (test-todos '("TODO" "≣" "TODO " "≣ "))
│        (regexes (list (concat "^ *\\(" (regexp-opt kwds 'words) "\\)?")  ;; 
orig
│                     (concat "^ *\\(" (regexp-opt kwds 'words) " \\)?")  ;; 
a1c923afd
│                     (concat "^ *\\(" (regexp-opt kwds 'symbols) "\\)?")  ;; 
symbols
│                     (concat "^ *\\(" (regexp-opt kwds 'symbols) " \\)?"))))  
;; symbols + space
│   (-map (lambda (regex)
│         (list regex
│              (-map (lambda (todo)
│                              (s-match-strings-all regex todo))
│                     test-todos)))
│   regexes))
└────

┌────
│ (("^ *\\(\\<\\(DONE\\|PROJECT\\|TODO\\|[∎≣⌛⎇⏵◇★⚙✔✘🔥]\\)\\>\\)?"
│   ((("TODO" "TODO" "TODO"))
│    ((""))
│    (("TODO" "TODO" "TODO"))
│    ((""))))
│  ("^ *\\(\\<\\(DONE\\|PROJECT\\|TODO\\|[∎≣⌛⎇⏵◇★⚙✔✘🔥]\\)\\> \\)?"
│   (((""))
│    ((""))
│    (("TODO " "TODO " "TODO"))
│    ((""))))
│  ("^ *\\(\\_<\\(DONE\\|PROJECT\\|TODO\\|[∎≣⌛⎇⏵◇★⚙✔✘🔥]\\)\\_>\\)?"
│   ((("TODO" "TODO" "TODO"))
│    (("≣" "≣" "≣"))
│    (("TODO" "TODO" "TODO"))
│    (("≣" "≣" "≣"))))
│  ("^ *\\(\\_<\\(DONE\\|PROJECT\\|TODO\\|[∎≣⌛⎇⏵◇★⚙✔✘🔥]\\)\\_> \\)?"
│   (((""))
│    ((""))
│    (("TODO " "TODO " "TODO"))
│    (("≣ " "≣ " "≣")))))
└────


~marcel





reply via email to

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