summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <dominik@nb-dominik2.science.uva.nl>2008-01-31 11:34:34 +0100
committerCarsten Dominik <dominik@nb-dominik2.science.uva.nl>2008-01-31 11:34:34 +0100
commit895d70fff97d505ebd83ec2335b75b5c67b1c44c (patch)
tree1f9ce98dfd4565c28741ce4b6c446f55984c7eca
parent8ddd57dcb06914ed446dc821be108eb5ef584037 (diff)
downloadorg-mode-895d70fff97d505ebd83ec2335b75b5c67b1c44c.tar.gz
Release 4.74release_4.74
-rw-r--r--org614
-rw-r--r--org-install.el3
-rw-r--r--org.el528
-rw-r--r--org.pdfbin706850 -> 718235 bytes
-rw-r--r--org.texi254
-rw-r--r--orgcard.pdfbin58572 -> 58569 bytes
-rw-r--r--orgcard.tex2
7 files changed, 1063 insertions, 338 deletions
diff --git a/org b/org
index f3bded4..f82b69a 100644
--- a/org
+++ b/org
@@ -5,7 +5,7 @@ START-INFO-DIR-ENTRY
* Org Mode: (org). Outline-based notes management and organizer
END-INFO-DIR-ENTRY
- This manual is for Org-mode (version 4.72).
+ This manual is for Org-mode (version 4.74).
Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation
@@ -27,7 +27,7 @@ File: org, Node: Top, Next: Introduction, Prev: (dir), Up: (dir)
Org Mode Manual
***************
-This manual is for Org-mode (version 4.72).
+This manual is for Org-mode (version 4.74).
Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation
@@ -193,7 +193,8 @@ Custom agenda views
* Storing searches:: Type once, use often
* Block agenda:: All the stuff you need in a single buffer
* Setting Options:: Changing the rules
-* Batch processing:: Agenda views from the command line
+* Exporting Agenda Views:: Writing agendas to files.
+* Extracting Agenda Information for other programs::
Embedded LaTeX
@@ -549,7 +550,7 @@ Org-mode uses just two commands, bound to <TAB> and `S-<TAB>' to change
the visibility in the buffer.
`<TAB>'
- _Subtree cycling_: Rotate current subtree between the states
+ _Subtree cycling_: Rotate current subtree among the states
,-> FOLDED -> CHILDREN -> SUBTREE --.
'-----------------------------------'
@@ -562,7 +563,7 @@ the visibility in the buffer.
`S-<TAB>'
`C-u <TAB>'
- _Global cycling_: Rotate the entire buffer between the states
+ _Global cycling_: Rotate the entire buffer among the states
,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
'--------------------------------------'
@@ -1154,6 +1155,11 @@ Miscellaneous
Any prefix argument is passed on to the converter, which uses it
to determine the separator.
+`C-c |'
+ Tables can also be imported by pasting tabular text into the
+ org-mode buffer, selecting the pasted text with `C-x C-x' and then
+ using the `C-c |' command (see above under Creation and conversion.
+
`M-x org-table-export'
Export the table as a TAB-separated file. Useful for data
exchange with, for example, Excel or database programs.
@@ -2309,7 +2315,7 @@ for example:
The most important commands to work with TODO entries are:
`C-c C-t'
- Rotate the TODO state of the current item between
+ Rotate the TODO state of the current item among
,-> (unmarked) -> TODO -> DONE --.
'--------------------------------'
@@ -3994,6 +4000,17 @@ Calendar commands
Export a single iCalendar file containing entries from all agenda
files.
+Exporting to a file
+...................
+
+`C-x C-w'
+ Write the agenda view to a file. Depending on the extension of the
+ selected file name, the view will be exported as HTML (extension
+ `.html' or `.htm'), Postscript (extension `.ps'), or plain text
+ (any other extension). Use the variable
+ `org-agenda-exporter-settings' to set options for `ps-print' and
+ for `htmlize' to be used during export.
+
Quit and Exit
.............
@@ -4021,7 +4038,8 @@ dispatcher (*note Agenda dispatcher::), just like the default commands.
* Storing searches:: Type once, use often
* Block agenda:: All the stuff you need in a single buffer
* Setting Options:: Changing the rules
-* Batch processing:: Agenda views from the command line
+* Exporting Agenda Views:: Writing agendas to files.
+* Extracting Agenda Information for other programs::

File: org, Node: Storing searches, Next: Block agenda, Prev: Custom agenda views, Up: Custom agenda views
@@ -4107,7 +4125,7 @@ your agenda for the current week, all TODO items that carry the tag
`C-c a o' provides a similar view for office tasks.

