diff options
Diffstat (limited to 'lisp/org/org-datetree.el')
-rw-r--r-- | lisp/org/org-datetree.el | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/org/org-datetree.el b/lisp/org/org-datetree.el index aea2c8d3d61..b4797de1e58 100644 --- a/lisp/org/org-datetree.el +++ b/lisp/org/org-datetree.el @@ -138,15 +138,16 @@ will be built under the headline at point." "^\\*+[ \t]+%d-%02d-\\([0123][0-9]\\) \\w+$" year month day)))) -(defun org-datetree--find-create (regex year &optional month day insert) - "Find the datetree matched by REGEX for YEAR, MONTH, or DAY. -REGEX is passed to `format' with YEAR, MONTH, and DAY as +(defun org-datetree--find-create + (regex-template year &optional month day insert) + "Find the datetree matched by REGEX-TEMPLATE for YEAR, MONTH, or DAY. +REGEX-TEMPLATE is passed to `format' with YEAR, MONTH, and DAY as arguments. Match group 1 is compared against the specified date component. If INSERT is non-nil and there is no match then it is inserted into the buffer." (when (or month day) (org-narrow-to-subtree)) - (let ((re (format regex year month day)) + (let ((re (format regex-template year month day)) match) (goto-char (point-min)) (while (and (setq match (re-search-forward re nil t)) |