emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Unicode TODO keyword issues in agenda search leading to org-scan-tags regex
@ 2022-09-01  8:17 Marcel Lauhoff
  2022-09-03  8:14 ` Ihor Radchenko
  0 siblings, 1 reply; 7+ messages in thread
From: Marcel Lauhoff @ 2022-09-01  8:17 UTC (permalink / raw)
  To: emacs-orgmode

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



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-09-06  7:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-01  8:17 Unicode TODO keyword issues in agenda search leading to org-scan-tags regex Marcel Lauhoff
2022-09-03  8:14 ` Ihor Radchenko
2022-09-05  9:53   ` Marcel Lauhoff
2022-09-05 10:29     ` Ihor Radchenko
2022-09-05 10:44       ` Marcel Lauhoff
2022-09-05 10:54         ` Ihor Radchenko
2022-09-06  7:11           ` Marcel Lauhoff

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).