emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] TODO type problem on speedbar and imenu.


From: Nicolas Goaziou
Subject: Re: [O] TODO type problem on speedbar and imenu.
Date: Thu, 21 Jul 2011 02:07:08 +0200

Hello,

Osamu OKANO <address@hidden> 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:address@hidden:]+:\\)\\)?[ \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:address@hidden:]+:\\)\\)?[ \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



reply via email to

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