commit | author | age
|
76bbd0
|
1 |
;ELC |
C |
2 |
;;; Compiled |
|
3 |
;;; in Emacs version 26.1 |
|
4 |
;;; with all optimizations. |
|
5 |
|
|
6 |
;;; This file uses dynamic docstrings, first added in Emacs 19.29. |
|
7 |
|
|
8 |
;;; This file does not contain utf-8 non-ASCII characters, |
|
9 |
;;; and so can be loaded in Emacs versions earlier than 23. |
|
10 |
|
|
11 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
12 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
13 |
|
|
14 |
|
|
15 |
(require 'org) |
|
16 |
#@288 The level at which years should be placed in the date tree. |
|
17 |
This is normally one, but if the buffer has an entry with a |
|
18 |
DATE_TREE (or WEEK_TREE for ISO week entries) property (any |
|
19 |
value), the date tree will become a subtree under that entry, so |
|
20 |
the base level will be properly adjusted. |
|
21 |
(defvar org-datetree-base-level 1 (#$ . 424)) |
|
22 |
(byte-code "\300\301\302\303\304DD\305\306\307\310\311\312\313& \207" [custom-declare-variable org-datetree-add-timestamp funcall function #[0 "\300\207" [nil] 1] "When non-nil, add a time stamp matching date of entry.\nAdded time stamp is active unless value is `inactive'." :group org-capture :version "24.3" :type (choice (const :tag "Do not add a time stamp" nil) (const :tag "Add an inactive time stamp" inactive) (const :tag "Add an active time stamp" active))] 10) |
|
23 |
#@319 Find or create an entry for date D. |
|
24 |
If KEEP-RESTRICTION is non-nil, do not widen the buffer. |
|
25 |
When it is nil, the buffer will be widened to make sure an existing date |
|
26 |
tree can be found. If it is the symbol `subtree-at-point', then the tree |
|
27 |
will be built under the headline at point. |
|
28 |
|
|
29 |
(fn D &optional KEEP-RESTRICTION) |
|
30 |
(defalias 'org-datetree-find-date-create #[513 "\302\300!\210\303\214\211\304=\203( \305 \204 \306\307!\210~\210\310 \210\302\300!\210\311\312 \303\"\202F \211\204. ~\210\313\314!\211\203E \211b\210\302\300!\210\311\312 \303\"\310 \210\210eb\210\315 8)\211@)\211A@)\316\317\"\210\316\320#\210\316\321$\266\203)\207" [org-datetree-base-level date make-local-variable 1 subtree-at-point org-at-heading-p error "Not at heading" org-narrow-to-subtree org-get-valid-level org-current-level org-find-property "DATE_TREE" 2 org-datetree--find-create "^\\*+[ ]+\\([12][0-9]\\{3\\}\\)\\(\\s-*?\\([ ]:[[:alnum:]:_@#%%]+:\\)?\\s-*$\\)" "^\\*+[ ]+%d-\\([01][0-9]\\) \\w+$" "^\\*+[ ]+%d-%02d-\\([0123][0-9]\\) \\w+$"] 11 (#$ . 1236)]) |
|
31 |
#@380 Find or create an ISO week entry for date D. |
|
32 |
Compared to `org-datetree-find-date-create' this function creates |
|
33 |
entries ordered by week instead of months. |
|
34 |
When it is nil, the buffer will be widened to make sure an existing date |
|
35 |
tree can be found. If it is the symbol `subtree-at-point', then the tree |
|
36 |
will be built under the headline at point. |
|
37 |
|
|
38 |
(fn D &optional KEEP-RESTRICTION) |
|
39 |
(defalias 'org-datetree-find-iso-week-create #[513 "\306\300!\210\307\214\211\310=\203( \311 \204 \312\313!\210~\210\314 \210\306\300!\210\315\316 \307\"\202F \211\204. ~\210\317\320!\211\203E \211b\210\306\300!\210\315\316 \307\"\314 \210\210eb\210\321\322!\210\323 8)\211@)\211A@)\324\325\211\211&\326\211\323 8)\327\211\325U\203\202 \330\331!\202\317\325V\203\374 S\332 \211\211@) \211A@) \323 8)
\fS\333_\\,\f\323V\203\350 ,\334\f\335_\\\336\245Z,\211\325W\203\311 \337!S\335\246\325U\205\337 \340\246\325U?\206\337 \341\246\325U)\203\350 ,T,,-\n\342_\n\335\245\n\340\245[\n\341\245%\202\317\337T!\343 \211\211@) \211A@) \323 8)
\fS\333_\\,\f\323V\203^,\334\f\335_\\\336\245Z,\211\325W\203?\337!S\335\246\325U\205U\340\246\325U?\206U\341\246\325U)\203^,T,,-\n\342_\n\335\245\n\340\245[\n\341\245\344\211\211@) \211A@) \323 8)
\fS\333_\\,\f\323V\203\312,\334\f\335_\\\336\245Z,\211\325W\203\253\337!S\335\246\325U\205\301\340\246\325U?\206\301\341\246\325U)\203\312,T,,-&+!\3238@\345\346\327\211\347\350\n\"%\210\345\351\327\347\352\n\"%\210\345\353$\266\207)\207" [org-datetree-base-level date offset-years year month day make-local-variable 1 subtree-at-point org-at-heading-p error "Not at heading" org-narrow-to-subtree org-get-valid-level org-current-level org-find-property "WEEK_TREE" require cal-iso 2 encode-time 0 calendar-iso-from-absolute nil user-error "There was no year zero" + 31 23 4 10 abs 100 400 365 - (12 31 -1) org-datetree--find-create "^\\*+[ ]+\\([12][0-9]\\{3\\}\\)\\(\\s-*?\\([ ]:[[:alnum:]:_@#%%]+:\\)?\\s-*$\\)" format-time-string "%G" "^\\*+[ ]+%d-W\\([0-5][0-9]\\)$" "%G-W%V" "^\\*+[ ]+%d-%02d-\\([0123][0-9]\\) \\w+$" day-of-year] 18 (#$ . 2303)]) |
|
40 |
#@319 Find the datetree matched by REGEX for YEAR, MONTH, or DAY. |
|
41 |
REGEX is passed to `format' with YEAR, MONTH, and DAY as |
|
42 |
arguments. Match group 1 is compared against the specified date |
|
43 |
component. If INSERT is non-nil and there is no match then it is |
|
44 |
inserted into the buffer. |
|
45 |
|
|
46 |
(fn REGEX YEAR &optional MONTH DAY INSERT) |
|
47 |
(defalias 'org-datetree--find-create #[1282 "\204 \203 \300 \210\301$\302eb\210\303\302\304#\211\262\2039 \305\224b\2039 \306\307\305!!\2065 \2065 W\204 \211\204T db\210n\204G \310c\210\311$\202y \306\307\305!!\206c \206c U\203l \312 \202y \312 \210\311$\207" [org-narrow-to-subtree format nil re-search-forward t 1 string-to-number match-string "\n" org-datetree-insert-line beginning-of-line] 12 (#$ . 4489)]) |
|
48 |
#@38 |
|
49 |
|
|
50 |
(fn YEAR &optional MONTH DAY TEXT) |
|
51 |
(defalias 'org-datetree-insert-line #[1025 "\212\302\303x\210`)`|\210\304\305\306\"\307\261\210\310u\210\203 \311 \210\203$ \311 \210\211\203. \211c\210\202^ \312\313\"c\210\203^ \203N \314\315\316\317\211\211 &\"\202\\ \314\320\316\317\211\211\321 &\"c\210\203\201 \203\201 \212\304c\210\322 \210\323\316\317\211\211\n&\303 \324=#\210)\325 \207" [org-datetree-base-level org-datetree-add-timestamp " \n" nil "\n" make-string 42 " \n" -1 org-do-demote format "%d" format-time-string "-%m-%d %A" encode-time 0 "-%m %B" 1 org-indent-line org-insert-time-stamp inactive beginning-of-line] 13 (#$ . 5260)]) |
|
52 |
#@64 Insert a node TXT into the date tree under date D. |
|
53 |
|
|
54 |
(fn TXT D) |
|
55 |
(defalias 'org-datetree-file-entry-under #[514 "\301!\210\302 \303\"\304\305\211\"\210\306 \210\307\"\207" [outline-level org-datetree-find-date-create org-get-valid-level 1 org-end-of-subtree t org-back-over-empty-lines org-paste-subtree] 6 (#$ . 5933)]) |
|
56 |
#@209 Make sure all entries in the current tree are under the correct date. |
|
57 |
It may be useful to restrict the buffer to the applicable portion |
|
58 |
before running this command, even though the command tries to be smart. |
|
59 |
(defalias 'org-datetree-cleanup #[0 "eb\210\304\305Q\304 \305Q\306\n\307\310#\205\244 \3112\240 \312 \313\224Z]\313\224{\314\315\"\2046 \316\"\2046 \316\"\203; \317\311\307\"\210\320\321\322\313!!!\3238\3248\3258E\3268@A@`\327\310!\210`\330 \204g b\210\317\311\307\"\210\331\332!\204u b\210\317\311\307\"\210\331\333\334$!\203\213 b\210\317\311\307\"\210\211b\210\335 \210\212\214\336\337\313!\"*\266\207\2620\210\202 \207" [org-deadline-string org-scheduled-string org-ts-regexp org-ds-keyword-length "\\<" "\\>[ ]*\\'" re-search-forward nil t next line-beginning-position 0 string-suffix-p "-" string-match throw decode-time org-time-string-to-time match-string 4 3 5 2 org-back-to-heading org-up-heading-safe looking-at "\\*+[ ]+[0-9]+-[0-1][0-9]-[0-3][0-9]" format "\\*+[ ]+%d-%02d-%02d" org-cut-subtree org-datetree-file-entry-under current-kill] 16 (#$ . 6263) nil]) |
|
60 |
(provide 'org-datetree) |