From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: TODO type problem on speedbar and imenu. Date: Thu, 21 Jul 2011 02:07:08 +0200 Message-ID: <8762mwsdhv.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:41218) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjgnM-00075D-UF for emacs-orgmode@gnu.org; Wed, 20 Jul 2011 20:07:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QjgnL-0006Ag-4O for emacs-orgmode@gnu.org; Wed, 20 Jul 2011 20:07:16 -0400 Received: from mail-wy0-f169.google.com ([74.125.82.169]:45622) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjgnK-0006AR-LR for emacs-orgmode@gnu.org; Wed, 20 Jul 2011 20:07:14 -0400 Received: by wyg36 with SMTP id 36so612735wyg.0 for ; Wed, 20 Jul 2011 17:07:13 -0700 (PDT) In-Reply-To: (Osamu OKANO's message of "Thu, 22 Jul 2010 21:51:11 +0900") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Osamu OKANO Cc: Bastien Guerry , emacs-orgmode@gnu.org Hello, Osamu OKANO 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