浏览代码

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.
Matt Lundin 13 年之前
父节点
当前提交
8f2a921cf9
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      lisp/org-datetree.el

+ 1 - 1
lisp/org-datetree.el

@@ -63,7 +63,7 @@ tree can be found."
       (goto-char (prog1 (point) (widen))))))
       (goto-char (prog1 (point) (widen))))))
 
 
 (defun org-datetree-find-year-create (year)
 (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)
 	match)
     (goto-char (point-min))
     (goto-char (point-min))
     (while (and (setq match (re-search-forward re nil t))
     (while (and (setq match (re-search-forward re nil t))