summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <dominik@nb-dominik2.science.uva.nl>2008-01-31 11:36:57 +0100
committerCarsten Dominik <dominik@nb-dominik2.science.uva.nl>2008-01-31 11:36:57 +0100
commitd7bbcefe4fdd2a842ee631d892af2608e6ea3abc (patch)
treeca47e3a4b63d975a553cf8a3dea0110e4e8730e9
parent5bc700251734ba3aeb6bdd9d44f0286e49b33212 (diff)
downloadorg-mode-d7bbcefe4fdd2a842ee631d892af2608e6ea3abc.tar.gz
Release 5.13release_5.13
-rw-r--r--ChangeLog41
-rw-r--r--Makefile12
-rw-r--r--org870
-rw-r--r--org-install.el1
-rw-r--r--org.el1766
-rw-r--r--org.pdfbin811657 -> 818211 bytes
-rw-r--r--org.texi126
-rw-r--r--orgcard.pdfbin59070 -> 59285 bytes
-rw-r--r--orgcard.tex10
-rw-r--r--orgcard_letter.pdfbin58784 -> 58852 bytes
10 files changed, 1858 insertions, 968 deletions
diff --git a/ChangeLog b/ChangeLog
index c571886..b267694 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,43 @@
-2007-10-12 Carsten Dominik <dominik@science.uva.nl>
+2007-10-18 Carsten Dominik <dominik@science.uva.nl>
- * org.el (org-sort-entries): Rewrite using `sort-subr'.
- (org-set-property): More appropriate completion during
- interactive use.
+ * org.el (org-agenda-get-restriction-and-command): New function.
+ (org-agenda): Use `org-agenda-get-restriction-and-command'.
+ (org-todo-blocker-hook, org-todo-trigger-hook): New hook.
+ (org-entry-is-todo-p, org-entry-is-done-p, org-get-todo-state):
+ New functions.
+ (org-entry-add-to-multivalued-property)
+ (org-entry-remove-from-multivalued-property)
+ (org-entry-member-in-multivalued-property): New functions.
+ (org-remember-apply-template): Catch C-g and make sure window
+ configuration is restored.
+ (org-agenda-open-link): Make is work with several links in the
+ line.
+ (org-drawers, org-set-regexps-and-options)
+ (org-get-current-options): Added support for a DRAWERS in-buffer
+ option.
+ (org-agenda-window-frame-fractions): New option.
+ (org-fit-agenda-window): Use `org-agenda-window-frame-fractions'.
+ (org-columns-cleanup-item, org-find-entry-with-id)
+ (org-insert-columns-dblock, org-listtable-to-string)
+ (org-dblock-write:columnview, org-columns-capture-view)
+ (org-edit-headline): New functions.
+ (org-agenda-to-appt): Require calendar.
+ (org-entry-get-with-inheritance): Widen for search.
+ (org-columns-display-here): Don't mark buffer as modified when
+ adding space characters to accomodate column overlays.
+ (org-export-as-html): Better formatting of tags in the toc.
+ (org-columns-display-here): Make the ITEM column as compact as
+ possible.
+ (org-remember-templates): Customization interface improved.
+ (org-export-with-property-drawer): Variable removed.
+ (org-export-with-drawers): New option.
+ (org-complex-heading-regexp): New variable.
+ (org-sort-entries): Rewrite using `sort-subr'.
+ (org-set-property): More appropriate completion during interactive
+ use.
(org-sort-entries): Allow sorting by property.
(org-additional-option-like-keywords): Added more values.
+ (org-sort-entries-or-items): Renamed from `org-sort-entries'.
----------------------------------------------------------------------
diff --git a/Makefile b/Makefile
index c4afac4..2852cf3 100644
--- a/Makefile
+++ b/Makefile
@@ -167,11 +167,13 @@ release:
$(MKDIR) org-release
cp org-$(TAG).zip org-$(TAG).tar.gz org-release
cp org.pdf orgcard.pdf org.texi org.html org-release
- cp ORGWEBPAGE/tmp/*.html org-release
- cp ORGWEBPAGE/tmp/*.el org-release
- cp ORGWEBPAGE/tmp/*.txt org-release
- cp ORGWEBPAGE/tmp/*.css org-release
- cp ORGWEBPAGE/tmp/*.jpg org-release
+ cp ORGWEBPAGE/tmp/*.html org-release
+ cp ORGWEBPAGE/tmp/*.el org-release
+ cp ORGWEBPAGE/tmp/*.txt org-release
+ cp ORGWEBPAGE/tmp/*.css org-release
+ cp ORGWEBPAGE/tmp/*.jpg org-release
+# cp ORGWEBPAGE/tmp/*.tar.gz org-release
+# cp ORGWEBPAGE/tmp/*.zip org-release
cp org-release/org-$(TAG).zip org-release/org.zip
cp org-release/org-$(TAG).tar.gz org-release/org.tar.gz
diff --git a/org b/org
index a5aed38..af9c9a7 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 5.12).
+ This manual is for Org-mode (version 5.13).
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 5.12).
+This manual is for Org-mode (version 5.13).
Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation
@@ -166,6 +166,7 @@ Column View
* Defining columns:: The COLUMNS format property
* Using column view:: How to create and use column view
+* Capturing Column View:: A dynamic block for column view
Defining Columns
@@ -753,7 +754,8 @@ File: org, Node: Structure editing, Next: Archiving, Prev: Motion, Up: Docum
the current headline are sorted. The command prompts for the
sorting method, which can be alphabetically, numerically, by time
(using the first time stamp in each entry), by priority, and each
- of these in reverse order. With a `C-u' prefix, sorting will be
+ of these in reverse order. You can also supply your own function
+ to extract the sorting key. With a `C-u' prefix, sorting will be
case-sensitive. With two `C-u C-u' prefixes, duplicate entries
will also be removed.
@@ -1045,8 +1047,8 @@ File: org, Node: Drawers, Next: orgstruct-mode, Prev: Plain lists, Up: Docum
Sometimes you want to keep information associated with an entry, but you
normally don't want to see it. For this, Org-mode has _drawers_.
-Drawers need to be configured with the variable `org-drawers', and look
-like this:
+Drawers need to be configured with the variable `org-drawers'(1), and
+look like this:
** This is a headline
Still outside the drawer
@@ -1061,6 +1063,11 @@ In order to look inside the drawer, you need to move the cursor to the
drawer line and press <TAB> there. Org-mode uses a drawer for storing
properties (*note Properties and columns::).
+ ---------- Footnotes ----------
+
+ (1) You can define drawers on a per-file basis with a line like
+`#+DRAWERS: HIDDEN PROPPERTIES STATE'
+

File: org, Node: orgstruct-mode, Prev: Drawers, Up: Document structure
@@ -3230,6 +3237,7 @@ collected selected items, possibly from a number of files.
* Defining columns:: The COLUMNS format property
* Using column view:: How to create and use column view
+* Capturing Column View:: A dynamic block for column view

File: org, Node: Defining columns, Next: Using column view, Prev: Column view, Up: Column view
@@ -3317,7 +3325,7 @@ column by adding time duration expressions like HH:MM, and for the
been checked.

-File: org, Node: Using column view, Prev: Defining columns, Up: Column view
+File: org, Node: Using column view, Next: Capturing Column View, Prev: Defining columns, Up: Column view
7.4.2 Using Column View
-----------------------
@@ -3357,6 +3365,9 @@ Editing values
property. For example, when editing a TAGS property, the tag
completion or fast selection interface will pop up.
+`C-c C-c'
+ When there is a checkbox at point, toggle it.
+
`v'
View the full value of this property. This is useful if the width
of the column is smaller than that of the value.
@@ -3380,6 +3391,56 @@ Modifying the table structure
Delete the current column.

+File: org, Node: Capturing Column View, Prev: Using column view, Up: Column view
+
+7.4.3 Capturing Column View
+---------------------------
+
+Since column view is just an overlay over a buffer, it cannot be
+exported or printed directly. If you want to capture a column view, use
+the dynamic block (*note Dynamic blocks::). The frame of this block
+looks like this:
+
+ * The column view
+ #+BEGIN: columnview :hlines 1 :id "label"
+
+ #+END:
+
+This dynamic block has the following parameters:
+
+`:id'
+ This is most important parameter. Column view is a feature that is
+ often localized to a certain (sub)tree, and the capture block
+ might be in a different location in the file. To identify the
+ tree whose view to capture, you can use 3 values:
+ local use the tree in which the capture block is located
+ global make a global view, including all headings in the file
+ "label" call column view in the tree that has and `:ID:'
+ property with the value label
+
+`:hlines'
+ When `t', insert a hline after every line. When a number N, insert
+ a hline before each headline with level `<= N'.
+
+`:vlines'
+ When set to `t', enforce column groups to get vertical lines.
+
+The following commands insert or update the dynamic block:
+
+`C-c C-x r'
+ Insert a dynamic block capturing a column view. You will be
+ prompted for the scope or id of the view.
+
+`C-c C-c'
+`C-c C-x C-u'
+ Update dynamical block at point. The cursor needs to be in the
+ `#+BEGIN' line of the dynamic block.
+
+`C-u C-c C-x C-u'
+ Update all dynamic blocks (*note Dynamic blocks::). This is
+ useful if you have several clocktable blocks in a buffer.
+
+
File: org, Node: Property API, Prev: Column view, Up: Properties and columns
7.5 The Property API
@@ -4178,14 +4239,15 @@ command. The dispatcher offers the following default commands:
`multi-occur'. A prefix argument can be used to specify the
number of context lines for each match, default is 1.
-`1'
- Restrict an agenda command to the current buffer. After pressing
- `1', you still need to press the character selecting the command.
+`<'
+ Restrict an agenda command to the current buffer(1). After
+ pressing `<', you still need to press the character selecting the
+ command.
-`0'
+`< <'
If there is an active region, restrict the following agenda
command to the region. Otherwise, restrict it to the current
- subtree. After pressing `0', you still need to press the
+ subtree(2). After pressing `< <', you still need to press the
character selecting the command.
You can also define custom commands that will be accessible through
@@ -4194,6 +4256,14 @@ possibility to create extended agenda buffers that contain several
blocks together, for example the weekly agenda, the global TODO list and
a number of special tags matches. *Note Custom agenda views::.
+ ---------- Footnotes ----------
+
+ (1) For backward compatibility, you can also press `1' to restrict
+to the current buffer.
+
+ (2) For backward compatibility, you can also press `0' to restrict
+to the current buffer.
+

