mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-12-28 10:56:57 +00:00
Extract times when storing new diary entries from the agenda
This commit is contained in:
parent
ac719d6853
commit
d16b7cd8a7
@ -1,3 +1,9 @@
|
||||
2010-02-03 Stephen Eglen <stephen@gnu.org>
|
||||
|
||||
* org-agenda.el (org-agenda-add-entry-to-org-agenda-diary-file):
|
||||
Optionally extract time specification from text and add to the
|
||||
timestamp.
|
||||
|
||||
2010-02-03 Carsten Dominik <carsten.dominik@gmail.com>
|
||||
|
||||
* org-exp.el (org-html-entities): Fix typo.
|
||||
|
@ -6891,13 +6891,29 @@ the resulting entry will not be shown. When TEXT is empty, switch to
|
||||
(insert (format "%%%%(diary-anniversary %s) %s"
|
||||
(calendar-date-string d1 nil t) text))))
|
||||
((eq type 'day)
|
||||
(if (eq org-agenda-insert-diary-strategy 'top-level)
|
||||
(org-agenda-insert-diary-as-top-level text)
|
||||
(require 'org-datetree)
|
||||
(org-datetree-find-date-create d1)
|
||||
(org-agenda-insert-diary-make-new-entry text))
|
||||
(org-insert-time-stamp (org-time-from-absolute
|
||||
(calendar-absolute-from-gregorian d1)))
|
||||
(let*
|
||||
(fmt time time2
|
||||
(org-agenda-time-leading-zero t))
|
||||
(if org-agenda-search-headline-for-time
|
||||
;; Use org-format-agenda-item to parse text for a time-range and
|
||||
;; remove it.
|
||||
(setq fmt (org-format-agenda-item nil text nil nil t)
|
||||
time (get-text-property 0 'time fmt)
|
||||
time2 (if (> (length time) 0)
|
||||
;; split-string removes trailing ...... if
|
||||
;; no end time given. First space
|
||||
;; separates time from date.
|
||||
(concat " " (car (split-string time "\\.")))
|
||||
nil)
|
||||
text (get-text-property 0 'txt fmt)))
|
||||
(if (eq org-agenda-insert-diary-strategy 'top-level)
|
||||
(org-agenda-insert-diary-as-top-level text)
|
||||
(require 'org-datetree)
|
||||
(org-datetree-find-date-create d1)
|
||||
(org-agenda-insert-diary-make-new-entry text))
|
||||
(org-insert-time-stamp (org-time-from-absolute
|
||||
(calendar-absolute-from-gregorian d1))
|
||||
nil nil nil nil time2))
|
||||
(end-of-line 0))
|
||||
((eq type 'block)
|
||||
(if (> (calendar-absolute-from-gregorian d1)
|
||||
|
Loading…
Reference in New Issue
Block a user