Hello, Osamu OKANO <okano.os...@gmail.com> writes:
> I found a problem on speedbar and imenu. > Reproducing date is here > -8<---------------cut here---------------start------------->8--- > * someday/maybe > * SOMEDAY/maybe > * SOMEDAY maybe > * someday maybe > * read/review > * READ/review > * conf > #+TYP_TODO: SOMEDAY > --8<---------------cut here---------------end--------------->8--- > > When a head line includes TODO state name, > I am afraid that displayed head line names on speedbar are wrong. > Because SOMEDAY is TODO type but "someday/maybe" and "SOMEDAY/maybe" > is not TODO task. This is a regexp problem: `org-complex-heading-regexp' recognizes "someday" and a TODO keyword in both "someday/maybe" and "SOMEDAY/maybe". It is defined as the following (I let the concat form for better readability): #+begin_src emacs-lisp (concat "^\\(\\*+\\)[ \t]+\\(?:\\(" (mapconcat 'regexp-quote org-todo-keywords-1 "\\|") "\\)\\>\\)?\\(?:[ \t]*\\(\\[#.\\]\\)\\)?[ \t]*\\(.*?\\)" "\\(?:[ \t]+\\(:[[:alnum:]_@#%:]+:\\)\\)?[ \t]*$") #+end_src The problem in at the "\\>" part. The following change may solve the problem. #+begin_src emacs-lisp (concat "^\\(\\*+\\)[ \t]+\\(?:\\(" (mapconcat 'regexp-quote org-todo-keywords-1 "\\|") "\\)[ \t]+\\)?\\(?:[ \t]*\\(\\[#.\\]\\)\\)?[ \t]*\\(.*?\\)" "\\(?:[ \t]+\\(:[[:alnum:]_@#%:]+:\\)\\)?[ \t]*$") #+end_src I think it is better to enforce some whitespace after a TODO keyword than a word boundary. There are a few places where this could also be changed (i.e. `org-complex-heading-regexp-format'). Any opinion on this? Regards, -- Nicolas Goaziou