summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2011-02-10 15:54:48 +0100
committerBastien Guerry <bzg@altern.org>2011-02-10 15:54:48 +0100
commita6554b2fdf40e8e76abf08f9a0364f0de75fa78b (patch)
tree12a7b873046c82aa06edf9b56bf8ba886b42bd27
parente4b762af3459fc9251ee1f3c66dccd2c83e420b1 (diff)
downloadorg-mode-a6554b2fdf40e8e76abf08f9a0364f0de75fa78b.tar.gz
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.
-rw-r--r--lisp/org-datetree.el6
1 files changed, 3 insertions, 3 deletions
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))