emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Marcel Lauhoff <ml@irq0.org>
To: Ihor Radchenko <yantar92@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Unicode TODO keyword issues in agenda search leading to org-scan-tags regex
Date: Mon, 5 Sep 2022 11:53:42 +0200	[thread overview]
Message-ID: <A2EA5FA8-6140-476F-8CBB-D885929D7963@irq0.org> (raw)
In-Reply-To: <87r10s98od.fsf@localhost>



> 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	other threads:[~2022-09-05  9:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=A2EA5FA8-6140-476F-8CBB-D885929D7963@irq0.org \
    --to=ml@irq0.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).