-File: org, Node: Setting Options, Next: Batch processing, Prev: Block agenda, Up: Custom agenda views
+File: org, Node: Setting Options, Next: Exporting Agenda Views, Prev: Block agenda, Up: Custom agenda views
8.6.3 Setting Options for custom commands
-----------------------------------------
@@ -4149,7 +4167,8 @@ This would look like this:
'(("h" "Agenda and Home-related tasks"
((agenda)
(tags-todo "HOME")
- (tags "GARDEN" ((org-agenda-sorting-strategy '(priority-up)))))
+ (tags "GARDEN"
+ ((org-agenda-sorting-strategy '(priority-up)))))
((org-agenda-sorting-strategy '(priority-down))))
("o" "Agenda and Office-related tasks"
((agenda)
@@ -4164,31 +4183,199 @@ value is a string, you need to add the double quotes around the value
yourself.

-File: org, Node: Batch processing, Prev: Setting Options, Up: Custom agenda views
+File: org, Node: Exporting Agenda Views, Next: Extracting Agenda Information for other programs, Prev: Setting Options, Up: Custom agenda views
-8.6.4 Creating agenda views in batch processing
------------------------------------------------
+8.6.4 Exporting Agenda Views
+----------------------------
+
+If you are away from your computer, it can be very useful to have a
+printed version of some agenda views to carry around. Org-mode can
+export custom agenda views as plain text, HTML(1) and postscript. If
+you want to do this only occasionally, use the commend
+
+`C-x C-w'
+ Write the agenda view to a file. Depending on the extension of the
+ selected file name, the view will be exported as HTML (extension
+ `.html' or `.htm'), Postscript (extension `.ps'), or plain text
+ (any other extension). Use the variable
+ `org-agenda-exporter-settings' to set options for `ps-print' and
+ for `htmlize' to be used during export, for example
+ (setq org-agenda-exporter-settings
+ '((ps-number-of-columns 2)
+ (ps-landscape-mode t)
+ (htmlize-output-type 'inline-css)))
+
+ If you need to export certain agenda views frequently, you can
+associate any custom agenda command with a list of output file names
+(2). Here is an example that first does define custom commands for the
+agenda and the global todo list, together with a number of files to
+which to export them. Then we define two block agenda commands and
+specify filenames for them as well. File names can be relative to the
+current working directory, or absolute.
+
+ (setq org-agenda-custom-commands
+ '(("X" agenda "" nil ("agenda.html" "agenda.ps"))
+ ("Y" alltodo "" nil ("todo.html" "todo.txt" "todo.ps"))
+ ("h" "Agenda and Home-related tasks"
+ ((agenda)
+ (tags-todo "HOME")
+ (tags "GARDEN"))
+ nil
+ ("~/views/home.html"))
+ ("o" "Agenda and Office-related tasks"
+ ((agenda)
+ (tags-todo "WORK")
+ (tags "OFFICE"))
+ nil
+ ("~/views/office.ps"))))
+
+ The extension of the file name determines the type of export. If it
+is `.html', Org-mode will use the `htmlize.el' package to convert the
+buffer to HTML and save it to this file name. If the extension is
+`.ps', `ps-print-buffer-with-faces' is used to produce postscript
+output. Any other extension produces a plain ASCII file.
+
+ The export files are _not_ created when you use one of those
+commands interactively. Instead, there is a special command to produce
+_all_ specified files in one step:
+
+`C-c a e'
+ Export all agenda views that have export filenames associated with
+ them.
+
+ You can use the options section of the custom agenda commands to also
+set options for the export commands. For example:
-If you want to print or otherwise reprocess agenda views, it can be
-useful to create an agenda from the command line. This is the purpose
-of the function `org-batch-agenda'. It takes as a parameter one of the
-strings that are the keys in `org-agenda-custom-commands'. For
-example, to directly print the current TODO list, you could use
+ (setq org-agenda-custom-commands
+ '(("X" agenda ""
+ ((ps-number-of-columns 2)
+ (ps-landscape-mode t)
+ (org-agenda-prefix-format " [ ] ")
+ (org-agenda-with-colors nil)
+ (org-agenda-remove-tags t))
+ ("theagenda.ps"))))
+
+This command sets two options for the postscript exporter, to make it
+print in two columns in landscape format - the resulting page can be cut
+in two and then used in a paper agenda. The remaining settings modify
+the agenda prefix to omit category and scheduling information, and
+instead include a checkbox to check off items. We also remove the tags
+to make the lines compact, and we don't want to use colors for the
+black-and-white printer. Settings specified in
+`org-agenda-exporter-settings' will also apply, but the settings in
+`org-agenda-custom-commands' take precedence.
+
+From the command line you may also use
+ emacs -f org-batch-store-agenda-views -kill
+ or, if you need to modify some parameters
+ emacs -eval '(org-batch-store-agenda-views \
+ org-agenda-ndays 30 \
+ org-agenda-include-diary nil \
+ org-agenda-files (quote ("~/org/project.org")))' \
+ -kill
+ which will create the agenda views restricted to the file
+`~/org/project.org', without diary entries and with 30 days extent.
+
+ ---------- Footnotes ----------
+
+ (1) You need to install Hrvoje Niksic' `htmlize.el'.
+
+ (2) If you want to store standard views like the weekly agenda or
+the global TODO list as well, you need to define custom commands for
+them in order to be able to specify filenames.
+
+
+File: org, Node: Extracting Agenda Information for other programs, Prev: Exporting Agenda Views, Up: Custom agenda views
+
+8.6.5 Extracting Agenda Information for other programs
+------------------------------------------------------
+
+Org-mode provides commands to access agenda information for the command
+line in emacs batch mode. This extracted information can be sent
+directly to a printer, or it can be read by a program that does further
+processing of the data. The first of these commands is the function
+`org-batch-agenda', that produces an agenda view and sends it as ASCII
+text to STDOUT. The command takes a single string as parameter. If
+the string has length 1, it is used as a key to one of the commands you
+have configured in `org-agenda-custom-commands', basically any key you
+can use after `C-c a'. For example, to directly print the current TODO
+list, you could use
emacs -batch -l ~/.emacs -eval '(org-batch-agenda "t")' | lpr
+ If the parameter is a string with 2 or more characters, it is used
+as a tags/todo match string. For example, to print your local shopping
+list (all items with the tag `shop', but excluding the tag `NewYork'),
+you could use
+
+ emacs -batch -l ~/.emacs \
+ -eval '(org-batch-agenda "+shop-NewYork")' | lpr
+
You may also modify parameters on the fly like this:
emacs -batch -l ~/.emacs \
-eval '(org-batch-agenda "a" \
- org-agenda-ndays 300 \
+ org-agenda-ndays 30 \
org-agenda-include-diary nil \
org-agenda-files (quote ("~/org/project.org")))' \
| lpr
-which will produce a 300 day agenda, fully restricted to the Org file
+which will produce a 30 day agenda, fully restricted to the Org file
`~/org/projects.org', not even including the diary.
+ If you want to process the agenda data in more sophisticated ways,
+you can use the command `org-batch-agenda-csv' to get a comma-separated
+list of values for each agenda item. Each line in the output will
+contain a number of fields separated by commas. The fields in a line
+are:
+
+ category The category of the item
+ head The headline, without TODO kwd, TAGS and PRIORITY
+ type The type of the agenda entry, can be
+ todo selected in TODO match
+ tagsmatch selected in tags match
+ diary imported from diary
+ deadline a deadline
+ scheduled scheduled
+ timestamp appointment, selected by timestamp
+ closed entry was closed on date
+ upcoming-deadline warning about nearing deadline
+ past-scheduled forwarded scheduled item
+ block entry has date block including date
+ todo The todo keyword, if any
+ tags All tags including inherited ones, separated by colons
+ date The relevant date, like 2007-2-14
+ time The time, like 15:00-16:50
+ extra String with extra planning info
+ priority-l The priority letter if any was given
+ priority-n The computed numerical priority
+
+Time and date will only be given if a timestamp (or deadline/scheduled)
+lead to the selection of the item.
+
+ A CSV list like this is very easy to use in a post processing script.
+For example, here is a Perl program that gets the TODO list from
+Emacs/org-mode and prints all the items, preceded by a checkbox:
+
+ #!/usr/bin/perl
+
+ # define the Emacs command to run
+ $cmd = "emacs -batch -l ~/.emacs -eval '(org-batch-agenda-csv \"t\")'";
+
+ # run it and capture the output
+ $agenda = qx{$cmd 2>/dev/null};
+
+ # loop over all lines
+ foreach $line (split(/\n/,$agenda)) {
+
+ # get the individual values
+ ($category,$head,$type,$todo,$tags,$date,$time,$extra,
+ $priority_l,$priority_n) = split(/,/,$line);
+
+ # proccess and print
+ print "[ ] $head\n";
+ }
+

File: org, Node: Embedded LaTeX, Next: Exporting, Prev: Agenda views, Up: Top
@@ -6210,12 +6397,16 @@ Index
* agenda: Weekly/Daily agenda. (line 6)
* agenda dispatcher: Agenda dispatcher. (line 6)
* agenda files: Agenda files. (line 6)
-* agenda files, removing buffers: Agenda commands. (line 228)
+* agenda files, removing buffers: Agenda commands. (line 239)
* agenda views: Agenda views. (line 6)
* agenda views, custom: Custom agenda views. (line 6)
+* agenda views, exporting <1>: Exporting Agenda Views.
+ (line 6)
+* agenda views, exporting: Agenda commands. (line 228)
* agenda views, user-defined: Special agenda views.
(line 6)
-* agenda, batch production: Batch processing. (line 6)
+* agenda, pipe: Extracting Agenda Information for other programs.
+ (line 6)
* agenda, with block views: Block agenda. (line 6)
* align, STARTUP keyword: In-buffer settings. (line 29)
* allout.el: Conflicts. (line 6)
@@ -6316,6 +6507,9 @@ Index
* evaluate time range: Creating timestamps. (line 64)
* even, STARTUP keyword: In-buffer settings. (line 44)
* exporting: Exporting. (line 6)
+* exporting agenda views <1>: Exporting Agenda Views.
+ (line 12)
+* exporting agenda views: Agenda commands. (line 228)
* exporting, not: Comment lines. (line 6)
* extended TODO keywords: TODO extensions. (line 6)
* extension, third-party: Extensions. (line 6)
@@ -6507,6 +6701,8 @@ Index
* SCHEDULED keyword: Time stamps. (line 40)
* scheduling: Time stamps. (line 6)
* scheduling, repeating: Repeating items. (line 6)
+* Scripts, for agenda processing: Extracting Agenda Information for other programs.
+ (line 6)
* search option in file links: Search options. (line 6)
* search strings, custom: Custom searches. (line 6)
* searching for tags: Tag searches. (line 6)
@@ -6715,6 +6911,8 @@ Key Index
* C-c a #: Stuck projects. (line 13)
* C-c a a: Weekly/Daily agenda. (line 9)
* C-c a C: Storing searches. (line 9)
+* C-c a e: Exporting Agenda Views.
+ (line 57)
* C-c a M: Matching headline tags.
(line 15)
* C-c a m: Matching headline tags.
@@ -6836,6 +7034,9 @@ Key Index
(line 18)
* C-x C-s: Editing and debugging formulas.
(line 46)
+* C-x C-w <1>: Exporting Agenda Views.
+ (line 11)
+* C-x C-w: Agenda commands. (line 227)
* D: Agenda commands. (line 72)
* d: Agenda commands. (line 69)
* f: Agenda commands. (line 42)
@@ -6907,7 +7108,7 @@ Key Index
* o: Agenda commands. (line 65)
* P: Agenda commands. (line 140)
* p: Agenda commands. (line 20)
-* q: Agenda commands. (line 227)
+* q: Agenda commands. (line 238)
* r <1>: Agenda commands. (line 80)
* r: Global TODO list. (line 22)
* S: Agenda commands. (line 206)
@@ -6954,194 +7155,197 @@ Key Index
* T: Agenda commands. (line 124)
* t: Agenda commands. (line 111)
* w: Agenda commands. (line 66)
-* x: Agenda commands. (line 228)
+* x: Agenda commands. (line 239)
* X: Agenda commands. (line 183)

Tag Table:
Node: Top970
-Node: Introduction11536
-Node: Summary11951
-Node: Installation14960
-Node: Activation16338
-Node: Feedback17587
-Node: Document structure19663
-Node: Outlines20437
-Node: Headlines21097
-Ref: Headlines-Footnote-122105
-Node: Visibility cycling22204
-Ref: Visibility cycling-Footnote-124418
-Ref: Visibility cycling-Footnote-224476
-Ref: Visibility cycling-Footnote-324526
-Node: Motion24796
-Node: Structure editing25750
-Node: Archiving28576
-Node: ARCHIVE tag29134
-Node: Moving subtrees30927
-Node: Sparse trees32238
-Ref: Sparse trees-Footnote-134370
-Ref: Sparse trees-Footnote-234552
-Node: Plain lists34667
-Ref: Plain lists-Footnote-138436
-Ref: Plain lists-Footnote-238794
-Node: Tables38978
-Node: Built-in table editor39492
-Node: Narrow columns46511
-Ref: Narrow columns-Footnote-148444
-Node: orgtbl-mode48490
-Node: The spreadsheet49294
-Node: References50381
-Ref: References-Footnote-154510
-Node: Formula syntax for Calc54799
-Node: Formula syntax for Lisp57256
-Node: Field formulas58525
-Node: Column formulas59833
-Node: Editing and debugging formulas61432
-Node: Updating the table65585
-Node: Advanced features66620
-Node: Hyperlinks71145
-Node: Link format71918
-Node: Internal links73211
-Ref: Internal links-Footnote-175136
-Node: Radio targets75268
-Node: External links75959
-Node: Handling links78363
-Ref: Handling links-Footnote-183473
-Ref: Handling links-Footnote-283710
-Node: Link abbreviations83784
-Node: Search options85463
-Ref: Search options-Footnote-187243
-Node: Custom searches87324
-Node: Remember88372
-Node: Setting up remember89359
-Node: Remember templates89941
-Ref: Remember templates-Footnote-193233
-Node: Storing notes93331
-Node: TODO items95218
-Node: TODO basics96201
-Node: TODO extensions97900
-Node: Workflow states98719
-Ref: Workflow states-Footnote-199894
-Node: TODO types99987
-Ref: TODO types-Footnote-1101570
-Node: Multiple sets in one file101652
-Node: Per file keywords103263
-Ref: Per file keywords-Footnote-1104552
-Node: Priorities104753
-Node: Breaking down tasks105999
-Ref: Breaking down tasks-Footnote-1106519
-Node: Checkboxes106615
-Node: Timestamps109370
-Node: Time stamps109904
-Ref: Time stamps-Footnote-1113398
-Ref: Time stamps-Footnote-2113514
-Node: Creating timestamps113669
-Node: The date/time prompt116327
-Ref: The date/time prompt-Footnote-1118288
-Node: Custom time format118394
-Node: Repeating items119952
-Node: Progress logging121762
-Node: Closing items122408
-Ref: Closing items-Footnote-1123342
-Ref: Closing items-Footnote-2123411
-Node: Tracking TODO state changes123484
-Node: Clocking work time124340
-Ref: Clocking work time-Footnote-1127986
-Ref: Clocking work time-Footnote-2128064
-Node: Tags128190
-Node: Tag inheritance128952
-Node: Setting tags129889
-Ref: Setting tags-Footnote-1134412
-Ref: Setting tags-Footnote-2134524
-Node: Tag searches134607
-Node: Agenda views137318
-Node: Agenda files139263
-Ref: Agenda files-Footnote-1140229
-Ref: Agenda files-Footnote-2140378
-Node: Agenda dispatcher140571
-Node: Built-in agenda views142262
-Node: Weekly/Daily agenda142840
-Node: Global TODO list144969
-Node: Matching headline tags147241
-Node: Timeline148312
-Node: Stuck projects148978
-Node: Presentation and sorting150829
-Node: Categories151620
-Node: Time-of-day specifications152284
-Node: Sorting of agenda items154255
-Node: Agenda commands155537
-Node: Custom agenda views162266
-Node: Storing searches162941
-Node: Block agenda164853
-Node: Setting Options166083
-Node: Batch processing168795
-Node: Embedded LaTeX169925
-Ref: Embedded LaTeX-Footnote-1171017
-Node: Math symbols171207
-Node: Subscripts and Superscripts171972
-Node: LaTeX fragments172816
-Ref: LaTeX fragments-Footnote-1175050
-Node: Processing LaTeX fragments175312
-Node: CDLaTeX mode176258
-Ref: CDLaTeX mode-Footnote-1178742
-Node: Exporting178890
-Node: ASCII export180204
-Node: HTML export181494
-Node: Export commands182113
-Node: Quoting HTML tags182924
-Node: Links183554
-Node: Images184251
-Ref: Images-Footnote-1185122
-Node: CSS support185183
-Ref: CSS support-Footnote-1186502
-Node: XOXO export186615
-Node: iCalendar export187054
-Node: Text interpretation188273
-Node: Comment lines188815
-Node: Initial text189210
-Node: Enhancing text190884
-Ref: Enhancing text-Footnote-1192746
-Node: Export options192836
-Node: Publishing194729
-Ref: Publishing-Footnote-1195525
-Node: Configuration195721
-Node: Project alist196439
-Node: Sources and destinations197505
-Node: Selecting files198235
-Node: Publishing action198983
-Node: Publishing options200216
-Node: Publishing links202368
-Node: Project page index203881
-Node: Sample configuration204659
-Node: Simple example205151
-Node: Complex example205824
-Node: Triggering publication207900
-Node: Miscellaneous208585
-Node: Completion209219
-Node: Customization210690
-Node: In-buffer settings211273
-Node: The very busy C-c C-c key215899
-Node: Clean view217543
-Node: TTY keys220120
-Node: Interaction221730
-Node: Cooperation222127
-Node: Conflicts224869
-Node: Bugs226432
-Node: Extensions and Hacking227928
-Node: Extensions228524
-Node: Tables in arbitrary syntax230471
-Node: Radio tables231548
-Node: A LaTeX example234051
-Ref: A LaTeX example-Footnote-1237697
-Ref: A LaTeX example-Footnote-2237845
-Node: Translator functions238280
-Ref: Translator functions-Footnote-1241389
-Node: Dynamic blocks241477
-Node: Special agenda views243449
-Ref: Special agenda views-Footnote-1245728
-Node: History and Acknowledgments245988
-Node: Index251848
-Node: Key Index282975
+Node: Introduction11580
+Node: Summary11995
+Node: Installation15004
+Node: Activation16382
+Node: Feedback17631
+Node: Document structure19707
+Node: Outlines20481
+Node: Headlines21141
+Ref: Headlines-Footnote-122149
+Node: Visibility cycling22248
+Ref: Visibility cycling-Footnote-124458
+Ref: Visibility cycling-Footnote-224516
+Ref: Visibility cycling-Footnote-324566
+Node: Motion24836
+Node: Structure editing25790
+Node: Archiving28616
+Node: ARCHIVE tag29174
+Node: Moving subtrees30967
+Node: Sparse trees32278
+Ref: Sparse trees-Footnote-134410
+Ref: Sparse trees-Footnote-234592
+Node: Plain lists34707
+Ref: Plain lists-Footnote-138476
+Ref: Plain lists-Footnote-238834
+Node: Tables39018
+Node: Built-in table editor39532
+Node: Narrow columns46771
+Ref: Narrow columns-Footnote-148704
+Node: orgtbl-mode48750
+Node: The spreadsheet49554
+Node: References50641
+Ref: References-Footnote-154770
+Node: Formula syntax for Calc55059
+Node: Formula syntax for Lisp57516
+Node: Field formulas58785
+Node: Column formulas60093
+Node: Editing and debugging formulas61692
+Node: Updating the table65845
+Node: Advanced features66880
+Node: Hyperlinks71405
+Node: Link format72178
+Node: Internal links73471
+Ref: Internal links-Footnote-175396
+Node: Radio targets75528
+Node: External links76219
+Node: Handling links78623
+Ref: Handling links-Footnote-183733
+Ref: Handling links-Footnote-283970
+Node: Link abbreviations84044
+Node: Search options85723
+Ref: Search options-Footnote-187503
+Node: Custom searches87584
+Node: Remember88632
+Node: Setting up remember89619
+Node: Remember templates90201
+Ref: Remember templates-Footnote-193493
+Node: Storing notes93591
+Node: TODO items95478
+Node: TODO basics96461
+Node: TODO extensions98158
+Node: Workflow states98977
+Ref: Workflow states-Footnote-1100152
+Node: TODO types100245
+Ref: TODO types-Footnote-1101828
+Node: Multiple sets in one file101910
+Node: Per file keywords103521
+Ref: Per file keywords-Footnote-1104810
+Node: Priorities105011
+Node: Breaking down tasks106257
+Ref: Breaking down tasks-Footnote-1106777
+Node: Checkboxes106873
+Node: Timestamps109628
+Node: Time stamps110162
+Ref: Time stamps-Footnote-1113656
+Ref: Time stamps-Footnote-2113772
+Node: Creating timestamps113927
+Node: The date/time prompt116585
+Ref: The date/time prompt-Footnote-1118546
+Node: Custom time format118652
+Node: Repeating items120210
+Node: Progress logging122020
+Node: Closing items122666
+Ref: Closing items-Footnote-1123600
+Ref: Closing items-Footnote-2123669
+Node: Tracking TODO state changes123742
+Node: Clocking work time124598
+Ref: Clocking work time-Footnote-1128244
+Ref: Clocking work time-Footnote-2128322
+Node: Tags128448
+Node: Tag inheritance129210
+Node: Setting tags130147
+Ref: Setting tags-Footnote-1134670
+Ref: Setting tags-Footnote-2134782
+Node: Tag searches134865
+Node: Agenda views137576
+Node: Agenda files139521
+Ref: Agenda files-Footnote-1140487
+Ref: Agenda files-Footnote-2140636
+Node: Agenda dispatcher140829
+Node: Built-in agenda views142520
+Node: Weekly/Daily agenda143098
+Node: Global TODO list145227
+Node: Matching headline tags147499
+Node: Timeline148570
+Node: Stuck projects149236
+Node: Presentation and sorting151087
+Node: Categories151878
+Node: Time-of-day specifications152542
+Node: Sorting of agenda items154513
+Node: Agenda commands155795
+Node: Custom agenda views162949
+Node: Storing searches163668
+Node: Block agenda165580
+Node: Setting Options166810
+Node: Exporting Agenda Views169549
+Ref: Exporting Agenda Views-Footnote-1173840
+Ref: Exporting Agenda Views-Footnote-2173897
+Node: Extracting Agenda Information for other programs174083
+Node: Embedded LaTeX178209
+Ref: Embedded LaTeX-Footnote-1179301
+Node: Math symbols179491
+Node: Subscripts and Superscripts180256
+Node: LaTeX fragments181100
+Ref: LaTeX fragments-Footnote-1183334
+Node: Processing LaTeX fragments183596
+Node: CDLaTeX mode184542
+Ref: CDLaTeX mode-Footnote-1187026
+Node: Exporting187174
+Node: ASCII export188488
+Node: HTML export189778
+Node: Export commands190397
+Node: Quoting HTML tags191208
+Node: Links191838
+Node: Images192535
+Ref: Images-Footnote-1193406
+Node: CSS support193467
+Ref: CSS support-Footnote-1194786
+Node: XOXO export194899
+Node: iCalendar export195338
+Node: Text interpretation196557
+Node: Comment lines197099
+Node: Initial text197494
+Node: Enhancing text199168
+Ref: Enhancing text-Footnote-1201030
+Node: Export options201120
+Node: Publishing203013
+Ref: Publishing-Footnote-1203809
+Node: Configuration204005
+Node: Project alist204723
+Node: Sources and destinations205789
+Node: Selecting files206519
+Node: Publishing action207267
+Node: Publishing options208500
+Node: Publishing links210652
+Node: Project page index212165
+Node: Sample configuration212943
+Node: Simple example213435
+Node: Complex example214108
+Node: Triggering publication216184
+Node: Miscellaneous216869
+Node: Completion217503
+Node: Customization218974
+Node: In-buffer settings219557
+Node: The very busy C-c C-c key224183
+Node: Clean view225827
+Node: TTY keys228404
+Node: Interaction230014
+Node: Cooperation230411
+Node: Conflicts233153
+Node: Bugs234716
+Node: Extensions and Hacking236212
+Node: Extensions236808
+Node: Tables in arbitrary syntax238755
+Node: Radio tables239832
+Node: A LaTeX example242335
+Ref: A LaTeX example-Footnote-1245981
+Ref: A LaTeX example-Footnote-2246129
+Node: Translator functions246564
+Ref: Translator functions-Footnote-1249673
+Node: Dynamic blocks249761
+Node: Special agenda views251733
+Ref: Special agenda views-Footnote-1254012
+Node: History and Acknowledgments254272
+Node: Index260132
+Node: Key Index291936

End Tag Table
diff --git a/org-install.el b/org-install.el
index 650a4ec..1489a3f 100644
--- a/org-install.el
+++ b/org-install.el
@@ -22,6 +22,9 @@
(autoload 'org-export-icalendar-combine-agenda-files "org"
"Export all files in `org-agenda-files' to a single combined iCalendar file." t)
(autoload 'org-batch-agenda "org")
+(autoload 'org-store-agenda-views "org" "Store agenda views to files" t)
+(autoload 'org-batch-store-agenda-views "org")
+
(autoload 'org-publish-current-file "org-publish" "Publish current file." t)
(autoload 'org-publish-current-project "org-publish"
"Publish all files of current project." t)
diff --git a/org.el b/org.el
index 4b177c1..2005e33 100644
--- a/org.el
+++ b/org.el
@@ -5,7 +5,7 @@
;; Author: Carsten Dominik <dominik at science dot uva dot nl>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/
-;; Version: 4.72
+;; Version: 4.74
;;
;; This file is part of GNU Emacs.
;;
@@ -83,7 +83,7 @@
;;; Version
-(defconst org-version "4.72"
+(defconst org-version "4.74"
"The version number of the file org.el.")
(defun org-version ()
(interactive)
@@ -154,19 +154,12 @@ has been set."
:type 'boolean)
(defcustom org-replace-disputed-keys nil
- "Non-nil means use alternative key bindings for S-<cursor movement>.
-Org-mode used S-<cursor movement> for changing timestamps and priorities.
-S-<cursor movement> is also used for example by `CUA-mode' to select text.
-If you want to use Org-mode together with `CUA-mode', Org-mode needs to use
-alternative bindings. Setting this variable to t will replace the following
-keys both in Org-mode and in the Org-agenda buffer.
-
-S-up -> M-p
-S-down -> M-n
-S-left -> M--
-S-right -> M-+
-
-If you do not like the alternative keys, take a look at the variable
+ "Non-nil means use alternative key bindings for some keys.
+Org-mode uses S-<cursor> keys for changing timestamps and priorities.
+These keys are also used by other packages like `CUA-mode' or `windmove.el'.
+If you want to use Org-mode together with one of these other modes,
+or more generally if you would like to move some Org-mode commands to
+other keys, set this variable and configure the keys with the variable
`org-disputed-keys'.
This option is only relevant at load-time of Org-mode, and must be set
@@ -175,7 +168,8 @@ become effective."
:group 'org-startup
:type 'boolean)
-(defvaralias 'org-CUA-compatible 'org-replace-disputed-keys)
+(if (fboundp 'defvaralias)
+ (defvaralias 'org-CUA-compatible 'org-replace-disputed-keys))
(defcustom org-disputed-keys
'(([(shift up)] . [(meta p)])
@@ -197,13 +191,20 @@ therefore you'll have to restart Emacs to apply it after changing."
(defun org-key (key)
"Select key according to `org-replace-disputed-keys' and `org-disputed-keys'.
Or return the original if not disputed."
- (let* ((nkey (key-description key))
- (x (find-if (lambda (x)
- (equal (key-description (car x)) nkey))
- org-disputed-keys)))
- (cond ((not x) key)
- (org-replace-disputed-keys (cdr x))
- (t (car x)))))
+ (if org-replace-disputed-keys
+ (let* ((nkey (key-description key))
+ (x (org-find-if (lambda (x)
+ (equal (key-description (car x)) nkey))
+ org-disputed-keys)))
+ (if x (cdr x) key))
+ key))
+
+(defun org-find-if (predicate seq)
+ (catch 'exit
+ (while seq
+ (if (funcall predicate (car seq))
+ (throw 'exit (car seq))
+ (pop seq)))))
(defun org-defkey (keymap key def)
"Define a key, possibly translated, as returned by `org-key'."
@@ -1478,6 +1479,12 @@ the following lines anywhere in the buffer:
(const :tag "when TODO state changes" state)
(const :tag "when clocking out" clock-out))))
+(defcustom org-log-done-with-time t
+ "Non-nil means, the CLOSED time stamp will contain date and time.
+When nil, only the date will be recorded."
+ :group 'org-progress
+ :type 'boolean)
+
(defcustom org-log-note-headings
'((done . "CLOSING NOTE %t")
(state . "State %-12s %t")
@@ -1746,6 +1753,25 @@ forth between agenda and calendar."
:group 'org-agenda
:type 'sexp)
+(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
+ "Alist of variable/value pairs that should be active during agenda export.
+This is a good place to set uptions for ps-print and for htmlize."
+ :group 'org-agenda-export
+ :type '(repeat
+ (list
+ (variable)
+ (sexp :tag "Value"))))
+
(defgroup org-agenda-custom-commands nil
"Options concerning agenda views in Org-mode."
:tag "Org Agenda Custom Commands"
@@ -1756,7 +1782,7 @@ forth between agenda and calendar."
These commands will be offered on the splash screen displayed by the
agenda dispatcher \\[org-agenda]. Each entry is a list like this:
- (key type match options)
+ (key type match options files)
key The key (a single char as a string) to be associated with the command.
type The command type, any of the following symbols:
@@ -1772,11 +1798,16 @@ match What to search for:
- a regular expression for occur searches
options A list of option setttings, similar to that in a let form, so like
this: ((opt1 val1) (opt2 val2) ...)
+files A list of files file 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. Otherwide, 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-options)
+ (key desc (cmd1 cmd2 ...) general-options file)
where
@@ -1787,19 +1818,22 @@ cmd An agenda command, similar to the above. However, tree commands
(agenda)
(alltodo)
(stuck)
- (todo \"match\" options)
- (tags \"match\" options )
- (tags-todo \"match\" options)
+ (todo \"match\" options files)
+ (tags \"match\" options files)
+ (tags-todo \"match\" options 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."
:group 'org-agenda-custom-commands
:type '(repeat
- (choice
+ (choice :value ("a" tags "" nil)
(list :tag "Single command"
(string :tag "Key")
(choice
+ (const :tag "Agenda" agenda)
+ (const :tag "TODO list" alltodo)
+ (const :tag "Stuck projects" stuck)
(const :tag "Tags search (all agenda files)" tags)
(const :tag "Tags search of TODO entries (all agenda files)" tags-todo)
(const :tag "TODO keyword search (all agenda files)" todo)
@@ -1809,7 +1843,8 @@ precedence over the general options."
(symbol :tag "Other, user-defined function"))
(string :tag "Match")
(repeat :tag "Local options"
- (list (variable :tag "Option") (sexp :tag "Value"))))
+ (list (variable :tag "Option") (sexp :tag "Value")))
+ (option (repeat :tag "Export" (file :tag "Export to"))))
(list :tag "Command series, all agenda files"
(string :tag "Key")
(string :tag "Description")
@@ -1848,7 +1883,8 @@ precedence over the general options."
(repeat :tag "General options"
(list (variable :tag "Option")
- (sexp :tag "Value")))))))
+ (sexp :tag "Value")))
+ (option (repeat :tag "Export" (file :tag "Export to")))))))
(defcustom org-stuck-projects
'("+LEVEL=2/-DONE" ("TODO" "NEXT" "NEXTACTION") nil "")
@@ -1911,6 +1947,14 @@ This is relevant for the daily/weekly agenda, not for the TODO list."
:group 'org-agenda-skip
:type 'boolean)
+(defcustom org-agenda-skip-deadline-if-done nil
+ "Non-nil means don't show deadines 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."
+ :group 'org-agenda-skip
+ :type 'boolean)
+
(defcustom org-timeline-show-empty-dates 3
"Non-nil means, `org-timeline' also shows dates without an entry.
When nil, only the days which actually have entries are shown.
@@ -1942,7 +1986,7 @@ Needs to be set before org.el is loaded."
:type 'boolean)
(defcustom org-agenda-start-with-follow-mode nil
- "The initial value of follwo-mode in a newly created agenda window."
+ "The initial value of follow-mode in a newly created agenda window."
:group 'org-agenda-startup
:type 'boolean)
@@ -2209,7 +2253,7 @@ the prefix, you could use:
(setq org-agenda-prefix-format \" %-11:c% s\")
See also the variables `org-agenda-remove-times-when-in-prefix' and
-`org-agenda-remove-tags-when-in-prefix'."
+`org-agenda-remove-tags'."
:type '(choice
(string :tag "General format")
(list :greedy t :tag "View dependent"
@@ -2240,7 +2284,7 @@ the headline/diary entry."
(const :tag "Never" nil)
(const :tag "When at beginning of entry" beg)))
-(defcustom org-agenda-remove-tags-when-in-prefix nil
+(defcustom org-agenda-remove-tags nil
"Non-nil means, remove the tags from the headline copy in the agenda.
When this is the symbol `prefix', only remove tags when
`org-agenda-prefix-format' contains a `%T' specifier."
@@ -2250,6 +2294,10 @@ When this is the symbol `prefix', only remove tags when
(const :tag "Never" nil)
(const :tag "When prefix format contains %T" prefix)))
+(if (fboundp 'defvaralias)
+ (defvaralias 'org-agenda-remove-tags-when-in-prefix
+ 'org-agenda-remove-tags))
+
(defcustom org-agenda-align-tags-to-column 65
"Shift tags in agenda items to this column."
:group 'org-agenda-prefix
@@ -3209,6 +3257,9 @@ Also put tags into group 4 if tags are present.")
(defvar org-maybe-keyword-time-regexp nil
"Matches a timestamp, possibly preceeded by a keyword.")
(make-variable-buffer-local 'org-maybe-keyword-time-regexp)
+(defvar org-planning-or-clock-line-re nil
+ "Matches a line with planning or clock info.")
+(make-variable-buffer-local 'org-planning-or-clock-line-re)
(defconst org-rm-props '(invisible t face t keymap t intangible t mouse-face t
rear-nonsticky t mouse-map t fontified t)
@@ -3439,7 +3490,12 @@ means to push this value onto the list in the variable.")
"\\|" org-deadline-string
"\\|" org-closed-string
"\\|" org-clock-string "\\)\\)?"
- " *\\([[<][0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}[^]\r\n>]*?[]>]\\)"))
+ " *\\([[<][0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}[^]\r\n>]*?[]>]\\)")
+ org-planning-or-clock-line-re
+ (concat "\\(?:^[ \t]*\\(" org-scheduled-string
+ "\\|" org-deadline-string
+ "\\|" org-closed-string "\\|" org-clock-string "\\)\\>\\)")
+ )
(org-set-font-lock-defaults)))
@@ -3902,14 +3958,19 @@ The time stamps may be either active or inactive.")
(defun org-activate-plain-links (limit)
"Run through the buffer and add overlays to links."
- (if (re-search-forward org-plain-link-re limit t)
- (progn
- (add-text-properties (match-beginning 0) (match-end 0)
- (list 'mouse-face 'highlight
- 'rear-nonsticky t
- 'keymap org-mouse-map
- ))
- t)))
+ (catch 'exit
+ (let (f)
+ (while (re-search-forward org-plain-link-re limit t)
+ (setq f (get-text-property (match-beginning 0) 'face))
+ (if (or (eq f 'org-tag)
+ (and (listp f) (memq 'org-tag f)))
+ nil
+ (add-text-properties (match-beginning 0) (match-end 0)
+ (list 'mouse-face 'highlight
+ 'rear-nonsticky t
+ 'keymap org-mouse-map
+ ))
+ (throw 'exit t))))))
(defun org-activate-angle-links (limit)
"Run through the buffer and add overlays to links."
@@ -4078,12 +4139,12 @@ between words."
'("^[ \t]*\\(\\(|\\|\\+-[-+]\\).*\\S-\\)"
(1 'org-table))
;; Links
+ (if (memq 'tag lk) '(org-activate-tags (1 'org-tag prepend)))
(if (memq 'angle lk) '(org-activate-angle-links (0 'org-link t)))
(if (memq 'plain lk) '(org-activate-plain-links (0 'org-link t)))
(if (memq 'bracket lk) '(org-activate-bracket-links (0 'org-link t)))
(if (memq 'radio lk) '(org-activate-target-links (0 'org-link t)))
(if (memq 'date lk) '(org-activate-dates (0 'org-date t)))
- (if (memq 'tag lk) '(org-activate-tags (1 'org-tag prepend)))
'(org-hide-wide-columns (0 nil append))
;; TODO lines
(list (concat "^\\*+[ \t]*" org-not-done-regexp)
@@ -4411,10 +4472,12 @@ are at least `org-cycle-separator-lines' empty lines before the headeline."
"[ \t]*\\(\n[ \t]*\n\\*+\\) ")))))
beg end)
(cond
- ((memq state '(overview content t))
+ ((memq state '(overview contents t))
(setq beg (point-min) end (point-max)))
- ((memq state '(children))
- (setq beg (point) end (org-end-of-subtree t t))))
+ ((memq state '(children folded))
+ (setq beg (point) end (progn (org-end-of-subtree t t)
+ (beginning-of-line 2)
+ (point)))))
(when beg
(goto-char beg)
(while (re-search-forward re end t)
@@ -5457,7 +5520,7 @@ If the cursor is not in an item, throw an error."
(skip-chars-forward " \t")
(setq ind1 (current-column)))
(if (< ind1 ind)
- (throw 'exit (org-at-item-p)))))
+ (progn (beginning-of-line 1) (throw 'exit (org-at-item-p))))))
nil
(goto-char pos)
(error "Not in an item")))))
@@ -5719,8 +5782,10 @@ this heading."
;; Try to find a local archive location
(save-excursion
- (if (or (re-search-backward re nil t) (re-search-forward re nil t))
- (setq org-archive-location (match-string 1))))
+ (save-restriction
+ (widen)
+ (if (or (re-search-backward re nil t) (re-search-forward re nil t))
+ (setq org-archive-location (match-string 1)))))
(if (string-match "\\(.*\\)::\\(.*\\)" org-archive-location)
(progn
@@ -6023,8 +6088,9 @@ and table.el tables."
(defun org-table-create-or-convert-from-region (arg)
"Convert region to table, or create an empty table.
-If there is an active region, convert it to a table. If there is no such
-region, create an empty table."
+If there is an active region, convert it to a table, using the function
+`org-table-convert-region'.
+If there is no such region, create an empty table with `org-table-create'."
(interactive "P")
(if (org-region-active-p)
(org-table-convert-region (region-beginning) (region-end) arg)
@@ -6067,7 +6133,10 @@ SIZE is a string Columns x Rows like for example \"3x2\"."
The region goes from BEG0 to END0, but these borders will be moved
slightly, to make sure a beginning of line in the first line is included.
When NSPACE is non-nil, it indicates the minimum number of spaces that
-separate columns (default: just one space)."
+separate columns. By default, the function first checks if every line
+contains at lease one TAB. If yes, it assumes that the material is TAB
+separated. If not, it assumes a single space as separator."
+ ;; FIXME: Allow CSV?????
(interactive "rP")
(let* ((beg (min beg0 end0))
(end (max beg0 end0))
@@ -6489,9 +6558,13 @@ If the current field is not empty, it is copied down to the next row, and
the cursor is moved with it. Therefore, repeating this command causes the
column to be filled row-by-row.
If the variable `org-table-copy-increment' is non-nil and the field is an
-integer, it will be incremented while copying."
+integer or a timestamp, it will be incremented while copying. In the case of
+a timestamp, if the cursor is on the year, change the year. If it is on the
+month or the day, change that. Point will stay on the current date field
+in order to easily repeat the interval."
(interactive "p")
(let* ((colpos (org-table-current-column))
+ (col (current-column))
(field (org-table-get-field))
(non-empty (string-match "[^ \t]" field))
(beg (org-table-begin))
@@ -6519,8 +6592,12 @@ integer, it will be incremented while copying."
(string-match "^[0-9]+$" txt))
(setq txt (format "%d" (+ (string-to-number txt) 1))))
(insert txt)
- (org-table-maybe-recalculate-line)
- (org-table-align))
+ (move-to-column col)
+ (if (and org-table-copy-increment (org-at-timestamp-p t))
+ (org-timestamp-up 1)
+ (org-table-maybe-recalculate-line))
+ (org-table-align)
+ (move-to-column col))
(error "No non-empty field found"))))
(defun org-table-check-inside-data-field ()
@@ -10149,7 +10226,7 @@ optional argument IN-EMACS is non-nil, Emacs will visit the file."
(setq type (match-string 1) path (match-string 2))
(throw 'match t)))
(save-excursion
- (when (org-in-regexp "\\(:[A-Za-z_@0-9:]+\\):[ \t\r\n]")
+ (when (org-in-regexp "\\(:[A-Za-z_@0-9:]+\\):[ \t]*$")
(setq type "tags"
path (match-string 1))
(while (string-match ":" path)
@@ -11108,14 +11185,14 @@ See also the variable `org-reverse-note-order'."
;; Find the file
(if (not visiting) (find-file-noselect file))
(with-current-buffer (or visiting (get-file-buffer file))
- (save-excursion (and (goto-char (point-min))
- (not (re-search-forward "^\\* " nil t))
- (insert "\n* Notes\n")))
- (setq reversed (org-notes-order-reversed-p))
(save-excursion
(save-restriction
(widen)
-
+ (and (goto-char (point-min))
+ (not (re-search-forward "^\\* " nil t))
+ (insert "\n* Notes\n"))
+ (setq reversed (org-notes-order-reversed-p))
+
;; Find the default location
(when (and heading (stringp heading) (string-match "\\S-" heading))
(goto-char (point-min))
@@ -11124,13 +11201,13 @@ See also the variable `org-reverse-note-order'."
"\\([ \t]+:[@a-zA-Z0-9_:]*\\)?[ \t]*$")
nil t)
(setq org-goto-start-pos (match-beginning 0))))
-
+
;; Ask the User for a location
(setq spos (if fastp
org-goto-start-pos
(org-get-location (current-buffer) org-remember-help)))
(if (not spos) (throw 'quit nil)) ; return nil to show we did
- ; not handle this note
+ ; not handle this note
(goto-char spos)
(cond ((and (bobp) (not reversed))
;; Put it at the end, one level below level 1
@@ -11152,7 +11229,7 @@ See also the variable `org-reverse-note-order'."
(org-back-to-heading t)
(setq level (funcall outline-level))
(if reversed
- (outline-end-of-heading)
+ (outline-next-heading)
(org-end-of-subtree t))
(if (not (bolp)) (newline))
(beginning-of-line 1)
@@ -11704,9 +11781,11 @@ be removed."
((eq what 'deadline) org-deadline-string)
((eq what 'closed) org-closed-string))
" ")
- (org-insert-time-stamp time
- (or org-time-was-given (eq what 'closed))
- (eq what 'closed))
+ (org-insert-time-stamp
+ time
+ (or org-time-was-given
+ (and (eq what 'closed) org-log-done-with-time))
+ (eq what 'closed))
(end-of-line 1))
(goto-char (point-min))
(widen)
@@ -11782,23 +11861,24 @@ The auto-repeater uses this.")
"")))))
(if lines (setq note (concat note " \\\\")))
(push note lines))
- (save-excursion
- (set-buffer (marker-buffer org-log-note-marker))
+ (when lines
(save-excursion
- (goto-char org-log-note-marker)
- (move-marker org-log-note-marker nil)
- (end-of-line 1)
- (if (not (bolp)) (insert "\n")) (indent-relative nil)
- (setq ind (concat (buffer-substring (point-at-bol) (point)) " "))
- (insert " - " (pop lines))
- (while lines
- (insert "\n" ind (pop lines))))))
+ (set-buffer (marker-buffer org-log-note-marker))
+ (save-excursion
+ (goto-char org-log-note-marker)
+ (move-marker org-log-note-marker nil)
+ (end-of-line 1)
+ (if (not (bolp)) (insert "\n")) (indent-relative nil)
+ (setq ind (concat (buffer-substring (point-at-bol) (point)) " "))
+ (insert " - " (pop lines))
+ (while lines
+ (insert "\n" ind (pop lines)))))))
(set-window-configuration org-log-note-window-configuration)
(with-current-buffer (marker-buffer org-log-note-return-to)
(goto-char org-log-note-return-to))
(move-marker org-log-note-return-to nil)
(and org-log-post-message (message org-log-post-message)))
-
+
(defvar org-occur-highlights nil)
(make-variable-buffer-local 'org-occur-highlights)
@@ -11980,15 +12060,14 @@ evaluated, testing if a given set of tags qualifies a headline for
inclusion. When TODO-ONLY is non-nil, only lines with a TODO keyword
are included in the output."
(let* ((re (concat "[\n\r]" outline-regexp " *\\(\\<\\("
- (mapconcat 'regexp-quote
- (nreverse (cdr (reverse org-todo-keywords-1)))
- "\\|")
+ (mapconcat 'regexp-quote org-todo-keywords-1 "\\|")
"\\>\\)\\)? *\\(.*?\\)\\(:[A-Za-z_@0-9:]+:\\)?[ \t]*$"))
(props (list 'face nil
'done-face 'org-done
'undone-face nil
'mouse-face 'highlight
'org-not-done-regexp org-not-done-regexp
+ 'org-todo-regexp org-todo-regexp
'keymap org-agenda-keymap
'help-echo
(format "mouse-2 or RET jump to org file %s"
@@ -12023,7 +12102,7 @@ are included in the output."
(if org-use-tag-inheritance
(apply 'append (mapcar 'cdr tags-alist))
tags))
- (when (and (or (not todo-only) todo)
+ (when (and (or (not todo-only) (member todo org-not-done-keywords))
(eval matcher)
(or (not org-agenda-skip-archived-trees)
(not (member org-archive-tag tags-list))))
@@ -12044,7 +12123,7 @@ are included in the output."
(setq marker (org-agenda-new-marker))
(org-add-props txt props
'org-marker marker 'org-hd-marker marker 'org-category category
- 'priority priority)
+ 'priority priority 'type "tagsmatch")
(push txt rtn))
;; if we are to skip sublevels, jump to end of subtree
(or org-tags-match-list-sublevels (org-end-of-subtree t))))))
@@ -13629,7 +13708,7 @@ The following commands are available:
(org-defkey org-agenda-mode-map "d" 'org-agenda-day-view)
(org-defkey org-agenda-mode-map "w" 'org-agenda-week-view)
(org-defkey org-agenda-mode-map [(shift right)] 'org-agenda-date-later)
-(org-defkey org-agenda-mode-map [(shift right)] 'org-agenda-date-earlier)
+(org-defkey org-agenda-mode-map [(shift left)] 'org-agenda-date-earlier)
(org-defkey org-agenda-mode-map [?\C-c ?\C-x (right)] 'org-agenda-date-later)
(org-defkey org-agenda-mode-map [?\C-c ?\C-x (left)] 'org-agenda-date-earlier)
@@ -13647,6 +13726,7 @@ The following commands are available:
(org-defkey org-agenda-mode-map "r" 'org-agenda-redo)
(org-defkey org-agenda-mode-map "q" 'org-agenda-quit)
(org-defkey org-agenda-mode-map "x" 'org-agenda-exit)
+(org-defkey org-agenda-mode-map "\C-x\C-w" 'org-write-agenda)
(org-defkey org-agenda-mode-map "s" 'org-save-all-org-buffers)
(org-defkey org-agenda-mode-map "P" 'org-agenda-show-priority)
(org-defkey org-agenda-mode-map "T" 'org-agenda-show-tags)
@@ -13667,12 +13747,12 @@ The following commands are available:
(org-defkey org-agenda-mode-map "S" 'org-agenda-sunrise-sunset)
(org-defkey org-agenda-mode-map "h" 'org-agenda-holidays)
(org-defkey org-agenda-mode-map "H" 'org-agenda-holidays)
-(org-defkey org-agenda-mode-map "+" 'org-agenda-priority-up)
(org-defkey org-agenda-mode-map "I" 'org-agenda-clock-in)
(org-defkey org-agenda-mode-map "O" 'org-agenda-clock-out)
(org-defkey org-agenda-mode-map "X" 'org-agenda-clock-cancel)
+(org-defkey org-agenda-mode-map "+" 'org-agenda-priority-up)
(org-defkey org-agenda-mode-map "-" 'org-agenda-priority-down)
-(org-defkey org-agenda-mode-map [(shift right)] 'org-agenda-priority-up)
+(org-defkey org-agenda-mode-map [(shift up)] 'org-agenda-priority-up)
(org-defkey org-agenda-mode-map [(shift down)] 'org-agenda-priority-down)
(org-defkey org-agenda-mode-map [?\C-c ?\C-x (up)] 'org-agenda-priority-up)
(org-defkey org-agenda-mode-map [?\C-c ?\C-x (down)] 'org-agenda-priority-down)
@@ -13744,6 +13824,7 @@ The following commands are available:
:style toggle :selected org-agenda-include-diary :active (org-agenda-check-type nil 'agenda)]
["Use Time Grid" org-agenda-toggle-time-grid
:style toggle :selected org-agenda-use-time-grid :active (org-agenda-check-type nil 'agenda)])
+ ["Write view to file" org-write-agenda t]
["Rebuild buffer" org-agenda-redo t]
["Save all Org-mode Buffers" org-save-all-org-buffers t]
"--"
@@ -13859,7 +13940,8 @@ T Call `org-todo-list' to display the global todo list, select only
m Call `org-tags-view' to display headlines with tags matching
a condition (the user is prompted for the condition).
M Like `m', but select only TODO entries, no ordinary headlines.
-l Create a timeeline for the current buffer.
+l Create a timeline for the current buffer.
+e Export views to associated files.
More commands can be added by configuring the variable
`org-agenda-custom-commands'. In particular, specific tags and TODO keyword
@@ -13890,7 +13972,7 @@ next use of \\[org-agenda]) restricted to the current file."
(let ((header
"Press key for an agenda command:
-------------------------------- C Configure custom agenda commands
-a Agenda for current week or day
+a Agenda for current week or day e Export agenda views
t List of all TODO entries T Entries with special TODO kwd
m Match a TAGS query M Like m, but only TODO entries
L Timeline for current buffer # List stuck projects (!=configure)
@@ -13908,6 +13990,9 @@ L Timeline for current buffer # List stuck projects (!=configure)
'(face bold))
(cond
((stringp type) type)
+ ((eq type 'agenda) "Agenda for current week or day")
+ ((eq type 'alltodo) "List of all TODO entries")
+ ((eq type 'stuck) "List of stuck projects")
((eq type 'todo) "TODO keyword")
((eq type 'tags) "Tags query")
((eq type 'tags-todo) "Tags (TODO)")
@@ -13962,6 +14047,13 @@ L Timeline for current buffer # List stuck projects (!=configure)
(setq type (nth 1 entry) match (nth 2 entry) lprops (nth 3 entry)
lprops (nth 3 entry))
(cond
+ ((eq type 'agenda)
+ (org-let lprops '(org-agenda-list current-prefix-arg)))
+ ((eq type 'alltodo)
+ (org-let lprops '(org-todo-list current-prefix-arg)))
+ ((eq type 'stuck)
+ (org-let lprops '(org-agenda-list-stuck-projects
+ current-prefix-arg)))
((eq type 'tags)
(org-let lprops '(org-tags-view current-prefix-arg match)))
((eq type 'tags-todo)
@@ -13989,6 +14081,7 @@ L Timeline for current buffer # List stuck projects (!=configure)
((equal c ?T) (org-call-with-arg 'org-todo-list (or arg '(4))))
((equal c ?m) (call-interactively 'org-tags-view))
((equal c ?M) (org-call-with-arg 'org-tags-view (or arg '(4))))
+ ((equal c ?e) (call-interactively 'org-store-agenda-views))
((equal c ?L)
(unless restrict-ok
(error "This is not an Org-mode file"))
@@ -14009,11 +14102,14 @@ L Timeline for current buffer # List stuck projects (!=configure)
(setq type (car cmd) match (nth 1 cmd) lprops (nth 2 cmd))
(cond
((eq type 'agenda)
- (call-interactively 'org-agenda-list))
+ (org-let2 gprops lprops
+ '(call-interactively 'org-agenda-list)))
((eq type 'alltodo)
- (call-interactively 'org-todo-list))
+ (org-let2 gprops lprops
+ '(call-interactively 'org-todo-list)))
((eq type 'stuck)
- (call-interactively 'org-agenda-list-stuck-projects))
+ (org-let2 gprops lprops
+ '(call-interactively 'org-agenda-list-stuck-projects)))
((eq type 'tags)
(org-let2 gprops lprops
'(org-tags-view current-prefix-arg match)))
@@ -14034,18 +14130,184 @@ L Timeline for current buffer # List stuck projects (!=configure)
;;;###autoload
(defmacro org-batch-agenda (cmd-key &rest parameters)
- "Run an agenda command in batch mode, send result to STDOUT.
-CMD-KEY is a string that is also a key in `org-agenda-custom-commands'.
+ "Run an agenda command in batch mode and send the result to STDOUT.
+If CMD-KEY is a string of length 1, it is used as a key in
+`org-agenda-custom-commands' and triggers this command. If it is a
+longer string is is used as a tags/todo match string.
Paramters are alternating variable names and values that will be bound
before running the agenda command."
(let (pars)
(while parameters
(push (list (pop parameters) (if parameters (pop parameters))) pars))
- (flet ((read-char-exclusive () (string-to-char cmd-key)))
- (eval (list 'let (nreverse pars) '(org-agenda nil))))
+ (if (> (length cmd-key) 1)
+ (eval (list 'let (nreverse pars)
+ (list 'org-tags-view nil cmd-key)))
+ (flet ((read-char-exclusive () (string-to-char cmd-key)))
+ (eval (list 'let (nreverse pars) '(org-agenda nil)))))
(set-buffer "*Org Agenda*")
(princ (buffer-string))))
+(defvar org-agenda-info nil)
+
+;;;###autoload
+(defmacro org-batch-agenda-csv (cmd-key &rest parameters)
+ "Run an agenda command in batch mode and send the result to STDOUT.
+If CMD-KEY is a string of length 1, it is used as a key in
+`org-agenda-custom-commands' and triggers this command. If it is a
+longer string is is used as a tags/todo match string.
+Paramters are alternating variable names and values that will be bound
+before running the agenda command.
+
+The output gives a line for each selected agenda item. Each
+item is a list of comma-separated values, like this:
+
+category,head,type,todo,tags,date,time,extra,priority-l,priority-n
+
+category The category of the item
+head The headline, without TODO kwd, TAGS and PRIORITY
+type The type of the agenda entry, can be
+ todo selected in TODO match
+ tagsmatch selected in tags match
+ diary imported from diary
+ deadline a deadline on given date
+ scheduled scheduled on given date
+ timestamp entry has timestamp on given date
+ closed entry was closed on given date
+ upcoming-deadline warning about deadline
+ past-scheduled forwarded scheduled item
+ block entry has date block including g. date
+todo The todo keyword, if any
+tags All tags including inherited ones, separated by colons
+date The relevant date, like 2007-2-14
+time The time, like 15:00-16:50
+extra Sting with extra planning info
+priority-l The priority letter if any was given
+priority-n The computed numerical priority"
+
+ (let (pars)
+ (while parameters
+ (push (list (pop parameters) (if parameters (pop parameters))) pars))
+ (push (list 'org-agenda-remove-tags t) pars)
+ (if (> (length cmd-key) 1)
+ (eval (list 'let (nreverse pars)
+ (list 'org-tags-view nil cmd-key)))
+ (flet ((read-char-exclusive () (string-to-char cmd-key)))
+ (eval (list 'let (nreverse pars) '(org-agenda nil)))))
+ (set-buffer "*Org Agenda*")
+ (let* ((lines (org-split-string (buffer-string) "\n"))
+ line)
+ (while (setq line (pop lines))
+ (catch 'next
+ (if (not (get-text-property 0 'org-category line)) (throw 'next nil))
+ (setq org-agenda-info
+ (org-fix-agenda-info (text-properties-at 0 line)))
+ (princ
+ (mapconcat 'org-agenda-export-csv-mapper
+ '(org-category txt type todo tags date time-of-day extra
+ priority-letter priority)
+ ","))
+ (princ "\n"))))))
+
+(defun org-fix-agenda-info (props)
+ "FIXME"
+ (let (tmp re)
+ (when (setq tmp (plist-get props 'tags))
+ (setq props (plist-put props 'tags (mapconcat 'identity tmp ":"))))
+ (when (setq tmp (plist-get props 'date))
+ (if (integerp tmp) (setq tmp (calendar-gregorian-from-absolute tmp)))
+ (let ((calendar-date-display-form '(year "-" month "-" day)))
+ (setq tmp (calendar-date-string tmp)))
+ (setq props (plist-put props 'date tmp)))
+ (when (setq tmp (plist-get props 'txt))
+ (when (string-match "\\[#\\([A-Z]\\)\\] ?" tmp)
+ (plist-put props 'priority-letter (match-string 1 tmp))
+ (setq tmp (replace-match "" t t tmp)))
+ (when (and (setq re (plist-get props 'org-todo-regexp))
+ (setq re (concat "\\`\\.*" re " ?"))
+ (string-match re tmp))
+ (plist-put props 'todo (match-string 1 tmp))
+ (setq tmp (replace-match "" t t tmp)))
+ (plist-put props 'txt tmp)))
+ props)
+
+(defun org-agenda-export-csv-mapper (prop)
+ (let ((res (plist-get org-agenda-info prop)))
+ (setq res
+ (cond
+ ((not res) "")
+ ((stringp res) res)
+ (t (prin1-to-string res))))
+ (while (string-match "," res)
+ (setq res (replace-match ";" t t res)))
+ (org-trim res)))
+
+
+;;;###autoload
+(defun org-store-agenda-views (&rest parameters)
+ (interactive)
+ (org-batch-store-agenda-views))
+
+(defvar org-agenda-buffer-name)
+
+;;;###autoload
+(defmacro org-batch-store-agenda-views (&rest parameters)
+ "Run all custom agenda commands that have a file argument."
+ (let ((cmds org-agenda-custom-commands)
+ pars cmd thiscmdkey files file bs opts)
+ (while parameters
+ (push (list (pop parameters) (if parameters (pop parameters))) pars))
+ (setq pars (reverse pars))
+ (save-window-excursion
+ (while cmds
+ (setq cmd (pop cmds)
+ thiscmdkey (car cmd)
+ opts (nth 3 cmd)
+ files (org-last cmd))
+ (if (stringp files) (setq files (list files)))
+ (when files
+ (flet ((read-char-exclusive () (string-to-char thiscmdkey)))
+ (eval (list 'let (append org-agenda-exporter-settings opts pars)
+ '(org-agenda nil))))
+ (set-buffer "*Org Agenda*")
+ (while files
+ (eval (list 'let (append org-agenda-exporter-settings opts pars)
+ (list 'org-write-agenda (pop files) 'nosettings)))))
+ (kill-buffer org-agenda-buffer-name)))))
+
+(defun org-write-agenda (file &optional nosettings)
+ "Write the current buffer (an agenda view) as a file.
+Depending on the extension of the file name, plain text (.txt),
+HTML (.html or .htm) or Postscript (.ps) is produced.
+If NOSETTINGS is given, do not scope the settings of
+`org-agenda-exporter-settings' into the export commands. This is used when
+the settings have already been scoped and we do not wish to overrule other,
+higher priority settings."
+ (interactive "FWrite agenda to file: ")
+ (if (not (file-writable-p file))
+ (error "Cannot write agenda to file %s" file))
+ (org-let (if nosettings nil org-agenda-exporter-settings)
+ '(save-excursion
+ (save-window-excursion
+ (cond
+ ((string-match "\\.html?\\'" file)
+ (require 'htmlize)
+ (set-buffer (htmlize-buffer (current-buffer)))
+ (write-file file)
+ (kill-buffer (current-buffer))
+ (message "HTML written to %s" file))
+ ((string-match "\\.ps\\'" file)
+ (require 'ps-print)
+ (ps-print-buffer-with-faces file)
+ (message "Postscript written to %s" file))
+ (t
+ (let ((bs (buffer-string)))
+ (find-file file)
+ (insert bs)
+ (save-buffer 0)
+ (kill-buffer (current-buffer))
+ (message "Plain text written to %s" file))))))
+ (set-buffer org-agenda-buffer-name)))
+
(defmacro org-no-read-only (&rest body)
"Inhibit read-only for BODY."
`(let ((inhibit-read-only t)) ,@body))
@@ -14245,7 +14507,9 @@ Optional argument FILE means, use this file instead of the current."
(goto-char (point-min))
(while (org-activate-bracket-links (point-max))
(add-text-properties (match-beginning 0) (match-end 0)
- '(face org-link))))
+ '(face org-link)))
+ (unless org-agenda-with-colors
+ (remove-text-properties (point-min) (point-max) '(face nil))))
(run-hooks 'org-finalize-agenda-hook))))
(defun org-prepare-agenda-buffers (files)
@@ -14593,7 +14857,8 @@ NDAYS defaults to `org-agenda-ndays'."
(insert (org-finalize-agenda-entries rtnall) "\n")))
(setq s (point))
(insert (if (= nd 7) "Week-" "Day-") "agenda:\n")
- (add-text-properties s (1- (point)) (list 'face 'org-level-3))
+ (add-text-properties s (1- (point)) (list 'face 'org-level-3
+ 'org-date-line t))
(while (setq d (pop day-numbers))
(setq date (calendar-gregorian-from-absolute d)
s (point))
@@ -14898,7 +15163,8 @@ MATCH is being ignored."
(lambda (x)
(setq x (org-format-agenda-item "" x "Diary" nil 'time))
;; Extend the text properties to the beginning of the line
- (org-add-props x (text-properties-at (1- (length x)) x)))
+ (org-add-props x (text-properties-at (1- (length x)) x)
+ 'type "diary" 'date date))
entries)))))
(defun org-agenda-cleanup-fancy-diary ()
@@ -15007,6 +15273,7 @@ function from a program - use `org-agenda-get-day-entries' instead."
(list entry)
(org-agenda-files t)))
file rtn results)
+ (org-prepare-agenda-buffers files)
;; If this is called during org-agenda, don't return any entries to
;; the calendar. Org Agenda will list these entries itself.
(if org-disable-agenda-to-diary (setq files nil))
@@ -15098,6 +15365,7 @@ the documentation of `org-diary'."
(let* ((props (list 'face nil
'done-face 'org-done
'org-not-done-regexp org-not-done-regexp
+ 'org-todo-regexp org-todo-regexp
'mouse-face 'highlight
'keymap org-agenda-keymap
'help-echo
@@ -15137,7 +15405,8 @@ the documentation of `org-diary'."
priority (1+ (org-get-priority txt)))
(org-add-props txt props
'org-marker marker 'org-hd-marker marker
- 'priority priority 'org-category category)
+ 'priority priority 'org-category category
+ 'type "todo")
(push txt ee)
(if org-agenda-todo-list-sublevels
(goto-char (match-end 1))
@@ -15151,6 +15420,7 @@ the documentation of `org-diary'."
"Return the date stamp information for agenda display."
(let* ((props (list 'face nil
'org-not-done-regexp org-not-done-regexp
+ 'org-todo-regexp org-todo-regexp
'mouse-face 'highlight
'keymap org-agenda-keymap
'help-echo
@@ -15183,6 +15453,9 @@ the documentation of `org-diary'."
(and org-agenda-skip-scheduled-if-done
scheduledp donep
(throw :skip t))
+ (and org-agenda-skip-deadline-if-done
+ deadlinep donep
+ (throw :skip t))
(if (string-match ">" timestr)
;; substring should only run to end of time stamp
(setq timestr (substring timestr 0 (match-end 0))))
@@ -15205,14 +15478,18 @@ the documentation of `org-diary'."
(if deadlinep
(org-add-props txt nil
'face (if donep 'org-done 'org-warning)
+ 'type "deadline" 'date date
'undone-face 'org-warning 'done-face 'org-done
'org-category category 'priority (+ 100 priority))
(if scheduledp
(org-add-props txt nil
'face 'org-scheduled-today
+ 'type "scheduled" 'date date
'undone-face 'org-scheduled-today 'done-face 'org-done
'org-category category 'priority (+ 99 priority))
- (org-add-props txt nil 'priority priority 'org-category category)))
+ (org-add-props txt nil 'priority priority
+ 'org-category category 'date date
+ 'type "timestamp")))
(push txt ee))
(outline-next-heading)))
(nreverse ee)))
@@ -15221,6 +15498,7 @@ the documentation of `org-diary'."
"Return the logged TODO entries for agenda display."
(let* ((props (list 'mouse-face 'highlight
'org-not-done-regexp org-not-done-regexp
+ 'org-todo-regexp org-todo-regexp
'keymap org-agenda-keymap
'help-echo
(format "mouse-2 or RET jump to org file %s"
@@ -15264,6 +15542,7 @@ the documentation of `org-diary'."
(org-add-props txt props
'org-marker marker 'org-hd-marker hdmarker 'face 'org-done
'priority priority 'org-category category
+ 'type "closed" 'date date
'undone-face 'org-warning 'done-face 'org-done)
(push txt ee))
(outline-next-heading)))
@@ -15274,6 +15553,7 @@ the documentation of `org-diary'."
(let* ((wdays org-deadline-warning-days)
(props (list 'mouse-face 'highlight
'org-not-done-regexp org-not-done-regexp
+ 'org-todo-regexp org-todo-regexp
'keymap org-agenda-keymap
'help-echo
(format "mouse-2 or RET jump to org file %s"
@@ -15320,6 +15600,7 @@ the documentation of `org-diary'."
'org-hd-marker (org-agenda-new-marker pos1)
'priority (+ (- 10 diff) (org-get-priority txt))
'org-category category
+ 'type "upcoming-deadline" 'date d2
'face face 'undone-face face 'done-face 'org-done)
(push txt ee))))))
ee))
@@ -15328,6 +15609,7 @@ the documentation of `org-diary'."
"Return the scheduled information for agenda display."
(let* ((props (list 'face 'org-scheduled-previously
'org-not-done-regexp org-not-done-regexp
+ 'org-todo-regexp org-todo-regexp
'undone-face 'org-scheduled-previously
'done-face 'org-done
'mouse-face 'highlight
@@ -15371,6 +15653,7 @@ the documentation of `org-diary'."
(org-add-props txt props
'org-marker (org-agenda-new-marker pos)
'org-hd-marker (org-agenda-new-marker pos1)
+ 'type "past-scheduled" 'date d2
'priority (+ (- 5 diff) (org-get-priority txt))
'org-category category)
(push txt ee))))))
@@ -15380,6 +15663,7 @@ the documentation of `org-diary'."
"Return the date-range information for agenda display."
(let* ((props (list 'face nil
'org-not-done-regexp org-not-done-regexp
+ 'org-todo-regexp org-todo-regexp
'mouse-face 'highlight
'keymap org-agenda-keymap
'help-echo
@@ -15418,6 +15702,7 @@ the documentation of `org-diary'."
(setq txt org-agenda-no-heading-message))
(org-add-props txt props
'org-marker marker 'org-hd-marker hdmarker
+ 'type "block" 'date date
'priority (org-get-priority txt) 'org-category category)
(push txt ee)))
(goto-char pos)))
@@ -15512,8 +15797,8 @@ only the correctly processes TXT should be returned - this is used by
(when (string-match "\\([ \t]+\\)\\(:[a-zA-Z_@0-9:]+:\\)[ \t]*$" txt)
;; Tags are in the string
- (if (or (eq org-agenda-remove-tags-when-in-prefix t)
- (and org-agenda-remove-tags-when-in-prefix
+ (if (or (eq org-agenda-remove-tags t)
+ (and org-agenda-remove-tags
org-prefix-has-tag))
(setq txt (replace-match "" t t txt))
(setq txt (replace-match
@@ -15538,6 +15823,9 @@ only the correctly processes TXT should be returned - this is used by
'org-category (downcase category) 'tags tags
'prefix-length (- (length rtn) (length txt))
'time-of-day time-of-day
+ 'txt txt
+ 'time time
+ 'extra extra
'dotime dotime))))
(defvar org-agenda-sorting-strategy) ;; FIXME: can be removed?
@@ -16899,7 +17187,7 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]."
(texfile (concat texfilebase ".tex"))
(dvifile (concat texfilebase ".dvi"))
(pngfile (concat texfilebase ".png"))
- (fnh (face-attribute 'default :height nil 'inherit))
+ (fnh (face-attribute 'default :height nil))
(scale (or (plist-get options (if buffer :scale :html-scale)) 1.0))
(dpi (number-to-string (floor (* 0.9 (if buffer fnh 140.)))))
(fg (or (plist-get options (if buffer :foreground :html-foreground))
@@ -16939,9 +17227,7 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]."
"Return an rgb color specification for dvipng."
(apply 'format "rgb %s %s %s"
(mapcar 'org-normalize-color
- (color-values (face-attribute 'default attr nil 'inherit)))))
-
- (face-attribute 'default :height nil)
+ (color-values (face-attribute 'default attr nil)))))
(defun org-normalize-color (value)
"Return string to be used as color value for an RGB component."
@@ -16971,6 +17257,7 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]."
(:headline-levels . org-export-headline-levels)
(:section-numbers . org-export-with-section-numbers)
(:table-of-contents . org-export-with-toc)
+ (:preserve-breaks . org-export-preserve-breaks)
(:archived-trees . org-export-with-archived-trees)
(:emphasize . org-export-with-emphasize)
(:sub-superscript . org-export-with-sub-superscripts)
@@ -17436,6 +17723,7 @@ translations. There is currently no way for users to extend this.")
(re-quote (concat "^\\*+[ \t]+" org-quote-string "\\>"))
(htmlp (plist-get parameters :for-html))
(outline-regexp "\\*+")
+ a b
rtn p)
(save-excursion
(set-buffer (get-buffer-create " org-mode-tmp"))
@@ -17467,9 +17755,10 @@ translations. There is currently no way for users to extend this.")
(if (not (org-on-heading-p t))
(org-end-of-subtree t)
(beginning-of-line 1)
- (delete-region
- (if org-export-with-archived-trees (1+ (point-at-eol)) (point))
- (org-end-of-subtree t)))))
+ (setq a (if org-export-with-archived-trees
+ (1+ (point-at-eol)) (point))
+ b (org-end-of-subtree t))
+ (if (> b a) (delete-region a b)))))
;; Protect stuff from HTML processing
(goto-char (point-min))
@@ -18300,9 +18589,10 @@ lang=\"%s\" xml:lang=\"%s\">
(if org-export-with-section-numbers
(setq txt (concat (org-section-number level)
" " txt)))
+ (if (<= level (max umax umax-toc))
+ (setq head-count (+ head-count 1)))
(if (<= level umax-toc)
(progn
- (setq head-count (+ head-count 1))
(if (> level org-last-level)
(progn
(setq cnt (- level org-last-level))
@@ -18515,7 +18805,8 @@ lang=\"%s\" xml:lang=\"%s\">
txt (match-string 2 line))
(if (string-match quote-re0 txt)
(setq txt (replace-match "" t t txt)))
- (if (<= level umax) (setq head-count (+ head-count 1)))
+ (if (<= level (max umax umax-toc))
+ (setq head-count (+ head-count 1)))
(when in-local-list
;; Close any local lists before inserting a new header line
(while local-list-num
@@ -18983,7 +19274,6 @@ stacked delimiters is N. Escaping delimiters is not possible."
(setq string (replace-match (match-string 1 string) t t string)))
string))
-;; FIXME: what if the if does not match???????
(defun org-export-html-convert-emphasize (string)
"Apply emphasis."
(let ((s 0))
@@ -19053,7 +19343,7 @@ When TITLE is nil, just close all open levels."
(setq title (concat (org-section-number level) " " title)))
(setq level (+ level org-export-html-toplevel-hlevel -1))
(if with-toc
- (insert (format "\n<h%d><a name=\"sec-%d\">%s</a></h%d>\n"
+ (insert (format "\n<h%d id=\"sec-%d\">%s</h%d>\n"
level head-count title level))
(insert (format "\n<h%d>%s</h%d>\n" level title level)))
(org-open-par)))))
@@ -19358,6 +19648,8 @@ The XOXO buffer is named *xoxo-<source buffer name>*"
(unless (featurep 'xemacs)
(org-defkey org-mode-map [S-iso-lefttab] 'org-shifttab))
(org-defkey org-mode-map [(shift tab)] 'org-shifttab)
+(define-key org-mode-map (kbd "<backtab>") 'org-shifttab)
+
(org-defkey org-mode-map [(shift return)] 'org-table-copy-down)
(org-defkey org-mode-map [(meta shift return)] 'org-insert-todo-heading)
@@ -20708,6 +21000,14 @@ Show the heading too, if it is currently invisible."
;;;; Experimental code
+(defun org-get-item-columns ()
+ (save-excursion
+ (when (condition-case nil
+ (org-beginning-of-item)
+ (error nil))
+ (if (looking-at "\\([ \t]*\\)[-+*0-9.)]+")
+ (cons (progn (goto-char (match-end 1)) (current-column))
+ (progn (goto-char (match-end 0)) (1+ (current-column))))))))
;;;; Finish up
diff --git a/org.pdf b/org.pdf
index e96dfd6..0fe9442 100644
--- a/org.pdf
+++ b/org.pdf
Binary files differ
diff --git a/org.texi b/org.texi
index 9b2b84d..bb72cd4 100644
--- a/org.texi
+++ b/org.texi
@@ -3,7 +3,7 @@
@setfilename ../info/org
@settitle Org Mode Manual
-@set VERSION 4.72
+@set VERSION 4.74
@set DATE April 2007
@dircategory Emacs
@@ -224,7 +224,8 @@ Custom agenda views
* Storing searches:: Type once, use often
* Block agenda:: All the stuff you need in a single buffer
* Setting Options:: Changing the rules
-* Batch processing:: Agenda views from the command line
+* Exporting Agenda Views:: Writing agendas to files.
+* Extracting Agenda Information for other programs::
Embedded LaTeX
@@ -624,7 +625,7 @@ Org-mode uses just two commands, bound to @key{TAB} and
@table @kbd
@kindex @key{TAB}
@item @key{TAB}
-@emph{Subtree cycling}: Rotate current subtree between the states
+@emph{Subtree cycling}: Rotate current subtree among the states
@example
,-> FOLDED -> CHILDREN -> SUBTREE --.
@@ -646,7 +647,7 @@ argument (@kbd{C-u @key{TAB}}), global cycling is invoked.
@kindex S-@key{TAB}
@item S-@key{TAB}
@itemx C-u @key{TAB}
-@emph{Global cycling}: Rotate the entire buffer between the states
+@emph{Global cycling}: Rotate the entire buffer among the states
@example
,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
@@ -1300,6 +1301,10 @@ database, because these programs generally can write TAB-separated text
files. This command works by inserting the file into the buffer and
then converting the region to a table. Any prefix argument is passed on
to the converter, which uses it to determine the separator.
+@item C-c |
+Tables can also be imported by pasting tabular text into the org-mode
+buffer, selecting the pasted text with @kbd{C-x C-x} and then using the
+@kbd{C-c |} command (see above under @i{Creation and conversion}.
@c
@item M-x org-table-export
Export the table as a TAB-separated file. Useful for data exchange with,
@@ -1533,6 +1538,7 @@ non-standard convention that @samp{/} has lower precedence than
evaluation by @code{calc-eval} (@pxref{Calling Calc from
Your Programs,calc-eval,Calling calc from Your Lisp Programs,calc,GNU
Emacs Calc Manual}),
+@c FIXME: The link to the calc manual in HTML does not work.
variable substitution takes place according to the rules described above.
@cindex vectors, in table calculations
The range vectors can be directly fed into the calc vector functions
@@ -2570,7 +2576,7 @@ The most important commands to work with TODO entries are:
@kindex C-c C-t
@cindex cycling, of TODO states
@item C-c C-t
-Rotate the TODO state of the current item between
+Rotate the TODO state of the current item among
@example
,-> (unmarked) -> TODO -> DONE --.
@@ -4401,6 +4407,18 @@ Show holidays for three month around the cursor date.
@item C-c C-x C-c
Export a single iCalendar file containing entries from all agenda files.
+@tsubheading{Exporting to a file}
+@kindex C-x C-w
+@item C-x C-w
+@cindex exporting agenda views
+@cindex agenda views, exporting
+Write the agenda view to a file. Depending on the extension of the
+selected file name, the view will be exported as HTML (extension
+@file{.html} or @file{.htm}), Postscript (extension @file{.ps}), or
+plain text (any other extension). Use the variable
+@code{org-agenda-exporter-settings} to set options for @file{ps-print}
+and for @file{htmlize} to be used during export.
+
@tsubheading{Quit and Exit}
@kindex q
@item q
@@ -4429,7 +4447,8 @@ dispatcher (@pxref{Agenda dispatcher}), just like the default commands.
* Storing searches:: Type once, use often
* Block agenda:: All the stuff you need in a single buffer
* Setting Options:: Changing the rules
-* Batch processing:: Agenda views from the command line
+* Exporting Agenda Views:: Writing agendas to files.
+* Extracting Agenda Information for other programs::
@end menu
@node Storing searches, Block agenda, Custom agenda views, Custom agenda views
@@ -4521,7 +4540,7 @@ your agenda for the current week, all TODO items that carry the tag
command @kbd{C-c a o} provides a similar view for office tasks.
-@node Setting Options, Batch processing, Block agenda, Custom agenda views
+@node Setting Options, Exporting Agenda Views, Block agenda, Custom agenda views
@subsection Setting Options for custom commands
@cindex options, for custom agenda views
@@ -4569,7 +4588,8 @@ the results for GARDEN tags query in the opposite order,
'(("h" "Agenda and Home-related tasks"
((agenda)
(tags-todo "HOME")
- (tags "GARDEN" ((org-agenda-sorting-strategy '(priority-up)))))
+ (tags "GARDEN"
+ ((org-agenda-sorting-strategy '(priority-up)))))
((org-agenda-sorting-strategy '(priority-down))))
("o" "Agenda and Office-related tasks"
((agenda)
@@ -4585,36 +4605,234 @@ this interface, the @emph{values} are just lisp expressions. So if the
value is a string, you need to add the double quotes around the value
yourself.
-@node Batch processing, , Setting Options, Custom agenda views
-@subsection Creating agenda views in batch processing
-@cindex agenda, batch production
-If you want to print or otherwise reprocess agenda views, it can be
-useful to create an agenda from the command line. This is the purpose
-of the function @code{org-batch-agenda}. It takes as a parameter one of
-the strings that are the keys in @code{org-agenda-custom-commands}. For
-example, to directly print the current TODO list, you could use
+@node Exporting Agenda Views, Extracting Agenda Information for other programs, Setting Options, Custom agenda views
+@subsection Exporting Agenda Views
+@cindex agenda views, exporting
+
+If you are away from your computer, it can be very useful to have a
+printed version of some agenda views to carry around. Org-mode can
+export custom agenda views as plain text, HTML@footnote{You need to
+install Hrvoje Niksic' @file{htmlize.el}.} and postscript. If you want
+to do this only occasionally, use the commend
+
+@table @kbd
+@kindex C-x C-w
+@item C-x C-w
+@cindex exporting agenda views
+@cindex agenda views, exporting
+Write the agenda view to a file. Depending on the extension of the
+selected file name, the view will be exported as HTML (extension
+@file{.html} or @file{.htm}), Postscript (extension @file{.ps}), or
+plain text (any other extension). Use the variable
+@code{org-agenda-exporter-settings} to set options for @file{ps-print}
+and for @file{htmlize} to be used during export, for example
+@lisp
+(setq org-agenda-exporter-settings
+ '((ps-number-of-columns 2)
+ (ps-landscape-mode t)
+ (htmlize-output-type 'inline-css)))
+@end lisp
+@end table
+
+If you need to export certain agenda views frequently, you can associate
+any custom agenda command with a list of output file names
+@footnote{If you want to store standard views like the weekly agenda
+or the global TODO list as well, you need to define custom commands for
+them in order to be able to specify filenames.}. Here is an example
+that first does define custom commands for the agenda and the global
+todo list, together with a number of files to which to export them.
+Then we define two block agenda commands and specify filenames for them
+as well. File names can be relative to the current working directory,
+or absolute.
+
+@lisp
+@group
+(setq org-agenda-custom-commands
+ '(("X" agenda "" nil ("agenda.html" "agenda.ps"))
+ ("Y" alltodo "" nil ("todo.html" "todo.txt" "todo.ps"))
+ ("h" "Agenda and Home-related tasks"
+ ((agenda)
+ (tags-todo "HOME")
+ (tags "GARDEN"))
+ nil
+ ("~/views/home.html"))
+ ("o" "Agenda and Office-related tasks"
+ ((agenda)
+ (tags-todo "WORK")
+ (tags "OFFICE"))
+ nil
+ ("~/views/office.ps"))))
+@end group
+@end lisp
+
+The extension of the file name determines the type of export. If it is
+@file{.html}, Org-mode will use the @file{htmlize.el} package to convert
+the buffer to HTML and save it to this file name. If the extension is
+@file{.ps}, @code{ps-print-buffer-with-faces} is used to produce
+postscript output. Any other extension produces a plain ASCII file.
+
+The export files are @emph{not} created when you use one of those
+commands interactively. Instead, there is a special command to produce
+@emph{all} specified files in one step:
+
+@table @kbd
+@kindex C-c a e
+@item C-c a e
+Export all agenda views that have export filenames associated with
+them.
+@end table
+
+You can use the options section of the custom agenda commands to also
+set options for the export commands. For example:
+
+@lisp
+(setq org-agenda-custom-commands
+ '(("X" agenda ""
+ ((ps-number-of-columns 2)
+ (ps-landscape-mode t)
+ (org-agenda-prefix-format " [ ] ")
+ (org-agenda-with-colors nil)
+ (org-agenda-remove-tags t))
+ ("theagenda.ps"))))
+@end lisp
+
+@noindent
+This command sets two options for the postscript exporter, to make it
+print in two columns in landscape format - the resulting page can be cut
+in two and then used in a paper agenda. The remaining settings modify
+the agenda prefix to omit category and scheduling information, and
+instead include a checkbox to check off items. We also remove the tags
+to make the lines compact, and we don't want to use colors for the
+black-and-white printer. Settings specified in
+@code{org-agenda-exporter-settings} will also apply, but the settings
+in @code{org-agenda-custom-commands} take precedence.
+
+@noindent
+From the command line you may also use
+@example
+emacs -f org-batch-store-agenda-views -kill
+@end example
+@noindent
+or, if you need to modify some parameters
+@example
+emacs -eval '(org-batch-store-agenda-views \
+ org-agenda-ndays 30 \
+ org-agenda-include-diary nil \
+ org-agenda-files (quote ("~/org/project.org")))' \
+ -kill
+@end example
+@noindent
+which will create the agenda views restricted to the file
+@file{~/org/project.org}, without diary entries and with 30 days
+extent.
+
+@node Extracting Agenda Information for other programs, , Exporting Agenda Views, Custom agenda views
+@subsection Extracting Agenda Information for other programs
+@cindex agenda, pipe
+@cindex Scripts, for agenda processing
+
+Org-mode provides commands to access agenda information for the command
+line in emacs batch mode. This extracted information can be sent
+directly to a printer, or it can be read by a program that does further
+processing of the data. The first of these commands is the function
+@code{org-batch-agenda}, that produces an agenda view and sends it as
+ASCII text to STDOUT. The command takes a single string as parameter.
+If the string has length 1, it is used as a key to one of the commands
+you have configured in @code{org-agenda-custom-commands}, basically any
+key you can use after @kbd{C-c a}. For example, to directly print the
+current TODO list, you could use
@example
emacs -batch -l ~/.emacs -eval '(org-batch-agenda "t")' | lpr
@end example
+If the parameter is a string with 2 or more characters, it is used as a
+tags/todo match string. For example, to print your local shopping list
+(all items with the tag @samp{shop}, but excluding the tag
+@samp{NewYork}), you could use
+
+@example
+emacs -batch -l ~/.emacs \
+ -eval '(org-batch-agenda "+shop-NewYork")' | lpr
+@end example
+
@noindent
You may also modify parameters on the fly like this:
@example
emacs -batch -l ~/.emacs \
-eval '(org-batch-agenda "a" \
- org-agenda-ndays 300 \
+ org-agenda-ndays 30 \
org-agenda-include-diary nil \
org-agenda-files (quote ("~/org/project.org")))' \
| lpr
@end example
@noindent
-which will produce a 300 day agenda, fully restricted to the Org file
+which will produce a 30 day agenda, fully restricted to the Org file
@file{~/org/projects.org}, not even including the diary.
+If you want to process the agenda data in more sophisticated ways, you
+can use the command @code{org-batch-agenda-csv} to get a comma-separated
+list of values for each agenda item. Each line in the output will
+contain a number of fields separated by commas. The fields in a line
+are:
+
+@example
+category @r{The category of the item}
+head @r{The headline, without TODO kwd, TAGS and PRIORITY}
+type @r{The type of the agenda entry, can be}
+ todo @r{selected in TODO match}
+ tagsmatch @r{selected in tags match}
+ diary @r{imported from diary}
+ deadline @r{a deadline}
+ scheduled @r{scheduled}
+ timestamp @r{appointment, selected by timestamp}
+ closed @r{entry was closed on date}
+ upcoming-deadline @r{warning about nearing deadline}
+ past-scheduled @r{forwarded scheduled item}
+ block @r{entry has date block including date}
+todo @r{The todo keyword, if any}
+tags @r{All tags including inherited ones, separated by colons}
+date @r{The relevant date, like 2007-2-14}
+time @r{The time, like 15:00-16:50}
+extra @r{String with extra planning info}
+priority-l @r{The priority letter if any was given}
+priority-n @r{The computed numerical priority}
+@end example
+
+@noindent
+Time and date will only be given if a timestamp (or deadline/scheduled)
+lead to the selection of the item.
+
+A CSV list like this is very easy to use in a post processing script.
+For example, here is a Perl program that gets the TODO list from
+Emacs/org-mode and prints all the items, preceded by a checkbox:
+
+@example
+@group
+#!/usr/bin/perl
+
+# define the Emacs command to run
+$cmd = "emacs -batch -l ~/.emacs -eval '(org-batch-agenda-csv \"t\")'";
+
+# run it and capture the output
+$agenda = qx@{$cmd 2>/dev/null@};
+
+# loop over all lines
+foreach $line (split(/\n/,$agenda)) @{
+
+ # get the individual values
+ ($category,$head,$type,$todo,$tags,$date,$time,$extra,
+ $priority_l,$priority_n) = split(/,/,$line);
+
+ # proccess and print
+ print "[ ] $head\n";
+@}
+@end group
+@end example
+
@node Embedded LaTeX, Exporting, Agenda views, Top
@chapter Embedded LaTeX
@cindex @TeX{} interpretation
diff --git a/orgcard.pdf b/orgcard.pdf
index 797e2c2..8f07685 100644
--- a/orgcard.pdf
+++ b/orgcard.pdf
Binary files differ
diff --git a/orgcard.tex b/orgcard.tex
index ce84820..4e11c78 100644
--- a/orgcard.tex
+++ b/orgcard.tex
@@ -1,5 +1,5 @@
% Reference Card for Org Mode
-\def\orgversionnumber{4.72}
+\def\orgversionnumber{4.74}
\def\versionyear{2007} % latest update
\def\year{2007} % latest copyright year
%