|
@@ -51,11 +51,29 @@ Added time stamp is active unless value is `inactive'."
|
|
|
|
|
|
;;;###autoload
|
|
|
(defun org-datetree-find-date-create (d &optional keep-restriction)
|
|
|
- "Find or create an entry for date D.
|
|
|
+ "Find or create a day entry for date D.
|
|
|
If KEEP-RESTRICTION is non-nil, do not widen the buffer.
|
|
|
When it is nil, the buffer will be widened to make sure an existing date
|
|
|
tree can be found. If it is the symbol `subtree-at-point', then the tree
|
|
|
will be built under the headline at point."
|
|
|
+ (org-datetree--find-create-group d 'day keep-restriction))
|
|
|
+
|
|
|
+;;;###autoload
|
|
|
+(defun org-datetree-find-month-create (d &optional keep-restriction)
|
|
|
+ "Find or create a month entry for date D.
|
|
|
+Compared to `org-datetree-find-date-create' this function creates
|
|
|
+entries grouped by month instead of days.
|
|
|
+If KEEP-RESTRICTION is non-nil, do not widen the buffer.
|
|
|
+When it is nil, the buffer will be widened to make sure an existing date
|
|
|
+tree can be found. If it is the symbol `subtree-at-point', then the tree
|
|
|
+will be built under the headline at point."
|
|
|
+ (org-datetree--find-create-group d 'month keep-restriction))
|
|
|
+
|
|
|
+(defun org-datetree--find-create-group
|
|
|
+ (d time-grouping &optional keep-restriction)
|
|
|
+ "Find or create an entry for date D.
|
|
|
+If time-period is day, group entries by day. If time-period is
|
|
|
+month, then group entries by month."
|
|
|
(setq-local org-datetree-base-level 1)
|
|
|
(save-restriction
|
|
|
(if (eq keep-restriction 'subtree-at-point)
|
|
@@ -84,9 +102,10 @@ will be built under the headline at point."
|
|
|
(org-datetree--find-create
|
|
|
"^\\*+[ \t]+%d-\\([01][0-9]\\) \\w+$"
|
|
|
year month)
|
|
|
- (org-datetree--find-create
|
|
|
- "^\\*+[ \t]+%d-%02d-\\([0123][0-9]\\) \\w+$"
|
|
|
- year month day))))
|
|
|
+ (when (eq time-grouping 'day)
|
|
|
+ (org-datetree--find-create
|
|
|
+ "^\\*+[ \t]+%d-%02d-\\([0123][0-9]\\) \\w+$"
|
|
|
+ year month day)))))
|
|
|
|
|
|
;;;###autoload
|
|
|
(defun org-datetree-find-iso-week-create (d &optional keep-restriction)
|