Merge branch 'maint'
This commit is contained in:
commit
e4cb441915
|
@ -929,12 +929,7 @@ Store them in the capture property list."
|
||||||
(time-to-days prompt-time)))
|
(time-to-days prompt-time)))
|
||||||
(t
|
(t
|
||||||
;; current date, possibly corrected for late night workers
|
;; current date, possibly corrected for late night workers
|
||||||
(org-today)))))
|
(org-today))))))
|
||||||
;; If `org-datetree-add-timestamp' is non-nil, point is not
|
|
||||||
;; located on a headline. However `file+datetree' expects
|
|
||||||
;; a node where to paste captured tree. Thus, we make sure to
|
|
||||||
;; move to day heading.
|
|
||||||
(org-back-to-heading t))
|
|
||||||
|
|
||||||
((eq (car target) 'file+function)
|
((eq (car target) 'file+function)
|
||||||
(set-buffer (org-capture-target-buffer (nth 1 target)))
|
(set-buffer (org-capture-target-buffer (nth 1 target)))
|
||||||
|
|
|
@ -39,7 +39,8 @@ property (any value), the date tree will become a subtree under that entry,
|
||||||
so the base level will be properly adjusted.")
|
so the base level will be properly adjusted.")
|
||||||
|
|
||||||
(defcustom org-datetree-add-timestamp nil
|
(defcustom org-datetree-add-timestamp nil
|
||||||
"When non-nil, add a time stamp when create a datetree entry."
|
"When non-nil, add a time stamp matching date of entry.
|
||||||
|
Added time stamp is active unless value is `inactive'."
|
||||||
:group 'org-capture
|
:group 'org-capture
|
||||||
:version "24.3"
|
:version "24.3"
|
||||||
:type '(choice
|
:type '(choice
|
||||||
|
@ -131,28 +132,30 @@ tree can be found."
|
||||||
(org-datetree-insert-line year month day)))))
|
(org-datetree-insert-line year month day)))))
|
||||||
|
|
||||||
(defun org-datetree-insert-line (year &optional month day)
|
(defun org-datetree-insert-line (year &optional month day)
|
||||||
(let ((pos (point)) ts-type)
|
(delete-region (save-excursion (skip-chars-backward " \t\n") (point)) (point))
|
||||||
(skip-chars-backward " \t\n")
|
(insert "\n" (make-string org-datetree-base-level ?*) " \n")
|
||||||
(delete-region (point) pos)
|
(backward-char)
|
||||||
(insert "\n" (make-string org-datetree-base-level ?*) " \n")
|
(when month (org-do-demote))
|
||||||
(backward-char 1)
|
(when day (org-do-demote))
|
||||||
(if month (org-do-demote))
|
(insert (format "%d" year))
|
||||||
(if day (org-do-demote))
|
(when month
|
||||||
(insert (format "%d" year))
|
(insert
|
||||||
(when month
|
(format "-%02d" month)
|
||||||
(insert (format "-%02d" month))
|
(if day
|
||||||
(if day
|
(format "-%02d %s"
|
||||||
(insert (format "-%02d %s"
|
day
|
||||||
day (format-time-string
|
(format-time-string "%A" (encode-time 0 0 0 day month year)))
|
||||||
"%A" (encode-time 0 0 0 day month year))))
|
(format " %s"
|
||||||
(insert (format " %s"
|
(format-time-string "%B" (encode-time 0 0 0 1 month year))))))
|
||||||
(format-time-string
|
(when (and day org-datetree-add-timestamp)
|
||||||
"%B" (encode-time 0 0 0 1 month year))))))
|
(save-excursion
|
||||||
(when (and day (setq ts-type org-datetree-add-timestamp))
|
|
||||||
(insert "\n")
|
(insert "\n")
|
||||||
(org-indent-line)
|
(org-indent-line)
|
||||||
(org-insert-time-stamp (encode-time 0 0 0 day month year) nil ts-type))
|
(org-insert-time-stamp
|
||||||
(beginning-of-line 1)))
|
(encode-time 0 0 0 day month year)
|
||||||
|
nil
|
||||||
|
(eq org-datetree-add-timestamp 'inactive))))
|
||||||
|
(beginning-of-line))
|
||||||
|
|
||||||
(defun org-datetree-file-entry-under (txt date)
|
(defun org-datetree-file-entry-under (txt date)
|
||||||
"Insert a node TXT into the date tree under DATE."
|
"Insert a node TXT into the date tree under DATE."
|
||||||
|
|
Loading…
Reference in New Issue