Ihor Radchenko <[email protected]> writes: > Mykhailo Shevchuk <[email protected]> writes: > >> Disclosure up front: the patch and this message were generated by an LLM and >> edited by me. >> >> The agenda skip functions silently ignore TODO keywords that begin >> or end with a character that is not a word constituent, such as >> "[ ]" and "[X]". >> >> MWE: in emacs -Q with Org 9.8.8 (also present on current bugfix, >> c75ffe4): >> >> (let ((org-todo-keywords '((sequence "[ ]" "|" "[X]")))) >> (with-temp-buffer >> (insert "* [ ] hello\n") >> (org-mode) >> (goto-char (point-min)) >> (list (org-get-todo-state) >> (org-agenda-skip-entry-if 'todo '("[ ]"))))) >> >> => ("[ ]" nil) >> >> Expected ("[ ]" 13). >> >> Org recognized the keyword, but the agenda skip function did not. The same >> holds >> for 'nottodo, 'todo-unblocked and 'nottodo-unblocked, and for the 'todo / >> 'done >> class symbols when every keyword is bracketed. >> >> The cause is in `org-agenda-skip-if-todo', which matches with >> >> (regexp-opt keywords 'words) > > Thanks for reporting! > The patch looks reasonable, but we currently cannot accept LLM-generated > patches as a matter of temporary GNU policy. See > https://orgmode.org/worg/org-contribute.html#llm > > Could you rewrite the commit message in your own words and leave just > the most basic fix without tests? That way, I will be able to merge the > patch.
I see. I'm sure I've checked the contribution guidelines before sending the patch and the LLM policy had not been there yet. The field is very dynamic indeed. In any case, I've originally traced the offending function myself, and the change is trivial, so I guess that's a fair use :) I'm attaching the revised patch with the commit message completely rewritten and tests left out. Thank you very much! Kind regards, Mykhailo
>From fecd8e2ade01608edf1dd0a5c3497b0dcfe65d9f Mon Sep 17 00:00:00 2001 From: Mykhailo Shevchuk <[email protected]> Date: Wed, 12 Aug 2026 21:45:17 +0200 Subject: [PATCH] org-agenda-skip-if-todo: fix TODO keyword regexp * lisp/org-agenda.el (org-agenda-skip-if-todo): Replace the `words' bounds of the TODO keyword regexp with a whitespace delimiter guard. The updated regexp behaves identically to the one used by the `org-element' parser. For instance, TODO keywords surrounded by non-word characters such punctuation are now recognized by the regexp. TINYCHANGE --- lisp/org-agenda.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index c7bc7fe14..a426d4f5b 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -5275,7 +5275,8 @@ a list of TODO keywords, or a state symbol `todo' or `done' or (error "Invalid TODO class or type: %S" args)) (`(,_ ,(pred (member "*"))) org-todo-keywords-1) (`(,_ ,todo-list) todo-list)) - 'words)))) + t) + "\\(?: \\|$\\)"))) (pcase args (`(todo . ,_) (let (case-fold-search) (re-search-forward todo-re end t))) -- 2.55.0
