From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Osamu OKANO <okano.osamu@gmail.com>
Cc: Bastien Guerry <bzg@altern.org>, emacs-orgmode@gnu.org
Subject: Re: TODO type problem on speedbar and imenu.
Date: Thu, 21 Jul 2011 02:07:08 +0200 [thread overview]
Message-ID: <8762mwsdhv.fsf@gmail.com> (raw)
In-Reply-To: <AANLkTimc5r-OxQW6Efhc3tdEvVbqRTg5hkX2T5oklYj4@mail.gmail.com> (Osamu OKANO's message of "Thu, 22 Jul 2010 21:51:11 +0900")
Hello,
Osamu OKANO <okano.osamu@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
next prev parent reply other threads:[~2011-07-21 0:07 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-22 12:51 TODO type problem on speedbar and imenu Osamu OKANO
2010-07-23 9:06 ` Noorul Islam K M
2010-07-24 21:38 ` Sébastien Vauban
2010-07-25 11:48 ` Osamu OKANO
2010-08-01 12:50 ` David Maus
2011-07-21 0:07 ` Nicolas Goaziou [this message]
2011-07-21 7:19 ` Sebastien Vauban
2011-07-24 19:00 ` Bastien
2011-08-13 10:16 ` Nicolas Goaziou
2011-08-16 14:47 ` Bastien
2011-08-16 20:54 ` Nicolas Goaziou
2011-08-17 16:00 ` Bastien
2011-08-17 18:16 ` Nicolas Goaziou
2011-08-24 14:18 ` Bastien
2011-08-24 14:37 ` Carsten Dominik
2011-08-25 0:31 ` Nicolas Goaziou
2011-08-16 21:07 ` Carsten Dominik
2011-08-16 21:44 ` Nicolas Goaziou
2011-08-17 7:30 ` Carsten Dominik
2011-08-17 16:07 ` Bastien
2011-08-17 15:57 ` Bastien
2011-08-17 17:45 ` Sebastien Vauban
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=8762mwsdhv.fsf@gmail.com \
--to=n.goaziou@gmail.com \
--cc=bzg@altern.org \
--cc=emacs-orgmode@gnu.org \
--cc=okano.osamu@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).