summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Lundin <mdl@imapmail.org>2012-05-25 13:16:26 -0500
committerBastien Guerry <bzg@altern.org>2012-05-25 23:22:09 +0200
commit8f2a921cf922b37d21f87fc06af406a25b2101a0 (patch)
tree533cdb3c4b547445bed0adaff59bfeafe5732971
parentb00eeb4d5a9b2f435d72f2b0b82c17c607ea4a1e (diff)
downloadorg-mode-8f2a921cf922b37d21f87fc06af406a25b2101a0.tar.gz
Allow datetree to find years with trailing whitespace.
* lisp/org-datetree.el: Fix regexp to allow datetree to find headings with trailing whitespace. This fixes a bug in which an existing datetree heading (e.g., "* 2012 ") would not be found by org-datetree-find-year-create if it had trailing whitespace. This can cause problems, for instance, if one is using column view on the date tree, since editing subheadings with column view adds whitespace at the end of the top heading.
-rw-r--r--lisp/org-datetree.el2
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/org-datetree.el b/lisp/org-datetree.el
index 192d1d6..8c04507 100644
--- a/lisp/org-datetree.el
+++ b/lisp/org-datetree.el
@@ -63,7 +63,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]\\)$")
+ (let ((re "^\\*+[ \t]+\\([12][0-9][0-9][0-9]\\)\\s-*$")
match)
(goto-char (point-min))
(while (and (setq match (re-search-forward re nil t))