File: org, Node: Built-in agenda views, Next: Presentation and sorting, Prev: Agenda dispatcher, Up: Agenda views
@@ -4828,12 +4898,19 @@ types:
("u" tags "+BOSS-URGENT")
("v" tags-todo "+BOSS-URGENT")
("U" tags-tree "+BOSS-URGENT")
- ("f" occur-tree "\\<FIXME\\>")))
-
-The initial single-character string in each entry defines the character
-you have to press after the dispatcher command `C-c a' in order to
-access the command. The second parameter is the search type, followed
-by the string or regular expression to be used for the matching. The
+ ("f" occur-tree "\\<FIXME\\>")
+ ("h" . "HOME+Name tags searches") ; description for "h" prefix
+ ("hl" tags "+HOME+Lisa")
+ ("hp" tags "+HOME+Peter")
+ ("hk" tags "+HOME+Kim")))
+
+The initial string in each entry defines the keys you have to press
+after the dispatcher command `C-c a' in order to access the command.
+Usually this will be just a single character, but if you have many
+similar commands, you can also define two-letter combinations where the
+first character is the same in several combinations and serves as a
+prefix key(1). The second parameter is the search type, followed by
+the string or regular expression to be used for the matching. The
example above will therefore define:
`C-c a w'
@@ -4858,7 +4935,17 @@ example above will therefore define:
`C-c a f'
to create a sparse tree (again: current buffer only) with all
- entries containing the word `FIXME'.
+ entries containing the word `FIXME'
+
+`C-c a h'
+ as a prefix command for a HOME tags search where you have to press
+ an additional key (`l', `p' or `k') to select a name (Lisa, Peter,
+ or Kim) as additional tag to match.
+
+ ---------- Footnotes ----------
+
+ (1) You can provide a description for a prefix key by inserting a
+cons cell with the prefix and the description.

File: org, Node: Block agenda, Next: Setting Options, Prev: Storing searches, Up: Custom agenda views
@@ -5896,7 +5983,7 @@ you can:
skip: turn on/off skipping the text before the first heading
author: turn on/off inclusion of author name/email into exported file
timestamp: turn on/off inclusion creation time into exported file
- p: turn on/off inclusion of tags
+ d: turn on/off inclusion of drawers
These options take effect in both the HTML and LaTeX export, except
for `TeX' and `LaTeX', which are respectively `t' and `nil' for the
@@ -6361,8 +6448,12 @@ file is visited again in a new Emacs session.
`#+CONSTANTS: name1=value1 ...'
Set file-local values for constants to be used in table formulas.
This line set the local variable
- `org-table-formula-constants-local'. The global version of theis
- variable is `org-table-formula-constants'. corresponding
+ `org-table-formula-constants-local'. The global version of this
+ variable is `org-table-formula-constants'.
+
+`#+DRAWERS: NAME1 .....'
+ Set the file-local set of drawers. The corresponding global
+ variable is `org-drawers'.
`#+LINK: linkword replace'
These lines (several are allowed) specify link abbreviations.
@@ -7412,7 +7503,7 @@ if I have forgotten someone, please accept my apologies and let me know.
* John Foerch figured out how to make incremental search show context
around a match in a hidden outline tree.
- * Niels Giessen had the idea to automatically archive DONE trees.
+ * Niels Giesen had the idea to automatically archive DONE trees.
* Bastien Guerry wrote the LaTeX exporter and has been prolific with
patches, ideas, and bug reports.
@@ -7525,7 +7616,7 @@ Index
* action, for publishing: Publishing action. (line 6)
* activation: Activation. (line 6)
* active region <1>: ASCII export. (line 9)
-* active region <2>: Structure editing. (line 70)
+* active region <2>: Structure editing. (line 71)
* active region <3>: Built-in table editor.
(line 143)
* active region: HTML Export commands.
@@ -7544,7 +7635,7 @@ Index
* 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 68)
+* align, STARTUP keyword: In-buffer settings. (line 72)
* allout.el: Conflicts. (line 6)
* angular brackets, around links: External links. (line 43)
* API, for properties <1>: Property API. (line 6)
@@ -7603,9 +7694,9 @@ Index
* completion, of TODO keywords: Workflow states. (line 15)
* constants, in calculations: References. (line 82)
* constants.el: Cooperation. (line 14)
-* constcgs, STARTUP keyword: In-buffer settings. (line 94)
-* constSI, STARTUP keyword: In-buffer settings. (line 94)
-* content, STARTUP keyword: In-buffer settings. (line 61)
+* constcgs, STARTUP keyword: In-buffer settings. (line 98)
+* constSI, STARTUP keyword: In-buffer settings. (line 98)
+* content, STARTUP keyword: In-buffer settings. (line 65)
* contents, global visibility state: Visibility cycling. (line 22)
* copying, of subtrees: Structure editing. (line 6)
* creating timestamps: Creating timestamps. (line 6)
@@ -7614,7 +7705,7 @@ Index
* custom date/time format: Custom time format. (line 6)
* custom search strings: Custom searches. (line 6)
* customization: Customization. (line 6)
-* customtime, STARTUP keyword: In-buffer settings. (line 91)
+* customtime, STARTUP keyword: In-buffer settings. (line 95)
* cutting, of subtrees: Structure editing. (line 6)
* cycling, of TODO states: TODO basics. (line 13)
* cycling, visibility: Visibility cycling. (line 6)
@@ -7650,7 +7741,7 @@ Index
* emphasized text: Export options. (line 26)
* enhancing text: Enhancing text. (line 6)
* evaluate time range: Creating timestamps. (line 48)
-* even, STARTUP keyword: In-buffer settings. (line 84)
+* even, STARTUP keyword: In-buffer settings. (line 88)
* exporting: Exporting. (line 6)
* exporting agenda views <1>: Agenda commands. (line 233)
* exporting agenda views: Exporting Agenda Views.
@@ -7714,7 +7805,7 @@ Index
* headline, promotion and demotion: Structure editing. (line 6)
* headlines: Headlines. (line 6)
* hide text: Visibility cycling. (line 6)
-* hidestars, STARTUP keyword: In-buffer settings. (line 84)
+* hidestars, STARTUP keyword: In-buffer settings. (line 88)
* hiding leading stars: Clean view. (line 6)
* history: History and Acknowledgments.
(line 6)
@@ -7772,12 +7863,12 @@ Index
* lists, hand-formatted: Enhancing text. (line 11)
* lists, ordered: Plain lists. (line 6)
* lists, plain: Plain lists. (line 6)
-* logdone, STARTUP keyword: In-buffer settings. (line 73)
+* logdone, STARTUP keyword: In-buffer settings. (line 77)
* logging, of progress: Progress logging. (line 6)
-* lognoteclock-out, STARTUP keyword: In-buffer settings. (line 73)
-* lognotedone, STARTUP keyword: In-buffer settings. (line 73)
-* lognotestate, STARTUP keyword: In-buffer settings. (line 73)
-* logrepeat, STARTUP keyword: In-buffer settings. (line 73)
+* lognoteclock-out, STARTUP keyword: In-buffer settings. (line 77)
+* lognotedone, STARTUP keyword: In-buffer settings. (line 77)
+* lognotestate, STARTUP keyword: In-buffer settings. (line 77)
+* logrepeat, STARTUP keyword: In-buffer settings. (line 77)
* maintainer: Feedback. (line 6)
* mark ring: Handling links. (line 82)
* marking characters, tables: Advanced features. (line 40)
@@ -7798,11 +7889,11 @@ Index
* named references: References. (line 82)
* names as TODO keywords: TODO types. (line 6)
* narrow columns in tables: Narrow columns. (line 6)
-* noalign, STARTUP keyword: In-buffer settings. (line 68)
-* nologging, STARTUP keyword: In-buffer settings. (line 73)
-* nologrepeat, STARTUP keyword: In-buffer settings. (line 73)
+* noalign, STARTUP keyword: In-buffer settings. (line 72)
+* nologging, STARTUP keyword: In-buffer settings. (line 77)
+* nologrepeat, STARTUP keyword: In-buffer settings. (line 77)
* occur, command: Sparse trees. (line 6)
-* odd, STARTUP keyword: In-buffer settings. (line 84)
+* odd, STARTUP keyword: In-buffer settings. (line 88)
* option keyword completion: Completion. (line 6)
* options, for custom agenda views: Setting Options. (line 6)
* options, for customization: Customization. (line 6)
@@ -7824,7 +7915,7 @@ Index
* outline-mode: Outlines. (line 6)
* outlines: Outlines. (line 6)
* overview, global visibility state: Visibility cycling. (line 22)
-* overview, STARTUP keyword: In-buffer settings. (line 61)
+* overview, STARTUP keyword: In-buffer settings. (line 65)
* packages, interaction with other: Interaction. (line 6)
* pasting, of subtrees: Structure editing. (line 6)
* per file keywords: Per file keywords. (line 6)
@@ -7861,7 +7952,7 @@ Index
* references, to fields: References. (line 15)
* references, to ranges: References. (line 60)
* region, active <1>: ASCII export. (line 9)
-* region, active <2>: Structure editing. (line 70)
+* region, active <2>: Structure editing. (line 71)
* region, active <3>: HTML Export commands.
(line 6)
* region, active: Built-in table editor.
@@ -7888,8 +7979,8 @@ Index
* show all, command: Visibility cycling. (line 33)
* show all, global visibility state: Visibility cycling. (line 22)
* show hidden text: Visibility cycling. (line 6)
-* showall, STARTUP keyword: In-buffer settings. (line 61)
-* showstars, STARTUP keyword: In-buffer settings. (line 84)
+* showall, STARTUP keyword: In-buffer settings. (line 65)
+* showstars, STARTUP keyword: In-buffer settings. (line 88)
* sorting, of agenda items: Sorting of agenda items.
(line 6)
* sparse tree, for deadlines: Inserting deadline/schedule.
@@ -7974,7 +8065,7 @@ Index
* TODO workflow: Workflow states. (line 6)
* transient-mark-mode <1>: Built-in table editor.
(line 143)
-* transient-mark-mode <2>: Structure editing. (line 70)
+* transient-mark-mode <2>: Structure editing. (line 71)
* transient-mark-mode <3>: ASCII export. (line 9)
* transient-mark-mode: HTML Export commands.
(line 6)
@@ -8019,40 +8110,40 @@ Key Index
* -: Agenda commands. (line 151)
* .: Agenda commands. (line 99)
* :: Agenda commands. (line 130)
-* < <1>: Using column view. (line 54)
-* <: The date/time prompt.
+* < <1>: The date/time prompt.
(line 45)
+* <: Using column view. (line 57)
* <left>: Agenda commands. (line 96)
* <RET> <1>: Agenda commands. (line 39)
* <RET> <2>: Setting tags. (line 76)
-* <RET> <3>: Built-in table editor.
- (line 64)
-* <RET>: The date/time prompt.
+* <RET> <3>: The date/time prompt.
(line 70)
+* <RET>: Built-in table editor.
+ (line 64)
* <right>: Agenda commands. (line 91)
* <SPC> <1>: Agenda commands. (line 28)
* <SPC>: Setting tags. (line 73)
-* <TAB> <1>: Setting tags. (line 68)
+* <TAB> <1>: CDLaTeX mode. (line 23)
* <TAB> <2>: Visibility cycling. (line 10)
-* <TAB> <3>: CDLaTeX mode. (line 23)
-* <TAB> <4>: Plain lists. (line 41)
-* <TAB> <5>: Built-in table editor.
+* <TAB> <3>: Setting tags. (line 68)
+* <TAB> <4>: Agenda commands. (line 33)
+* <TAB> <5>: Editing and debugging formulas.
(line 57)
-* <TAB> <6>: Editing and debugging formulas.
+* <TAB> <6>: Built-in table editor.
(line 57)
-* <TAB>: Agenda commands. (line 33)
-* > <1>: Using column view. (line 54)
-* > <2>: Agenda commands. (line 173)
-* >: The date/time prompt.
+* <TAB>: Plain lists. (line 41)
+* > <1>: The date/time prompt.
(line 46)
+* > <2>: Using column view. (line 57)
+* >: Agenda commands. (line 173)
* ^: CDLaTeX mode. (line 33)
* _: CDLaTeX mode. (line 33)
* `: CDLaTeX mode. (line 39)
-* a <1>: Using column view. (line 43)
-* a: Agenda commands. (line 134)
+* a <1>: Agenda commands. (line 134)
+* a: Using column view. (line 46)
* b: Agenda commands. (line 49)
-* c: Agenda commands. (line 196)
* C: Agenda commands. (line 216)
+* c: Agenda commands. (line 196)
* C-#: Advanced features. (line 9)
* C-': Agenda files. (line 18)
* C-,: Agenda files. (line 18)
@@ -8104,37 +8195,41 @@ Key Index
* C-c a e: Exporting Agenda Views.
(line 57)
* C-c a L: Timeline. (line 10)
-* C-c a M: Matching tags and properties.
- (line 15)
-* C-c a m <1>: Matching tags and properties.
- (line 10)
* C-c a m: Tag searches. (line 13)
+* C-c a M <1>: Matching tags and properties.
+ (line 15)
* C-c a M: Tag searches. (line 17)
+* C-c a m: Matching tags and properties.
+ (line 10)
* C-c a T: Global TODO list. (line 14)
* C-c a t <1>: TODO basics. (line 49)
* C-c a t: Global TODO list. (line 9)
* C-c C-a: Visibility cycling. (line 33)
* C-c C-b: Motion. (line 15)
-* C-c C-c <1>: Clocking work time. (line 89)
-* C-c C-c <2>: Built-in table editor.
- (line 56)
-* C-c C-c <3>: TODO basics. (line 30)
-* C-c C-c <4>: The very busy C-c C-c key.
- (line 6)
-* C-c C-c <5>: Editing and debugging formulas.
- (line 90)
-* C-c C-c <6>: Plain lists. (line 81)
-* C-c C-c <7>: Cooperation. (line 46)
-* C-c C-c <8>: Property syntax. (line 58)
-* C-c C-c <9>: Processing LaTeX fragments.
+* C-c C-c <1>: Processing LaTeX fragments.
(line 15)
-* C-c C-c <10>: Checkboxes. (line 37)
-* C-c C-c <11>: Editing and debugging formulas.
+* C-c C-c <2>: Cooperation. (line 37)
+* C-c C-c <3>: Built-in table editor.
+ (line 56)
+* C-c C-c <4>: Editing and debugging formulas.
(line 46)
-* C-c C-c: Setting tags. (line 10)
-* C-c C-d <1>: Inserting deadline/schedule.
+* C-c C-c <5>: Plain lists. (line 81)
+* C-c C-c <6>: Editing and debugging formulas.
+ (line 90)
+* C-c C-c <7>: Capturing Column View.
+ (line 39)
+* C-c C-c <8>: Cooperation. (line 46)
+* C-c C-c <9>: TODO basics. (line 30)
+* C-c C-c <10>: Clocking work time. (line 89)
+* C-c C-c <11>: Checkboxes. (line 37)
+* C-c C-c <12>: Using column view. (line 39)
+* C-c C-c <13>: Property syntax. (line 58)
+* C-c C-c <14>: Setting tags. (line 10)
+* C-c C-c: The very busy C-c C-c key.
+ (line 6)
+* C-c C-d <1>: Agenda commands. (line 158)
+* C-c C-d: Inserting deadline/schedule.
(line 9)
-* C-c C-d: Agenda commands. (line 158)
* C-c C-e: Exporting. (line 20)
* C-c C-e a: ASCII export. (line 9)
* C-c C-e b: HTML Export commands.
@@ -8158,10 +8253,10 @@ Key Index
* C-c C-e v a: ASCII export. (line 16)
* C-c C-e v b: HTML Export commands.
(line 24)
-* C-c C-e v H: HTML Export commands.
- (line 24)
* C-c C-e v h: HTML Export commands.
(line 24)
+* C-c C-e v H: HTML Export commands.
+ (line 24)
* C-c C-e v l: LaTeX export commands.
(line 10)
* C-c C-e v L: LaTeX export commands.
@@ -8180,9 +8275,9 @@ Key Index
(line 127)
* C-c C-q: Editing and debugging formulas.
(line 50)
-* C-c C-r <1>: Editing and debugging formulas.
+* C-c C-r <1>: Visibility cycling. (line 34)
+* C-c C-r: Editing and debugging formulas.
(line 53)
-* C-c C-r: Visibility cycling. (line 34)
* C-c C-s <1>: Agenda commands. (line 155)
* C-c C-s: Inserting deadline/schedule.
(line 20)
@@ -8195,8 +8290,8 @@ Key Index
* C-c C-x b: Visibility cycling. (line 41)
* C-c C-x C-a: ARCHIVE tag. (line 28)
* C-c C-x C-b: Checkboxes. (line 39)
-* C-c C-x C-c <1>: Agenda commands. (line 223)
-* C-c C-x C-c: Using column view. (line 9)
+* C-c C-x C-c <1>: Using column view. (line 9)
+* C-c C-x C-c: Agenda commands. (line 223)
* C-c C-x C-d: Clocking work time. (line 42)
* C-c C-x C-i: Clocking work time. (line 12)
* C-c C-x C-j: Clocking work time. (line 38)
@@ -8209,8 +8304,10 @@ Key Index
* C-c C-x C-r: Clocking work time. (line 50)
* C-c C-x C-s: Moving subtrees. (line 10)
* C-c C-x C-t: Custom time format. (line 12)
-* C-c C-x C-u <1>: Clocking work time. (line 91)
-* C-c C-x C-u: Dynamic blocks. (line 21)
+* C-c C-x C-u <1>: Capturing Column View.
+ (line 42)
+* C-c C-x C-u <2>: Dynamic blocks. (line 21)
+* C-c C-x C-u: Clocking work time. (line 91)
* C-c C-x C-w <1>: Built-in table editor.
(line 116)
* C-c C-x C-w: Structure editing. (line 43)
@@ -8222,16 +8319,18 @@ Key Index
* C-c C-x M-w: Built-in table editor.
(line 113)
* C-c C-x p: Property syntax. (line 49)
-* C-c C-y <1>: Creating timestamps. (line 48)
-* C-c C-y: Clocking work time. (line 25)
+* C-c C-x r: Capturing Column View.
+ (line 37)
+* C-c C-y <1>: Clocking work time. (line 25)
+* C-c C-y: Creating timestamps. (line 48)
* C-c l: Handling links. (line 9)
-* C-c { <1>: Editing and debugging formulas.
+* C-c { <1>: CDLaTeX mode. (line 21)
+* C-c {: Editing and debugging formulas.
(line 33)
-* C-c {: CDLaTeX mode. (line 21)
* C-c |: Built-in table editor.
(line 40)
* C-c }: Editing and debugging formulas.
- (line 28)
+ (line 79)
* C-c ~: Cooperation. (line 48)
* C-k: Agenda commands. (line 116)
* C-S-<left>: Multiple sets in one file.
@@ -8241,23 +8340,25 @@ Key Index
* C-TAB: ARCHIVE tag. (line 38)
* C-u C-c *: Updating the table. (line 16)
* C-u C-c .: Creating timestamps. (line 14)
-* C-u C-c = <1>: Editing and debugging formulas.
+* C-u C-c = <1>: Field formulas. (line 24)
+* C-u C-c =: Editing and debugging formulas.
(line 14)
-* C-u C-c =: Field formulas. (line 24)
* C-u C-c C-c: Updating the table. (line 19)
* C-u C-c C-l: Handling links. (line 44)
* C-u C-c C-t: TODO basics. (line 22)
* C-u C-c C-x C-a: ARCHIVE tag. (line 31)
* C-u C-c C-x C-s: Moving subtrees. (line 14)
* C-u C-c C-x C-u <1>: Clocking work time. (line 93)
+* C-u C-c C-x C-u <2>: Capturing Column View.
+ (line 44)
* C-u C-c C-x C-u: Dynamic blocks. (line 22)
* C-u C-u C-c *: Updating the table. (line 22)
* C-u C-u C-c =: Editing and debugging formulas.
(line 18)
* C-u C-u C-c C-c: Updating the table. (line 22)
-* C-x C-s <1>: Agenda commands. (line 87)
-* C-x C-s: Editing and debugging formulas.
+* C-x C-s <1>: Editing and debugging formulas.
(line 46)
+* C-x C-s: Agenda commands. (line 87)
* C-x C-w <1>: Exporting Agenda Views.
(line 11)
* C-x C-w: Agenda commands. (line 232)
@@ -8267,17 +8368,17 @@ Key Index
* f: Agenda commands. (line 42)
* g: Agenda commands. (line 76)
* H: Agenda commands. (line 220)
-* i: Agenda commands. (line 201)
* I: Agenda commands. (line 178)
+* i: Agenda commands. (line 201)
* J: Agenda commands. (line 190)
* l: Agenda commands. (line 55)
* L: Agenda commands. (line 30)
* M: Agenda commands. (line 207)
* m: Agenda commands. (line 66)
-* M-<down> <1>: Editing and debugging formulas.
- (line 76)
-* M-<down>: Built-in table editor.
+* M-<down> <1>: Built-in table editor.
(line 82)
+* M-<down>: Editing and debugging formulas.
+ (line 76)
* M-<left> <1>: Structure editing. (line 25)
* M-<left>: Built-in table editor.
(line 74)
@@ -8286,45 +8387,45 @@ Key Index
* M-<right> <1>: Built-in table editor.
(line 74)
* M-<right>: Structure editing. (line 28)
-* M-<TAB> <1>: Per file keywords. (line 23)
-* M-<TAB> <2>: Property syntax. (line 46)
-* M-<TAB> <3>: Completion. (line 10)
-* M-<TAB> <4>: Setting tags. (line 6)
-* M-<TAB>: Editing and debugging formulas.
+* M-<TAB> <1>: Editing and debugging formulas.
(line 64)
+* M-<TAB> <2>: Completion. (line 10)
+* M-<TAB> <3>: Per file keywords. (line 23)
+* M-<TAB> <4>: Property syntax. (line 46)
+* M-<TAB>: Setting tags. (line 6)
* M-<up> <1>: Built-in table editor.
(line 82)
* M-<up>: Editing and debugging formulas.
(line 76)
-* M-S-<down> <1>: Structure editing. (line 40)
-* M-S-<down> <2>: Editing and debugging formulas.
- (line 72)
-* M-S-<down> <3>: Built-in table editor.
+* M-S-<down> <1>: Built-in table editor.
(line 89)
-* M-S-<down>: Plain lists. (line 66)
-* M-S-<left> <1>: Built-in table editor.
- (line 76)
+* M-S-<down> <2>: Plain lists. (line 66)
+* M-S-<down> <3>: Structure editing. (line 40)
+* M-S-<down>: Editing and debugging formulas.
+ (line 72)
+* M-S-<left> <1>: Structure editing. (line 31)
* M-S-<left> <2>: The date/time prompt.
(line 67)
* M-S-<left> <3>: Plain lists. (line 72)
-* M-S-<left>: Structure editing. (line 31)
+* M-S-<left>: Built-in table editor.
+ (line 76)
* M-S-<RET> <1>: Checkboxes. (line 54)
* M-S-<RET> <2>: Structure editing. (line 22)
* M-S-<RET>: Plain lists. (line 59)
-* M-S-<right> <1>: The date/time prompt.
- (line 64)
-* M-S-<right> <2>: Built-in table editor.
+* M-S-<right> <1>: Built-in table editor.
(line 79)
-* M-S-<right> <3>: Structure editing. (line 34)
-* M-S-<right>: Plain lists. (line 72)
+* M-S-<right> <2>: The date/time prompt.
+ (line 64)
+* M-S-<right> <3>: Plain lists. (line 72)
+* M-S-<right>: Structure editing. (line 34)
* M-S-<up> <1>: Built-in table editor.
(line 86)
* M-S-<up> <2>: Editing and debugging formulas.
(line 72)
-* M-S-<up> <3>: Structure editing. (line 37)
-* M-S-<up>: Plain lists. (line 66)
-* mouse-1 <1>: Handling links. (line 73)
-* mouse-1 <2>: Agenda commands. (line 33)
+* M-S-<up> <3>: Plain lists. (line 66)
+* M-S-<up>: Structure editing. (line 37)
+* mouse-1 <1>: Agenda commands. (line 33)
+* mouse-1 <2>: Handling links. (line 73)
* mouse-1: The date/time prompt.
(line 49)
* mouse-2 <1>: Agenda commands. (line 33)
@@ -8333,66 +8434,66 @@ Key Index
* mouse-3: Handling links. (line 78)
* n <1>: Agenda commands. (line 19)
* n: Using column view. (line 30)
-* o: Agenda commands. (line 65)
* O: Agenda commands. (line 182)
+* o: Agenda commands. (line 65)
* p <1>: Agenda commands. (line 20)
* p: Using column view. (line 30)
* P: Agenda commands. (line 142)
-* q <1>: Using column view. (line 17)
-* q: Agenda commands. (line 243)
-* r <1>: Agenda commands. (line 80)
-* r: Global TODO list. (line 22)
-* S: Agenda commands. (line 211)
+* q <1>: Agenda commands. (line 243)
+* q: Using column view. (line 17)
+* r <1>: Global TODO list. (line 22)
+* r: Agenda commands. (line 80)
* s: Agenda commands. (line 87)
-* S-<down> <1>: Editing and debugging formulas.
- (line 67)
+* S: Agenda commands. (line 211)
+* S-<down> <1>: Plain lists. (line 62)
* S-<down> <2>: Creating timestamps. (line 40)
-* S-<down> <3>: The date/time prompt.
- (line 58)
-* S-<down> <4>: Agenda commands. (line 151)
-* S-<down> <5>: Priorities. (line 23)
-* S-<down>: Plain lists. (line 62)
-* S-<left> <1>: Creating timestamps. (line 35)
-* S-<left> <2>: The date/time prompt.
- (line 55)
-* S-<left> <3>: Editing and debugging formulas.
+* S-<down> <3>: Priorities. (line 23)
+* S-<down> <4>: Editing and debugging formulas.
(line 67)
-* S-<left> <4>: Multiple sets in one file.
+* S-<down> <5>: The date/time prompt.
+ (line 58)
+* S-<down>: Agenda commands. (line 151)
+* S-<left> <1>: Multiple sets in one file.
(line 29)
-* S-<left> <5>: Using column view. (line 26)
+* S-<left> <2>: Using column view. (line 26)
+* S-<left> <3>: Agenda commands. (line 169)
+* S-<left> <4>: The date/time prompt.
+ (line 55)
+* S-<left> <5>: TODO basics. (line 26)
* S-<left> <6>: Property syntax. (line 66)
-* S-<left> <7>: Agenda commands. (line 169)
-* S-<left>: TODO basics. (line 26)
+* S-<left> <7>: Editing and debugging formulas.
+ (line 67)
+* S-<left>: Creating timestamps. (line 35)
* S-<RET>: Built-in table editor.
(line 146)
-* S-<right> <1>: Using column view. (line 26)
-* S-<right> <2>: Agenda commands. (line 161)
-* S-<right> <3>: Multiple sets in one file.
+* S-<right> <1>: Multiple sets in one file.
(line 29)
-* S-<right> <4>: TODO basics. (line 26)
-* S-<right> <5>: The date/time prompt.
- (line 52)
-* S-<right> <6>: Creating timestamps. (line 35)
-* S-<right> <7>: Property syntax. (line 66)
-* S-<right>: Editing and debugging formulas.
+* S-<right> <2>: Using column view. (line 26)
+* S-<right> <3>: Agenda commands. (line 161)
+* S-<right> <4>: Creating timestamps. (line 35)
+* S-<right> <5>: Property syntax. (line 66)
+* S-<right> <6>: Editing and debugging formulas.
(line 67)
+* S-<right> <7>: The date/time prompt.
+ (line 52)
+* S-<right>: TODO basics. (line 26)
* S-<TAB> <1>: Built-in table editor.
(line 61)
* S-<TAB>: Visibility cycling. (line 22)
-* S-<up> <1>: The date/time prompt.
- (line 61)
-* S-<up> <2>: Priorities. (line 23)
-* S-<up> <3>: Editing and debugging formulas.
+* S-<up> <1>: Editing and debugging formulas.
(line 67)
-* S-<up> <4>: Plain lists. (line 62)
+* S-<up> <2>: Plain lists. (line 62)
+* S-<up> <3>: The date/time prompt.
+ (line 61)
+* S-<up> <4>: Creating timestamps. (line 40)
* S-<up> <5>: Agenda commands. (line 145)
-* S-<up>: Creating timestamps. (line 40)
-* S-M-<left>: Using column view. (line 58)
+* S-<up>: Priorities. (line 23)
+* S-M-<left>: Using column view. (line 61)
* S-M-<RET>: TODO basics. (line 57)
-* S-M-<right>: Using column view. (line 55)
-* T: Agenda commands. (line 125)
+* S-M-<right>: Using column view. (line 58)
* t: Agenda commands. (line 112)
-* v: Using column view. (line 39)
+* T: Agenda commands. (line 125)
+* v: Using column view. (line 42)
* w: Agenda commands. (line 66)
* X: Agenda commands. (line 185)
* x: Agenda commands. (line 244)
@@ -8402,222 +8503,227 @@ Key Index

Tag Table:
Node: Top970
-Node: Introduction13081
-Node: Summary13496
-Node: Installation16623
-Node: Activation18001
-Node: Feedback19238
-Node: Document structure21307
-Node: Outlines22199
-Node: Headlines22864
-Ref: Headlines-Footnote-123868
-Node: Visibility cycling23979
-Ref: Visibility cycling-Footnote-126189
-Ref: Visibility cycling-Footnote-226247
-Ref: Visibility cycling-Footnote-326297
-Node: Motion26567
-Node: Structure editing27521
-Node: Archiving30616
-Node: ARCHIVE tag31174
-Node: Moving subtrees32967
-Ref: Moving subtrees-Footnote-134514
-Node: Sparse trees34801
-Ref: Sparse trees-Footnote-137073
-Ref: Sparse trees-Footnote-237255
-Node: Plain lists37370
-Ref: Plain lists-Footnote-141567
-Ref: Plain lists-Footnote-241925
-Node: Drawers42106
-Node: orgstruct-mode42944
-Node: Tables43844
-Node: Built-in table editor44425
-Node: Narrow columns51831
-Ref: Narrow columns-Footnote-153766
-Node: Column groups53812
-Node: orgtbl-mode55345
-Node: The spreadsheet56148
-Node: References57235
-Ref: References-Footnote-161699
-Node: Formula syntax for Calc61988
-Node: Formula syntax for Lisp64445
-Node: Field formulas66163
-Node: Column formulas67471
-Node: Editing and debugging formulas69070
-Node: Updating the table73223
-Node: Advanced features74276
-Node: Hyperlinks78801
-Node: Link format79579
-Node: Internal links80872
-Ref: Internal links-Footnote-182797
-Node: Radio targets82932
-Node: External links83632
-Node: Handling links86036
-Ref: Handling links-Footnote-191352
-Ref: Handling links-Footnote-291589
-Node: Using links outside Org-mode91663
-Node: Link abbreviations92173
-Node: Search options93866
-Ref: Search options-Footnote-195646
-Node: Custom searches95727
-Node: TODO items96758
-Node: TODO basics97796
-Node: TODO extensions100011
-Node: Workflow states100955
-Ref: Workflow states-Footnote-1102130
-Node: TODO types102223
-Ref: TODO types-Footnote-1103806
-Node: Multiple sets in one file103888
-Node: Fast access to TODO states105508
-Node: Per file keywords106651
-Ref: Per file keywords-Footnote-1107953
-Node: Faces for TODO keywords108154
-Node: Progress logging108860
-Node: Closing items109291
-Ref: Closing items-Footnote-1110225
-Ref: Closing items-Footnote-2110430
-Node: Tracking TODO state changes110503
-Ref: Tracking TODO state changes-Footnote-1111688
-Node: Priorities111763
-Ref: Priorities-Footnote-1113413
-Node: Breaking down tasks113483
-Ref: Breaking down tasks-Footnote-1114003
-Node: Checkboxes114099
-Node: Tags116948
-Node: Tag inheritance117720
-Node: Setting tags118657
-Ref: Setting tags-Footnote-1123180
-Ref: Setting tags-Footnote-2123292
-Node: Tag searches123375
-Node: Properties and columns126102
-Node: Property syntax127207
-Node: Special properties129897
-Node: Property searches130813
-Node: Column view132080
-Node: Defining columns133247
-Node: Scope of column definitions133645
-Node: Column attributes134567
-Node: Using column view136815
-Node: Property API138802
-Node: Timestamps139156
-Node: Time stamps139567
-Ref: Time stamps-Footnote-1141921
-Node: Creating timestamps142037
-Node: The date/time prompt144111
-Ref: The date/time prompt-Footnote-1146717
-Node: Custom time format146823
-Node: Deadlines and scheduling148515
-Ref: Deadlines and scheduling-Footnote-1150588
-Node: Inserting deadline/schedule150743
-Node: Repeated tasks151861
-Ref: Repeated tasks-Footnote-1153539
-Node: Clocking work time153660
-Ref: Clocking work time-Footnote-1158507
-Ref: Clocking work time-Footnote-2158585
-Node: Remember158711
-Node: Setting up remember159590
-Node: Remember templates160193
-Ref: Remember templates-Footnote-1163754
-Ref: Remember templates-Footnote-2163937
-Node: Storing notes164035
-Ref: Storing notes-Footnote-1166514
-Node: Agenda views166616
-Node: Agenda files168567
-Ref: Agenda files-Footnote-1169535
-Ref: Agenda files-Footnote-2169684
-Node: Agenda dispatcher169877
-Node: Built-in agenda views171880
-Node: Weekly/Daily agenda172462
-Node: Global TODO list175799
-Node: Matching tags and properties178079
-Node: Timeline179170
-Node: Stuck projects179844
-Node: Presentation and sorting181697
-Node: Categories182490
-Ref: Categories-Footnote-1183201
-Node: Time-of-day specifications183521
-Node: Sorting of agenda items185494
-Node: Agenda commands186778
-Node: Custom agenda views194241
-Node: Storing searches194962
-Node: Block agenda196876
-Node: Setting Options198108
-Node: Exporting Agenda Views200849
-Ref: Exporting Agenda Views-Footnote-1205135
-Ref: Exporting Agenda Views-Footnote-2205192
-Node: Extracting Agenda Information for other programs205378
-Node: Embedded LaTeX209506
-Ref: Embedded LaTeX-Footnote-1210600
-Node: Math symbols210790
-Node: Subscripts and Superscripts211557
-Node: LaTeX fragments212403
-Ref: LaTeX fragments-Footnote-1214636
-Ref: LaTeX fragments-Footnote-2214897
-Node: Processing LaTeX fragments215031
-Node: CDLaTeX mode215979
-Ref: CDLaTeX mode-Footnote-1218465
-Node: Exporting218613
-Node: ASCII export220080
-Node: HTML export221581
-Node: HTML Export commands222207
-Node: Quoting HTML tags223994
-Node: Links224629
-Node: Images225326
-Ref: Images-Footnote-1226197
-Node: CSS support226258
-Ref: CSS support-Footnote-1227577
-Node: LaTeX export227690
-Node: LaTeX export commands228014
-Node: Quoting LaTeX code229176
-Node: XOXO export229681
-Node: iCalendar export230121
-Node: Text interpretation231590
-Node: Comment lines232181
-Node: Initial text232576
-Node: Footnotes234245
-Node: Enhancing text235036
-Ref: Enhancing text-Footnote-1236905
-Node: Export options236995
-Node: Publishing239394
-Ref: Publishing-Footnote-1240355
-Ref: Publishing-Footnote-2240499
-Node: Configuration240650
-Node: Project alist241368
-Node: Sources and destinations242434
-Node: Selecting files243164
-Node: Publishing action243912
-Node: Publishing options245246
-Node: Publishing links247621
-Node: Project page index249134
-Node: Sample configuration249912
-Node: Simple example250404
-Node: Complex example251077
-Node: Triggering publication253153
-Node: Miscellaneous253838
-Node: Completion254472
-Node: Customization256142
-Node: In-buffer settings256725
-Node: The very busy C-c C-c key262287
-Node: Clean view264142
-Node: TTY keys266719
-Node: Interaction268329
-Node: Cooperation268726
-Node: Conflicts271602
-Node: Bugs273605
-Node: Extensions and Hacking275101
-Node: Extensions275826
-Node: Adding hyperlink types278088
-Node: Tables in arbitrary syntax281750
-Node: Radio tables282839
-Node: A LaTeX example285342
-Ref: A LaTeX example-Footnote-1288988
-Ref: A LaTeX example-Footnote-2289136
-Node: Translator functions289571
-Ref: Translator functions-Footnote-1292680
-Node: Dynamic blocks292768
-Node: Special agenda views294740
-Node: Using the property API297985
-Node: History and Acknowledgments299466
-Node: Index306028
-Node: Key Index341097
+Node: Introduction13145
+Node: Summary13560
+Node: Installation16687
+Node: Activation18065
+Node: Feedback19302
+Node: Document structure21371
+Node: Outlines22263
+Node: Headlines22928
+Ref: Headlines-Footnote-123932
+Node: Visibility cycling24043
+Ref: Visibility cycling-Footnote-126253
+Ref: Visibility cycling-Footnote-226311
+Ref: Visibility cycling-Footnote-326361
+Node: Motion26631
+Node: Structure editing27585
+Node: Archiving30752
+Node: ARCHIVE tag31310
+Node: Moving subtrees33103
+Ref: Moving subtrees-Footnote-134650
+Node: Sparse trees34937
+Ref: Sparse trees-Footnote-137209
+Ref: Sparse trees-Footnote-237391
+Node: Plain lists37506
+Ref: Plain lists-Footnote-141703
+Ref: Plain lists-Footnote-242061
+Node: Drawers42242
+Ref: Drawers-Footnote-143119
+Node: orgstruct-mode43225
+Node: Tables44125
+Node: Built-in table editor44706
+Node: Narrow columns52112
+Ref: Narrow columns-Footnote-154047
+Node: Column groups54093
+Node: orgtbl-mode55626
+Node: The spreadsheet56429
+Node: References57516
+Ref: References-Footnote-161980
+Node: Formula syntax for Calc62269
+Node: Formula syntax for Lisp64726
+Node: Field formulas66444
+Node: Column formulas67752
+Node: Editing and debugging formulas69351
+Node: Updating the table73504
+Node: Advanced features74557
+Node: Hyperlinks79082
+Node: Link format79860
+Node: Internal links81153
+Ref: Internal links-Footnote-183078
+Node: Radio targets83213
+Node: External links83913
+Node: Handling links86317
+Ref: Handling links-Footnote-191633
+Ref: Handling links-Footnote-291870
+Node: Using links outside Org-mode91944
+Node: Link abbreviations92454
+Node: Search options94147
+Ref: Search options-Footnote-195927
+Node: Custom searches96008
+Node: TODO items97039
+Node: TODO basics98077
+Node: TODO extensions100292
+Node: Workflow states101236
+Ref: Workflow states-Footnote-1102411
+Node: TODO types102504
+Ref: TODO types-Footnote-1104087
+Node: Multiple sets in one file104169
+Node: Fast access to TODO states105789
+Node: Per file keywords106932
+Ref: Per file keywords-Footnote-1108234
+Node: Faces for TODO keywords108435
+Node: Progress logging109141
+Node: Closing items109572
+Ref: Closing items-Footnote-1110506
+Ref: Closing items-Footnote-2110711
+Node: Tracking TODO state changes110784
+Ref: Tracking TODO state changes-Footnote-1111969
+Node: Priorities112044
+Ref: Priorities-Footnote-1113694
+Node: Breaking down tasks113764
+Ref: Breaking down tasks-Footnote-1114284
+Node: Checkboxes114380
+Node: Tags117229
+Node: Tag inheritance118001
+Node: Setting tags118938
+Ref: Setting tags-Footnote-1123461
+Ref: Setting tags-Footnote-2123573
+Node: Tag searches123656
+Node: Properties and columns126383
+Node: Property syntax127488
+Node: Special properties130178
+Node: Property searches131094
+Node: Column view132361
+Node: Defining columns133592
+Node: Scope of column definitions133990
+Node: Column attributes134912
+Node: Using column view137160
+Node: Capturing Column View139241
+Node: Property API140968
+Node: Timestamps141322
+Node: Time stamps141733
+Ref: Time stamps-Footnote-1144087
+Node: Creating timestamps144203
+Node: The date/time prompt146277
+Ref: The date/time prompt-Footnote-1148883
+Node: Custom time format148989
+Node: Deadlines and scheduling150681
+Ref: Deadlines and scheduling-Footnote-1152754
+Node: Inserting deadline/schedule152909
+Node: Repeated tasks154027
+Ref: Repeated tasks-Footnote-1155705
+Node: Clocking work time155826
+Ref: Clocking work time-Footnote-1160673
+Ref: Clocking work time-Footnote-2160751
+Node: Remember160877
+Node: Setting up remember161756
+Node: Remember templates162359
+Ref: Remember templates-Footnote-1165920
+Ref: Remember templates-Footnote-2166103
+Node: Storing notes166201
+Ref: Storing notes-Footnote-1168680
+Node: Agenda views168782
+Node: Agenda files170733
+Ref: Agenda files-Footnote-1171701
+Ref: Agenda files-Footnote-2171850
+Node: Agenda dispatcher172043
+Ref: Agenda dispatcher-Footnote-1174097
+Ref: Agenda dispatcher-Footnote-2174191
+Node: Built-in agenda views174285
+Node: Weekly/Daily agenda174867
+Node: Global TODO list178204
+Node: Matching tags and properties180484
+Node: Timeline181575
+Node: Stuck projects182249
+Node: Presentation and sorting184102
+Node: Categories184895
+Ref: Categories-Footnote-1185606
+Node: Time-of-day specifications185926
+Node: Sorting of agenda items187899
+Node: Agenda commands189183
+Node: Custom agenda views196646
+Node: Storing searches197367
+Ref: Storing searches-Footnote-1199901
+Node: Block agenda200018
+Node: Setting Options201250
+Node: Exporting Agenda Views203991
+Ref: Exporting Agenda Views-Footnote-1208277
+Ref: Exporting Agenda Views-Footnote-2208334
+Node: Extracting Agenda Information for other programs208520
+Node: Embedded LaTeX212648
+Ref: Embedded LaTeX-Footnote-1213742
+Node: Math symbols213932
+Node: Subscripts and Superscripts214699
+Node: LaTeX fragments215545
+Ref: LaTeX fragments-Footnote-1217778
+Ref: LaTeX fragments-Footnote-2218039
+Node: Processing LaTeX fragments218173
+Node: CDLaTeX mode219121
+Ref: CDLaTeX mode-Footnote-1221607
+Node: Exporting221755
+Node: ASCII export223222
+Node: HTML export224723
+Node: HTML Export commands225349
+Node: Quoting HTML tags227136
+Node: Links227771
+Node: Images228468
+Ref: Images-Footnote-1229339
+Node: CSS support229400
+Ref: CSS support-Footnote-1230719
+Node: LaTeX export230832
+Node: LaTeX export commands231156
+Node: Quoting LaTeX code232318
+Node: XOXO export232823
+Node: iCalendar export233263
+Node: Text interpretation234732
+Node: Comment lines235323
+Node: Initial text235718
+Node: Footnotes237387
+Node: Enhancing text238178
+Ref: Enhancing text-Footnote-1240047
+Node: Export options240137
+Node: Publishing242539
+Ref: Publishing-Footnote-1243500
+Ref: Publishing-Footnote-2243644
+Node: Configuration243795
+Node: Project alist244513
+Node: Sources and destinations245579
+Node: Selecting files246309
+Node: Publishing action247057
+Node: Publishing options248391
+Node: Publishing links250766
+Node: Project page index252279
+Node: Sample configuration253057
+Node: Simple example253549
+Node: Complex example254222
+Node: Triggering publication256298
+Node: Miscellaneous256983
+Node: Completion257617
+Node: Customization259287
+Node: In-buffer settings259870
+Node: The very busy C-c C-c key265540
+Node: Clean view267395
+Node: TTY keys269972
+Node: Interaction271582
+Node: Cooperation271979
+Node: Conflicts274855
+Node: Bugs276858
+Node: Extensions and Hacking278354
+Node: Extensions279079
+Node: Adding hyperlink types281341
+Node: Tables in arbitrary syntax285003
+Node: Radio tables286092
+Node: A LaTeX example288595
+Ref: A LaTeX example-Footnote-1292241
+Ref: A LaTeX example-Footnote-2292389
+Node: Translator functions292824
+Ref: Translator functions-Footnote-1295933
+Node: Dynamic blocks296021
+Node: Special agenda views297993
+Node: Using the property API301238
+Node: History and Acknowledgments302719
+Node: Index309280
+Node: Key Index344349

End Tag Table
diff --git a/org-install.el b/org-install.el
index 6455399..b21dc1a 100644
--- a/org-install.el
+++ b/org-install.el
@@ -28,6 +28,7 @@
(autoload 'org-export-icalendar-combine-agenda-files "org"
"Export all files in `org-agenda-files' to a single combined iCalendar file." t)
(autoload 'org-run-like-in-org-mode "Run a command like in Org-mode.")
+(autoload 'org-agenda-to-appt "Activate appointments in `org-agenda-files'.")
;; org-latex.el
(autoload 'org-export-as-latex-batch "org-export-latex")
diff --git a/org.el b/org.el
index 63fb936..07fd764 100644
--- a/org.el
+++ b/org.el
@@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
-;; Version: 5.12c
+;; Version: 5.13
;;
;; This file is part of GNU Emacs.
;;
@@ -83,7 +83,7 @@
;;; Version
-(defconst org-version "5.12c"
+(defconst org-version "5.13"
"The version number of the file org.el.")
(defun org-version ()
(interactive)
@@ -251,7 +251,7 @@ Or return the original if not disputed."
"Define a key, possibly translated, as returned by `org-key'."
(define-key keymap (org-key key) def))
-(defcustom org-ellipsis 'org-link
+(defcustom org-ellipsis 'org-ellipsis
"The ellipsis to use in the Org-mode outline.
When nil, just use the standard three dots. When a string, use that instead,
When a face, use the standart 3 dots, but with the specified face.
@@ -439,7 +439,11 @@ this:
.....
:END:
The drawer \"PROPERTIES\" is special for capturing properties through
-the property API."
+the property API.
+
+Drawers can be defined on the per-file basis with a line like:
+
+#+DRAWERS: HIDDEN STATE PROPERTIES"
:group 'org-structure
:type '(repeat (string :tag "Drawer Name")))
@@ -1470,8 +1474,12 @@ calendar | %:type %:date"
(string :tag "Name")
(character :tag "Selection Key")
(string :tag "Template")
- (file :tag "Destination file (optional)")
- (string :tag "Destination headline (optional)"))))
+ (choice
+ (file :tag "Destination file")
+ (const :tag "Prompt for file" nil))
+ (choice
+ (string :tag "Destination headline")
+ (const :tag "Selection interface for heading")))))
(defcustom org-reverse-note-order nil
"Non-nil means, store new notes at the beginning of a file or entry.
@@ -2091,9 +2099,12 @@ you can \"misuse\" it to also add other text to the header. However,
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 files)
+ (key desc type match options files)
-key The key (a single char as a string) to be associated with the command.
+key The key (one or more characters as a string) to be associated
+ with the command.
+desc A description of the commend, when omitted or nil, a default
+ description is built using MATCH.
type The command type, any of the following symbols:
todo Entries with a specific TODO keyword, in all agenda files.
tags Tags match in all agenda files.
@@ -2101,6 +2112,7 @@ type The command type, any of the following symbols:
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.
+ ... A user-defined function.
match What to search for:
- a single keyword for TODO keyword searches
- a tags match expression for tags searches
@@ -2133,12 +2145,23 @@ cmd An agenda command, similar to the above. However, tree commands
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."
+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\")))"
:group 'org-agenda-custom-commands
:type '(repeat
- (choice :value ("a" tags "" nil)
+ (choice :value ("a" "" tags "" nil)
(list :tag "Single command"
- (string :tag "Key")
+ (string :tag "Access Key(s) ")
+ (option (string :tag "Description"))
(choice
(const :tag "Agenda" agenda)
(const :tag "TODO list" alltodo)
@@ -2149,14 +2172,14 @@ precedence over the general options."
(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)
- (symbol :tag "Other, user-defined function"))
+ (sexp :tag "Other, user-defined function"))
(string :tag "Match")
(repeat :tag "Local options"
(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")
+ (string :tag "Access Key(s)")
+ (string :tag "Description ")
(repeat
(choice
(const :tag "Agenda" (agenda))
@@ -2193,7 +2216,10 @@ precedence over the general options."
(repeat :tag "General options"
(list (variable :tag "Option")
(sexp :tag "Value")))
- (option (repeat :tag "Export" (file :tag "Export to")))))))
+ (option (repeat :tag "Export" (file :tag "Export to"))))
+ (cons :tag "Prefix key documentation"
+ (string :tag "Access Key(s)")
+ (string :tag "Description ")))))
(defcustom org-stuck-projects
'("+LEVEL=2/-DONE" ("TODO" "NEXT" "NEXTACTION") nil "")
@@ -2234,10 +2260,22 @@ potentially much shorter TODO lists."
:group 'org-todo
: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."
+ :group 'org-agenda-skip
+ :group 'org-todo
+ :type 'boolean)
+
(defcustom org-agenda-todo-ignore-scheduled nil
"Non-nil means, don't show scheduled entries in the global todo list.
The idea behind this is that by scheduling it, you have already taken care
-of this item."
+of this item.
+See also `org-agenda-todo-ignore-with-date'."
:group 'org-agenda-skip
:group 'org-todo
:type 'boolean)
@@ -2245,7 +2283,8 @@ of this item."
(defcustom org-agenda-todo-ignore-deadlines nil
"Non-nil means, don't show near deadline entries in the global todo list.
Near means closer than `org-deadline-warning-days' days.
-The idea behind this is that such items will appear in the agenda anyway."
+The idea behind this is that such items will appear in the agenda anyway.
+See also `org-agenda-todo-ignore-with-date'."
:group 'org-agenda-skip
:group 'org-todo
:type 'boolean)
@@ -2325,6 +2364,13 @@ See also the variable `org-agenda-restore-windows-after-quit'."
(const other-window)
(const reorganize-frame)))
+(defcustom org-agenda-window-frame-fractions '(0.5 . 0.75)
+ "The min and max height of the agenda window as a fraction of frame height.
+The value of the variable is a cons cell with two numbers between 0 and 1.
+It only matters if `org-agenda-window-setup' is `reorganize-frame'."
+ :group 'org-agenda-windows
+ :type '(cons (number :tag "Minimum") (number :tag "Maximum")))
+
(defcustom org-agenda-restore-windows-after-quit nil
"Non-nil means, restore window configuration open exiting agenda.
Before the window configuration is changed for displaying the agenda,
@@ -2693,9 +2739,16 @@ it means that the tags should be flushright to that column. For example,
(defcustom org-agenda-fontify-priorities t
"Non-nil means, highlight low and high priorities in agenda.
-The highest priority entries are bold, lowest priority italic."
+When t, the highest priority entries are bold, lowest priority italic.
+This may also be an association list of priority faces. The face may be
+a names face, or a list like `(:background \"Red\")'."
:group 'org-agenda-line-format
- :type 'boolean)
+ :type '(choice
+ (const :tag "Never" nil)
+ (const :tag "Defaults" t)
+ (repeat :tag "Specify"
+ (list (character :tag "Priority" :value ?A)
+ (sexp :tag "face")))))
(defgroup org-latex nil
"Options for embedding LaTeX code into Org-mode"
@@ -2904,13 +2957,16 @@ This option can also be set with the +OPTIONS line, e.g. \"tags:nil\"."
(const :tag "Not in TOC" not-in-toc)
(const :tag "On" t)))
-(defcustom org-export-with-property-drawer nil
- "Non-nil means, export property drawers.
-When nil, these drawers are removed before export.
-
-This option can also be set with the +OPTIONS line, e.g. \"p:t\"."
+(defcustom org-export-with-drawers nil
+ "Non-nil means, export with drawers like the property drawer.
+When t, all drawers are exported. This may also be a list of
+drawer names to export."
:group 'org-export-general
- :type 'boolean)
+ :type '(choice
+ (const :tag "All drawers" t)
+ (const :tag "None" nil)
+ (repeat :tag "Selected drawers"
+ (string :tag "Drawer name"))))
(defgroup org-export-translation nil
"Options for translating special ascii sequences for the export backends."
@@ -3611,6 +3667,13 @@ color of the frame."
"Face for links."
:group 'org-faces)
+(defface org-ellipsis
+ '((((class color) (background light)) (:foreground "DarkGoldenrod" :strike-through t))
+ (((class color) (background dark)) (:foreground "LightGoldenrod" :strike-through t))
+ (t (:strike-through t)))
+ "Face for the ellipsis in folded text."
+ :group 'org-faces)
+
(defface org-target
'((((class color) (background light)) (:underline t))
(((class color) (background dark)) (:underline t))
@@ -3823,6 +3886,14 @@ If it is less than 8, the level-1 face gets re-used for level N+1 etc."
(defvar org-todo-line-regexp nil
"Matches a headline and puts TODO state into group 2 if present.")
(make-variable-buffer-local 'org-todo-line-regexp)
+(defvar org-complex-heading-regexp nil
+ "Matches a headline and puts everything into groups:
+group 1: the stars
+group 2: The todo keyword, maybe
+group 3: Priority cookie
+group 4: True headline
+group 5: Tags")
+(make-variable-buffer-local 'org-complex-heading-regexp)
(defvar org-todo-line-tags-regexp nil
"Matches a headline and puts TODO state into group 2 if present.
Also put tags into group 4 if tags are present.")
@@ -3959,11 +4030,11 @@ means to push this value onto the list in the variable.")
(let ((re (org-make-options-regexp
'("CATEGORY" "SEQ_TODO" "TYP_TODO" "TODO" "COLUMNS"
"STARTUP" "ARCHIVE" "TAGS" "LINK" "PRIORITIES"
- "CONSTANTS" "PROPERTY")))
+ "CONSTANTS" "PROPERTY" "DRAWERS")))
(splitre "[ \t]+")
kwds kws0 kwsa key value cat arch tags const links hw dws
- tail sep kws1 prio props
- ex log note)
+ tail sep kws1 prio props drawers
+ ex log)
(save-excursion
(save-restriction
(widen)
@@ -3994,6 +4065,8 @@ means to push this value onto the list in the variable.")
(when (string-match "\\(\\S-+\\)\\s-+\\(.*\\)" value)
(push (cons (match-string 1 value) (match-string 2 value))
props)))
+ ((equal key "DRAWERS")
+ (setq drawers (org-split-string value splitre)))
((equal key "CONSTANTS")
(setq const (append const (org-split-string value splitre))))
((equal key "STARTUP")
@@ -4022,6 +4095,7 @@ means to push this value onto the list in the variable.")
(org-set-local 'org-lowest-priority (nth 1 prio))
(org-set-local 'org-default-priority (nth 2 prio)))
(and props (org-set-local 'org-local-properties (nreverse props)))
+ (and drawers (org-set-local 'org-drawers drawers))
(and arch (org-set-local 'org-archive-location arch))
(and links (setq org-link-abbrev-alist-local (nreverse links)))
;; Process the TODO keywords
@@ -4116,6 +4190,11 @@ means to push this value onto the list in the variable.")
(concat "^\\(\\*+\\)[ \t]+\\(?:\\("
(mapconcat 'regexp-quote org-todo-keywords-1 "\\|")
"\\)\\>\\)?[ \t]*\\(.*\\)")
+ org-complex-heading-regexp
+ (concat "^\\(\\*+\\)\\(?:[ \t]+\\("
+ (mapconcat 'regexp-quote org-todo-keywords-1 "\\|")
+ "\\)\\>\\)?\\(?:[ \t]*\\(\\[#.\\]\\)\\)?[ \t]*\\(.*?\\)"
+ "\\(?:[ \t]+\\(:[[:alnum:]_@:]+:\\)\\)?[ \t]*$")
org-nl-done-regexp
(concat "\n\\*+[ \t]+"
"\\(?:" (mapconcat 'regexp-quote org-done-keywords "\\|")
@@ -5786,7 +5865,7 @@ is signaled in this case."
(save-excursion
(goto-char (point-min))
(while (re-search-forward "^\\*\\*+ " nil t)
- (setq n (/ (length (1- (match-string 0))) 2))
+ (setq n (/ (1- (length (match-string 0))) 2))
(while (>= (setq n (1- n)) 0)
(org-promote))
(end-of-line 1))))))
@@ -5945,7 +6024,6 @@ If optional TREE is given, use this text instead of the kill ring."
(= old-level new-level))
0
(- new-level old-level)))
- (shift1 shift)
(delta (if (> shift 0) -1 1))
(func (if (> shift 0) 'org-demote 'org-promote))
(org-odd-levels-only nil)
@@ -6010,13 +6088,16 @@ If optional TXT is given, check this string instead of the current kill."
;;; Outline Sorting
(defun org-sort (with-case)
- "Call `org-sort-entries' or `org-table-sort-lines', depending on context."
+ "Call `org-sort-entries-or-items' or `org-table-sort-lines'.
+Optional argument WITH-CASE means sort case-sensitively."
(interactive "P")
(if (org-at-table-p)
(org-call-with-arg 'org-table-sort-lines with-case)
- (org-call-with-arg 'org-sort-entries with-case)))
+ (org-call-with-arg 'org-sort-entries-or-items with-case)))
+
+(defvar org-priority-regexp) ; defined later in the file
-(defun org-sort-entries (&optional with-case sorting-type)
+(defun org-sort-entries-or-items (&optional with-case sorting-type getkey-func property)
"Sort entries on a certain level of an outline tree.
If there is an active region, the entries in the region are sorted.
Else, if the cursor is before the first entry, sort the top-level items.
@@ -6025,26 +6106,35 @@ Else, the children of the entry at point are sorted.
Sorting can be alphabetically, numerically, and by date/time as given by
the first time stamp in the entry. The command prompts for the sorting
type unless it has been given to the function through the SORTING-TYPE
-argument, which needs to a character, any of (?n ?N ?a ?A ?t ?T).
+argument, which needs to a character, any of (?n ?N ?a ?A ?t ?T ?p ?P ?f ?F).
+If the SORTING-TYPE is ?f or ?F, then GETKEY-FUNC specifies a function to be
+called with point at the beginning of the record. It must return either
+a string or a number that should serve as the sorting key for that record.
Comparing entries ignores case by default. However, with an optional argument
-WITH-CASE, the sorting considers case as well. With two prefix arguments
-`C-u C-u', sorting is case-sensitive and duplicate entries will be removed."
+WITH-CASE, the sorting considers case as well."
(interactive "P")
- (let ((unique (equal with-case '(16)))
- start beg end entries stars re re2 p nentries (nremoved 0)
- last txt what)
+ (let ((case-func (if with-case 'identity 'downcase))
+ start beg end stars re re2
+ txt what tmp plain-list-p)
;; Find beginning and end of region to sort
(cond
((org-region-active-p)
;; we will sort the region
(setq end (region-end)
- what "region")
+ what "region")
(goto-char (region-beginning))
(if (not (org-on-heading-p)) (outline-next-heading))
(setq start (point)))
+ ((org-at-item-p)
+ ;; we will sort this plain list
+ (org-beginning-of-item-list) (setq start (point))
+ (org-end-of-item-list) (setq end (point))
+ (goto-char start)
+ (setq plain-list-p t
+ what "plain list"))
((or (org-on-heading-p)
- (condition-case nil (progn (org-back-to-heading) t) (error nil)))
+ (condition-case nil (progn (org-back-to-heading) t) (error nil)))
;; we will sort the children of the current headline
(org-back-to-heading)
(setq start (point) end (org-end-of-subtree) what "children")
@@ -6058,46 +6148,129 @@ WITH-CASE, the sorting considers case as well. With two prefix arguments
(setq start (point) end (point-max) what "top-level")
(goto-char start)
(show-all)))
- (setq beg (point))
- (if (>= (point) end) (error "Nothing to sort"))
- (looking-at "\\(\\*+\\)")
- (setq stars (match-string 1)
- re (concat "^" (regexp-quote stars) " +")
- re2 (concat "^" (regexp-quote (substring stars 0 -1)) "[^*]")
- txt (buffer-substring beg end))
- (if (not (equal (substring txt -1) "\n")) (setq txt (concat txt "\n")))
- (if (and (not (equal stars "*")) (string-match re2 txt))
- (error "Region to sort contains a level above the first entry"))
- ;; Make a list that can be sorted.
- ;; The car is the string for comparison, the cdr is the subtree
- (message "Sorting entries...")
- (setq entries
- (mapcar
- (lambda (x)
- (string-match "^.*\\(\n.*\\)?" x) ; take two lines
- (cons (match-string 0 x) x))
- (org-split-string txt re)))
- ;; Sort the list
- (save-excursion
- (goto-char start)
- (setq entries (org-do-sort entries what with-case sorting-type)))
+ (setq beg (point))
+ (if (>= beg end) (error "Nothing to sort"))
+
+ (unless plain-list-p
+ (looking-at "\\(\\*+\\)")
+ (setq stars (match-string 1)
+ re (concat "^" (regexp-quote stars) " +")
+ re2 (concat "^" (regexp-quote (substring stars 0 -1)) "[^*]")
+ txt (buffer-substring beg end))
+ (if (not (equal (substring txt -1) "\n")) (setq txt (concat txt "\n")))
+ (if (and (not (equal stars "*")) (string-match re2 txt))
+ (error "Region to sort contains a level above the first entry")))
+
+ (unless sorting-type
+ (message
+ (if plain-list-p
+ "Sort %s: [a]lpha [n]umeric [t]ime [f]unc A/N/T/F means reversed:"
+ "Sort %s: [a]lpha [n]umeric [t]ime [p]riority p[r]operty [f]unc A/N/T/P/F means reversed:")
+ what)
+ (setq sorting-type (read-char-exclusive))
+
+ (and (= (downcase sorting-type) ?f)
+ (setq getkey-func
+ (completing-read "Sort using function: "
+ obarray 'fboundp t nil nil))
+ (setq getkey-func (intern getkey-func)))
+
+ (and (= (downcase sorting-type) ?r)
+ (setq property
+ (completing-read "Property: "
+ (mapcar 'list (org-buffer-property-keys t))
+ nil t))))
- ;; Delete the old stuff
- (goto-char beg)
- (kill-region beg end)
- (setq nentries (length entries))
- ;; Insert the sorted entries, and remove duplicates if this is required
- (while (setq p (pop entries))
- (if (and unique (equal last (setq last (org-trim (cdr p)))))
- (setq nremoved (1+ nremoved)) ; same entry as before, skip it
- (insert stars " " (cdr p))))
- (goto-char start)
- (message "Sorting entries...done (%d entries%s)"
- nentries
- (if unique (format ", %d duplicates removed" nremoved) ""))))
+ (message "Sorting entries...")
-(defvar org-priority-regexp) ; defined later in the file
+ (save-restriction
+ (narrow-to-region start end)
+
+ (let ((dcst (downcase sorting-type))
+ (now (current-time)))
+ (sort-subr
+ (/= dcst sorting-type)
+ ;; This function moves to the beginning character of the "record" to
+ ;; be sorted.
+ (if plain-list-p
+ (lambda nil
+ (if (org-at-item-p) t (goto-char (point-max))))
+ (lambda nil
+ (if (re-search-forward re nil t)
+ (goto-char (match-beginning 0))
+ (goto-char (point-max)))))
+ ;; This function moves to the last character of the "record" being
+ ;; sorted.
+ (if plain-list-p
+ 'org-end-of-item
+ (lambda nil
+ (save-match-data
+ (condition-case nil
+ (outline-forward-same-level 1)
+ (error
+ (goto-char (point-max)))))))
+
+ ;; This function returns the value that gets sorted against.
+ (if plain-list-p
+ (lambda nil
+ (when (looking-at "[ \t]*[-+*0-9.)]+[ \t]+")
+ (cond
+ ((= dcst ?n)
+ (string-to-number (buffer-substring (match-end 0)
+ (line-end-position))))
+ ((= dcst ?a)
+ (buffer-substring (match-end 0) (line-end-position)))
+ ((= dcst ?t)
+ (if (re-search-forward org-ts-regexp
+ (line-end-position) t)
+ (org-time-string-to-time (match-string 0))
+ now))
+ ((= dcst ?f)
+ (if getkey-func
+ (progn
+ (setq tmp (funcall getkey-func))
+ (if (stringp tmp) (setq tmp (funcall case-func tmp)))
+ tmp)
+ (error "Invalid key function `%s'" getkey-func)))
+ (t (error "Invalid sorting type `%c'" sorting-type)))))
+ (lambda nil
+ (cond
+ ((= dcst ?n)
+ (if (looking-at outline-regexp)
+ (string-to-number (buffer-substring (match-end 0)
+ (line-end-position)))
+ nil))
+ ((= dcst ?a)
+ (funcall case-func (buffer-substring (line-beginning-position)
+ (line-end-position))))
+ ((= dcst ?t)
+ (if (re-search-forward org-ts-regexp
+ (save-excursion
+ (forward-line 2)
+ (point)) t)
+ (org-time-string-to-time (match-string 0))
+ now))
+ ((= dcst ?p)
+ (if (re-search-forward org-priority-regexp (line-end-position) t)
+ (string-to-char (match-string 2))
+ org-default-priority))
+ ((= dcst ?r)
+ (or (org-entry-get nil property) ""))
+ ((= dcst ?f)
+ (if getkey-func
+ (progn
+ (setq tmp (funcall getkey-func))
+ (if (stringp tmp) (setq tmp (funcall case-func tmp)))
+ tmp)
+ (error "Invalid key function `%s'" getkey-func)))
+ (t (error "Invalid sorting type `%c'" sorting-type)))))
+ nil
+ (cond
+ ((= dcst ?a) 'string<)
+ ((= dcst ?t) 'time-less-p)
+ (t nil)))))
+ (message "Sorting entries...done")))
(defun org-do-sort (table what &optional with-case sorting-type)
"Sort TABLE of WHAT according to SORTING-TYPE.
@@ -6108,7 +6281,7 @@ the car of the elements of the table.
If WITH-CASE is non-nil, the sorting will be case-sensitive."
(unless sorting-type
(message
- "Sort %s: [a]lphabetic. [n]umeric. [t]ime [p]riority. A/N/T/P means reversed:"
+ "Sort %s: [a]lphabetic. [n]umeric. [t]ime. A/N/T means reversed:"
what)
(setq sorting-type (read-char-exclusive)))
(let ((dcst (downcase sorting-type))
@@ -6132,13 +6305,6 @@ If WITH-CASE is non-nil, the sorting will be case-sensitive."
(org-time-string-to-time (match-string 0 x)))
0))
comparefun (if (= dcst sorting-type) '< '>)))
- ((= dcst ?p)
- (setq extractfun
- (lambda (x)
- (if (string-match org-priority-regexp x)
- (string-to-char (match-string 2 x))
- org-default-priority))
- comparefun (if (= dcst sorting-type) '< '>)))
(t (error "Invalid sorting type `%c'" sorting-type)))
(sort (mapcar (lambda (x) (cons (funcall extractfun (car x)) (cdr x)))
@@ -6545,15 +6711,18 @@ If WHICH is a string, use that as the new bullet. If WHICH is an integer,
(org-beginning-of-item-list)
(org-at-item-p)
(beginning-of-line 1)
- (let ((current (match-string 0)) new)
+ (let ((current (match-string 0))
+ (prevp (eq which 'previous))
+ new)
(setq new (cond
- ((and which (nth (1- which) '("-" "+" "*" "1." "1)"))))
- ((string-match "-" current) "+")
+ ((and (numberp which)
+ (nth (1- which) '("-" "+" "*" "1." "1)"))))
+ ((string-match "-" current) (if prevp "1)" "+"))
((string-match "\\+" current)
- (if (looking-at "\\S-") "1." "*"))
- ((string-match "\\*" current) "1.")
- ((string-match "\\." current) "1)")
- ((string-match ")" current) "-")
+ (if prevp "-" (if (looking-at "\\S-") "1." "*")))
+ ((string-match "\\*" current) (if prevp "+" "1."))
+ ((string-match "\\." current) (if prevp "*" "1)"))
+ ((string-match ")" current) (if prevp "1." "-"))
(t (error "This should not happen"))))
(and (looking-at "\\([ \t]*\\)\\S-+") (replace-match (concat "\\1" new)))
(org-fix-bullet-type)
@@ -6665,6 +6834,33 @@ I.e. to the first item in this list."
(when (org-at-item-p) (setq pos (point-at-bol)))))))
(goto-char pos)))
+
+(defun org-end-of-item-list ()
+ "Go to the end of the current item list.
+I.e. to the text after the last item."
+ (interactive)
+ (org-beginning-of-item)
+ (let ((pos (point-at-bol))
+ (ind (org-get-indentation))
+ ind1)
+ ;; find where this list begins
+ (catch 'exit
+ (while t
+ (catch 'next
+ (beginning-of-line 2)
+ (if (looking-at "[ \t]*$")
+ (throw (if (eobp) 'exit 'next) t))
+ (skip-chars-forward " \t") (setq ind1 (current-column))
+ (if (or (< ind1 ind)
+ (and (= ind1 ind)
+ (not (org-at-item-p)))
+ (eobp))
+ (progn
+ (setq pos (point-at-bol))
+ (throw 'exit t))))))
+ (goto-char pos)))
+
+
(defvar org-last-indent-begin-marker (make-marker))
(defvar org-last-indent-end-marker (make-marker))
@@ -6965,12 +7161,15 @@ this heading."
(this-buffer (current-buffer))
(org-archive-location org-archive-location)
(re "^#\\+ARCHIVE:[ \t]+\\(\\S-.*\\S-\\)[ \t]*$")
+ ;; start of variables that will be used for savind context
(file (abbreviate-file-name (buffer-file-name)))
(time (format-time-string
(substring (cdr org-time-stamp-formats) 1 -1)
(current-time)))
afile heading buffer level newfile-p
- category todo priority ltags itags prop)
+ category todo priority
+ ;; start of variables that will be used for savind context
+ ltags itags prop)
;; Try to find a local archive location
(save-excursion
@@ -7241,11 +7440,13 @@ If ONOFF is `on' or `off', don't toggle but set to this state."
(setq res t)
(push tag current))))
(end-of-line 1)
- (when current
- (insert " :" (mapconcat 'identity (nreverse current) ":") ":"))
- (org-set-tags nil t)
- res)
- (run-hooks 'org-after-tags-change-hook)))
+ (if current
+ (progn
+ (insert " :" (mapconcat 'identity (nreverse current) ":") ":")
+ (org-set-tags nil t))
+ (delete-horizontal-space))
+ (run-hooks 'org-after-tags-change-hook))
+ res))
(defun org-toggle-archive-tag (&optional arg)
"Toggle the archive tag for the current headline.
@@ -7419,7 +7620,7 @@ nil When nil, the command tries to be smart and figure out the
(interactive "rP")
(let* ((beg (min beg0 end0))
(end (max beg0 end0))
- sep-re re)
+ re)
(goto-char beg)
(beginning-of-line 1)
(setq beg (move-marker (make-marker) (point)))
@@ -8296,7 +8497,6 @@ In particular, this does handle wide and invisible characters."
(org-table-fix-formulas "@" (list (cons (number-to-string dline) "INVALID"))
dline -1 dline)))
-
(defun org-table-sort-lines (with-case &optional sorting-type)
"Sort table lines according to the column at point.
@@ -11848,7 +12048,6 @@ optional argument IN-EMACS is non-nil, Emacs will visit the file."
(browse-url-at-point)))))
(move-marker org-open-link-marker nil))
-
;;; File search
(defvar org-create-file-search-functions nil
@@ -12532,7 +12731,11 @@ to be run from that hook to fucntion properly."
(format "[%c]%s" (car x) (substring (nth 1 x) 1)))
(t (format "[%c]%s" (car x) (nth 1 x)))))
templates " "))
- (read-char-exclusive)))))
+ (let ((inhibit-quit t) (char0 (read-char-exclusive)))
+ (when (equal char0 ?\C-g)
+ (jump-to-register remember-register)
+ (kill-buffer remember-buffer))
+ char0)))))
(entry (cddr (assoc char templates)))
(tpl (car entry))
(plist-p (if org-store-link-plist t nil))
@@ -12968,7 +13171,7 @@ This function can be used in a hook."
(defconst org-additional-option-like-keywords
'("BEGIN_HTML" "BEGIN_LaTeX" "END_HTML" "END_LaTeX"
- "ORGTBL" "HTML:" "LaTeX:"))
+ "ORGTBL" "HTML:" "LaTeX:" "BEGIN:" "END:" "DATE:"))
(defun org-complete (&optional arg)
"Perform completion on word at point.
@@ -13113,6 +13316,56 @@ If yes, return this value. If not, return the current value of the variable."
(read prop)
(symbol-value var))))
+(defun org-parse-local-options (string var)
+ "Parse STRING for startup setting relevant for variable VAR."
+ (let ((rtn (symbol-value var))
+ e opts)
+ (save-match-data
+ (if (or (not string) (not (string-match "\\S-" string)))
+ rtn
+ (setq opts (delq nil (mapcar (lambda (x)
+ (setq e (assoc x org-startup-options))
+ (if (eq (nth 1 e) var) e nil))
+ (org-split-string string "[ \t]+"))))
+ (if (not opts)
+ rtn
+ (setq rtn nil)
+ (while (setq e (pop opts))
+ (if (not (nth 3 e))
+ (setq rtn (nth 2 e))
+ (if (not (listp rtn)) (setq rtn nil))
+ (push (nth 2 e) rtn)))
+ rtn)))))
+
+(defvar org-blocker-hook nil
+ "Hook for functions that are allowed to block a state change.
+
+Each function gets as its single argument a property list, see
+`org-trigger-hook' for more information about this list.
+
+If any of the functions in this hook returns nil, the state change
+is blocked.")
+
+(defvar org-trigger-hook nil
+ "Hook for functions that are triggered by a state change.
+
+Each function gets as its single argument a property list with at least
+the following elements:
+
+ (:type type-of-change :position pos-at-entry-start
+ :from old-state :to new-state)
+
+Depending on the type, more properties may be present.
+
+This mechanism is currently implemented for:
+
+TODO state changes
+------------------
+:type todo-state-change
+:from previous state (keyword as a string), or nil
+:to new state (keyword as a string), or nil")
+
+
(defun org-todo (&optional arg)
"Change the TODO state of an item.
The state of an item is given by a keyword at the start of the heading,
@@ -13139,134 +13392,151 @@ For calling through lisp, arg is also interpreted in the following way:
really is a member of `org-todo-keywords'."
(interactive "P")
(save-excursion
- (org-back-to-heading)
- (if (looking-at outline-regexp) (goto-char (1- (match-end 0))))
- (or (looking-at (concat " +" org-todo-regexp " *"))
- (looking-at " *"))
- (let* ((logging (save-match-data (org-entry-get nil "LOGGING" t)))
- (org-log-done (org-parse-local-options logging 'org-log-done))
- (org-log-repeat (org-parse-local-options logging 'org-log-repeat))
- (this (match-string 1))
- (hl-pos (match-beginning 0))
- (head (org-get-todo-sequence-head this))
- (ass (assoc head org-todo-kwd-alist))
- (interpret (nth 1 ass))
- (done-word (nth 3 ass))
- (final-done-word (nth 4 ass))
- (last-state (or this ""))
- (completion-ignore-case t)
- (member (member this org-todo-keywords-1))
- (tail (cdr member))
- (state (cond
- ((and org-todo-key-trigger
- (or (and (equal arg '(4)) (eq org-use-fast-todo-selection 'prefix))
- (and (not arg) org-use-fast-todo-selection
- (not (eq org-use-fast-todo-selection 'prefix)))))
- ;; Use fast selection
- (org-fast-todo-selection))
- ((and (equal arg '(4))
- (or (not org-use-fast-todo-selection)
- (not org-todo-key-trigger)))
- ;; Read a state with completion
- (completing-read "State: " (mapcar (lambda(x) (list x))
- org-todo-keywords-1)
- nil t))
- ((eq arg 'right)
- (if this
- (if tail (car tail) nil)
- (car org-todo-keywords-1)))
- ((eq arg 'left)
- (if (equal member org-todo-keywords-1)
- nil
+ (catch 'exit
+ (org-back-to-heading)
+ (if (looking-at outline-regexp) (goto-char (1- (match-end 0))))
+ (or (looking-at (concat " +" org-todo-regexp " *"))
+ (looking-at " *"))
+ (let* ((startpos (line-beginning-position))
+ (logging (save-match-data (org-entry-get nil "LOGGING" t)))
+ (org-log-done (org-parse-local-options logging 'org-log-done))
+ (org-log-repeat (org-parse-local-options logging 'org-log-repeat))
+ (this (match-string 1))
+ (hl-pos (match-beginning 0))
+ (head (org-get-todo-sequence-head this))
+ (ass (assoc head org-todo-kwd-alist))
+ (interpret (nth 1 ass))
+ (done-word (nth 3 ass))
+ (final-done-word (nth 4 ass))
+ (last-state (or this ""))
+ (completion-ignore-case t)
+ (member (member this org-todo-keywords-1))
+ (tail (cdr member))
+ (state (cond
+ ((and org-todo-key-trigger
+ (or (and (equal arg '(4)) (eq org-use-fast-todo-selection 'prefix))
+ (and (not arg) org-use-fast-todo-selection
+ (not (eq org-use-fast-todo-selection 'prefix)))))
+ ;; Use fast selection
+ (org-fast-todo-selection))
+ ((and (equal arg '(4))
+ (or (not org-use-fast-todo-selection)
+ (not org-todo-key-trigger)))
+ ;; Read a state with completion
+ (completing-read "State: " (mapcar (lambda(x) (list x))
+ org-todo-keywords-1)
+ nil t))
+ ((eq arg 'right)
(if this
- (nth (- (length org-todo-keywords-1) (length tail) 2)
- org-todo-keywords-1)
- (org-last org-todo-keywords-1))))
- ((and (eq org-use-fast-todo-selection t) (equal arg '(4))
- (setq arg nil))) ; hack to fall back to cycling
- (arg
- ;; user or caller requests a specific state
- (cond
- ((equal arg "") nil)
- ((eq arg 'none) nil)
- ((eq arg 'done) (or done-word (car org-done-keywords)))
- ((eq arg 'nextset)
- (or (car (cdr (member head org-todo-heads)))
- (car org-todo-heads)))
- ((eq arg 'previousset)
- (let ((org-todo-heads (reverse org-todo-heads)))
+ (if tail (car tail) nil)
+ (car org-todo-keywords-1)))
+ ((eq arg 'left)
+ (if (equal member org-todo-keywords-1)
+ nil
+ (if this
+ (nth (- (length org-todo-keywords-1) (length tail) 2)
+ org-todo-keywords-1)
+ (org-last org-todo-keywords-1))))
+ ((and (eq org-use-fast-todo-selection t) (equal arg '(4))
+ (setq arg nil))) ; hack to fall back to cycling
+ (arg
+ ;; user or caller requests a specific state
+ (cond
+ ((equal arg "") nil)
+ ((eq arg 'none) nil)
+ ((eq arg 'done) (or done-word (car org-done-keywords)))
+ ((eq arg 'nextset)
(or (car (cdr (member head org-todo-heads)))
- (car org-todo-heads))))
- ((car (member arg org-todo-keywords-1)))
- ((nth (1- (prefix-numeric-value arg))
+ (car org-todo-heads)))
+ ((eq arg 'previousset)
+ (let ((org-todo-heads (reverse org-todo-heads)))
+ (or (car (cdr (member head org-todo-heads)))
+ (car org-todo-heads))))
+ ((car (member arg org-todo-keywords-1)))
+ ((nth (1- (prefix-numeric-value arg))
org-todo-keywords-1))))
- ((null member) (or head (car org-todo-keywords-1)))
- ((equal this final-done-word) nil) ;; -> make empty
- ((null tail) nil) ;; -> first entry
- ((eq interpret 'sequence)
- (car tail))
- ((memq interpret '(type priority))
- (if (eq this-command last-command)
- (car tail)
- (if (> (length tail) 0)
- (or done-word (car org-done-keywords))
- nil)))
- (t nil)))
- (next (if state (concat " " state " ") " "))
- dostates)
- (replace-match next t t)
- (unless (pos-visible-in-window-p hl-pos)
- (message "TODO state changed to %s" (org-trim next)))
- (unless head
- (setq head (org-get-todo-sequence-head state)
- ass (assoc head org-todo-kwd-alist)
- interpret (nth 1 ass)
- done-word (nth 3 ass)
- final-done-word (nth 4 ass)))
- (when (memq arg '(nextset previousset))
- (message "Keyword-Set %d/%d: %s"
- (- (length org-todo-sets) -1
- (length (memq (assoc state org-todo-sets) org-todo-sets)))
- (length org-todo-sets)
- (mapconcat 'identity (assoc state org-todo-sets) " ")))
- (setq org-last-todo-state-is-todo
- (not (member state org-done-keywords)))
- (when (and org-log-done (not (memq arg '(nextset previousset))))
- (setq dostates (and (listp org-log-done) (memq 'state org-log-done)
- (or (not org-todo-log-states)
- (member state org-todo-log-states))))
-
- (cond
- ((and state (member state org-not-done-keywords)
- (not (member this org-not-done-keywords)))
- ;; This is now a todo state and was not one before
- ;; Remove any CLOSED timestamp, and possibly log the state change
- (org-add-planning-info nil nil 'closed)
- (and dostates (org-add-log-maybe 'state state 'findpos)))
- ((and state dostates)
- ;; This is a non-nil state, and we need to log it
- (org-add-log-maybe 'state state 'findpos))
- ((and (member state org-done-keywords)
- (not (member this org-done-keywords)))
- ;; It is now done, and it was not done before
- (org-add-planning-info 'closed (org-current-time))
- (org-add-log-maybe 'done state 'findpos))))
- ;; Fixup tag positioning
- (and org-auto-align-tags (not org-setting-tags) (org-set-tags nil t))
- (run-hooks 'org-after-todo-state-change-hook)
- (and (member state org-done-keywords) (org-auto-repeat-maybe))
- (if (and arg (not (member state org-done-keywords)))
- (setq head (org-get-todo-sequence-head state)))
- (put-text-property (point-at-bol) (point-at-eol) 'org-todo-head head)))
- ;; Fixup cursor location if close to the keyword
- (if (and (outline-on-heading-p)
- (not (bolp))
- (save-excursion (beginning-of-line 1)
- (looking-at org-todo-line-regexp))
- (< (point) (+ 2 (or (match-end 2) (match-end 1)))))
- (progn
- (goto-char (or (match-end 2) (match-end 1)))
- (just-one-space))))
+ ((null member) (or head (car org-todo-keywords-1)))
+ ((equal this final-done-word) nil) ;; -> make empty
+ ((null tail) nil) ;; -> first entry
+ ((eq interpret 'sequence)
+ (car tail))
+ ((memq interpret '(type priority))
+ (if (eq this-command last-command)
+ (car tail)
+ (if (> (length tail) 0)
+ (or done-word (car org-done-keywords))
+ nil)))
+ (t nil)))
+ (next (if state (concat " " state " ") " "))
+ (change-plist (list :type 'todo-state-change :from this :to state
+ :position startpos))
+ dostates)
+ (when org-blocker-hook
+ (unless (save-excursion
+ (save-match-data
+ (run-hook-with-args-until-failure
+ 'org-blocker-hook change-plist)))
+ (if (interactive-p)
+ (error "TODO state change from %s to %s blocked" this state)
+ ;; fail silently
+ (message "TODO state change from %s to %s blocked" this state)
+ (throw 'exit nil))))
+ (replace-match next t t)
+ (unless (pos-visible-in-window-p hl-pos)
+ (message "TODO state changed to %s" (org-trim next)))
+ (unless head
+ (setq head (org-get-todo-sequence-head state)
+ ass (assoc head org-todo-kwd-alist)
+ interpret (nth 1 ass)
+ done-word (nth 3 ass)
+ final-done-word (nth 4 ass)))
+ (when (memq arg '(nextset previousset))
+ (message "Keyword-Set %d/%d: %s"
+ (- (length org-todo-sets) -1
+ (length (memq (assoc state org-todo-sets) org-todo-sets)))
+ (length org-todo-sets)
+ (mapconcat 'identity (assoc state org-todo-sets) " ")))
+ (setq org-last-todo-state-is-todo
+ (not (member state org-done-keywords)))
+ (when (and org-log-done (not (memq arg '(nextset previousset))))
+ (setq dostates (and (listp org-log-done) (memq 'state org-log-done)
+ (or (not org-todo-log-states)
+ (member state org-todo-log-states))))
+
+ (cond
+ ((and state (member state org-not-done-keywords)
+ (not (member this org-not-done-keywords)))
+ ;; This is now a todo state and was not one before
+ ;; Remove any CLOSED timestamp, and possibly log the state change
+ (org-add-planning-info nil nil 'closed)
+ (and dostates (org-add-log-maybe 'state state 'findpos)))
+ ((and state dostates)
+ ;; This is a non-nil state, and we need to log it
+ (org-add-log-maybe 'state state 'findpos))
+ ((and (member state org-done-keywords)
+ (not (member this org-done-keywords)))
+ ;; It is now done, and it was not done before
+ (org-add-planning-info 'closed (org-current-time))
+ (org-add-log-maybe 'done state 'findpos))))
+ ;; Fixup tag positioning
+ (and org-auto-align-tags (not org-setting-tags) (org-set-tags nil t))
+ (run-hooks 'org-after-todo-state-change-hook)
+ (and (member state org-done-keywords) (org-auto-repeat-maybe))
+ (if (and arg (not (member state org-done-keywords)))
+ (setq head (org-get-todo-sequence-head state)))
+ (put-text-property (point-at-bol) (point-at-eol) 'org-todo-head head)
+ ;; Fixup cursor location if close to the keyword
+ (if (and (outline-on-heading-p)
+ (not (bolp))
+ (save-excursion (beginning-of-line 1)
+ (looking-at org-todo-line-regexp))
+ (< (point) (+ 2 (or (match-end 2) (match-end 1)))))
+ (progn
+ (goto-char (or (match-end 2) (match-end 1)))
+ (just-one-space)))
+ (when org-trigger-hook
+ (save-excursion
+ (run-hook-with-args 'org-trigger-hook change-plist)))))))
(defun org-get-todo-sequence-head (kwd)
"Return the head of the TODO sequence to which KWD belongs.
@@ -13293,11 +13563,10 @@ Returns the new TODO keyword, or nil if no state change should occur."
(lambda (x)
(if (stringp (car x)) (string-width (car x)) 0))
fulltable)))
- (buf (current-buffer))
(expert nil)
(fwidth (+ maxlen 3 1 3))
(ncol (/ (- (window-width) 4) fwidth))
- tg cnt e c char c1 c2 ntable tbl rtn
+ tg cnt e c tbl
groups ingroup)
(save-window-excursion
(if expert
@@ -13307,7 +13576,7 @@ Returns the new TODO keyword, or nil if no state change should occur."
(org-switch-to-buffer-other-window (get-buffer-create " *Org tags*")))
(erase-buffer)
(org-set-local 'org-done-keywords done-keywords)
- (setq tbl fulltable char ?a cnt 0)
+ (setq tbl fulltable cnt 0)
(while (setq e (pop tbl))
(cond
((equal e '(:startgroup))
@@ -13618,6 +13887,41 @@ The auto-repeater uses this.")
(move-marker org-log-note-return-to nil)
(and org-log-post-message (message org-log-post-message)))
+;; FIXME: what else would be useful?
+;; - priority
+;; - date
+
+(defun org-sparse-tree (&optional arg)
+ "Create a sparse tree, prompt for the details.
+This command can create sparse trees. You first need to select the type
+of match used to create the tree:
+
+t Show entries with a specific TODO keyword.
+T Show entries selected by a tags match.
+p Enter a property name and its value (both with completion on existing
+ names/values) and show entries with that property.
+r Show entries matching a regular expression"
+ (interactive "P")
+ (let (ans kwd value)
+ (message "Sparse tree: [r]egexp [t]odo-kwd [T]ag [p]roperty")
+ (setq ans (read-char-exclusive))
+ (cond
+ ((equal ans ?t)
+ (org-show-todo-tree '(4)))
+ ((equal ans ?T)
+ (call-interactively 'org-tags-sparse-tree))
+ ((member ans '(?p ?P))
+ (setq kwd (completing-read "Property: "
+ (mapcar 'list (org-buffer-property-keys))))
+ (setq value (completing-read "Value: "
+ (mapcar 'list (org-property-values kwd))))
+ (unless (string-match "\\`{.*}\\'" value)
+ (setq value (concat "\"" value "\"")))
+ (org-tags-sparse-tree arg (concat kwd "=" value)))
+ ((member ans '(?r ?R))
+ (call-interactively 'org-occur))
+ (t (error "No such sparse tree command \"%c\"" ans)))))
+
(defvar org-occur-highlights nil)
(make-variable-buffer-local 'org-occur-highlights)
@@ -14445,6 +14749,12 @@ Returns the new tags string, or nil to not change the current settings."
These are properties that are not defined in the property drawer,
but in some other way.")
+(defconst org-default-properties
+ '("ARCHIVE" "CATEGORY" "SUMMARY" "DESCRIPTION"
+ "LOCATION" "LOGGING" "COLUMNS")
+ "Some properties that are used by Org-mode for various purposes.
+Being in this list makes sure that they are offered for completion.")
+
(defconst org-property-start-re "^[ \t]*:PROPERTIES:[ \t]*$"
"Regular expression matching the first line of a property drawer.")
@@ -14454,9 +14764,8 @@ but in some other way.")
(defun org-property-action ()
"Do an action on properties."
(interactive)
- (let (c prop)
+ (let (c)
(org-at-property-p)
- (setq prop (match-string 2))
(message "Property Action: [s]et [d]elete [D]elete globally [c]ompute")
(setq c (read-char-exclusive))
(cond
@@ -14614,22 +14923,50 @@ If the property is not present at all, nil is returned."
t)
nil)))))
+;; Multi-values properties are properties that contain multiple values
+;; These values are assumed to be single words, separated by whitespace.
+(defun org-entry-add-to-multivalued-property (pom property value)
+ "Add VALUE to the words in the PROPERTY in entry at point-or-marker POM."
+ (let* ((old (org-entry-get pom property))
+ (values (and old (org-split-string old "[ \t]"))))
+ (unless (member value values)
+ (setq values (cons value values))
+ (org-entry-put pom property
+ (mapconcat 'identity values " ")))))
+
+(defun org-entry-remove-from-multivalued-property (pom property value)
+ "Remove VALUE from words in the PROPERTY in entry at point-or-marker POM."
+ (let* ((old (org-entry-get pom property))
+ (values (and old (org-split-string old "[ \t]"))))
+ (when (member value values)
+ (setq values (delete value values))
+ (org-entry-put pom property
+ (mapconcat 'identity values " ")))))
+
+(defun org-entry-member-in-multivalued-property (pom property value)
+ "Is VALUE one of the words in the PROPERTY in entry at point-or-marker POM?"
+ (let* ((old (org-entry-get pom property))
+ (values (and old (org-split-string old "[ \t]"))))
+ (member value values)))
+
(defvar org-entry-property-inherited-from (make-marker))
(defun org-entry-get-with-inheritance (property)
"Get entry property, and search higher levels if not present."
(let (tmp)
(save-excursion
- (catch 'ex
- (while t
- (when (setq tmp (org-entry-get nil property))
- (org-back-to-heading t)
- (move-marker org-entry-property-inherited-from (point))
- (throw 'ex tmp))
- (or (org-up-heading-safe) (throw 'ex nil)))))
- (or tmp (cdr (assoc property org-local-properties))
- (cdr (assoc property org-global-properties)))))
-
+ (save-restriction
+ (widen)
+ (catch 'ex
+ (while t
+ (when (setq tmp (org-entry-get nil property))
+ (org-back-to-heading t)
+ (move-marker org-entry-property-inherited-from (point))
+ (throw 'ex tmp))
+ (or (org-up-heading-safe) (throw 'ex nil)))))
+ (or tmp (cdr (assoc property org-local-properties))
+ (cdr (assoc property org-global-properties))))))
+
(defun org-entry-put (pom property value)
"Set PROPERTY to VALUE for entry at point-or-marker POM."
(org-with-point-at pom
@@ -14703,11 +15040,13 @@ internally: ARCHIVE, CATEGORY, SUMMARY, DESCRIPTION, LOCATION, and LOGGING."
(cdr range) t)
(add-to-list 'rtn (org-match-string-no-properties 1)))
(outline-next-heading))))
+
(when include-specials
(setq rtn (append org-special-properties rtn)))
+
(when include-defaults
- (add-to-list 'rtn "CATEGORY")
- (add-to-list 'rtn "ARCHIVE"))
+ (mapc (lambda (x) (add-to-list 'rtn x)) org-default-properties))
+
(sort rtn (lambda (a b) (string< (upcase a) (upcase b))))))
(defun org-property-values (key)
@@ -14737,10 +15076,10 @@ internally: ARCHIVE, CATEGORY, SUMMARY, DESCRIPTION, LOCATION, and LOGGING."
(while (re-search-forward re end t))
(setq hiddenp (org-invisible-p))
(end-of-line 1)
- (and (= (char-after) ?\n) (forward-char 1))
+ (and (equal (char-after) ?\n) (forward-char 1))
(org-skip-over-state-notes)
(skip-chars-backward " \t\n\r")
- (insert "\n:PROPERTIES:\n:END:")
+ (let ((inhibit-read-only t)) (insert "\n:PROPERTIES:\n:END:"))
(beginning-of-line 0)
(indent-to-column indent)
(beginning-of-line 2)
@@ -14753,19 +15092,25 @@ internally: ARCHIVE, CATEGORY, SUMMARY, DESCRIPTION, LOCATION, and LOGGING."
(org-flag-drawer t))))
(defun org-set-property (property value)
- "In the current entry, set PROPERTY to VALUE."
+ "In the current entry, set PROPERTY to VALUE.
+When called interactively, this will prompt for a property name, offering
+completion on existing and default properties. And then it will prompt
+for a value, offering competion either on allowed values (via an inherited
+xxx_ALL property) or on existing values in other instances of this property
+in the current file."
(interactive
- (let* ((prop (completing-read "Property: "
- (mapcar 'list (org-buffer-property-keys))))
+ (let* ((prop (completing-read
+ "Property: " (mapcar 'list (org-buffer-property-keys nil t))))
(cur (org-entry-get nil prop))
(allowed (org-property-get-allowed-values nil prop 'table))
+ (existing (mapcar 'list (org-property-values prop)))
(val (if allowed
(completing-read "Value: " allowed nil 'req-match)
- (read-string
+ (completing-read
(concat "Value" (if (and cur (string-match "\\S-" cur))
(concat "[" cur "]") "")
": ")
- "" cur))))
+ existing nil nil "" nil cur))))
(list prop (if (equal val "") cur val))))
(unless (equal (org-entry-get nil property) value)
(org-entry-put nil property value)))
@@ -14873,6 +15218,26 @@ completion."
(beginning-of-line 1)
(skip-chars-forward " \t")))
+(defun org-find-entry-with-id (ident)
+ "Locate the entry that contains the ID property with exact value IDENT.
+IDENT can be a string, a symbol or a number, this function will search for
+the string representation of it.
+Return the position where this entry starts, or nil if there is no such entry."
+ (let ((id (cond
+ ((stringp ident) ident)
+ ((symbol-name ident) (symbol-name ident))
+ ((numberp ident) (number-to-string ident))
+ (t (error "IDENT %s must be a string, symbol or number" ident))))
+ (case-fold-search nil))
+ (save-excursion
+ (save-restriction
+ (goto-char (point-min))
+ (when (re-search-forward
+ (concat "^[ \t]*:ID:[ \t]+" (regexp-quote id) "[ \t]*$")
+ nil t)
+ (org-back-to-heading)
+ (point))))))
+
;;; Column View
(defvar org-columns-overlays nil
@@ -14883,6 +15248,8 @@ completion."
(defvar org-columns-current-fmt-compiled nil
"Local variable, holds the currently active column format.
This is the compiled version of the format.")
+(defvar org-columns-current-widths nil
+ "Loval variable, holds the currently widths of fields.")
(defvar org-columns-current-maxwidths nil
"Loval variable, holds the currently active maximum column widths.")
(defvar org-columns-begin-marker (make-marker)
@@ -14902,16 +15269,18 @@ This is the compiled version of the format.")
(org-defkey org-columns-map "c" 'org-columns-content)
(org-defkey org-columns-map "o" 'org-overview)
(org-defkey org-columns-map "e" 'org-columns-edit-value)
+(org-defkey org-columns-map "\C-c\C-t" 'org-columns-todo)
+(org-defkey org-columns-map "\C-c\C-c" 'org-columns-set-tags-or-toggle)
(org-defkey org-columns-map "v" 'org-columns-show-value)
(org-defkey org-columns-map "q" 'org-columns-quit)
(org-defkey org-columns-map "r" 'org-columns-redo)
(org-defkey org-columns-map [left] 'backward-char)
+(org-defkey org-columns-map "\M-b" 'backward-char)
(org-defkey org-columns-map "a" 'org-columns-edit-allowed)
(org-defkey org-columns-map "s" 'org-columns-edit-attributes)
-(org-defkey org-columns-map [right] 'forward-char)
+(org-defkey org-columns-map "\M-f" (lambda () (interactive) (goto-char (1+ (point)))))
(org-defkey org-columns-map [right] (lambda () (interactive) (goto-char (1+ (point)))))
(org-defkey org-columns-map [(shift right)] 'org-columns-next-allowed-value)
-(org-defkey org-columns-map "\C-c\C-c" 'org-columns-next-allowed-value)
(org-defkey org-columns-map "n" 'org-columns-next-allowed-value)
(org-defkey org-columns-map [(shift left)] 'org-columns-previous-allowed-value)
(org-defkey org-columns-map "p" 'org-columns-previous-allowed-value)
@@ -14964,7 +15333,7 @@ This is the compiled version of the format.")
(org-get-level-face 2))))
(color (list :foreground
(face-attribute (or level-face 'default) :foreground)))
- props pom property ass width f string ov column)
+ props pom property ass width f string ov column val modval)
;; Check if the entry is in another buffer.
(unless props
(if (eq major-mode 'org-agenda-mode)
@@ -14984,9 +15353,13 @@ This is the compiled version of the format.")
(point-at-bol) (point-at-eol))))))
(assoc property props))
width (or (cdr (assoc property org-columns-current-maxwidths))
- (nth 2 column))
+ (nth 2 column)
+ (length property))
f (format "%%-%d.%ds | " width width)
- string (format f (or (cdr ass) "")))
+ val (or (cdr ass) "")
+ modval (if (equal property "ITEM")
+ (org-columns-cleanup-item val org-columns-current-fmt-compiled))
+ string (format f (or modval val)))
;; Create the overlay
(org-unmodified
(setq ov (org-columns-new-overlay
@@ -14996,6 +15369,7 @@ This is the compiled version of the format.")
(org-overlay-put ov 'keymap org-columns-map)
(org-overlay-put ov 'org-columns-key property)
(org-overlay-put ov 'org-columns-value (cdr ass))
+ (org-overlay-put ov 'org-columns-value-modified modval)
(org-overlay-put ov 'org-columns-pom pom)
(org-overlay-put ov 'org-columns-format f))
(if (or (not (char-after beg))
@@ -15003,7 +15377,7 @@ This is the compiled version of the format.")
(let ((inhibit-read-only t))
(save-excursion
(goto-char beg)
- (insert " ")))))
+ (org-unmodified (insert " ")))))) ;; FIXME: add props and remove later?
;; Make the rest of the line disappear.
(org-unmodified
(setq ov (org-columns-new-overlay beg (point-at-eol)))
@@ -15024,18 +15398,21 @@ This is the compiled version of the format.")
(defvar org-columns-inhibit-recalculation nil
"Inhibit recomputing of columns on column view startup.")
+
(defvar header-line-format)
(defun org-columns-display-here-title ()
"Overlay the newline before the current line with the table title."
(interactive)
(let ((fmt org-columns-current-fmt-compiled)
string (title "")
- property width f column str)
+ property width f column str widths)
(while (setq column (pop fmt))
(setq property (car column)
str (or (nth 1 column) property)
width (or (cdr (assoc property org-columns-current-maxwidths))
- (nth 2 column))
+ (nth 2 column)
+ (length str))
+ widths (push width widths)
f (format "%%-%d.%ds | " width width)
string (format f str)
title (concat title string)))
@@ -15043,6 +15420,7 @@ This is the compiled version of the format.")
(org-add-props " " nil 'display '(space :align-to 0))
(org-add-props title nil 'face '(:weight bold :underline t))))
(org-set-local 'org-previous-header-line-format header-line-format)
+ (org-set-local 'org-columns-current-widths (nreverse widths))
(setq header-line-format title)))
(defun org-columns-remove-overlays ()
@@ -15061,6 +15439,17 @@ This is the compiled version of the format.")
(let ((inhibit-read-only t))
(remove-text-properties (point-min) (point-max) '(read-only t)))))))
+(defun org-columns-cleanup-item (item fmt)
+ "Remove from ITEM what is a column in the format FMT."
+ (when (string-match org-complex-heading-regexp item)
+ (concat
+ (org-add-props (concat (match-string 1 item) " ") nil
+ 'org-whitespace (* 2 (1- (org-reduced-level (- (match-end 1) (match-beginning 1))))))
+ (and (match-end 2) (not (assoc "TODO" fmt)) (concat " " (match-string 2 item)))
+ (and (match-end 3) (not (assoc "PRIORITY" fmt)) (concat " " (match-string 3 item)))
+ " " (match-string 4 item)
+ (and (match-end 5) (not (assoc "TAGS" fmt)) (concat " " (match-string 5 item))))))
+
(defun org-columns-show-value ()
"Show the full value of the property."
(interactive)
@@ -15086,13 +15475,27 @@ If yes, throw an error indicating that changing it does not make sense."
(get-char-property 0 'org-computed val))
(error "This value is computed from the entry's children"))))
-(defun org-columns-edit-value ()
+(defun org-columns-todo (&optional arg)
+ "Change the TODO state during column view."
+ (interactive "P")
+ (org-columns-edit-value "TODO"))
+
+(defun org-columns-set-tags-or-toggle (&optional arg)
+ "Toggle checkbox at point, or set tags for current headline."
+ (interactive "P")
+ (if (string-match "\\`\\[[ xX-]\\]\\'"
+ (get-char-property (point) 'org-columns-value))
+ (org-columns-next-allowed-value)
+ (org-columns-edit-value "TAGS")))
+
+(defun org-columns-edit-value (&optional key)
"Edit the value of the property at point in column view.
Where possible, use the standard interface for changing this line."
(interactive)
(org-columns-check-computed)
- (let* ((col (current-column))
- (key (get-char-property (point) 'org-columns-key))
+ (let* ((external-key key)
+ (col (current-column))
+ (key (or key (get-char-property (point) 'org-columns-key)))
(value (get-char-property (point) 'org-columns-value))
(bol (point-at-bol)) (eol (point-at-eol))
(pom (or (get-text-property bol 'org-hd-marker)
@@ -15105,13 +15508,15 @@ Where possible, use the standard interface for changing this line."
x))
org-columns-overlays)))
nval eval allowed)
- (when (equal key "ITEM")
- (error "Cannot edit item headline from here"))
-
(cond
+ ((equal key "ITEM")
+ (setq eval '(org-with-point-at pom
+ (org-edit-headline))))
((equal key "TODO")
(setq eval '(org-with-point-at pom
- (let ((current-prefix-arg '(4))) (org-todo '(4))))))
+ (let ((current-prefix-arg
+ (if external-key current-prefix-arg '(4))))
+ (call-interactively 'org-todo)))))
((equal key "PRIORITY")
(setq eval '(org-with-point-at pom
(call-interactively 'org-priority))))
@@ -15137,7 +15542,7 @@ Where possible, use the standard interface for changing this line."
(setq eval '(org-entry-put pom key nval)))))
(when eval
(let ((inhibit-read-only t))
- (remove-text-properties (1- bol) eol '(read-only t))
+ (remove-text-properties (max (point-min) (1- bol)) eol '(read-only t))
(unwind-protect
(progn
(setq org-columns-overlays
@@ -15149,13 +15554,29 @@ Where possible, use the standard interface for changing this line."
(if (nth 3 (assoc key org-columns-current-fmt-compiled))
(org-columns-update key))))
+(defun org-edit-headline () ; FIXME: this is not columns specific
+ "Edit the current headline, the part without TODO keyword, TAGS."
+ (org-back-to-heading)
+ (when (looking-at org-todo-line-regexp)
+ (let ((pre (buffer-substring (match-beginning 0) (match-beginning 3)))
+ (txt (match-string 3))
+ (post "")
+ txt2)
+ (if (string-match (org-re "[ \t]+:[[:alnum:]:_@]+:[ \t]*$") txt)
+ (setq post (match-string 0 txt)
+ txt (substring txt 0 (match-beginning 0))))
+ (setq txt2 (read-string "Edit: " txt))
+ (when (not (equal txt txt2))
+ (beginning-of-line 1)
+ (insert pre txt2 post)
+ (delete-region (point) (point-at-eol))
+ (org-set-tags nil t)))))
+
(defun org-columns-edit-allowed ()
"Edit the list of allowed values for the current property."
(interactive)
- (let* ((col (current-column))
- (key (get-char-property (point) 'org-columns-key))
+ (let* ((key (get-char-property (point) 'org-columns-key))
(key1 (concat key "_ALL"))
- (value (get-char-property (point) 'org-columns-value))
(allowed (org-entry-get (point) key1 t))
nval)
(setq nval (read-string "Allowed: " allowed))
@@ -15170,7 +15591,7 @@ Where possible, use the standard interface for changing this line."
(let (hidep)
(save-excursion
(beginning-of-line 1)
- (next-line 1)
+ (condition-case nil (next-line 1) (error nil))
(setq hidep (org-on-heading-p 1)))
(eval form)
(and hidep (hide-entry))))
@@ -15234,6 +15655,16 @@ Where possible, use the standard interface for changing this line."
(< emacs-major-version 22))
(error "Emacs 22 is required for the columns feature")))))
+;; FIXME: does not yet work
+(defun org-columns-follow-link ()
+ (let ((key (get-char-property (point) 'org-columns-key))
+ (value (get-char-property (point) 'org-columns-value)))
+ (if (or (string-match org-bracket-link-regexp value)
+ (string-match org-angle-link-re value)
+ (string-match org-plain-link-re value))
+ (org-open-at-point) ; fixme
+ (error "No link in this value"))))
+
(defun org-columns-get-format-and-top-level ()
(let (fmt)
(when (condition-case nil (org-back-to-heading) (error nil))
@@ -15375,17 +15806,26 @@ Where possible, use the standard interface for changing this line."
"Store the text version of the current columns format in appropriate place.
This is either in the COLUMNS property of the node starting the current column
display, or in the #+COLUMNS line of the current buffer."
- (let (fmt)
+ (let (fmt (cnt 0))
(setq fmt (org-columns-uncompile-format org-columns-current-fmt-compiled))
+ (org-set-local 'org-columns-current-fmt fmt)
(if (marker-position org-columns-top-level-marker)
(save-excursion
(goto-char org-columns-top-level-marker)
- (if (org-entry-get nil "COLUMNS")
+ (if (and (org-at-heading-p)
+ (org-entry-get nil "COLUMNS"))
(org-entry-put nil "COLUMNS" fmt)
(goto-char (point-min))
+ ;; Overwrite all #+COLUMNS lines....
(while (re-search-forward "^#\\+COLUMNS:.*" nil t)
- (replace-match (concat "#+COLUMNS: " fmt t t)))))
- (setq org-columns-current-fmt fmt))))
+ (setq cnt (1+ cnt))
+ (replace-match (concat "#+COLUMNS: " fmt) t t))
+ (unless (> cnt 0)
+ (goto-char (point-min))
+ (or (org-on-heading-p t) (outline-next-heading))
+ (let ((inhibit-read-only t))
+ (insert-before-markers "#+COLUMNS: " fmt "\n")))
+ (org-set-local 'org-columns-default-format fmt))))))
(defvar org-overriding-columns-format nil
"When set, overrides any other definition.")
@@ -15634,6 +16074,114 @@ format the output format for computed results, derived from operator"
(setq org-columns-current-fmt-compiled
(nreverse org-columns-current-fmt-compiled))))
+
+;;; Dynamic block for Column view
+
+(defun org-columns-capture-view ()
+ "Get the column view of the current buffer and return it as a list.
+The list will contains the title row and all other rows. Each row is
+a list of fields."
+ (save-excursion
+ (let* ((title (mapcar 'cadr org-columns-current-fmt-compiled))
+ (n (length title)) row tbl)
+ (goto-char (point-min))
+ (while (re-search-forward "^\\*+ " nil t)
+ (when (get-char-property (match-beginning 0) 'org-columns-key)
+ (setq row nil)
+ (loop for i from 0 to (1- n) do
+ (push (or (get-char-property (+ (match-beginning 0) i) 'org-columns-value-modified)
+ (get-char-property (+ (match-beginning 0) i) 'org-columns-value)
+ "")
+ row))
+ (setq row (nreverse row))
+ (push row tbl)))
+ (append (list title 'hline) (nreverse tbl)))))
+
+(defun org-dblock-write:columnview (params)
+ "Write the column view table.
+PARAMS is a property list of parameters:
+
+:width enforce same column widths with <N> specifiers.
+:id the :ID: property of the entry where the columns view
+ should be built, as a string. When `local', call locally.
+ When `global' call column view with the cursor at the beginning
+ of the buffer (usually this means that the whole buffer switches
+ to column view).
+:hlines When t, insert a hline before each item. When a number, insert
+ a hline before each level <= that number.
+:vlines When t, make each column a colgroup to enforce vertical lines."
+ (let ((pos (move-marker (make-marker) (point)))
+ (hlines (plist-get params :hlines))
+ (vlines (plist-get params :vlines))
+ tbl id idpos nfields tmp)
+ (save-excursion
+ (save-restriction
+ (when (setq id (plist-get params :id))
+ (cond ((not id) nil)
+ ((eq id 'global) (goto-char (point-min)))
+ ((eq id 'local) nil)
+ ((setq idpos (org-find-entry-with-id id))
+ (goto-char idpos))
+ (t (error "Cannot find entry with :ID: %s" id))))
+ (org-columns)
+ (setq tbl (org-columns-capture-view))
+ (setq nfields (length (car tbl)))
+ (org-columns-quit)))
+ (goto-char pos)
+ (move-marker pos nil)
+ (when tbl
+ (when (plist-get params :hlines)
+ (setq tmp nil)
+ (while tbl
+ (if (eq (car tbl) 'hline)
+ (push (pop tbl) tmp)
+ (if (string-match "\\` *\\(\\*+\\)" (caar tbl))
+ (if (and (not (eq (car tmp) 'hline))
+ (or (eq hlines t)
+ (and (numberp hlines) (<= (- (match-end 1) (match-beginning 1)) hlines))))
+ (push 'hline tmp)))
+ (push (pop tbl) tmp)))
+ (setq tbl (nreverse tmp)))
+ (when vlines
+ (setq tbl (mapcar (lambda (x)
+ (if (eq 'hline x) x (cons "" x)))
+ tbl))
+ (setq tbl (append tbl (list (cons "/" (make-list nfields "<>"))))))
+ (setq pos (point))
+ (insert (org-listtable-to-string tbl))
+ (when (plist-get params :width)
+ (insert "\n|" (mapconcat (lambda (x) (format "<%d>" (max 3 x)))
+ org-columns-current-widths "|")))
+ (goto-char pos)
+ (org-table-align))))
+
+(defun org-listtable-to-string (tbl)
+ "Convert a listtable TBL to a string that contains the Org-mode table.
+The table still need to be alligned. The resulting string has no leading
+and tailing newline characters."
+ (mapconcat
+ (lambda (x)
+ (cond
+ ((listp x)
+ (concat "|" (mapconcat 'identity x "|") "|"))
+ ((eq x 'hline) "|-|")
+ (t (error "Garbage in listtable: %s" x))))
+ tbl "\n"))
+
+(defun org-insert-columns-dblock ()
+ "Create a dynamic block capturing a column view table."
+ (interactive)
+ (let ((defaults '(:name "columnview" :hlines 1))
+ (id (completing-read
+ "Capture columns (local, global, entry with :ID: property) [local]: "
+ (append '(("global") ("local"))
+ (mapcar 'list (org-property-values "ID"))))))
+ (if (equal id "") (setq id 'local))
+ (if (equal id "global") (setq id 'global))
+ (setq defaults (append defaults (list :id id)))
+ (org-create-dblock defaults)
+ (org-update-dblock)))
+
;;;; Timestamps
(defvar org-last-changed-timestamp nil)
@@ -16398,6 +16946,8 @@ With prefix ARG, change that many days."
(boundp 'org-ts-what)
(setq org-ts-what
(cond
+ ((= pos (match-beginning 0)) 'bracket)
+ ((= pos (1- (match-end 0))) 'bracket)
((org-pos-in-match-range pos 2) 'year)
((org-pos-in-match-range pos 3) 'month)
((org-pos-in-match-range pos 7) 'hour)
@@ -16410,6 +16960,18 @@ With prefix ARG, change that many days."
(t 'day))))
ans))
+(defun org-toggle-timestamp-type ()
+ ""
+ (interactive)
+ (when (org-at-timestamp-p t)
+ (save-excursion
+ (goto-char (match-beginning 0))
+ (insert (if (equal (char-after) ?<) "[" "<")) (delete-char 1)
+ (goto-char (1- (match-end 0)))
+ (insert (if (equal (char-after) ?>) "]" ">")) (delete-char 1))
+ (message "Timestamp is now %sactive"
+ (if (equal (char-before) ?>) "in" ""))))
+
(defun org-timestamp-change (n &optional what)
"Change the date in the time stamp at point.
The date will be changed by N times WHAT. WHAT can be `day', `month',
@@ -16422,50 +16984,52 @@ in the timestamp determines what will be changed."
ts time time0)
(if (not (org-at-timestamp-p t))
(error "Not at a timestamp"))
- (if (and (not what) (not (eq org-ts-what 'day))
- org-display-custom-times
- (get-text-property (point) 'display)
- (not (get-text-property (1- (point)) 'display)))
- (setq org-ts-what 'day))
- (setq org-ts-what (or what org-ts-what)
- inactive (= (char-after (match-beginning 0)) ?\[)
- ts (match-string 0))
- (replace-match "")
- (if (string-match
- "\\(\\(-[012][0-9]:[0-5][0-9]\\)?\\( [-+][0-9]+[dwmy]\\)*\\)[]>]"
- ts)
- (setq extra (match-string 1 ts)))
- (if (string-match "^.\\{10\\}.*?[0-9]+:[0-9][0-9]" ts)
- (setq with-hm t))
- (setq time0 (org-parse-time-string ts))
- (setq time
- (encode-time (or (car time0) 0)
- (+ (if (eq org-ts-what 'minute) n 0) (nth 1 time0))
- (+ (if (eq org-ts-what 'hour) n 0) (nth 2 time0))
- (+ (if (eq org-ts-what 'day) n 0) (nth 3 time0))
- (+ (if (eq org-ts-what 'month) n 0) (nth 4 time0))
- (+ (if (eq org-ts-what 'year) n 0) (nth 5 time0))
- (nthcdr 6 time0)))
- (when (integerp org-ts-what)
- (setq extra (org-modify-ts-extra extra org-ts-what n)))
- (if (eq what 'calendar)
- (let ((cal-date (org-get-date-from-calendar)))
- (setcar (nthcdr 4 time0) (nth 0 cal-date)) ; month
- (setcar (nthcdr 3 time0) (nth 1 cal-date)) ; day
- (setcar (nthcdr 5 time0) (nth 2 cal-date)) ; year
- (setcar time0 (or (car time0) 0))
- (setcar (nthcdr 1 time0) (or (nth 1 time0) 0))
- (setcar (nthcdr 2 time0) (or (nth 2 time0) 0))
- (setq time (apply 'encode-time time0))))
- (setq org-last-changed-timestamp
- (org-insert-time-stamp time with-hm inactive nil nil extra))
- (org-clock-update-time-maybe)
- (goto-char pos)
- ;; Try to recenter the calendar window, if any
- (if (and org-calendar-follow-timestamp-change
- (get-buffer-window "*Calendar*" t)
- (memq org-ts-what '(day month year)))
- (org-recenter-calendar (time-to-days time)))))
+ (if (and (not what) (eq org-ts-what 'bracket))
+ (org-toggle-timestamp-type)
+ (if (and (not what) (not (eq org-ts-what 'day))
+ org-display-custom-times
+ (get-text-property (point) 'display)
+ (not (get-text-property (1- (point)) 'display)))
+ (setq org-ts-what 'day))
+ (setq org-ts-what (or what org-ts-what)
+ inactive (= (char-after (match-beginning 0)) ?\[)
+ ts (match-string 0))
+ (replace-match "")
+ (if (string-match
+ "\\(\\(-[012][0-9]:[0-5][0-9]\\)?\\( [-+][0-9]+[dwmy]\\)*\\)[]>]"
+ ts)
+ (setq extra (match-string 1 ts)))
+ (if (string-match "^.\\{10\\}.*?[0-9]+:[0-9][0-9]" ts)
+ (setq with-hm t))
+ (setq time0 (org-parse-time-string ts))
+ (setq time
+ (encode-time (or (car time0) 0)
+ (+ (if (eq org-ts-what 'minute) n 0) (nth 1 time0))
+ (+ (if (eq org-ts-what 'hour) n 0) (nth 2 time0))
+ (+ (if (eq org-ts-what 'day) n 0) (nth 3 time0))
+ (+ (if (eq org-ts-what 'month) n 0) (nth 4 time0))
+ (+ (if (eq org-ts-what 'year) n 0) (nth 5 time0))
+ (nthcdr 6 time0)))
+ (when (integerp org-ts-what)
+ (setq extra (org-modify-ts-extra extra org-ts-what n)))
+ (if (eq what 'calendar)
+ (let ((cal-date (org-get-date-from-calendar)))
+ (setcar (nthcdr 4 time0) (nth 0 cal-date)) ; month
+ (setcar (nthcdr 3 time0) (nth 1 cal-date)) ; day
+ (setcar (nthcdr 5 time0) (nth 2 cal-date)) ; year
+ (setcar time0 (or (car time0) 0))
+ (setcar (nthcdr 1 time0) (or (nth 1 time0) 0))
+ (setcar (nthcdr 2 time0) (or (nth 2 time0) 0))
+ (setq time (apply 'encode-time time0))))
+ (setq org-last-changed-timestamp
+ (org-insert-time-stamp time with-hm inactive nil nil extra))
+ (org-clock-update-time-maybe)
+ (goto-char pos)
+ ;; Try to recenter the calendar window, if any
+ (if (and org-calendar-follow-timestamp-change
+ (get-buffer-window "*Calendar*" t)
+ (memq org-ts-what '(day month year)))
+ (org-recenter-calendar (time-to-days time))))))
;; FIXME: does not yet work for lead times
(defun org-modify-ts-extra (s pos n)
@@ -16546,6 +17110,7 @@ If there is already a time stamp at the cursor position, update it."
(encode-time 0 0 0 (nth 1 cal-date) (car cal-date) (nth 2 cal-date))))))
;; Make appt aware of appointments from the agenda
+;;;###autoload
(defun org-agenda-to-appt (&optional filter)
"Activate appointments found in `org-agenda-files'.
When prefixed, prompt for a regular expression and use it as a
@@ -16563,36 +17128,45 @@ either 'headline or 'category. For example:
will only add headlines containing IMPORTANT or headlines
belonging to the category \"Work\"."
(interactive "P")
- (require 'org)
+ (require 'calendar)
(if (equal filter '(4))
(setq filter (read-from-minibuffer "Regexp filter: ")))
- (let* ((today (org-date-to-gregorian
+ (let* ((cnt 0) ; count added events
+ (today (org-date-to-gregorian
(time-to-days (current-time))))
- (files org-agenda-files) entries file)
+ (files (org-agenda-files)) entries file)
+ ;; Get all entries which may contain an appt
(while (setq file (pop files))
- (setq entries (append entries (org-agenda-get-day-entries
- file today :timestamp))))
+ (setq entries
+ (append entries
+ (org-agenda-get-day-entries
+ file today
+ :timestamp :scheduled :deadline))))
(setq entries (delq nil entries))
+ ;; Map thru entries and find if they pass thru the filter
(mapc
(lambda(x)
(let* ((evt (org-trim (get-text-property 1 'txt x)))
(cat (get-text-property 1 'org-category x))
(tod (get-text-property 1 'time-of-day x))
- (ok (or (and (stringp filter) (string-match filter evt))
- (and (not (null filter)) (listp filter)
+ (ok (or (null filter)
+ (and (stringp filter) (string-match filter evt))
+ (and (listp filter)
(or (string-match
(cadr (assoc 'category filter)) cat)
(string-match
(cadr (assoc 'headline filter)) evt))))))
- ;; (setq evt (set-text-properties 0 (length event) nil evt))
+ ;; FIXME Shall we remove text-properties for the appt text?
+ ;; (setq evt (set-text-properties 0 (length evt) nil evt))
(when (and ok tod)
(setq tod (number-to-string tod)
tod (when (string-match
"\\([0-9]\\{1,2\\}\\)\\([0-9]\\{2\\}\\)" tod)
(concat (match-string 1 tod) ":"
(match-string 2 tod))))
- (appt-add tod evt)))) entries)
- nil))
+ (appt-add tod evt)
+ (setq cnt (1+ cnt))))) entries)
+ (message "Added %d event%s for today" cnt (if (> cnt 1) "s" ""))))
;;; The clock for measuring work time.
@@ -17502,9 +18076,9 @@ that have been changed along."
(defvar org-agenda-last-dispatch-buffer nil)
;;;###autoload
-(defun org-agenda (arg)
+(defun org-agenda (arg &optional keys restriction)
"Dispatch agenda commands to collect entries to the agenda buffer.
-Prompts for a character to select a command. Any prefix arg will be passed
+Prompts for a command to execute. Any prefix arg will be passed
on to the selected command. The default selections are:
a Call `org-agenda-list' to display the agenda for current day or week.
@@ -17522,15 +18096,28 @@ More commands can be added by configuring the variable
searches can be pre-defined in this way.
If the current buffer is in Org-mode and visiting a file, you can also
-first press `1' to indicate that the agenda should be temporarily (until the
-next use of \\[org-agenda]) restricted to the current file."
+first press `<' once to indicate that the agenda should be temporarily
+\(until the next use of \\[org-agenda]) restricted to the current file.
+Pressing `<' twice means to restrict to the current subtree or region
+\(if active)."
(interactive "P")
(catch 'exit
- (let* ((buf (current-buffer))
+ (let* ((prefix-descriptions nil)
+ (org-agenda-custom-commands
+ ;; normalize different versions
+ (delq nil
+ (mapcar
+ (lambda (x)
+ (cond ((stringp (cdr x))
+ (push x prefix-descriptions)
+ nil)
+ ((stringp (nth 1 x)) x)
+ ((not (nth 1 x)) (cons (car x) (cons "" (cddr x))))
+ (t (cons (car x) (cons "" (cdr x))))))
+ org-agenda-custom-commands)))
+ (buf (current-buffer))
(bfn (buffer-file-name (buffer-base-buffer)))
- (restrict-ok (and bfn (org-mode-p)))
- (custom org-agenda-custom-commands)
- c entry key type match lprops)
+ entry key type match lprops ans)
;; Turn off restriction
(put 'org-agenda-files 'org-restrict nil)
(setq org-agenda-restrict nil)
@@ -17540,89 +18127,33 @@ next use of \\[org-agenda]) restricted to the current file."
(put 'org-agenda-redo-command 'org-lprops nil)
;; Remember where this call originated
(setq org-agenda-last-dispatch-buffer (current-buffer))
- (save-window-excursion
- (delete-other-windows)
- (org-switch-to-buffer-other-window " *Agenda Commands*")
- (erase-buffer)
- (insert (eval-when-compile
- (let ((header
-"Press key for an agenda command:
--------------------------------- C Configure custom agenda commands
-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)
-/ Multi-occur
-")
- (start 0))
- (while (string-match "\\(^\\| \\|(\\)\\(\\S-\\)\\( \\|=\\)" header start)
- (setq start (match-end 0))
- (add-text-properties (match-beginning 2) (match-end 2)
- '(face bold) header))
- header)))
- (while (setq entry (pop custom))
- (setq key (car entry) type (nth 1 entry) match (nth 2 entry))
- (insert (format "\n%-4s%-14s: %s"
- (org-add-props (copy-sequence key)
- '(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)")
- ((eq type 'tags-tree) "Tags tree")
- ((eq type 'todo-tree) "TODO kwd tree")
- ((eq type 'occur-tree) "Occur tree")
- ((functionp type) (symbol-name type))
- (t "???"))
- (if (stringp match)
- (org-add-props match nil 'face 'org-warning)
- (format "set of %d commands" (length match))))))
- (if restrict-ok
- (insert "\n"
- (org-add-props "1 Restrict call to current buffer 0 Restrict call to region or subtree" nil 'face 'org-table)))
- (goto-char (point-min))
- (if (fboundp 'fit-window-to-buffer) (fit-window-to-buffer))
- (message "Press key for agenda command%s"
- (if restrict-ok ", or [1] or [0] to restrict" ""))
- (setq c (read-char-exclusive))
- (message "")
- (when (memq c '(?L ?1 ?0))
- (if restrict-ok
- (put 'org-agenda-files 'org-restrict (list bfn))
- (error "Cannot restrict agenda to current buffer"))
- (with-current-buffer " *Agenda Commands*"
- (goto-char (point-max))
- (delete-region (point-at-bol) (point))
- (goto-char (point-min)))
- (when (eq c ?0)
+ (unless keys
+ (setq ans (org-agenda-get-restriction-and-command prefix-descriptions)
+ keys (car ans)
+ restriction (cdr ans)))
+ ;; Estabish the restriction, if any
+ (when restriction
+ (put 'org-agenda-files 'org-restrict (list bfn))
+ (cond
+ ((eq restriction 'region)
+ (setq org-agenda-restrict t)
+ (move-marker org-agenda-restrict-begin (region-beginning))
+ (move-marker org-agenda-restrict-end (region-end)))
+ ((eq restriction 'subtree)
+ (save-excursion
(setq org-agenda-restrict t)
- (with-current-buffer buf
- (if (org-region-active-p)
- (progn
- (move-marker org-agenda-restrict-begin (region-beginning))
- (move-marker org-agenda-restrict-end (region-end)))
- (save-excursion
- (org-back-to-heading t)
- (move-marker org-agenda-restrict-begin (point))
- (move-marker org-agenda-restrict-end
- (progn (org-end-of-subtree t)))))))
- (unless (eq c ?L)
- (message "Press key for agenda command%s"
- (if restrict-ok " (restricted to current file)" ""))
- (setq c (read-char-exclusive)))
- (message "")))
+ (org-back-to-heading t)
+ (move-marker org-agenda-restrict-begin (point))
+ (move-marker org-agenda-restrict-end
+ (progn (org-end-of-subtree t)))))))
+
(require 'calendar) ; FIXME: can we avoid this for some commands?
;; For example the todo list should not need it (but does...)
(cond
- ((setq entry (assoc (char-to-string c) org-agenda-custom-commands))
- (if (symbolp (nth 1 entry))
+ ((setq entry (assoc keys org-agenda-custom-commands))
+ (if (or (symbolp (nth 2 entry)) (functionp (nth 2 entry)))
(progn
- (setq type (nth 1 entry) match (nth 2 entry) lprops (nth 3 entry)
- lprops (nth 3 entry))
+ (setq type (nth 2 entry) match (nth 3 entry) lprops (nth 4 entry))
(put 'org-agenda-redo-command 'org-lprops lprops)
(cond
((eq type 'agenda)
@@ -17649,25 +18180,162 @@ L Timeline for current buffer # List stuck projects (!=configure)
((eq type 'occur-tree)
(org-check-for-org-mode)
(org-let lprops '(org-occur match)))
+ ((functionp type)
+ (org-let lprops '(funcall type match)))
((fboundp type)
(org-let lprops '(funcall type match)))
(t (error "Invalid custom agenda command type %s" type))))
(org-run-agenda-series (nth 1 entry) (cddr entry))))
- ((equal c ?C) (customize-variable 'org-agenda-custom-commands))
- ((equal c ?a) (call-interactively 'org-agenda-list))
- ((equal c ?t) (call-interactively 'org-todo-list))
- ((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
+ ((equal keys "C") (customize-variable 'org-agenda-custom-commands))
+ ((equal keys "a") (call-interactively 'org-agenda-list))
+ ((equal keys "t") (call-interactively 'org-todo-list))
+ ((equal keys "T") (org-call-with-arg 'org-todo-list (or arg '(4))))
+ ((equal keys "m") (call-interactively 'org-tags-view))
+ ((equal keys "M") (org-call-with-arg 'org-tags-view (or arg '(4))))
+ ((equal keys "e") (call-interactively 'org-store-agenda-views))
+ ((equal keys "L")
+ (unless (org-mode-p)
(error "This is not an Org-mode file"))
- (org-call-with-arg 'org-timeline arg))
- ((equal c ?#) (call-interactively 'org-agenda-list-stuck-projects))
- ((equal c ?/) (call-interactively 'org-occur-in-agenda-files))
- ((equal c ?!) (customize-variable 'org-stuck-projects))
- (t (error "Invalid key"))))))
+ (unless restriction
+ (put 'org-agenda-files 'org-restrict (list bfn))
+ (org-call-with-arg 'org-timeline arg)))
+ ((equal keys "#") (call-interactively 'org-agenda-list-stuck-projects))
+ ((equal keys "/") (call-interactively 'org-occur-in-agenda-files))
+ ((equal keys "!") (customize-variable 'org-stuck-projects))
+ (t (error "Invalid agenda key"))))))
+
+(defun org-agenda-get-restriction-and-command (prefix-descriptions)
+ "The user interface for selecting an agenda command."
+ (catch 'exit
+ (let* ((bfn (buffer-file-name (buffer-base-buffer)))
+ (restrict-ok (and bfn (org-mode-p)))
+ (region-p (org-region-active-p))
+ (custom org-agenda-custom-commands)
+ (selstring "")
+ restriction
+ c entry key type match prefixes rmheader header-end custom1 desc)
+ (save-window-excursion
+ (delete-other-windows)
+ (org-switch-to-buffer-other-window " *Agenda Commands*")
+ (erase-buffer)
+ (insert (eval-when-compile
+ (let ((header
+"Press key for an agenda command: < Buffer,subtree/region restriction
+-------------------------------- C Configure custom agenda commands
+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)
+/ Multi-occur
+")
+ (start 0))
+ (while (string-match
+ "\\(^\\| \\|(\\)\\(\\S-\\)\\( \\|=\\)"
+ header start)
+ (setq start (match-end 0))
+ (add-text-properties (match-beginning 2) (match-end 2)
+ '(face bold) header))
+ header)))
+ (setq header-end (move-marker (make-marker) (point)))
+ (while t
+ (setq custom1 custom)
+ (when (eq rmheader t)
+ (goto-line 1)
+ (re-search-forward ":" nil t)
+ (delete-region (match-end 0) (line-end-position))
+ (forward-char 1)
+ (looking-at "-+")
+ (delete-region (match-end 0) (line-end-position))
+ (move-marker header-end (match-end 0)))
+ (goto-char header-end)
+ (delete-region (point) (point-max))
+ (while (setq entry (pop custom1))
+ (setq key (car entry) desc (nth 1 entry)
+ type (nth 2 entry) match (nth 3 entry))
+ (if (> (length key) 1)
+ (add-to-list 'prefixes (string-to-char key))
+ (insert
+ (format
+ "\n%-4s%-14s: %s"
+ (org-add-props (copy-sequence key)
+ '(face bold))
+ (cond
+ ((string-match "\\S-" desc) desc)
+ ((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)")
+ ((eq type 'tags-tree) "Tags tree")
+ ((eq type 'todo-tree) "TODO kwd tree")
+ ((eq type 'occur-tree) "Occur tree")
+ ((functionp type) (if (symbolp type)
+ (symbol-name type)
+ "Lambda expression"))
+ (t "???"))
+ (cond
+ ((stringp match)
+ (org-add-props match nil 'face 'org-warning))
+ (match
+ (format "set of %d commands" (length match)))
+ (t ""))))))
+ (when prefixes
+ (mapcar (lambda (x)
+ (insert
+ (format "\n%s %s"
+ (org-add-props (char-to-string x)
+ nil 'face 'bold)
+ (or (cdr (assoc (concat selstring (char-to-string x))
+ prefix-descriptions))
+ "Prefix key"))))
+ prefixes))
+ (goto-char (point-min))
+ (if (and (fboundp 'fit-window-to-buffer)
+ (not (pos-visible-in-window-p (point-max))))
+ (fit-window-to-buffer))
+ (message "Press key for agenda command%s:"
+ (if restrict-ok
+ (if restriction
+ (format " (restricted to %s)" restriction)
+ " (unrestricted)")
+ ""))
+ (setq c (read-char-exclusive))
+ (message "")
+ (cond
+ ((assoc (char-to-string c) custom)
+ (setq selstring (concat selstring (char-to-string c)))
+ (throw 'exit (cons selstring restriction)))
+ ((memq c prefixes)
+ (setq selstring (concat selstring (char-to-string c))
+ prefixes nil
+ rmheader (or rmheader t)
+ custom (delq nil (mapcar
+ (lambda (x)
+ (if (or (= (length (car x)) 1)
+ (/= (string-to-char (car x)) c))
+ nil
+ (cons (substring (car x) 1) (cdr x))))
+ custom))))
+ ((and (not restrict-ok) (memq c '(?1 ?0 ?<)))
+ (message "Restriction is only possible in Org-mode buffers")
+ (ding) (sit-for 1))
+ ((eq c ?1)
+ (setq restriction 'buffer))
+ ((eq c ?0)
+ (setq restriction (if region-p 'region 'subtree)))
+ ((eq c ?<)
+ (setq restriction
+ (cond
+ ((eq restriction 'buffer)
+ (if region-p 'region 'subtree))
+ ((memq restriction '(subtree region))
+ nil)
+ (t 'buffer))))
+ ((and (equal selstring "") (memq c '(?a ?t ?m ?L ?C ?e ?T ?M ?# ?/)))
+ (throw 'exit (cons (setq selstring (char-to-string c)) restriction)))
+ ((equal c ?q) (error "Abort"))
+ (t (error "Invalid key %c" c))))))))
(defun org-run-agenda-series (name series)
(org-prepare-agenda name)
@@ -17718,11 +18386,10 @@ before running the agenda command."
(let (pars)
(while parameters
(push (list (pop parameters) (if parameters (pop parameters))) pars))
- (if (> (length cmd-key) 1)
+ (if (> (length cmd-key) 2)
(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)))))
+ (eval (list 'let (nreverse pars) (list 'org-agenda nil cmd-key))))
(set-buffer org-agenda-buffer-name)
(princ (org-encode-for-stdout (buffer-string)))))
@@ -17773,11 +18440,10 @@ agenda-day The day in the agenda where this is listed"
(while parameters
(push (list (pop parameters) (if parameters (pop parameters))) pars))
(push (list 'org-agenda-remove-tags t) pars)
- (if (> (length cmd-key) 1)
+ (if (> (length cmd-key) 2)
(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)))))
+ (eval (list 'let (nreverse pars) (list 'org-agenda nil cmd-key))))
(set-buffer org-agenda-buffer-name)
(let* ((lines (org-split-string (buffer-string) "\n"))
line)
@@ -17861,9 +18527,8 @@ so the the export commands caneasily use it."
files (nth 4 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))))
+ (eval (list 'let (append org-agenda-exporter-settings opts pars)
+ (list 'org-agenda nil thiscmdkey)))
(set-buffer org-agenda-buffer-name)
(while files
(eval (list 'let (append org-agenda-exporter-settings opts pars)
@@ -17929,7 +18594,10 @@ higher priority settings."
"Fit the window to the buffer size."
(and (memq org-agenda-window-setup '(reorganize-frame))
(fboundp 'fit-window-to-buffer)
- (fit-window-to-buffer)))
+ (fit-window-to-buffer
+ nil
+ (floor (* (frame-height) (cdr org-agenda-window-frame-fractions)))
+ (floor (* (frame-height) (car org-agenda-window-frame-fractions))))))
;;; Agenda file list
@@ -18159,8 +18827,12 @@ Optional argument FILE means, use this file instead of the current."
p (string-to-char (match-string 1))
b (match-beginning 0) e (line-end-position)
ov (org-make-overlay b e))
- (org-overlay-put ov 'face (cond ((equal p l) 'italic)
- ((equal p h) 'bold)))
+ (org-overlay-put
+ ov 'face
+ (cond ((listp org-agenda-fontify-priorities)
+ (cdr (assoc p org-agenda-fontify-priorities)))
+ ((equal p l) 'italic)
+ ((equal p h) 'bold)))
(org-overlay-put ov 'org-type 'org-priority)))))
(defun org-prepare-agenda-buffers (files)
@@ -19050,11 +19722,24 @@ the documentation of `org-diary'."
;; FIXME: this works only if the cursor is *not* at the
;; beginning of the entry
+;(defun org-entry-is-done-p ()
+; "Is the current entry marked DONE?"
+; (save-excursion
+; (and (re-search-backward "[\r\n]\\*+ " nil t)
+; (looking-at org-nl-done-regexp))))
+
+(defun org-entry-is-todo-p ()
+ (member (org-get-todo-state) org-not-done-keywords))
+
(defun org-entry-is-done-p ()
- "Is the current entry marked DONE?"
+ (member (org-get-todo-state) org-done-keywords))
+
+(defun org-get-todo-state ()
(save-excursion
- (and (re-search-backward "[\r\n]\\*+ " nil t)
- (looking-at org-nl-done-regexp))))
+ (org-back-to-heading t)
+ (and (looking-at org-todo-line-regexp)
+ (match-end 2)
+ (match-string 2))))
(defun org-at-date-range-p (&optional inactive-ok)
"Is the cursor inside a date range?"
@@ -19103,7 +19788,9 @@ the documentation of `org-diary'."
(save-match-data
(beginning-of-line)
(setq beg (point) end (progn (outline-next-heading) (point)))
- (when (or (and org-agenda-todo-ignore-scheduled (goto-char beg)
+ (when (or (and org-agenda-todo-ignore-with-date (goto-char beg)
+ (re-search-forward org-ts-regexp end t))
+ (and org-agenda-todo-ignore-scheduled (goto-char beg)
(re-search-forward org-scheduled-time-regexp end t))
(and org-agenda-todo-ignore-deadlines (goto-char beg)
(re-search-forward org-deadline-time-regexp end t)
@@ -19598,6 +20285,7 @@ Any match of REMOVE-RE will be removed from TXT."
;; The user can turn this off with a variable.
(if (and org-agenda-remove-times-when-in-prefix (or stamp plain)
(string-match (concat (regexp-quote s0) " *") txt)
+ (not (equal ?\] (string-to-char (substring txt (match-end 0)))))
(if (eq org-agenda-remove-times-when-in-prefix 'beg)
(= (match-beginning 0) 0)
t))
@@ -19741,9 +20429,8 @@ The optional STRING argument forces conversion into a 5 character wide string
HH:MM."
(save-match-data
(when
- (and (or (string-match "\\<\\([012]?[0-9]\\)\\(:\\([0-5][0-9]\\)\\)\\([AaPp][Mm]\\)?\\> *" s)
- (string-match "\\<\\([012]?[0-9]\\)\\(:\\([0-5][0-9]\\)\\)?\\([AaPp][Mm]\\)\\> *" s))
- (not (equal (string-to-char (substring s (match-end 0))) ?\])))
+ (or (string-match "\\<\\([012]?[0-9]\\)\\(:\\([0-5][0-9]\\)\\)\\([AaPp][Mm]\\)?\\> *" s)
+ (string-match "\\<\\([012]?[0-9]\\)\\(:\\([0-5][0-9]\\)\\)?\\([AaPp][Mm]\\)\\> *" s))
(let* ((h (string-to-number (match-string 1 s)))
(m (if (match-end 3) (string-to-number (match-string 3 s)) 0))
(ampm (if (match-end 4) (downcase (match-string 4 s))))
@@ -20247,13 +20934,10 @@ If this information is not given, the function uses the tree at point."
(defun org-agenda-open-link ()
"Follow the link in the current line, if any."
(interactive)
- (let ((eol (point-at-eol)))
- (save-excursion
- (if (or (re-search-forward org-bracket-link-regexp eol t)
- (re-search-forward org-angle-link-re eol t)
- (re-search-forward org-plain-link-re eol t))
- (call-interactively 'org-open-at-point)
- (error "No link in current line")))))
+ (save-excursion
+ (save-restriction
+ (narrow-to-region (point-at-bol) (point-at-eol))
+ (org-open-at-point))))
(defun org-agenda-switch-to (&optional delete-other-windows)
"Go to the Org-mode file which contains the item at point."
@@ -21168,7 +21852,7 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]."
(:emphasize . org-export-with-emphasize)
(:sub-superscript . org-export-with-sub-superscripts)
(:footnotes . org-export-with-footnotes)
- (:property-drawer . org-export-with-property-drawer)
+ (:drawers . org-export-with-drawers)
(:tags . org-export-with-tags)
(:TeX-macros . org-export-with-TeX-macros)
(:LaTeX-fragments . org-export-with-LaTeX-fragments)
@@ -21231,7 +21915,7 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]."
("|" . :tables)
("^" . :sub-superscript)
("f" . :footnotes)
- ("p" . :property-drawer)
+ ("d" . :drawers)
("tags" . :tags)
("*" . :emphasize)
("TeX" . :TeX-macros)
@@ -21693,11 +22377,18 @@ translations. There is currently no way for users to extend this.")
b (org-end-of-subtree t))
(if (> b a) (delete-region a b)))))
- ;; Get rid of property drawers
- (unless org-export-with-property-drawer
+ ;; Get rid of drawers
+ (unless (eq t org-export-with-drawers)
(goto-char (point-min))
- (while (re-search-forward "^[ \t]*:PROPERTIES:[ \t]*\n\\([^@]*?\n\\)?[ \t]*:END:[ \t]*\n" nil t)
- (replace-match "")))
+ (let ((re (concat "^[ \t]*:\\("
+ (mapconcat 'identity
+ (if (listp org-export-with-drawers)
+ org-export-with-drawers
+ org-drawers)
+ "\\|")
+ "\\):[ \t]*\n\\([^@]*?\n\\)?[ \t]*:END:[ \t]*\n")))
+ (while (re-search-forward re nil t)
+ (replace-match ""))))
;; Find targets in comments and move them out of comments,
;; but mark them as targets that should be invisible
@@ -22184,6 +22875,15 @@ underlined headlines. The default is 3."
(or (looking-at "[ \t]*\n[ \t]*\n")
(insert "\n\n")))
+ ;; Convert whitespace place holders
+ (goto-char (point-min))
+ (let (beg end)
+ (while (setq beg (next-single-property-change (point) 'org-whitespace))
+ (setq end (next-single-property-change beg 'org-whitespace))
+ (goto-char beg)
+ (delete-region beg end)
+ (insert (make-string (- end beg) ?\ ))))
+
(save-buffer)
;; remove display and invisible chars
(let (beg end)
@@ -22349,11 +23049,12 @@ Does include HTML export options as well as TODO and CATEGORY stuff."
#+EMAIL: %s
#+LANGUAGE: %s
#+TEXT: Some descriptive text to be emitted. Several lines OK.
-#+OPTIONS: H:%d num:%s toc:%s \\n:%s @:%s ::%s |:%s ^:%s f:%s *:%s TeX:%s LaTeX:%s skip:%s p:%s tags:%s
+#+OPTIONS: H:%d num:%s toc:%s \\n:%s @:%s ::%s |:%s ^:%s f:%s *:%s TeX:%s LaTeX:%s skip:%s d:%s tags:%s
#+CATEGORY: %s
#+SEQ_TODO: %s
#+TYP_TODO: %s
#+PRIORITIES: %c %c %c
+#+DRAWERS: %s
#+STARTUP: %s %s %s %s %s
#+TAGS: %s
#+ARCHIVE: %s
@@ -22373,12 +23074,13 @@ Does include HTML export options as well as TODO and CATEGORY stuff."
org-export-with-TeX-macros
org-export-with-LaTeX-fragments
org-export-skip-text-before-1st-heading
- org-export-with-property-drawer
+ org-export-with-drawers
org-export-with-tags
(file-name-nondirectory buffer-file-name)
"TODO FEEDBACK VERIFY DONE"
"Me Jason Marie DONE"
org-highest-priority org-lowest-priority org-default-priority
+ (mapconcat 'identity org-drawers " ")
(cdr (assoc org-startup-folded
'((nil . "showall") (t . "overview") (content . "content"))))
(if org-odd-levels-only "odd" "oddeven")
@@ -22758,11 +23460,9 @@ lang=\"%s\" xml:lang=\"%s\">
(= level umax-toc)
(org-search-todo-below
line lines level))))
- (if (and (memq org-export-with-tags '(not-in-toc nil))
- (string-match
- (org-re "[ \t]+:[[:alnum:]_@:]+:[ \t]*$")
- txt))
- (setq txt (replace-match "" t t txt)))
+ (if (string-match
+ (org-re "[ \t]+:\\([[:alnum:]_@:]+\\):[ \t]*$") txt)
+ (setq txt (replace-match "&nbsp;&nbsp;&nbsp;<span class=\"tag\"> \\1</span>" t nil txt)))
(if (string-match quote-re0 txt)
(setq txt (replace-match "" t t txt)))
(if org-export-with-section-numbers
@@ -23122,12 +23822,13 @@ lang=\"%s\" xml:lang=\"%s\">
(pop local-list-num))
(setq local-list-indent nil
in-local-list nil))
- (org-html-level-start 1 nil umax
+ (org-html-level-start 0 nil umax
(and org-export-with-toc (<= level umax))
head-count)
(unless body-only
(when (plist-get opt-plist :auto-postamble)
+ (insert "<div=\"postamble\">")
(when (and org-export-author-info author)
(insert "<p class=\"author\"> "
(nth 1 lang-words) ": " author "\n")
@@ -23138,7 +23839,8 @@ lang=\"%s\" xml:lang=\"%s\">
(when (and date org-export-time-stamp-file)
(insert "<p class=\"date\"> "
(nth 2 lang-words) ": "
- date "</p>\n")))
+ date "</p>\n"))
+ (insert "</div>"))
(if org-export-html-with-timestamp
(insert org-export-html-html-helper-timestamp))
@@ -23162,7 +23864,9 @@ lang=\"%s\" xml:lang=\"%s\">
(when (looking-at "\\s-*</p>")
(goto-char (match-end 0))
(insert "\n")))
- (mapc 'insert thetoc))
+ (insert "<div class=\"table-of-contents\">\n")
+ (mapc 'insert thetoc)
+ (insert "</div>\n"))
;; remove empty paragraphs and lists
(goto-char (point-min))
(while (re-search-forward "<p>[ \r\n\t]*</p>" nil t)
@@ -23170,6 +23874,17 @@ lang=\"%s\" xml:lang=\"%s\">
(goto-char (point-min))
(while (re-search-forward "<li>[ \r\n\t]*</li>\n?" nil t)
(replace-match ""))
+ ;; Convert whitespace place holders
+ (goto-char (point-min))
+ (let (beg end n)
+ (while (setq beg (next-single-property-change (point) 'org-whitespace))
+ (setq n (get-text-property beg 'org-whitespace)
+ end (next-single-property-change beg 'org-whitespace))
+ (goto-char beg)
+ (delete-region beg end)
+ (insert (format "<span style=\"visibility:hidden;\">%s</span>"
+ (make-string n ?x)))))
+
(or to-buffer (save-buffer))
(goto-char (point-min))
(message "Exporting... done")
@@ -23479,8 +24194,9 @@ But it has the disadvantage, that Org-mode's HTML conversions cannot be used."
(defun org-export-cleanup-toc-line (s)
"Remove tags and time staps from lines going into the toc."
- (if (string-match (org-re " +:[[:alnum:]_@:]+: *$") s)
- (setq s (replace-match "" t t s)))
+ (when (memq org-export-with-tags '(not-in-toc nil))
+ (if (string-match (org-re " +:[[:alnum:]_@:]+: *$") s)
+ (setq s (replace-match "" t t s))))
(when org-export-remove-timestamps-from-toc
(while (string-match org-maybe-keyword-time-regexp s)
(setq s (replace-match "" t t s))))
@@ -23609,13 +24325,13 @@ stacked delimiters is N. Escaping delimiters is not possible."
"Insert a new level in HTML export.
When TITLE is nil, just close all open levels."
(org-close-par-maybe)
- (let ((l (1+ (max level umax))))
- (while (<= l org-level-max)
+ (let ((l org-level-max))
+ (while (>= l (1+ level))
(if (aref org-levels-open (1- l))
(progn
- (org-html-level-close l)
+ (org-html-level-close l umax)
(aset org-levels-open (1- l) nil)))
- (setq l (1+ l)))
+ (setq l (1- l)))
(when title
;; If title is nil, this means this function is called to close
;; all levels, so the rest is done only if title is given
@@ -23640,19 +24356,22 @@ When TITLE is nil, just close all open levels."
(aset org-levels-open (1- level) t)
(org-close-par-maybe)
(insert "<ul>\n<li>" title "<br/>\n")))
+ (aset org-levels-open (1- level) t)
(if (and org-export-with-section-numbers (not body-only))
(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 id=\"sec-%d\">%s</h%d>\n"
- level head-count title level))
- (insert (format "\n<h%d>%s</h%d>\n" level title level)))
+ (insert (format "\n<div class=\"outline-%d\">\n<h%d id=\"sec-%d\">%s</h%d>\n"
+ level level head-count title level))
+ (insert (format "\n<div class=\"outline-%d\">\n<h%d>%s</h%d>\n" level level title level)))
(org-open-par)))))
-(defun org-html-level-close (&rest args)
+(defun org-html-level-close (level max-outline-level)
"Terminate one level in HTML export."
- (org-close-li)
- (insert "</ul>\n"))
+ (if (<= level max-outline-level)
+ (insert "</div>\n")
+ (org-close-li)
+ (insert "</ul>\n")))
;;; iCalendar export
@@ -24036,7 +24755,7 @@ 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)
+(define-key org-mode-map [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)
@@ -24167,6 +24886,7 @@ The XOXO buffer is named *xoxo-<source buffer name>*"
(org-defkey org-mode-map "\C-c\C-x\C-l" 'org-preview-latex-fragment)
(org-defkey org-mode-map "\C-c\C-x\C-b" 'org-toggle-checkbox)
(org-defkey org-mode-map "\C-c\C-xp" 'org-set-property)
+(org-defkey org-mode-map "\C-c\C-xr" 'org-insert-columns-dblock)
(define-key org-mode-map "\C-c\C-x\C-c" 'org-columns)
@@ -24399,7 +25119,7 @@ for more information."
((org-at-table-p) (org-call-with-arg 'org-table-move-row 'up))
((org-on-heading-p) (call-interactively 'org-move-subtree-up))
((org-at-item-p) (call-interactively 'org-move-item-up))
- (t (org-shiftcursor-error))))
+ (t (transpose-lines 1) (beginning-of-line -1))))
(defun org-metadown (&optional arg)
"Move subtree down or move table row down.
@@ -24411,7 +25131,7 @@ commands for more information."
((org-at-table-p) (call-interactively 'org-table-move-row))
((org-on-heading-p) (call-interactively 'org-move-subtree-down))
((org-at-item-p) (call-interactively 'org-move-item-down))
- (t (org-shiftcursor-error))))
+ (t (beginning-of-line 2) (transpose-lines 1) (beginning-of-line 0))))
(defun org-shiftup (&optional arg)
"Increase item in timestamp or increase priority of current headline.
@@ -24444,6 +25164,7 @@ depending on context. See the individual commands for more information."
(cond
((org-at-timestamp-p t) (call-interactively 'org-timestamp-up-day))
((org-on-heading-p) (org-call-with-arg 'org-todo 'right))
+ ((org-at-item-p) (org-call-with-arg 'org-cycle-list-bullet nil))
((org-at-property-p) (call-interactively 'org-property-next-allowed-value))
(t (org-shiftcursor-error))))
@@ -24453,6 +25174,7 @@ depending on context. See the individual commands for more information."
(cond
((org-at-timestamp-p t) (call-interactively 'org-timestamp-down-day))
((org-on-heading-p) (org-call-with-arg 'org-todo 'left))
+ ((org-at-item-p) (org-call-with-arg 'org-cycle-list-bullet 'previous))
((org-at-property-p)
(call-interactively 'org-property-previous-allowed-value))
(t (org-shiftcursor-error))))
@@ -24612,6 +25334,7 @@ See the individual commands for more information."
(call-interactively 'org-table-next-row))
(t (newline))))
+
(defun org-ctrl-c-minus ()
"Insert separator line in table or modify bullet type in list.
Calls `org-table-insert-hline' or `org-cycle-list-bullet',
@@ -24620,6 +25343,12 @@ depending on context."
(cond
((org-at-table-p)
(call-interactively 'org-table-insert-hline))
+ ((org-on-heading-p)
+ ;; Convert to item
+ (save-excursion
+ (beginning-of-line 1)
+ (if (looking-at "\\*+ ")
+ (replace-match (concat (make-string (- (match-end 0) (point)) ?\ ) "- ")))))
((org-in-item-p)
(call-interactively 'org-cycle-list-bullet))
(t (error "`C-c -' does have no function here."))))
@@ -24774,7 +25503,8 @@ See the individual commands for more information."
["Change tag in region" 'org-change-tag-in-region (org-region-active-p)]
"--"
["Set property" 'org-set-property t]
- ["Column view of properties" org-columns t])
+ ["Column view of properties" org-columns t]
+ ["Insert Column View DBlock" org-insert-columns-dblock t])
("Dates and Scheduling"
["Timestamp" org-time-stamp t]
["Timestamp (inactive)" org-time-stamp-inactive t]
@@ -25562,7 +26292,6 @@ Show the heading too, if it is currently invisible."
;;;; Experimental code
-
(defun org-closed-in-range ()
"Sparse tree of items closed in a certain time range.
Still experimental, may disappear in the furture."
@@ -25627,63 +26356,6 @@ Respect keys that are already there."
(push (cons k c) new))))
(nreverse new)))
-(defun org-parse-local-options (string var)
- "Parse STRING for startup setting relevant for variable VAR."
- (let ((rtn (symbol-value var))
- e opts)
- (save-match-data
- (if (or (not string) (not (string-match "\\S-" string)))
- rtn
- (setq opts (delq nil (mapcar (lambda (x)
- (setq e (assoc x org-startup-options))
- (if (eq (nth 1 e) var) e nil))
- (org-split-string string "[ \t]+"))))
- (if (not opts)
- rtn
- (setq rtn nil)
- (while (setq e (pop opts))
- (if (not (nth 3 e))
- (setq rtn (nth 2 e))
- (if (not (listp rtn)) (setq rtn nil))
- (push (nth 2 e) rtn)))
- rtn)))))
-
-;; FIXME: what else would be useful?
-;; - priority
-;; - date
-
-(defun org-sparse-tree (&optional arg)
- "Create a sparse tree, prompt for the details.
-This command can create sparse trees. You first need to select the type
-of match used to create the tree:
-
-t Show entries with a specific TODO keyword.
-T Show entries selected by a tags match.
-p Enter a property name and its value (both with completion on existing
- names/values) and show entries with that property.
-r Show entries matching a regular expression"
- (interactive "P")
- (let (ans kwd value)
- (message "Sparse tree: [r]egexp [t]odo-kwd [T]ag [p]roperty")
- (setq ans (read-char-exclusive))
- (cond
- ((equal ans ?t)
- (org-show-todo-tree '(4)))
- ((equal ans ?T)
- (call-interactively 'org-tags-sparse-tree))
- ((member ans '(?p ?P))
- (setq kwd (completing-read "Property: "
- (mapcar 'list (org-buffer-property-keys))))
- (setq value (completing-read "Value: "
- (mapcar 'list (org-property-values kwd))))
- (unless (string-match "\\`{.*}\\'" value)
- (setq value (concat "\"" value "\"")))
- (org-tags-sparse-tree arg (concat kwd "=" value)))
- ((member ans '(?r ?R))
- (call-interactively 'org-occur))
- (t (error "No such sparse tree command \"%c\"" ans)))))
-
-
;;;; Finish up
(provide 'org)
diff --git a/org.pdf b/org.pdf
index a0da5df..6d1f046 100644
--- a/org.pdf
+++ b/org.pdf
Binary files differ
diff --git a/org.texi b/org.texi
index 3ff5e23..6ae14eb 100644
--- a/org.texi
+++ b/org.texi
@@ -3,7 +3,7 @@
@setfilename ../info/org
@settitle Org Mode Manual
-@set VERSION 5.12
+@set VERSION 5.13
@set DATE October 2007
@dircategory Emacs
@@ -197,6 +197,7 @@ Column View
* Defining columns:: The COLUMNS format property
* Using column view:: How to create and use column view
+* Capturing Column View:: A dynamic block for column view
Defining Columns
@@ -855,7 +856,8 @@ Sort same-level entries. When there is an active region, all entries in
the region will be sorted. Otherwise the children of the current
headline are sorted. The command prompts for the sorting method, which
can be alphabetically, numerically, by time (using the first time stamp
-in each entry), by priority, and each of these in reverse order. With a
+in each entry), by priority, and each of these in reverse order. You
+can also supply your own function to extract the sorting key. With a
@kbd{C-u} prefix, sorting will be case-sensitive. With two @kbd{C-u
C-u} prefixes, duplicate entries will also be removed.
@end table
@@ -1162,7 +1164,9 @@ With prefix arg, select the nth bullet from this list.
Sometimes you want to keep information associated with an entry, but you
normally don't want to see it. For this, Org-mode has @emph{drawers}.
-Drawers need to be configured with the variable @code{org-drawers}, and
+Drawers need to be configured with the variable
+@code{org-drawers}@footnote{You can define drawers on a per-file basis
+with a line like @code{#+DRAWERS: HIDDEN PROPPERTIES STATE}}, and
look like this:
@example
@@ -3522,6 +3526,7 @@ queries have collected selected items, possibly from a number of files.
@menu
* Defining columns:: The COLUMNS format property
* Using column view:: How to create and use column view
+* Capturing Column View:: A dynamic block for column view
@end menu
@node Defining columns, Using column view, Column view, Column view
@@ -3613,7 +3618,7 @@ be created for the @samp{Time_Spent} column by adding time duration
expressions like HH:MM, and for the @samp{Approved} column, by providing
an @samp{[X]} status if all children have been checked.
-@node Using column view, , Defining columns, Column view
+@node Using column view, Capturing Column View, Defining columns, Column view
@subsection Using Column View
@table @kbd
@@ -3648,6 +3653,9 @@ Edit the property at point. For the special properties, this will
invoke the same interface that you normally use to change that
property. For example, when editing a TAGS property, the tag completion
or fast selection interface will pop up.
+@kindex C-c C-c
+@item C-c C-c
+When there is a checkbox at point, toggle it.
@kindex v
@item v
View the full value of this property. This is useful if the width of
@@ -3671,6 +3679,62 @@ Insert a new column, to the right of the current column.
Delete the current column.
@end table
+@node Capturing Column View, , Using column view, Column view
+@subsection Capturing Column View
+
+Since column view is just an overlay over a buffer, it cannot be
+exported or printed directly. If you want to capture a column view, use
+the dynamic block (@pxref{Dynamic blocks}). The frame of this block
+looks like this:
+
+@example
+* The column view
+#+BEGIN: columnview :hlines 1 :id "label"
+
+#+END:
+@end example
+
+@noindent This dynamic block has the following parameters:
+
+@table @code
+@item :id
+This is most important parameter. Column view is a feature that is
+often localized to a certain (sub)tree, and the capture block might be
+in a different location in the file. To identify the tree whose view to
+capture, you can use 3 values:
+@example
+local @r{use the tree in which the capture block is located}
+global @r{make a global view, including all headings in the file}
+"label" @r{call column view in the tree that has and @code{:ID:}}
+ @r{property with the value @i{label}}
+@end example
+@item :hlines
+When @code{t}, insert a hline after every line. When a number N, insert
+a hline before each headline with level @code{<= N}.
+@item :vlines
+When set to @code{t}, enforce column groups to get vertical lines.
+@end table
+
+@noindent
+The following commands insert or update the dynamic block:
+
+@table @kbd
+@kindex C-c C-x r
+@item C-c C-x r
+Insert a dynamic block capturing a column view. You will be prompted
+for the scope or id of the view.
+@kindex C-c C-c
+@item C-c C-c
+@kindex C-c C-x C-u
+@itemx C-c C-x C-u
+Update dynamical block at point. The cursor needs to be in the
+@code{#+BEGIN} line of the dynamic block.
+@kindex C-u C-c C-x C-u
+@item C-u C-c C-x C-u
+Update all dynamic blocks (@pxref{Dynamic blocks}). This is useful if
+you have several clocktable blocks in a buffer.
+@end table
+
@node Property API, , Column view, Properties and columns
@section The Property API
@cindex properties, API
@@ -4516,14 +4580,17 @@ the files listed in @code{org-agenda-multi-occur-extra-files}. This
uses the Emacs command @code{multi-occur}. A prefix argument can be
used to specify the number of context lines for each match, default is
1.
-@item 1
-Restrict an agenda command to the current buffer. After pressing
-@kbd{1}, you still need to press the character selecting the command.
-@item 0
+@item <
+Restrict an agenda command to the current buffer@footnote{For backward
+compatibility, you can also press @kbd{1} to restrict to the current
+buffer.}. After pressing @kbd{<}, you still need to press the character
+selecting the command.
+@item < <
If there is an active region, restrict the following agenda command to
-the region. Otherwise, restrict it to the current subtree. After
-pressing @kbd{0}, you still need to press the character selecting the
-command.
+the region. Otherwise, restrict it to the current subtree@footnote{For
+backward compatibility, you can also press @kbd{0} to restrict to the
+current buffer.}. After pressing @kbd{< <}, you still need to press the
+character selecting the command.
@end table
You can also define custom commands that will be accessible through the
@@ -5241,16 +5308,25 @@ search types:
("u" tags "+BOSS-URGENT")
("v" tags-todo "+BOSS-URGENT")
("U" tags-tree "+BOSS-URGENT")
- ("f" occur-tree "\\<FIXME\\>")))
+ ("f" occur-tree "\\<FIXME\\>")
+ ("h" . "HOME+Name tags searches") ; description for "h" prefix
+ ("hl" tags "+HOME+Lisa")
+ ("hp" tags "+HOME+Peter")
+ ("hk" tags "+HOME+Kim")))
@end group
@end lisp
@noindent
-The initial single-character string in each entry defines the character
-you have to press after the dispatcher command @kbd{C-c a} in order to
-access the command. The second parameter is the search type, followed
-by the string or regular expression to be used for the matching. The
-example above will therefore define:
+The initial string in each entry defines the keys you have to press
+after the dispatcher command @kbd{C-c a} in order to access the command.
+Usually this will be just a single character, but if you have many
+similar commands, you can also define two-letter combinations where the
+first character is the same in several combinations and serves as a
+prefix key@footnote{You can provide a description for a prefix key by
+inserting a cons cell with the prefix and the description.}. The second
+parameter is the search type, followed by the string or regular
+expression to be used for the matching. The example above will
+therefore define:
@table @kbd
@item C-c a w
@@ -5270,7 +5346,11 @@ as the same search as @kbd{C-c a u}, but only in the current buffer and
displaying the result as a sparse tree
@item C-c a f
to create a sparse tree (again: current buffer only) with all entries
-containing the word @samp{FIXME}.
+containing the word @samp{FIXME}
+@item C-c a h
+as a prefix command for a HOME tags search where you have to press an
+additional key (@kbd{l}, @kbd{p} or @kbd{k}) to select a name (Lisa,
+Peter, or Kim) as additional tag to match.
@end table
@node Block agenda, Setting Options, Storing searches, Custom agenda views
@@ -6423,7 +6503,7 @@ LaTeX: @r{turn on/off La@TeX{} fragments}
skip: @r{turn on/off skipping the text before the first heading}
author: @r{turn on/off inclusion of author name/email into exported file}
timestamp: @r{turn on/off inclusion creation time into exported file}
-p: @r{turn on/off inclusion of tags}
+d: @r{turn on/off inclusion of drawers}
@end example
These options take effect in both the HTML and La@TeX{} export, except
@@ -6895,9 +6975,11 @@ columns view is invoked in location where no COLUMNS property applies.
@item #+CONSTANTS: name1=value1 ...
Set file-local values for constants to be used in table formulas. This
line set the local variable @code{org-table-formula-constants-local}.
-The global version of theis variable is
+The global version of this variable is
@code{org-table-formula-constants}.
-corresponding
+@item #+DRAWERS: NAME1 .....
+Set the file-local set of drawers. The corresponding global variable is
+@code{org-drawers}.
@item #+LINK: linkword replace
These lines (several are allowed) specify link abbreviations.
@xref{Link abbreviations}. The corresponding variable is
@@ -8035,7 +8117,7 @@ HTML agendas.
@i{John Foerch} figured out how to make incremental search show context
around a match in a hidden outline tree.
@item
-@i{Niels Giessen} had the idea to automatically archive DONE trees.
+@i{Niels Giesen} had the idea to automatically archive DONE trees.
@item
@i{Bastien Guerry} wrote the La@TeX{} exporter and has been prolific
with patches, ideas, and bug reports.
diff --git a/orgcard.pdf b/orgcard.pdf
index c0f4ae7..1050a04 100644
--- a/orgcard.pdf
+++ b/orgcard.pdf
Binary files differ
diff --git a/orgcard.tex b/orgcard.tex
index 9d72b9b..4949402 100644
--- a/orgcard.tex
+++ b/orgcard.tex
@@ -1,5 +1,5 @@
% Reference Card for Org Mode
-\def\orgversionnumber{5.12}
+\def\orgversionnumber{5.13}
\def\versionyear{2007} % latest update
\def\year{2007} % latest copyright year
@@ -551,6 +551,7 @@ after ``{\tt :}'', and dictionary words elsewhere.
\key{special commands in property lines}{C-c C-c}
\key{next/previous allowed value}{S-left/right}
\key{turn on column view}{C-c C-x C-c}
+\key{capture columns view in dynamic block}{C-c C-x r}
\key{quit column view}{q}
\key{next/previous allowed value}{S-left/right}
@@ -614,13 +615,6 @@ after ``{\tt :}'', and dictionary words elsewhere.
\key{configure stuck projects}{C-c a !$^1$}
\key{agenda for date at cursor}{C-c C-o}
-%\vskip 1mm
-%To set categories, add lines like$^2$:
-%\vskip -1mm
-%\beginexample%
-%\#+CATEGORY: MyCateg
-%\endexample
-
{\bf Commands available in an agenda buffer}
{\bf View Org file}
diff --git a/orgcard_letter.pdf b/orgcard_letter.pdf
index 6248e34..07e8574 100644
--- a/orgcard_letter.pdf
+++ b/orgcard_letter.pdf
Binary files differ