-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathorg-agenda.el
11239 lines (10459 loc) · 442 KB
/
org-agenda.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
;;; org-agenda.el --- Dynamic task and appointment lists for Org -*- lexical-binding: t; -*-
;; Copyright (C) 2004-2025 Free Software Foundation, Inc.
;; Author: Carsten Dominik <[email protected]>
;; Keywords: outlines, hypermedia, calendar, text
;; URL: https://orgmode.org
;;
;; This file is part of GNU Emacs.
;;
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Commentary:
;; This file contains the code for creating and using the Agenda for Org.
;;
;; The functions `org-batch-agenda', `org-batch-agenda-csv', and
;; `org-batch-store-agenda-views' are implemented as macros to provide
;; a convenient way for extracting agenda information from the command
;; line. The Lisp does not evaluate parameters of a macro call; thus
;; it is not necessary to quote the parameters passed to one of those
;; functions. E.g. you can write:
;;
;; emacs -batch -l ~/.emacs -eval '(org-batch-agenda "a" org-agenda-span 7)'
;;
;; To export an agenda spanning 7 days. If `org-batch-agenda' would
;; have been implemented as a regular function you'd have to quote the
;; symbol org-agenda-span. Moreover: To use a symbol as parameter
;; value you would have to double quote the symbol.
;;
;; This is a hack, but it works even when running Org byte-compiled.
;;
;;; Code:
(require 'org-macs)
(org-assert-version)
(require 'cl-lib)
(require 'ol)
(require 'org-fold-core)
(require 'org)
(require 'org-macs)
(require 'org-refile)
(require 'org-element)
(declare-function diary-add-to-list "diary-lib"
(date string specifier &optional marker globcolor literal))
(declare-function calendar-iso-to-absolute "cal-iso" (date))
(declare-function calendar-astro-date-string "cal-julian" (&optional date))
(declare-function calendar-bahai-date-string "cal-bahai" (&optional date))
(declare-function calendar-chinese-date-string "cal-china" (&optional date))
(declare-function calendar-coptic-date-string "cal-coptic" (&optional date))
(declare-function calendar-ethiopic-date-string "cal-coptic" (&optional date))
(declare-function calendar-french-date-string "cal-french" (&optional date))
(declare-function calendar-goto-date "cal-move" (date))
(declare-function calendar-hebrew-date-string "cal-hebrew" (&optional date))
(declare-function calendar-islamic-date-string "cal-islam" (&optional date))
(declare-function calendar-iso-date-string "cal-iso" (&optional date))
(declare-function calendar-iso-from-absolute "cal-iso" (date))
(declare-function calendar-julian-date-string "cal-julian" (&optional date))
(declare-function calendar-mayan-date-string "cal-mayan" (&optional date))
(declare-function calendar-persian-date-string "cal-persia" (&optional date))
(declare-function calendar-check-holidays "holidays" (date))
(declare-function org-columns-remove-overlays "org-colview" ())
(declare-function org-datetree-find-date-create "org-datetree"
(date &optional keep-restriction))
(declare-function org-columns-quit "org-colview" ())
(declare-function diary-date-display-form "diary-lib" (&optional type))
(declare-function org-mobile-write-agenda-for-mobile "org-mobile" (file))
(declare-function org-habit-insert-consistency-graphs
"org-habit" (&optional line))
(declare-function org-is-habit-p "org-habit" (&optional pom))
(declare-function org-habit-parse-todo "org-habit" (&optional pom))
(declare-function org-habit-get-urgency "org-habit" (habit &optional moment))
(declare-function org-agenda-columns "org-colview" ())
(declare-function org-add-archive-files "org-archive" (files))
(declare-function org-capture "org-capture" (&optional goto keys))
(declare-function org-clock-modify-effort-estimate "org-clock" (&optional value))
(defvar calendar-mode-map)
(defvar org-clock-current-task)
(defvar org-current-tag-alist)
(defvar org-mobile-force-id-on-agenda-items)
(defvar org-habit-show-habits)
(defvar org-habit-show-habits-only-for-today)
(defvar org-habit-show-all-today)
(defvar org-habit-scheduled-past-days)
;; Defined somewhere in this file, but used before definition.
(defvar org-agenda-buffer-name "*Org Agenda*")
(defvar org-agenda-title-append nil)
(defvar org-agenda-overriding-header)
;; (with-no-warnings (defvar entry)) ;; unprefixed, from calendar.el
;; (with-no-warnings (defvar date)) ;; unprefixed, from calendar.el
(defvar original-date) ; dynamically scoped, calendar.el does scope this
(defvar org-agenda-undo-list nil
"List of undoable operations in the agenda since last refresh.")
(defvar org-agenda-pending-undo-list nil
"In a series of undo commands, this is the list of remaining undo items.")
(defcustom org-agenda-confirm-kill 1
"When set, remote killing from the agenda buffer needs confirmation.
When t, a confirmation is always needed. When a number N, confirmation is
only needed when the text to be killed contains more than N non-white lines."
:group 'org-agenda
:type '(choice
(const :tag "Never" nil)
(const :tag "Always" t)
(integer :tag "When more than N lines")))
(defcustom org-agenda-compact-blocks nil
"Non-nil means make the block agenda more compact.
This is done globally by leaving out lines like the agenda span
name and week number or the separator lines."
:group 'org-agenda
:type 'boolean)
(defcustom org-agenda-block-separator
(if (and (display-graphic-p)
(char-displayable-p ?─))
?─
?=)
"The separator between blocks in the agenda.
If this is a string, it will be used as the separator, with a newline added.
If it is a character, it will be repeated to fill the window width.
If nil the separator is disabled. In `org-agenda-custom-commands' this
addresses the separator between the current and the previous block."
:group 'org-agenda
:package-version '(Org . "9.6")
:type '(choice
(const :tag "Disabled" nil)
(character)
(string)))
(defgroup org-agenda-export nil
"Options concerning exporting agenda views in Org mode."
:tag "Org Agenda Export"
:group 'org-agenda)
(defcustom org-agenda-with-colors t
"Non-nil means use colors in agenda views."
:group 'org-agenda-export
:type 'boolean)
(defcustom org-agenda-exporter-settings nil
;; FIXME: Do we really want to evaluate those settings and thus force
;; the user to use `quote' all the time?
"Alist of variable/value pairs that should be active during agenda export.
This is a good place to set options for ps-print and for htmlize.
Note that the way this is implemented, the values will be evaluated
before assigned to the variables. So make sure to quote values you do
*not* want evaluated, for example
(setq org-agenda-exporter-settings
\\='((ps-print-color-p \\='black-white)))"
:group 'org-agenda-export
:type '(repeat
(list
(variable)
(sexp :tag "Value"))))
(defcustom org-agenda-before-write-hook '(org-agenda-add-entry-text)
"Hook run in a temporary buffer before writing the agenda to an export file.
A useful function for this hook is `org-agenda-add-entry-text'."
:group 'org-agenda-export
:type 'hook
:options '(org-agenda-add-entry-text))
(defcustom org-agenda-add-entry-text-maxlines 0
"Maximum number of entry text lines to be added to agenda.
This is only relevant when `org-agenda-add-entry-text' is part of
`org-agenda-before-write-hook', which is the default.
When this is 0, nothing will happen. When it is greater than 0, it
specifies the maximum number of lines that will be added for each entry
that is listed in the agenda view.
Note that this variable is not used during display, only when exporting
the agenda. For agenda display, see the variables `org-agenda-entry-text-mode'
and `org-agenda-entry-text-maxlines'."
:group 'org-agenda
:type 'integer)
(defcustom org-agenda-add-entry-text-descriptive-links t
"Non-nil means export org-links as descriptive links in agenda added text.
This variable applies to the text added to the agenda when
`org-agenda-add-entry-text-maxlines' is larger than 0.
When this variable is nil, the URL will (also) be shown."
:group 'org-agenda
:type 'boolean)
(defcustom org-agenda-export-html-style nil
"The style specification for exported HTML Agenda files.
If this variable contains a string, it will replace the default <style>
section as produced by `htmlize'.
Since there are different ways of setting style information, this variable
needs to contain the full HTML structure to provide a style, including the
surrounding HTML tags. The style specifications should include definitions
the fonts used by the agenda, here is an example:
<style type=\"text/css\">
p { font-weight: normal; color: gray; }
.org-agenda-structure {
font-size: 110%;
color: #003399;
font-weight: 600;
}
.org-todo {
color: #cc6666;
font-weight: bold;
}
.org-agenda-done {
color: #339933;
}
.org-done {
color: #339933;
}
.title { text-align: center; }
.todo, .deadline { color: red; }
.done { color: green; }
</style>
or, if you want to keep the style in a file,
<link rel=\"stylesheet\" type=\"text/css\" href=\"mystyles.css\">
As the value of this option simply gets inserted into the HTML <head> header,
you can \"misuse\" it to also add other text to the header."
:group 'org-agenda-export
:group 'org-export-html
:type '(choice
(const nil)
(string)))
(defcustom org-agenda-persistent-filter nil
"When set, keep filters from one agenda view to the next."
:group 'org-agenda
:type 'boolean)
(defgroup org-agenda-custom-commands nil
"Options concerning agenda views in Org mode."
:tag "Org Agenda Custom Commands"
:group 'org-agenda)
(defconst org-sorting-choice
'(choice
(const time-up) (const time-down)
(const timestamp-up) (const timestamp-down)
(const scheduled-up) (const scheduled-down)
(const deadline-up) (const deadline-down)
(const ts-up) (const ts-down)
(const tsia-up) (const tsia-down)
(const category-keep) (const category-up) (const category-down)
(const tag-down) (const tag-up)
(const priority-up) (const priority-down)
(const urgency-up) (const urgency-down)
(const todo-state-up) (const todo-state-down)
(const effort-up) (const effort-down)
(const habit-up) (const habit-down)
(const alpha-up) (const alpha-down)
(const user-defined-up) (const user-defined-down))
"Sorting choices.")
;; Keep custom values for `org-agenda-filter-preset' compatible with
;; the new variable `org-agenda-tag-filter-preset'.
(defvaralias 'org-agenda-filter-preset 'org-agenda-tag-filter-preset)
(defvaralias 'org-agenda-filter 'org-agenda-tag-filter)
(defvar org-agenda-entry-types '(:deadline :scheduled :timestamp :sexp)
"List of types searched for when creating the daily/weekly agenda.
This variable is a list of symbols that controls the types of
items that appear in the daily/weekly agenda. Allowed symbols in this
list are
:timestamp List items containing a date stamp or date range matching
the selected date. This includes sexp entries in angular
brackets.
:sexp List entries resulting from plain diary-like sexps.
:deadline List deadline due on that date. When the date is today,
also list any deadlines past due, or due within
`org-deadline-warning-days'.
:deadline* Same as above, but only include the deadline if it has an
hour specification as [h]h:mm.
:scheduled List all items which are scheduled for the given date.
The diary for *today* also contains items which were
scheduled earlier and are not yet marked DONE.
:scheduled* Same as above, but only include the scheduled item if it
has an hour specification as [h]h:mm.
By default, all four non-starred types are turned on.
When :scheduled* or :deadline* are included, :schedule or :deadline
will be ignored.
Never set this variable globally using `setq', because then it
will apply to all future agenda commands. Instead, bind it with
`let' to scope it dynamically into the agenda-constructing
command. A good way to set it is through options in
`org-agenda-custom-commands'. For a more flexible (though
somewhat less efficient) way of determining what is included in
the daily/weekly agenda, see `org-agenda-skip-function'.")
(defconst org-agenda-custom-commands-local-options
`(repeat :tag "Local settings for this command. Remember to quote values"
(choice :tag "Setting"
(list :tag "Heading for this block"
(const org-agenda-overriding-header)
(string :tag "Headline"))
(list :tag "Files to be searched"
(const org-agenda-files)
(list
(const :format "" quote)
(repeat (file))))
(list :tag "Sorting strategy"
(const org-agenda-sorting-strategy)
(list
(const :format "" quote)
(repeat
,org-sorting-choice)))
(list :tag "Prefix format"
(const org-agenda-prefix-format :value " %-12:c%?-12t% s")
(string))
(list :tag "Number of days in agenda"
(const org-agenda-span)
(list
(const :format "" quote)
(choice (const :tag "Day" day)
(const :tag "Week" week)
(const :tag "Fortnight" fortnight)
(const :tag "Month" month)
(const :tag "Year" year)
(integer :tag "Custom"))))
(list :tag "Fixed starting date"
(const org-agenda-start-day)
(string :value "2007-11-01"))
(list :tag "Start on day of week"
(const org-agenda-start-on-weekday)
(choice :value 1
(const :tag "Today" nil)
(integer :tag "Weekday No.")))
(list :tag "Include data from diary"
(const org-agenda-include-diary)
(boolean))
(list :tag "Deadline Warning days"
(const org-deadline-warning-days)
(integer :value 1))
(list :tag "Category filter preset"
(const org-agenda-category-filter-preset)
(list
(const :format "" quote)
(repeat
(string :tag "+category or -category"))))
(list :tag "Tags filter preset"
(const org-agenda-tag-filter-preset)
(list
(const :format "" quote)
(repeat
(string :tag "+tag or -tag"))))
(list :tag "Effort filter preset"
(const org-agenda-effort-filter-preset)
(list
(const :format "" quote)
(repeat
(string :tag "+=10 or -=10 or +<10 or ->10"))))
(list :tag "Regexp filter preset"
(const org-agenda-regexp-filter-preset)
(list
(const :format "" quote)
(repeat
(string :tag "+regexp or -regexp"))))
(list :tag "Set daily/weekly entry types"
(const org-agenda-entry-types)
(list
(const :format "" quote)
(set :greedy t :value ,org-agenda-entry-types
(const :deadline)
(const :scheduled)
(const :deadline*)
(const :scheduled*)
(const :timestamp)
(const :sexp))))
(list :tag "Columns format"
(const org-overriding-columns-format)
(string :tag "Format"))
(list :tag "Standard skipping condition"
:value (org-agenda-skip-function '(org-agenda-skip-entry-if))
(const org-agenda-skip-function)
(list
(const :format "" quote)
(list
(choice
:tag "Skipping range"
(const :tag "Skip entry" org-agenda-skip-entry-if)
(const :tag "Skip subtree" org-agenda-skip-subtree-if))
(repeat :inline t :tag "Conditions for skipping"
(choice
:tag "Condition type"
(list :tag "Regexp matches" :inline t
(const :format "" regexp)
(regexp))
(list :tag "Regexp does not match" :inline t
(const :format "" notregexp)
(regexp))
(list :tag "TODO state is" :inline t
(const todo)
(choice
(const :tag "Any not-done state" todo)
(const :tag "Any done state" done)
(const :tag "Any state" any)
(list :tag "Keyword list"
(const :format "" quote)
(repeat (string :tag "Keyword")))))
(list :tag "TODO state is not" :inline t
(const nottodo)
(choice
(const :tag "Any not-done state" todo)
(const :tag "Any done state" done)
(const :tag "Any state" any)
(list :tag "Keyword list"
(const :format "" quote)
(repeat (string :tag "Keyword")))))
(const :tag "scheduled" scheduled)
(const :tag "not scheduled" notscheduled)
(const :tag "deadline" deadline)
(const :tag "no deadline" notdeadline)
(const :tag "timestamp" timestamp)
(const :tag "no timestamp" nottimestamp))))))
(list :tag "Non-standard skipping condition"
:value (org-agenda-skip-function)
(const org-agenda-skip-function)
(sexp :tag "Function or form (quoted!)"))
(list :tag "Any variable"
(variable :tag "Variable")
(sexp :tag "Value (sexp)"))))
"Selection of examples for agenda command settings.
This will be spliced into the custom type of
`org-agenda-custom-commands'.")
(defcustom org-agenda-custom-commands
'(("n" "Agenda and all TODOs" ((agenda "") (alltodo ""))))
"Custom commands for the agenda.
\\<org-mode-map>
These commands will be offered on the splash screen displayed by the
agenda dispatcher `\\[org-agenda]'. Each entry is a list like this:
(key desc type match settings files)
key The key (one or more characters as a string) to be associated
with the command.
desc A description of the command. When omitted or nil, a default
description is built using MATCH.
type The command type, any of the following symbols:
agenda The daily/weekly agenda.
agenda* Appointments for current week/day.
todo Entries with a specific TODO keyword, in all agenda files.
search Entries containing search words entry or headline.
tags Tags/Property/TODO match in all agenda files.
tags-todo Tags/P/T match in all agenda files, TODO entries only.
todo-tree Sparse tree of specific TODO keyword in *current* file.
tags-tree Sparse tree with all tags matches in *current* file.
occur-tree Occur sparse tree for *current* file.
alltodo The global TODO list.
stuck Stuck projects.
... A user-defined function.
match What to search for:
- a single keyword for TODO keyword searches
- a tags/property/todo match expression for searches
- a word search expression for text searches.
- a regular expression for occur searches
For all other commands, this should be the empty string.
settings A list of option settings, similar to that in a let form, so like
this: ((opt1 val1) (opt2 val2) ...). The values will be
evaluated at the moment of execution, so quote them when needed.
files A list of files to write the produced agenda buffer to with
the command `org-store-agenda-views'.
If a file name ends in \".html\", an HTML version of the buffer
is written out. If it ends in \".ps\", a PostScript version is
produced. Otherwise, only the plain text is written to the file.
You can also define a set of commands, to create a composite agenda buffer.
In this case, an entry looks like this:
(key desc (cmd1 cmd2 ...) general-settings-for-whole-set files)
where
desc A description string to be displayed in the dispatcher menu.
cmd An agenda command, similar to the above. However, tree commands
are not allowed. Valid commands for a set are:
(agenda \"\" settings)
(agenda* \"\" settings)
(alltodo \"\" settings)
(stuck \"\" settings)
(todo \"match\" settings files)
(search \"match\" settings files)
(tags \"match\" settings files)
(tags-todo \"match\" settings files)
Each command can carry a list of options, and another set of options can be
given for the whole set of commands. Individual command options take
precedence over the general options.
When using several characters as key to a command, the first characters
are prefix commands. For the dispatcher to display useful information, you
should provide a description for the prefix, like
(setq org-agenda-custom-commands
\\='((\"h\" . \"HOME + Name tag searches\") ; describe prefix \"h\"
(\"hl\" tags \"+HOME+Lisa\")
(\"hp\" tags \"+HOME+Peter\")
(\"hk\" tags \"+HOME+Kim\")))
See also Info node `(org) Custom Agenda Views'."
:group 'org-agenda-custom-commands
:type `(repeat
(choice :value ("x" "Describe command here" tags "" nil)
(list :tag "Single command"
(string :tag "Access Key(s) ")
(option (string :tag "Description"))
(choice
(const :tag "Agenda" agenda)
(const :tag "TODO list" alltodo)
(const :tag "Search words" search)
(const :tag "Stuck projects" stuck)
(const :tag "Tags/Property match (all agenda files)" tags)
(const :tag "Tags/Property match of TODO entries (all agenda files)" tags-todo)
(const :tag "TODO keyword search (all agenda files)" todo)
(const :tag "Tags sparse tree (current buffer)" tags-tree)
(const :tag "TODO keyword tree (current buffer)" todo-tree)
(const :tag "Occur tree (current buffer)" occur-tree)
(sexp :tag "Other, user-defined function"))
(string :tag "Match (only for some commands)")
,org-agenda-custom-commands-local-options
(option (repeat :tag "Export" (file :tag "Export to"))))
(list :tag "Command series, all agenda files"
(string :tag "Access Key(s)")
(string :tag "Description ")
(repeat :tag "Component"
(choice
(list :tag "Agenda"
(const :format "" agenda)
(const :tag "" :format "" "")
,org-agenda-custom-commands-local-options)
(list :tag "TODO list (all keywords)"
(const :format "" alltodo)
(const :tag "" :format "" "")
,org-agenda-custom-commands-local-options)
(list :tag "Search words"
(const :format "" search)
(string :tag "Match")
,org-agenda-custom-commands-local-options)
(list :tag "Stuck projects"
(const :format "" stuck)
(const :tag "" :format "" "")
,org-agenda-custom-commands-local-options)
(list :tag "Tags/Property match (all agenda files)"
(const :format "" tags)
(string :tag "Match")
,org-agenda-custom-commands-local-options)
(list :tag "Tags/Property match of TODO entries (all agenda files)"
(const :format "" tags-todo)
(string :tag "Match")
,org-agenda-custom-commands-local-options)
(list :tag "TODO keyword search"
(const :format "" todo)
(string :tag "Match")
,org-agenda-custom-commands-local-options)
(list :tag "Other, user-defined function"
(symbol :tag "function")
(string :tag "Match")
,org-agenda-custom-commands-local-options)))
(repeat :tag "Settings for entire command set"
(list (variable :tag "Any variable")
(sexp :tag "Value")))
(option (repeat :tag "Export" (file :tag "Export to"))))
(cons :tag "Prefix key documentation"
(string :tag "Access Key(s)")
(string :tag "Description ")))))
(defcustom org-agenda-query-register ?o
"The register holding the current query string.
The purpose of this is that if you construct a query string interactively,
you can then use it to define a custom command."
:group 'org-agenda-custom-commands
:type 'character)
(defcustom org-stuck-projects
'("+LEVEL=2/-DONE" ("TODO" "NEXT" "NEXTACTION") nil "")
"How to identify stuck projects.
This is a list of four items:
1. A tags/todo/property matcher string that is used to identify a project.
See Info node `(org) Matching tags and properties' for a
description of tag and property searches. The entire tree
below a headline matched by this is considered one project.
2. A list of TODO keywords identifying non-stuck projects.
If the project subtree contains any headline with one of these todo
keywords, the project is considered to be not stuck. If you specify
\"*\" as a keyword, any TODO keyword will mark the project unstuck.
3. A list of tags identifying non-stuck projects.
If the project subtree contains any headline with one of these tags,
the project is considered to be not stuck. If you specify \"*\" as
a tag, any tag will mark the project unstuck. Note that this is about
the explicit presence of a tag somewhere in the subtree, inherited
tags do not count here. If inherited tags make a project not stuck,
use \"-TAG\" in the tags part of the matcher under (1.) above.
4. An arbitrary regular expression matching non-stuck projects.
If the project turns out to be not stuck, search continues also in the
subtree to see if any of the subtasks have project status.
See also the variable `org-tags-match-list-sublevels' which applies
to projects matched by this search as well.
After defining this variable, you may use `org-agenda-list-stuck-projects'
\(bound to `\\[org-agenda] #') to produce the list."
:group 'org-agenda-custom-commands
:type '(list
(string :tag "Tags/TODO match to identify a project")
(repeat :tag "Projects are *not* stuck if they have an entry with \
TODO keyword any of" (string))
(repeat :tag "Projects are *not* stuck if they have an entry with \
TAG being any of" (string))
(regexp :tag "Projects are *not* stuck if this regexp matches inside \
the subtree")))
(defgroup org-agenda-skip nil
"Options concerning skipping parts of agenda files."
:tag "Org Agenda Skip"
:group 'org-agenda)
(defcustom org-agenda-skip-function-global nil
"Function to be called at each match during agenda construction.
If this function returns nil, the current match should not be skipped.
If the function decided to skip an agenda match, is must return the
buffer position from which the search should be continued.
This may also be a Lisp form, which will be evaluated.
This variable will be applied to every agenda match, including
tags/property searches and TODO lists. So try to make the test function
do its checking as efficiently as possible. To implement a skipping
condition just for specific agenda commands, use the variable
`org-agenda-skip-function' which can be set in the options section
of custom agenda commands."
:group 'org-agenda-skip
:type 'sexp)
(defgroup org-agenda-daily/weekly nil
"Options concerning the daily/weekly agenda."
:tag "Org Agenda Daily/Weekly"
:group 'org-agenda)
(defgroup org-agenda-todo-list nil
"Options concerning the global todo list agenda view."
:tag "Org Agenda Todo List"
:group 'org-agenda)
(defgroup org-agenda-match-view nil
"Options concerning the general tags/property/todo match agenda view."
:tag "Org Agenda Match View"
:group 'org-agenda)
(defgroup org-agenda-search-view nil
"Options concerning the search agenda view."
:tag "Org Agenda Search View"
:group 'org-agenda)
(defvar org-agenda-archives-mode nil
"Non-nil means the agenda will include archived items.
If this is the symbol `trees', trees in the selected agenda scope
that are marked with the ARCHIVE tag will be included anyway. When this is
t, also all archive files associated with the current selection of agenda
files will be included.")
(defcustom org-agenda-restriction-lock-highlight-subtree t
"Non-nil means highlight the whole subtree when restriction is active.
Otherwise only highlight the headline. Highlighting the whole subtree is
useful to ensure no edits happen beyond the restricted region."
:group 'org-agenda
:type 'boolean)
(defcustom org-agenda-skip-comment-trees t
"Non-nil means skip trees that start with the COMMENT keyword.
When nil, these trees are also scanned by agenda commands."
:group 'org-agenda-skip
:type 'boolean)
(defcustom org-agenda-todo-list-sublevels t
"Non-nil means check also the sublevels of a TODO entry for TODO entries.
When nil, the sublevels of a TODO entry are not checked, resulting in
potentially much shorter TODO lists."
:group 'org-agenda-skip
:group 'org-agenda-todo-list
:type 'boolean)
(defcustom org-agenda-todo-ignore-with-date nil
"Non-nil means don't show entries with a date in the global todo list.
You can use this if you prefer to mark mere appointments with a TODO keyword,
but don't want them to show up in the TODO list.
When this is set, it also covers deadlines and scheduled items, the settings
of `org-agenda-todo-ignore-scheduled' and `org-agenda-todo-ignore-deadlines'
will be ignored.
See also the variable `org-agenda-tags-todo-honor-ignore-options'."
:group 'org-agenda-skip
:group 'org-agenda-todo-list
:type 'boolean)
(defcustom org-agenda-todo-ignore-timestamp nil
"Non-nil means don't show entries with a timestamp.
This applies when creating the global todo list.
Valid values are:
past Don't show entries for today or in the past.
future Don't show entries with a timestamp in the future.
The idea behind this is that if it has a future
timestamp, you don't want to think about it until the
date.
all Don't show any entries with a timestamp in the global todo list.
The idea behind this is that by setting a timestamp, you
have already \"taken care\" of this item.
This variable can also have an integer as a value. If positive (N),
todos with a timestamp N or more days in the future will be ignored. If
negative (-N), todos with a timestamp N or more days in the past will be
ignored. If 0, todos with a timestamp either today or in the future will
be ignored. For example, a value of -1 will exclude todos with a
timestamp in the past (yesterday or earlier), while a value of 7 will
exclude todos with a timestamp a week or more in the future.
See also `org-agenda-todo-ignore-with-date'.
See also the variable `org-agenda-tags-todo-honor-ignore-options' if you want
to make his option also apply to the tags-todo list."
:group 'org-agenda-skip
:group 'org-agenda-todo-list
:version "24.1"
:type '(choice
(const :tag "Ignore future timestamp todos" future)
(const :tag "Ignore past or present timestamp todos" past)
(const :tag "Ignore all timestamp todos" all)
(const :tag "Show timestamp todos" nil)
(integer :tag "Ignore if N or more days in past(-) or future(+).")))
(defcustom org-agenda-todo-ignore-scheduled nil
"Non-nil means, ignore some scheduled TODO items when making TODO list.
This applies when creating the global todo list.
Valid values are:
past Don't show entries scheduled today or in the past.
future Don't show entries scheduled in the future.
The idea behind this is that by scheduling it, you don't want to
think about it until the scheduled date.
all Don't show any scheduled entries in the global todo list.
The idea behind this is that by scheduling it, you have already
\"taken care\" of this item.
t Same as `all', for backward compatibility.
This variable can also have an integer as a value. See
`org-agenda-todo-ignore-timestamp' for more details.
See also `org-agenda-todo-ignore-with-date'.
See also the variable `org-agenda-tags-todo-honor-ignore-options' if you want
to make his option also apply to the tags-todo list."
:group 'org-agenda-skip
:group 'org-agenda-todo-list
:type '(choice
(const :tag "Ignore future-scheduled todos" future)
(const :tag "Ignore past- or present-scheduled todos" past)
(const :tag "Ignore all scheduled todos" all)
(const :tag "Ignore all scheduled todos (compatibility)" t)
(const :tag "Show scheduled todos" nil)
(integer :tag "Ignore if N or more days in past(-) or future(+).")))
(defcustom org-agenda-todo-ignore-deadlines nil
"Non-nil means ignore some deadline TODO items when making TODO list.
There are different motivations for using different values, please think
carefully when configuring this variable.
This applies when creating the global TODO list.
Valid values are:
near Don't show near deadline entries. A deadline is near when it is
closer than `org-deadline-warning-days' days. The idea behind this
is that such items will appear in the agenda anyway.
far Don't show TODO entries where a deadline has been defined, but
is not going to happen anytime soon. This is useful if you want to use
the TODO list to figure out what to do now.
past Don't show entries with a deadline timestamp for today or in the past.
future Don't show entries with a deadline timestamp in the future, not even
when they become `near' ones. Use it with caution.
all Ignore all TODO entries that do have a deadline.
t Same as `near', for backward compatibility.
This variable can also have an integer as a value. See
`org-agenda-todo-ignore-timestamp' for more details.
See also `org-agenda-todo-ignore-with-date'.
See also the variable `org-agenda-tags-todo-honor-ignore-options' if you want
to make his option also apply to the tags-todo list."
:group 'org-agenda-skip
:group 'org-agenda-todo-list
:type '(choice
(const :tag "Ignore near deadlines" near)
(const :tag "Ignore near deadlines (compatibility)" t)
(const :tag "Ignore far deadlines" far)
(const :tag "Ignore all TODOs with a deadlines" all)
(const :tag "Show all TODOs, even if they have a deadline" nil)
(integer :tag "Ignore if N or more days in past(-) or future(+).")))
(defcustom org-agenda-todo-ignore-time-comparison-use-seconds nil
"Time unit to use when possibly ignoring an agenda item.
See the docstring of various `org-agenda-todo-ignore-*' options.
The default is to compare time stamps using days. An item is thus
considered to be in the future if it is at least one day after today.
Non-nil means to compare time stamps using seconds. An item is then
considered future if it has a time value later than current time."
:group 'org-agenda-skip
:group 'org-agenda-todo-list
:version "24.4"
:package-version '(Org . "8.0")
:type '(choice
(const :tag "Compare time with days" nil)
(const :tag "Compare time with seconds" t)))
(defcustom org-agenda-tags-todo-honor-ignore-options nil
"Non-nil means honor todo-list ignores options also in tags-todo search.
The variables
`org-agenda-todo-ignore-with-date',
`org-agenda-todo-ignore-timestamp',
`org-agenda-todo-ignore-scheduled',
`org-agenda-todo-ignore-deadlines'
make the global TODO list skip entries that have time stamps of certain
kinds. If this option is set, the same options will also apply for the
tags-todo search, which is the general tags/property matcher
restricted to unfinished TODO entries only."
:group 'org-agenda-skip
:group 'org-agenda-todo-list
:group 'org-agenda-match-view
:type 'boolean)
(defcustom org-agenda-skip-scheduled-if-done nil
"Non-nil means don't show scheduled items in agenda when they are done.
This is relevant for the daily/weekly agenda, not for the TODO list. It
applies only to the actual date of the scheduling. Warnings about an item
with a past scheduling dates are always turned off when the item is DONE."
:group 'org-agenda-skip
:group 'org-agenda-daily/weekly
:type 'boolean)
(defcustom org-agenda-skip-scheduled-if-deadline-is-shown nil
"Non-nil means skip scheduling line if same entry shows because of deadline.
In the agenda of today, an entry can show up multiple times
because it is both scheduled and has a nearby deadline, and maybe
a plain time stamp as well.
When this variable is nil, the entry will be shown several times.
When set to t, then only the deadline is shown and the fact that
the entry is scheduled today or was scheduled previously is not
shown.
When set to the symbol `not-today', skip scheduled previously,
but not scheduled today."
:group 'org-agenda-skip
:group 'org-agenda-daily/weekly
:type '(choice
(const :tag "Never" nil)
(const :tag "Always" t)
(const :tag "Not when scheduled today" not-today))
:package-version '(Org . "9.7"))
(defcustom org-agenda-skip-timestamp-if-deadline-is-shown nil
"Non-nil means skip timestamp line if same entry shows because of deadline.
In the agenda of today, an entry can show up multiple times
because it has both a plain timestamp and has a nearby deadline.
When this variable is t, then only the deadline is shown and the
fact that the entry has a timestamp for or including today is not
shown. When this variable is nil, the entry will be shown
several times."
:group 'org-agenda-skip
:group 'org-agenda-daily/weekly
:version "24.1"
:type '(choice
(const :tag "Never" nil)
(const :tag "Always" t)))
(defcustom org-agenda-skip-deadline-if-done nil
"Non-nil means don't show deadlines when the corresponding item is done.
When nil, the deadline is still shown and should give you a happy feeling.
This is relevant for the daily/weekly agenda. It applies only to the
actual date of the deadline. Warnings about approaching and past-due
deadlines are always turned off when the item is DONE."
:group 'org-agenda-skip
:group 'org-agenda-daily/weekly
:type 'boolean)
(defcustom org-agenda-skip-deadline-prewarning-if-scheduled nil
"Non-nil means skip deadline prewarning when entry is also scheduled.
This will apply on all days where a prewarning for the deadline would
be shown, but not at the day when the entry is actually due. On that day,
the deadline will be shown anyway.
This variable may be set to nil, t, the symbol `pre-scheduled',
or a number which will then give the number of days before the actual
deadline when the prewarnings should resume. The symbol `pre-scheduled'
eliminates the deadline prewarning only prior to the scheduled date.
This can be used in a workflow where the first showing of the deadline will
trigger you to schedule it, and then you don't want to be reminded of it
because you will take care of it on the day when scheduled."
:group 'org-agenda-skip
:group 'org-agenda-daily/weekly
:version "24.1"
:type '(choice
(const :tag "Always show prewarning" nil)
(const :tag "Remove prewarning prior to scheduled date" pre-scheduled)
(const :tag "Remove prewarning if entry is scheduled" t)
(integer :tag "Restart prewarning N days before deadline")))
(defcustom org-agenda-skip-scheduled-delay-if-deadline nil
"Non-nil means skip scheduled delay when entry also has a deadline.
This variable may be set to nil, t, the symbol `post-deadline',
or a number which will then give the number of days after the actual
scheduled date when the delay should expire. The symbol `post-deadline'
eliminates the schedule delay when the date is posterior to the deadline."
:group 'org-agenda-skip
:group 'org-agenda-daily/weekly
:version "24.4"
:package-version '(Org . "8.0")
:type '(choice
(const :tag "Always honor delay" nil)
(const :tag "Ignore delay if posterior to the deadline" post-deadline)
(const :tag "Ignore delay if entry has a deadline" t)
(integer :tag "Honor delay up until N days after the scheduled date")))
(defcustom org-agenda-skip-additional-timestamps-same-entry nil
"When nil, multiple same-day timestamps in entry make multiple agenda lines.
When non-nil, after the search for timestamps has matched once in an
entry, the rest of the entry will not be searched."
:group 'org-agenda-skip
:type 'boolean)
(defcustom org-agenda-skip-timestamp-if-done nil
"Non-nil means don't select item by timestamp or -range if it is DONE."
:group 'org-agenda-skip
:group 'org-agenda-daily/weekly
:type 'boolean)
(defcustom org-agenda-dim-blocked-tasks t
"Non-nil means dim blocked tasks in the agenda display.
This causes some overhead during agenda construction, but if you
have turned on `org-enforce-todo-dependencies',
`org-enforce-todo-checkbox-dependencies', or any other blocking
mechanism, this will create useful feedback in the agenda.
Instead of t, this variable can also have the value `invisible'.
Then blocked tasks will be invisible and only become visible when
they become unblocked. An exemption to this behavior is when a task is
blocked because of unchecked checkboxes below it. Since checkboxes do
not show up in the agenda views, making this task invisible you remove any
trace from agenda views that there is something to do. Therefore, a task
that is blocked because of checkboxes will never be made invisible, it
will only be dimmed."
:group 'org-agenda-daily/weekly
:group 'org-agenda-todo-list
:version "24.3"
:type '(choice
(const :tag "Do not dim" nil)