From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Date tree capture regexp for headline matching has changed. Date: Mon, 09 May 2011 21:34:57 -0400 Message-ID: <6169.1304991297@alphaville.dokosmarshall.org> References: Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([140.186.70.92]:56548) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJbr5-0006Oy-CW for emacs-orgmode@gnu.org; Mon, 09 May 2011 21:35:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QJbr3-00013b-Fe for emacs-orgmode@gnu.org; Mon, 09 May 2011 21:35:19 -0400 Received: from vms173011pub.verizon.net ([206.46.173.11]:59067) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJbr3-00012W-8H for emacs-orgmode@gnu.org; Mon, 09 May 2011 21:35:17 -0400 Received: from alphaville.dokosmarshall.org ([unknown] [173.76.32.106]) by vms173011.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0LKY00MC4HQ96Z20@vms173011.mailsrvcs.net> for emacs-orgmode@gnu.org; Mon, 09 May 2011 20:35:03 -0500 (CDT) In-reply-to: Message from Charles Cave of "Tue, 10 May 2011 01:03:05 -0000." 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: Charles Cave Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org Charles Cave wrote: > I compared org-datetre.el from 7.4 to 7.5 and got the following > diff output (edited) > > I can see that the regular expression has become more restricted > with the addition of \\w+$" at the end. > > At least I know what to manually change to make orgmode work the > way I want it. > > > 105c105 (this is the org-datetree-find-day-create function > 7.4: (let ((re (format "^\\*+[ \t]+%d-%02d-\\([0123][0-9]\\)[ \t\n]" year month)) > --- > 7.5: (let ((re (format "^\\*+[ \t]+%d-%02d-\\([0123][0-9]\\) \\w+$" year month)) > > > > Yes, but: there are two commits to org-datetree.el in the relevant time frame. One was a fix in response to a bug report by you, so presumably you want that fix - note that it touches the same regexp that you identified above, but also note that there are similar regexps that got modified in two other functions: --8<---------------cut here---------------start------------->8--- commit a6554b2fdf40e8e76abf08f9a0364f0de75fa78b Author: Bastien Guerry Date: Thu Feb 10 15:54:48 2011 +0100 Fix bug when creating datetree heading. When a heading like * 2011 Do this existed, the creation of a datetree for the year 2011 didn't work, as the "2011 Do this" heading was mistaken for such a datetree. This has been reported by Charles Cave. diff --git a/lisp/org-datetree.el b/lisp/org-datetree.el index 8014f8f..702b3a9 100644 --- a/lisp/org-datetree.el +++ b/lisp/org-datetree.el @@ -64,7 +64,7 @@ tree can be found." (goto-char (prog1 (point) (widen)))))) (defun org-datetree-find-year-create (year) - (let ((re "^\\*+[ \t]+\\([12][0-9][0-9][0-9]\\)[ \t\n]") + (let ((re "^\\*+[ \t]+\\([12][0-9][0-9][0-9]\\)[ \t]*$") match) (goto-char (point-min)) (while (and (setq match (re-search-forward re nil t)) @@ -83,7 +83,7 @@ tree can be found." (defun org-datetree-find-month-create (year month) (org-narrow-to-subtree) - (let ((re (format "^\\*+[ \t]+%d-\\([01][0-9]\\)[ \t\n]" year)) + (let ((re (format "^\\*+[ \t]+%d-\\([01][0-9]\\)[ \t]*$" year)) match) (goto-char (point-min)) (while (and (setq match (re-search-forward re nil t)) @@ -102,7 +102,7 @@ tree can be found." (defun org-datetree-find-day-create (year month day) (org-narrow-to-subtree) - (let ((re (format "^\\*+[ \t]+%d-%02d-\\([0123][0-9]\\)[ \t\n]" year month)) + (let ((re (format "^\\*+[ \t]+%d-%02d-\\([0123][0-9]\\)[ \t]*$" year month)) match) (goto-char (point-min)) (while (and (setq match (re-search-forward re nil t)) --8<---------------cut here---------------end--------------->8--- The second commit is probably the one that broke your setup - note that it too touches all three regexps, so if you fix one and not the others, you are probably going to end up with an inconsistent code base. If you use git to keep up to date, you'd be better off reverting this commit in a private branch (see http://orgmode.org/worg/org-faq.html#keeping-local-changes-current-with-Org-mode-development for information on how to keep current but still carry local changes): --8<---------------cut here---------------start------------->8--- commit d9eeb15ab9d55316f08cd7efe818119bb7e5fc56 Author: Bastien Guerry Date: Tue Feb 15 06:07:53 2011 +0100 Fix bug when jumping to a datetree from the agenda. Datetree entries have a fixed form now: * 2011 ** 2011-02 monthname *** 2011-02-13 dayname These headings will not be recognized as datetrees: * 2011 A task for 2011 ** 2011-02 several words *** 2011-02-13 several words Thanks to Detlef Steuer for reporting this. diff --git a/lisp/org-datetree.el b/lisp/org-datetree.el index 702b3a9..f0f1b90 100644 --- a/lisp/org-datetree.el +++ b/lisp/org-datetree.el @@ -64,7 +64,7 @@ tree can be found." (goto-char (prog1 (point) (widen)))))) (defun org-datetree-find-year-create (year) - (let ((re "^\\*+[ \t]+\\([12][0-9][0-9][0-9]\\)[ \t]*$") + (let ((re "^\\*+[ \t]+\\([12][0-9][0-9][0-9]\\)$") match) (goto-char (point-min)) (while (and (setq match (re-search-forward re nil t)) @@ -83,7 +83,7 @@ tree can be found." (defun org-datetree-find-month-create (year month) (org-narrow-to-subtree) - (let ((re (format "^\\*+[ \t]+%d-\\([01][0-9]\\)[ \t]*$" year)) + (let ((re (format "^\\*+[ \t]+%d-\\([01][0-9]\\) \\w+$" year)) match) (goto-char (point-min)) (while (and (setq match (re-search-forward re nil t)) @@ -102,7 +102,7 @@ tree can be found." (defun org-datetree-find-day-create (year month day) (org-narrow-to-subtree) - (let ((re (format "^\\*+[ \t]+%d-%02d-\\([0123][0-9]\\)[ \t]*$" year month)) + (let ((re (format "^\\*+[ \t]+%d-%02d-\\([0123][0-9]\\) \\w+$" year month)) match) (goto-char (point-min)) (while (and (setq match (re-search-forward re nil t)) --8<---------------cut here---------------end--------------->8--- Nick