emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Bastien <bzg@altern.org>
Cc: emacs-orgmode@gnu.org, Osamu OKANO <okano.osamu@gmail.com>
Subject: Re: TODO type problem on speedbar and imenu.
Date: Sat, 13 Aug 2011 12:16:34 +0200	[thread overview]
Message-ID: <871uwp8vlp.fsf@gmail.com> (raw)
In-Reply-To: <87vcursd79.fsf@altern.org> (Bastien's message of "Sun, 24 Jul 2011 21:00:26 +0200")

[-- Attachment #1: Type: text/plain, Size: 527 bytes --]

Hello,

Bastien <bzg@altern.org> writes:

> Yep.  When you have some free time (!), please suggest a patch and a
> small org test file so that we can test.

Here is an attempt to convert word boundaries into white spaces where it
matters.

I paste again the test file from Osamu Okano for reference.

#+begin_src org
#+TYP_TODO: SOMEDAY 
* someday/maybe     
* SOMEDAY/maybe     
* SOMEDAY maybe     
* someday maybe     
* read/review       
* READ/review       
* conf              
#+end_src


Regards,

-- 
Nicolas Goaziou

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Enforce-white-space-after-todo-keywords.patch --]
[-- Type: text/x-patch, Size: 2819 bytes --]

From 95709480975155387121fdd18cea144145b47e5c Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <n.goaziou@gmail.com>
Date: Mon, 25 Jul 2011 17:50:28 +0200
Subject: [PATCH] Enforce white space after todo keywords

* lisp/org.el (org-set-regexps-and-options): enforce white space after
  todo keyword, as word boundary isn't sufficient (i.e. in matches * TODO/this)
---
 lisp/org.el |   28 +++++++++++++++-------------
 1 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index a13730b..9fef2a8 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -4537,38 +4537,40 @@ means to push this value onto the list in the variable.")
 	    org-not-done-heading-regexp
 	    (concat "^\\(\\*+\\)[ \t]+\\("
 		    (mapconcat 'regexp-quote org-not-done-keywords "\\|")
-		    "\\)\\>")
+		    "\\)[ \t]+")
 	    org-todo-line-regexp
 	    (concat "^\\(\\*+\\)[ \t]+\\(?:\\("
 		    (mapconcat 'regexp-quote org-todo-keywords-1 "\\|")
-		    "\\)\\>\\)?[ \t]*\\(.*\\)")
+		    "\\)[ \t]+\\)?\\(.*\\)")
 	    org-complex-heading-regexp
 	    (concat "^\\(\\*+\\)[ \t]+\\(?:\\("
 		    (mapconcat 'regexp-quote org-todo-keywords-1 "\\|")
-		    "\\)\\>\\)?\\(?:[ \t]*\\(\\[#.\\]\\)\\)?[ \t]*\\(.*?\\)"
+		    "\\)[ \t]+\\)?"
+		    "\\(?:\\(\\[#.\\]\\)[ \t]+\\)?"
+		    "\\(.*?\\)"
 		    "\\(?:[ \t]+\\(:[[:alnum:]_@#%:]+:\\)\\)?[ \t]*$")
 	    org-complex-heading-regexp-format
 	    (concat "^\\(\\*+\\)[ \t]+\\(?:\\("
 		    (mapconcat 'regexp-quote org-todo-keywords-1 "\\|")
-		    "\\)\\>\\)?"
-		    "\\(?:[ \t]*\\(\\[#.\\]\\)\\)?"
-		    "\\(?:[ \t]*\\(?:\\[[0-9%%/]+\\]\\)\\)?" ;; stats cookie
-		    "[ \t]*\\(%s\\)"
-		    "\\(?:[ \t]*\\(?:\\[[0-9%%/]+\\]\\)\\)?" ;; stats cookie
-		    "\\(?:[ \t]+\\(:[[:alnum:]_@#%%:]+:\\)\\)?[ \t]*$")
+		    "\\)[ \t]+\\)?"
+		    "\\(?:\\(\\[#.\\]\\)[ \t]+\\)?"
+		    "\\(?:\\(?:\\[[0-9%%/]+\\]\\)[ \t]+\\)?" ; stats cookie
+		    "\\(%s\\)[ \t]*"
+		    "\\(?:\\[[0-9%%/]+\\]\\)?" ; stats cookie
+		    (org-re "\\(?:[ \t]+\\(:[[:alnum:]_@#%%:]+:\\)\\)?[ \t]*$"))
 	    org-nl-done-regexp
 	    (concat "\n\\*+[ \t]+"
 		    "\\(?:" (mapconcat 'regexp-quote org-done-keywords "\\|")
-		    "\\)" "\\>")
+		    "\\)" "[ \t]+")
 	    org-todo-line-tags-regexp
 	    (concat "^\\(\\*+\\)[ \t]+\\(?:\\("
 		    (mapconcat 'regexp-quote org-todo-keywords-1 "\\|")
-		    (org-re
-		     "\\)\\>\\)? *\\(.*?\\([ \t]:[[:alnum:]:_@#%]+:[ \t]*\\)?$\\)"))
+		    "\\)[ \t]+\\)"
+		    (org-re "\\(.*?\\([ \t]:[[:alnum:]:_@#%]+:[ \t]*\\)?$\\)"))
 	    org-looking-at-done-regexp
 	    (concat "^" "\\(?:"
 		    (mapconcat 'regexp-quote org-done-keywords "\\|") "\\)"
-		    "\\>")
+		    "[ \t]+")
 	    org-deadline-regexp (concat "\\<" org-deadline-string)
 	    org-deadline-time-regexp
 	    (concat "\\<" org-deadline-string " *<\\([^>]+\\)>")
-- 
1.7.6


  reply	other threads:[~2011-08-13 10:17 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
2011-07-21  7:19   ` Sebastien Vauban
2011-07-24 19:00   ` Bastien
2011-08-13 10:16     ` Nicolas Goaziou [this message]
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=871uwp8vlp.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).