diff --git a/ChangeLog b/ChangeLog index 4df89103b..9d09ccad8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,71 @@ +2007-10-05 Carsten Dominik + + * org.el (org-additional-option-like-keywords): New constant. + (org-complete): Use `org-additional-option-like-keywords'. + (org-parse-local-options): New function. + +2007-10-04 Carsten Dominik + + * org.el (org-in-clocktable-p): New function. + (org-clock-report): Only update the table at point, or insert a + new one. + (org-clock-goto): New function. + (org-open-file): Use `start-process-shell-command' instead of + `shell-command' with an ampersand. + (org-deadline, org-schedule): New argument REMOVE to remove the + date from the entry. + (org-agenda-schedule, org-agenda-deadline): Pass the prefix + argument to `org-schedule' and `org-deadline'. + (org-trim): Use the correct expressions for beginning and end of + the string. + (org-get-cleaned-entry): Trim the string before returning it. + (org-clock-find-position): New function. + (org-clock-into-drawer): New option. + (org-agenda-tags-column): Renamed from + `org-agenda-align-tags-to-column'. + (org-agenda-align-tags): Allow negative values for + `org-agenda-tags-column'. + (org-insert-labeled-timestamps-before-properties-drawer): Variable + removed. + (org-agenda-to-appt): new optional argument FILTER. + (org-completion-fallback-command): New variable. + (org-complete): Use `org-completion-fallback-command'. + (org-find-base-buffer-visiting): Catch the case that there is no + buffer visiting the file. + (org-property-or-variable-value): New function. + (org-todo): Use `org-property-or-variable-value' + (org-agenda-compact-blocks): New option. + (org-prepare-agenda, org-agenda-list): Use + `org-agenda-compact-blocks'. + (org-agenda-schedule, org-agenda-deadline): Call + `org-agenda-show-new-time'. + (org-agenda-show-new-time): New argument PREFIX. + (org-colgroup-info-to-vline-list): Fixed but that cause a + shift in the vertical lines. + (org-buffer-property-keys): New argument INCLUDE-DEFAULTS. + (org-maybe-renumber-ordered-list, org-cycle-list-bullet) + (org-indent-item): No arg in call to `org-fix-bullet-type'. + (org-fix-bullet-type): Removed argument. + (org-read-date): Check for am/pm twice, to catch the end time. + (org-goto-map): Use `suppress-keymap'. + (org-remember-apply-template): Respect the dynamically scoped + selection character. + + * org.texi (Appointment reminders): New section. + +2007-10-05 Bastien Guerry + + * org-export-latex.el (org-export-latex-protect-string): + Renaming of `org-latex-protect'. + (org-export-latex-emphasis-alist): By default, don't protect + any emphasis formatter from further conversion. + (org-export-latex-tables): honor column grouping for tables. + (org-export-latex-title-command): New option. + (org-export-latex-treat-backslash-char): Use \textbackslash{} to + export backslash character. + +------------------------------------------------------------ +Installed as 5.10 2007-09-26 Carsten Dominik diff --git a/Makefile b/Makefile index f59e03603..abaa095d8 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ infodir = $(prefix)/info # Using emacs in batch mode. # BATCH=$(EMACS) -batch -q -BATCH=$(EMACS) -batch -q -eval "(add-to-list (quote load-path) \"$(lispdir)\")" +BATCH=$(EMACS) -batch -q -eval "(add-to-list (quote load-path) \".\")" # Specify the byte-compiler for compiling org-mode files ELC= $(BATCH) -f batch-byte-compile diff --git a/org b/org index 651cec107..4928b663f 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.10). + This manual is for Org-mode (version 5.11). 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.10). +This manual is for Org-mode (version 5.11). Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation @@ -2092,12 +2092,13 @@ insert it into an org-mode file, and to follow the link. link, or one of the link type prefixes mentioned in the examples above. All links stored during the current session are part of the history for this prompt, so you can access them with and - . Completion, on the other hand, will help you to insert - valid link prefixes like `http:' or `ftp:', including the prefixes - defined through link abbreviations (*note Link abbreviations::). - The link will be inserted into the buffer(1), along with a - descriptive text. If some text was selected when this command is - called, the selected text becomes the default description. + (or `M-p/n'). Completion, on the other hand, will help you + to insert valid link prefixes like `http:' or `ftp:', including + the prefixes defined through link abbreviations (*note Link + abbreviations::). The link will be inserted into the buffer(1), + along with a descriptive text. If some text was selected when + this command is called, the selected text becomes the default + description. Note that you don't have to use this command to insert a link. Links in Org-mode are plain text, and you can type or paste them straight into the buffer. By using this command, the links are @@ -2631,7 +2632,9 @@ the timestamp, use(2) ---------- Footnotes ---------- - (1) The corresponding in-buffer setting is: `#+STARTUP: logdone' + (1) The corresponding in-buffer setting is: `#+STARTUP: logdone'. +You may also set this for the scope of a subtree by adding a `LOGGING' +property with one or more of the logging keywords in the value. (2) The corresponding in-buffer setting is: `#+STARTUP: lognotedone' @@ -2643,7 +2646,7 @@ File: org, Node: Tracking TODO state changes, Prev: Closing items, Up: Progre When TODO keywords are used as workflow states (*note Workflow states::), you might want to keep track of when a state change occurred -and record a note about this change. With the setting +and record a note about this change. With the setting(1) (setq org-log-done '(state)) @@ -2664,6 +2667,11 @@ states with an additional `@', like this: #+SEQ_TODO: TODO(t) ORDERED(o@) INVOICE(i@) PAYED(p) | RECEIVED(r) #+STARTUP: lognotestate + ---------- Footnotes ---------- + + (1) The corresponding in-buffer setting is: `#+STARTUP: +lognotestate'. +  File: org, Node: Priorities, Next: Breaking down tasks, Prev: Progress logging, Up: TODO items @@ -3130,6 +3138,10 @@ The following commands help to work with properties: `C-c C-c D' Globally remove a property, from all entries in the current file. +`C-c C-c c' + Compute the property at point, using the operator and scope from + the nearest column format definition. +  File: org, Node: Special properties, Next: Property searches, Prev: Property syntax, Up: Properties and columns @@ -3660,7 +3672,9 @@ an item: `C-c C-d' Insert `DEADLINE' keyword along with a stamp. The insertion will - happen in the line directly following the headline. + happen in the line directly following the headline. When called + with a prefix arg, an existing deadline will be removed from the + entry. `C-c C-w' Create a sparse tree with all deadlines that are either past-due, @@ -3672,7 +3686,8 @@ an item: `C-c C-s' Insert `SCHEDULED' keyword along with a stamp. The insertion will happen in the line directly following the headline. Any CLOSED - timestamp will be removed. + timestamp will be removed. When called with a prefix argument, + remove the scheduling date from the entry.  File: org, Node: Repeated tasks, Prev: Inserting deadline/schedule, Up: Deadlines and scheduling @@ -3701,7 +3716,7 @@ actually switch the date like this: ** TODO Pay the rent DEADLINE: <2005-11-01 Tue +1m> - You will also be prompted for a note that will be put under the + You will also be prompted for a note(1) that will be put under the DEADLINE line to keep a record that you actually acted on the previous instance of this deadline. @@ -3712,6 +3727,11 @@ future instances will be visible. You may have both scheduling and deadline information for a specific task - just make sure that the repeater intervals on both are the same. + ---------- Footnotes ---------- + + (1) You can change this using the option `org-log-repeat', or the +`#+STARTUP' options `logrepeat' and `nologrepeat'. +  File: org, Node: Clocking work time, Prev: Deadlines and scheduling, Up: Timestamps @@ -3726,7 +3746,10 @@ also computes the total time spent on each subtree of a project. `C-c C-x C-i' Start the clock on the current item (clock-in). This inserts the - CLOCK keyword together with a timestamp. + CLOCK keyword together with a timestamp. If this is not the first + clocking of this item, the multiple CLOCK lines will be wrapped + into a `:CLOCK:' drawer (see also the variable + `org-clock-into-drawer'. `C-c C-x C-o' Stop the clock (clock-out). The inserts another timestamp at the @@ -3749,6 +3772,10 @@ also computes the total time spent on each subtree of a project. Cancel the current clock. This is useful if a clock was started by mistake, or if you ended up working on something else. +`C-c C-x C-j' + Jump to the entry that contains the currently running clock, an + another window. + `C-c C-x C-d' Display time summaries for each subtree in the current buffer. This puts overlays at the end of each headline, showing the total @@ -3760,11 +3787,11 @@ also computes the total time spent on each subtree of a project. `C-c C-x C-r' Insert a dynamic block (*note Dynamic blocks::) containing a clock report as an org-mode table into the current file. - #+BEGIN: clocktable :maxlevel 2 :emphasize nil + #+BEGIN: clocktable :maxlevel 2 :emphasize nil :scope file #+END: clocktable - If such a block already exists, its content is replaced by the new - table. The `BEGIN' line can specify options: + If such a block already exists at point, its content is replaced + by the new table. The `BEGIN' line can specify options: :maxlevel Maximum level depth to which times are listed in the table. :emphasize When `t', emphasize level one and level two items :scope The scope to consider. This can be any of the following: @@ -4205,6 +4232,17 @@ will be made in the agenda: %%(diary-anniversary 14 5 1956) Arthur Dent is %d years old %%(diary-anniversary 2 10 1869) Mahatma Gandhi would be %d years old +Appointment reminders +..................... + +Org can interact with Emacs appointments notification facility. + + To add all the appointments of your agenda files, use the command +`org-agenda-to-appt'. This commands also lets you filter through the +list of your appointments and add only those belonging to a specific +category or matching a regular expression. See the docstring for +details. +  File: org, Node: Global TODO list, Next: Matching tags and properties, Prev: Weekly/Daily agenda, Up: Built-in agenda views @@ -4478,10 +4516,10 @@ Motion ...... `n' - Next line (same as ). + Next line (same as and `C-p'). `p' - Previous line (same as ). + Previous line (same as and `C-n'). View/GoTo org file .................. @@ -4548,6 +4586,7 @@ Change display TODO keyword. `s' +`C-x C-s' Save all Org-mode buffers in the current Emacs session. `' @@ -4647,6 +4686,9 @@ Remote editing `X' Cancel the currently running clock. +`J' + Jump to the running clock in another window. + Calendar commands ................. @@ -5626,6 +5668,11 @@ export, configure the variable `org-icalendar-include-todo'. `org-agenda-files' and write it to the file given by `org-combined-agenda-icalendar-file'. + The export will honor SUMMARY, DESCRIPTION and LOCATION properties if +the selected entries have them. If not, the summary will be derived +from the headline, and the description from the body (limited to +`org-icalendar-include-body' characters). + How this calendar is best read and updated, depends on the application you are using. The FAQ covers this issue. @@ -6306,8 +6353,9 @@ file is visited again in a new Emacs session. default value `nil'. align align all tables noalign don't align tables on startup - Logging TODO state changes and clock intervals (variable - `org-log-done') can be configured using these options. + Logging TODO state changes and clock intervals (variables + `org-log-done' and `org-log-repeat') can be configured using these + options. logging record a timestamp when an item is marked DONE nologging don't record when items are marked DONE lognotedone record timestamp and a note when DONE @@ -7325,7 +7373,7 @@ if I have forgotten someone, please accept my apologies and let me know. * Niels Giessen had the idea to automatically archive DONE trees. * Bastien Guerry wrote the LaTeX exporter and has been prolific with - patches, ideas, and bug reports. to Org-mode. + patches, ideas, and bug reports. * Kai Grossjohann pointed out key-binding conflicts with other packages. @@ -7436,19 +7484,19 @@ Index * activation: Activation. (line 6) * active region <1>: Structure editing. (line 68) * active region <2>: ASCII export. (line 9) -* active region <3>: Built-in table editor. - (line 143) -* active region: HTML Export commands. +* active region <3>: HTML Export commands. (line 6) +* active region: Built-in table editor. + (line 143) * agenda: Weekly/Daily agenda. (line 6) * agenda dispatcher: Agenda dispatcher. (line 6) * agenda files: Agenda files. (line 6) -* agenda files, removing buffers: Agenda commands. (line 240) +* agenda files, removing buffers: Agenda commands. (line 244) * agenda views: Agenda views. (line 6) * agenda views, custom: Custom agenda views. (line 6) -* agenda views, exporting <1>: Agenda commands. (line 229) -* agenda views, exporting: Exporting Agenda Views. +* agenda views, exporting <1>: Exporting Agenda Views. (line 12) +* agenda views, exporting: Agenda commands. (line 233) * agenda views, user-defined: Special agenda views. (line 6) * agenda, pipe: Extracting Agenda Information for other programs. @@ -7457,9 +7505,11 @@ Index * align, STARTUP keyword: In-buffer settings. (line 68) * allout.el: Conflicts. (line 6) * angular brackets, around links: External links. (line 43) -* API, for properties <1>: Property API. (line 6) -* API, for properties: Using the property API. +* API, for properties <1>: Using the property API. (line 6) +* API, for properties: Property API. (line 6) +* appointment reminders: Weekly/Daily agenda. (line 66) +* appt.el: Weekly/Daily agenda. (line 66) * archive locations: Moving subtrees. (line 23) * archiving: Archiving. (line 6) * ASCII export: ASCII export. (line 6) @@ -7478,10 +7528,10 @@ Index (line 6) * calc package: The spreadsheet. (line 6) * calc.el: Cooperation. (line 6) -* calculations, in tables <1>: The spreadsheet. (line 6) -* calculations, in tables: Built-in table editor. +* calculations, in tables <1>: Built-in table editor. (line 143) -* calendar commands, from agenda: Agenda commands. (line 192) +* calculations, in tables: The spreadsheet. (line 6) +* calendar commands, from agenda: Agenda commands. (line 196) * calendar integration: Weekly/Daily agenda. (line 24) * calendar, for selecting date: The date/time prompt. (line 26) @@ -7497,11 +7547,11 @@ Index * commands, in agenda buffer: Agenda commands. (line 6) * comment lines: Comment lines. (line 6) * completion, of dictionary words: Completion. (line 6) -* completion, of file names: Handling links. (line 43) +* completion, of file names: Handling links. (line 44) * completion, of link abbreviations: Completion. (line 6) * completion, of links: Handling links. (line 25) -* completion, of option keywords <1>: Export options. (line 6) -* completion, of option keywords <2>: Per file keywords. (line 23) +* completion, of option keywords <1>: Per file keywords. (line 23) +* completion, of option keywords <2>: Export options. (line 6) * completion, of option keywords: Completion. (line 6) * completion, of property keys: Completion. (line 6) * completion, of tags <1>: Setting tags. (line 11) @@ -7511,8 +7561,8 @@ Index * completion, of TODO keywords: Completion. (line 6) * constants, in calculations: References. (line 82) * constants.el: Cooperation. (line 14) -* constcgs, STARTUP keyword: In-buffer settings. (line 93) -* constSI, STARTUP keyword: In-buffer settings. (line 93) +* constcgs, STARTUP keyword: In-buffer settings. (line 94) +* constSI, STARTUP keyword: In-buffer settings. (line 94) * content, STARTUP keyword: In-buffer settings. (line 61) * contents, global visibility state: Visibility cycling. (line 22) * copying, of subtrees: Structure editing. (line 6) @@ -7522,15 +7572,15 @@ 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 90) +* customtime, STARTUP keyword: In-buffer settings. (line 91) * cutting, of subtrees: Structure editing. (line 6) * cycling, of TODO states: TODO basics. (line 13) * cycling, visibility: Visibility cycling. (line 6) * daily agenda: Weekly/Daily agenda. (line 6) * date format, custom: Custom time format. (line 6) * date range: Time stamps. (line 40) -* date stamps <1>: Time stamps. (line 6) -* date stamps: Timestamps. (line 6) +* date stamps <1>: Timestamps. (line 6) +* date stamps: Time stamps. (line 6) * date, reading in minibuffer: The date/time prompt. (line 6) * DEADLINE keyword: Deadlines and scheduling. @@ -7539,7 +7589,7 @@ Index * debugging, of table formulas: Editing and debugging formulas. (line 97) * demotion, of subtrees: Structure editing. (line 6) -* diary entries, creating from agenda: Agenda commands. (line 197) +* diary entries, creating from agenda: Agenda commands. (line 201) * diary integration: Weekly/Daily agenda. (line 24) * dictionary word completion: Completion. (line 6) * directories, for publishing: Sources and destinations. @@ -7558,11 +7608,11 @@ 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 83) +* even, STARTUP keyword: In-buffer settings. (line 84) * exporting: Exporting. (line 6) -* exporting agenda views <1>: Exporting Agenda Views. +* exporting agenda views <1>: Agenda commands. (line 233) +* exporting agenda views: Exporting Agenda Views. (line 12) -* exporting agenda views: Agenda commands. (line 229) * exporting, not: Comment lines. (line 6) * extended TODO keywords: TODO extensions. (line 6) * extension, third-party: Extensions. (line 6) @@ -7577,7 +7627,7 @@ Index * field references: References. (line 15) * file links: External links. (line 6) * file links, searching: Search options. (line 6) -* file name completion: Handling links. (line 43) +* file name completion: Handling links. (line 44) * files for agenda: Agenda files. (line 6) * files, adding to agenda list: Agenda files. (line 12) * files, selecting for publishing: Selecting files. (line 6) @@ -7585,12 +7635,12 @@ Index * fixed-width sections: Export options. (line 26) * folded, subtree visibility state: Visibility cycling. (line 10) * folding, sparse trees: Sparse trees. (line 6) -* following links: Handling links. (line 58) -* footnote.el <1>: Conflicts. (line 35) -* footnote.el <2>: Cooperation. (line 56) -* footnote.el: Footnotes. (line 6) -* footnotes <1>: Export options. (line 26) -* footnotes: Footnotes. (line 6) +* following links: Handling links. (line 59) +* footnote.el <1>: Cooperation. (line 56) +* footnote.el <2>: Footnotes. (line 6) +* footnote.el: Conflicts. (line 35) +* footnotes <1>: Footnotes. (line 6) +* footnotes: Export options. (line 26) * format specifier: Formula syntax for Calc. (line 14) * format, of links: Link format. (line 6) @@ -7612,17 +7662,17 @@ Index * grouping columns in tables: Column groups. (line 6) * hand-formatted lists: Enhancing text. (line 11) * headline levels: Export options. (line 26) -* headline levels, for exporting <1>: HTML Export commands. - (line 44) -* headline levels, for exporting <2>: LaTeX export commands. +* headline levels, for exporting <1>: LaTeX export commands. (line 26) +* headline levels, for exporting <2>: HTML Export commands. + (line 44) * headline levels, for exporting: ASCII export. (line 21) * headline navigation: Motion. (line 6) * headline tagging: Tags. (line 6) * 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 83) +* hidestars, STARTUP keyword: In-buffer settings. (line 84) * hiding leading stars: Clean view. (line 6) * history: History and Acknowledgments. (line 6) @@ -7667,26 +7717,26 @@ Index * link completion: Handling links. (line 25) * link format: Link format. (line 6) * links, external: External links. (line 6) -* links, finding next/previous: Handling links. (line 91) +* links, finding next/previous: Handling links. (line 92) * links, handling: Handling links. (line 6) * links, in HTML export: Links. (line 6) * links, internal: Internal links. (line 6) * links, publishing: Publishing links. (line 6) * links, radio targets: Radio targets. (line 6) -* links, returning to: Handling links. (line 85) +* links, returning to: Handling links. (line 86) * Lisp forms, as table formulas: Formula syntax for Lisp. (line 6) * 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 72) +* logdone, STARTUP keyword: In-buffer settings. (line 73) * logging, of progress: Progress logging. (line 6) -* lognoteclock-out, STARTUP keyword: In-buffer settings. (line 72) -* lognotedone, STARTUP keyword: In-buffer settings. (line 72) -* lognotestate, STARTUP keyword: In-buffer settings. (line 72) -* logrepeat, STARTUP keyword: In-buffer settings. (line 72) +* 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) * maintainer: Feedback. (line 6) -* mark ring: Handling links. (line 81) +* mark ring: Handling links. (line 82) * marking characters, tables: Advanced features. (line 40) * matching, of properties: Matching tags and properties. (line 6) @@ -7706,10 +7756,10 @@ Index * 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 72) -* nologrepeat, STARTUP keyword: In-buffer settings. (line 72) +* nologging, STARTUP keyword: In-buffer settings. (line 73) +* nologrepeat, STARTUP keyword: In-buffer settings. (line 73) * occur, command: Sparse trees. (line 6) -* odd, STARTUP keyword: In-buffer settings. (line 83) +* odd, STARTUP keyword: In-buffer settings. (line 84) * option keyword completion: Completion. (line 6) * options, for custom agenda views: Setting Options. (line 6) * options, for customization: Customization. (line 6) @@ -7769,14 +7819,14 @@ Index * region, active <1>: Built-in table editor. (line 143) * region, active <2>: ASCII export. (line 9) -* region, active <3>: HTML Export commands. +* region, active <3>: Structure editing. (line 68) +* region, active: HTML Export commands. (line 6) -* region, active: Structure editing. (line 68) * regular expressions, with tags search: Tag searches. (line 63) -* remember.el <1>: Remember. (line 6) -* remember.el: Cooperation. (line 33) -* remote editing, from agenda: Agenda commands. (line 106) -* remote editing, undo: Agenda commands. (line 107) +* remember.el <1>: Cooperation. (line 33) +* remember.el: Remember. (line 6) +* remote editing, from agenda: Agenda commands. (line 107) +* remote editing, undo: Agenda commands. (line 108) * richer text: Enhancing text. (line 6) * RMAIL links: External links. (line 6) * SCHEDULED keyword: Deadlines and scheduling. @@ -7794,11 +7844,11 @@ Index * 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 83) +* showstars, STARTUP keyword: In-buffer settings. (line 84) * sorting, of agenda items: Sorting of agenda items. (line 6) * sparse tree, for deadlines: Inserting deadline/schedule. - (line 11) + (line 13) * sparse tree, for TODO: TODO basics. (line 38) * sparse tree, tag based: Tags. (line 6) * sparse trees: Sparse trees. (line 6) @@ -7827,8 +7877,8 @@ Index * table editor, table.el: Cooperation. (line 37) * table of contents: Export options. (line 26) * table.el: Cooperation. (line 37) -* tables <1>: Export options. (line 26) -* tables: Tables. (line 6) +* tables <1>: Tables. (line 6) +* tables: Export options. (line 26) * tables, export: Enhancing text. (line 24) * tables, in other modes: Tables in arbitrary syntax. (line 6) @@ -7854,8 +7904,8 @@ Index * time grid: Time-of-day specifications. (line 26) * time info, in export: Export options. (line 26) -* time stamps <1>: Timestamps. (line 6) -* time stamps: Time stamps. (line 6) +* time stamps <1>: Time stamps. (line 6) +* time stamps: Timestamps. (line 6) * time, reading in minibuffer: The date/time prompt. (line 6) * time-of-day specification: Time-of-day specifications. @@ -7877,11 +7927,11 @@ Index * TODO types: TODO types. (line 6) * TODO workflow: Workflow states. (line 6) * transient-mark-mode <1>: Structure editing. (line 68) -* transient-mark-mode <2>: Built-in table editor. +* transient-mark-mode <2>: ASCII export. (line 9) +* transient-mark-mode <3>: Built-in table editor. (line 143) -* transient-mark-mode <3>: HTML Export commands. +* transient-mark-mode: HTML Export commands. (line 6) -* transient-mark-mode: ASCII export. (line 9) * translator function: Translator functions. (line 6) * trees, sparse: Sparse trees. (line 6) @@ -7889,7 +7939,7 @@ Index * tty keybindings: TTY keys. (line 6) * types as TODO keywords: TODO types. (line 6) * underlined text: Enhancing text. (line 15) -* undoing remote-editing events: Agenda commands. (line 107) +* undoing remote-editing events: Agenda commands. (line 108) * updating, table: Updating the table. (line 6) * URL links: External links. (line 6) * USENET links: External links. (line 6) @@ -7916,66 +7966,66 @@ Key Index [index] * Menu: -* $: Agenda commands. (line 121) +* $: Agenda commands. (line 122) * ': CDLaTeX mode. (line 43) -* +: Agenda commands. (line 144) -* ,: Agenda commands. (line 136) -* -: Agenda commands. (line 150) -* .: Agenda commands. (line 98) -* :: Agenda commands. (line 129) +* +: Agenda commands. (line 145) +* ,: Agenda commands. (line 137) +* -: Agenda commands. (line 151) +* .: Agenda commands. (line 99) +* :: Agenda commands. (line 130) * < <1>: Using column view. (line 54) * <: The date/time prompt. (line 32) -* : Agenda commands. (line 95) +* : Agenda commands. (line 96) * <1>: Built-in table editor. (line 64) -* <2>: The date/time prompt. +* <2>: Agenda commands. (line 39) +* <3>: The date/time prompt. (line 57) -* <3>: Agenda commands. (line 39) * : Setting tags. (line 76) -* : Agenda commands. (line 90) +* : Agenda commands. (line 91) * <1>: Setting tags. (line 73) * : Agenda commands. (line 28) -* <1>: Built-in table editor. +* <1>: Editing and debugging formulas. (line 57) * <2>: Agenda commands. (line 33) * <3>: Visibility cycling. (line 10) * <4>: Plain lists. (line 41) -* <5>: Setting tags. (line 68) -* <6>: CDLaTeX mode. (line 23) -* : Editing and debugging formulas. +* <5>: Built-in table editor. (line 57) -* > <1>: The date/time prompt. +* <6>: Setting tags. (line 68) +* : CDLaTeX mode. (line 23) +* > <1>: Using column view. (line 54) +* > <2>: Agenda commands. (line 173) +* >: The date/time prompt. (line 33) -* > <2>: Using column view. (line 54) -* >: Agenda commands. (line 172) * ^: CDLaTeX mode. (line 33) * _: CDLaTeX mode. (line 33) * `: CDLaTeX mode. (line 39) * a <1>: Using column view. (line 43) -* a: Agenda commands. (line 133) +* a: Agenda commands. (line 134) * b: Agenda commands. (line 49) -* c: Agenda commands. (line 192) -* C: Agenda commands. (line 212) +* 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) * C-: Structure editing. (line 18) -* C-_: Agenda commands. (line 107) -* C-c ! <1>: Creating timestamps. (line 19) -* C-c !: Footnotes. (line 14) +* C-_: Agenda commands. (line 108) +* C-c ! <1>: Footnotes. (line 14) +* C-c !: Creating timestamps. (line 19) * C-c #: Checkboxes. (line 57) -* C-c %: Handling links. (line 81) -* C-c &: Handling links. (line 85) +* C-c %: Handling links. (line 82) +* C-c &: Handling links. (line 86) * C-c ': Editing and debugging formulas. (line 36) * C-c *: Updating the table. (line 13) * C-c +: Built-in table editor. (line 143) * C-c ,: Priorities. (line 18) -* C-c - <1>: Built-in table editor. +* C-c - <1>: Plain lists. (line 88) +* C-c -: Built-in table editor. (line 92) -* C-c -: Plain lists. (line 88) * C-c .: Creating timestamps. (line 10) * C-c /: Sparse trees. (line 15) * C-c :: Enhancing text. (line 32) @@ -8011,37 +8061,37 @@ Key Index * C-c a M: Matching tags and properties. (line 15) * C-c a T: Global TODO list. (line 14) -* C-c a t <1>: TODO basics. (line 48) -* C-c a t: Global TODO list. (line 9) +* C-c a t <1>: Global TODO list. (line 9) +* C-c a t: TODO basics. (line 48) * C-c C-a: Visibility cycling. (line 33) * C-c C-b: Motion. (line 15) -* C-c C-c <1>: TODO basics. (line 30) +* C-c C-c <1>: Processing LaTeX fragments. + (line 15) * C-c C-c <2>: Cooperation. (line 37) * C-c C-c <3>: The very busy C-c C-c key. (line 6) -* C-c C-c <4>: Processing LaTeX fragments. - (line 15) -* C-c C-c <5>: Clocking work time. (line 79) -* C-c C-c <6>: Property syntax. (line 54) -* C-c C-c <7>: Setting tags. (line 10) -* C-c C-c <8>: Checkboxes. (line 37) +* C-c C-c <4>: Clocking work time. (line 86) +* C-c C-c <5>: Property syntax. (line 54) +* C-c C-c <6>: Setting tags. (line 10) +* C-c C-c <7>: Checkboxes. (line 37) +* C-c C-c <8>: TODO basics. (line 30) * C-c C-c <9>: Editing and debugging formulas. (line 46) * C-c C-c <10>: Built-in table editor. (line 56) * C-c C-c: Plain lists. (line 81) -* C-c C-d <1>: Inserting deadline/schedule. +* 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 157) * C-c C-e: Exporting. (line 20) * C-c C-e a: ASCII export. (line 9) * C-c C-e b: HTML Export commands. (line 13) * C-c C-e c: iCalendar export. (line 21) -* C-c C-e h: HTML Export commands. - (line 6) * C-c C-e H: HTML Export commands. (line 16) +* C-c C-e h: HTML Export commands. + (line 6) * C-c C-e I: iCalendar export. (line 16) * C-c C-e i: iCalendar export. (line 14) * C-c C-e l: LaTeX export commands. @@ -8056,10 +8106,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. @@ -8071,66 +8121,67 @@ Key Index * C-c C-j: Motion. (line 21) * C-c C-l: Handling links. (line 25) * C-c C-n: Motion. (line 8) -* C-c C-o <1>: Handling links. (line 58) +* C-c C-o <1>: Handling links. (line 59) * C-c C-o: Creating timestamps. (line 31) * C-c C-p: Motion. (line 9) -* C-c C-q <1>: Editing and debugging formulas. - (line 50) -* C-c C-q: Built-in table editor. +* C-c C-q <1>: Built-in table editor. (line 127) +* C-c C-q: Editing and debugging formulas. + (line 50) * C-c C-r <1>: Editing and debugging formulas. (line 53) * C-c C-r: Visibility cycling. (line 34) -* C-c C-s <1>: Agenda commands. (line 154) -* C-c C-s: Inserting deadline/schedule. - (line 18) -* C-c C-t <1>: Clocking work time. (line 27) -* C-c C-t: TODO basics. (line 13) +* C-c C-s <1>: Inserting deadline/schedule. + (line 20) +* C-c C-s: Agenda commands. (line 155) +* C-c C-t <1>: TODO basics. (line 13) +* C-c C-t: Clocking work time. (line 30) * C-c C-u: Motion. (line 18) * C-c C-v: TODO basics. (line 38) * C-c C-w: Inserting deadline/schedule. - (line 11) + (line 13) * C-c C-x /: Agenda files. (line 22) * 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 219) +* 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-d: Clocking work time. (line 35) +* 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) * C-c C-x C-k: Structure editing. (line 43) * C-c C-x C-l: Processing LaTeX fragments. (line 9) -* C-c C-x C-n: Handling links. (line 91) -* C-c C-x C-o: Clocking work time. (line 14) -* C-c C-x C-p: Handling links. (line 91) -* C-c C-x C-r: Clocking work time. (line 43) +* C-c C-x C-n: Handling links. (line 92) +* C-c C-x C-o: Clocking work time. (line 17) +* C-c C-x C-p: Handling links. (line 92) +* 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>: Dynamic blocks. (line 21) -* C-c C-x C-u: Clocking work time. (line 81) -* C-c C-x C-w <1>: Built-in table editor. +* C-c C-x C-u: Clocking work time. (line 88) +* C-c C-x C-w <1>: Structure editing. (line 43) +* C-c C-x C-w: Built-in table editor. (line 116) -* C-c C-x C-w: Structure editing. (line 43) -* C-c C-x C-x: Clocking work time. (line 31) +* C-c C-x C-x: Clocking work time. (line 34) * C-c C-x C-y <1>: Built-in table editor. (line 120) * C-c C-x C-y: Structure editing. (line 50) -* C-c C-x M-w <1>: Built-in table editor. +* C-c C-x M-w <1>: Structure editing. (line 47) +* C-c C-x M-w: Built-in table editor. (line 113) -* C-c C-x M-w: Structure editing. (line 47) -* C-c C-y <1>: Clocking work time. (line 22) +* 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 79) + (line 28) * C-c ~: Cooperation. (line 48) -* C-k: Agenda commands. (line 115) +* C-k: Agenda commands. (line 116) * C-S-: Multiple sets in one file. (line 25) * C-S-: Multiple sets in one file. @@ -8142,33 +8193,35 @@ Key Index * C-u C-c =: Editing and debugging formulas. (line 14) * C-u C-c C-c: Updating the table. (line 19) -* C-u C-c C-l: Handling links. (line 43) +* 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 83) +* C-u C-c C-x C-u <1>: Clocking work time. (line 90) * 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. (line 46) * C-x C-w <1>: Exporting Agenda Views. (line 11) -* C-x C-w: Agenda commands. (line 228) -* D: Agenda commands. (line 72) +* C-x C-w: Agenda commands. (line 232) * d: Agenda commands. (line 66) +* D: Agenda commands. (line 72) * e: Using column view. (line 33) * f: Agenda commands. (line 42) * g: Agenda commands. (line 76) -* H: Agenda commands. (line 216) -* I: Agenda commands. (line 177) -* i: Agenda commands. (line 197) +* H: Agenda commands. (line 220) +* I: Agenda commands. (line 178) +* i: Agenda commands. (line 201) +* J: Agenda commands. (line 190) * L: Agenda commands. (line 30) * l: Agenda commands. (line 55) * m: Agenda commands. (line 66) -* M: Agenda commands. (line 203) +* M: Agenda commands. (line 207) * M- <1>: Editing and debugging formulas. (line 76) * M-: Built-in table editor. @@ -8176,121 +8229,121 @@ Key Index * M- <1>: Structure editing. (line 25) * M-: Built-in table editor. (line 74) -* M- <1>: Structure editing. (line 6) -* M-: Plain lists. (line 49) +* M- <1>: Plain lists. (line 49) +* M-: Structure editing. (line 6) * M- <1>: Built-in table editor. (line 74) * M-: Structure editing. (line 28) -* M- <1>: Per file keywords. (line 23) -* M- <2>: Editing and debugging formulas. - (line 64) +* M- <1>: Setting tags. (line 6) +* M- <2>: Completion. (line 10) * M- <3>: Property syntax. (line 46) -* M- <4>: Completion. (line 10) -* M-: Setting tags. (line 6) +* M- <4>: Per file keywords. (line 23) +* M-: Editing and debugging formulas. + (line 64) * M- <1>: Built-in table editor. (line 82) * M-: Editing and debugging formulas. (line 76) -* M-S- <1>: Plain lists. (line 66) -* M-S- <2>: Structure editing. (line 40) +* M-S- <1>: Built-in table editor. + (line 89) +* M-S- <2>: Plain lists. (line 66) * M-S- <3>: Editing and debugging formulas. (line 72) -* M-S-: Built-in table editor. - (line 89) -* M-S- <1>: Structure editing. (line 31) -* M-S- <2>: The date/time prompt. - (line 54) +* M-S-: Structure editing. (line 40) +* M-S- <1>: Plain lists. (line 72) +* M-S- <2>: Structure editing. (line 31) * M-S- <3>: Built-in table editor. (line 76) -* M-S-: Plain lists. (line 72) -* M-S- <1>: Checkboxes. (line 54) +* M-S-: The date/time prompt. + (line 54) +* M-S- <1>: Structure editing. (line 22) * M-S- <2>: Plain lists. (line 59) -* M-S-: Structure editing. (line 22) +* M-S-: Checkboxes. (line 54) * M-S- <1>: Built-in table editor. (line 79) * M-S- <2>: Structure editing. (line 34) * M-S- <3>: Plain lists. (line 72) * M-S-: The date/time prompt. (line 51) -* M-S- <1>: Structure editing. (line 37) -* M-S- <2>: Editing and debugging formulas. - (line 72) -* M-S- <3>: Built-in table editor. +* M-S- <1>: Plain lists. (line 66) +* M-S- <2>: Built-in table editor. (line 86) -* M-S-: Plain lists. (line 66) -* mouse-1 <1>: Handling links. (line 72) +* M-S- <3>: Structure editing. (line 37) +* M-S-: Editing and debugging formulas. + (line 72) +* mouse-1 <1>: Handling links. (line 73) * mouse-1 <2>: Agenda commands. (line 33) * mouse-1: The date/time prompt. (line 36) -* mouse-2 <1>: Handling links. (line 72) +* mouse-2 <1>: Handling links. (line 73) * mouse-2: Agenda commands. (line 33) * mouse-3 <1>: Agenda commands. (line 28) -* mouse-3: Handling links. (line 77) -* n <1>: Using column view. (line 30) -* n: Agenda commands. (line 19) -* O: Agenda commands. (line 181) +* mouse-3: Handling links. (line 78) +* n <1>: Agenda commands. (line 19) +* n: Using column view. (line 30) * o: Agenda commands. (line 65) -* p: Using column view. (line 30) -* P: Agenda commands. (line 141) +* O: Agenda commands. (line 182) +* p <1>: Using column view. (line 30) * p: Agenda commands. (line 20) +* P: Agenda commands. (line 142) * q <1>: Using column view. (line 17) -* q: Agenda commands. (line 239) +* q: Agenda commands. (line 243) * r <1>: Agenda commands. (line 80) * r: Global TODO list. (line 22) -* S: Agenda commands. (line 207) * s: Agenda commands. (line 87) -* S- <1>: Priorities. (line 23) -* S- <2>: The date/time prompt. - (line 45) +* S: Agenda commands. (line 211) +* S- <1>: Editing and debugging formulas. + (line 67) +* S- <2>: Priorities. (line 23) * S- <3>: Plain lists. (line 62) * S- <4>: Creating timestamps. (line 40) -* S- <5>: Agenda commands. (line 150) -* S-: Editing and debugging formulas. - (line 67) -* S- <1>: Editing and debugging formulas. - (line 67) -* S- <2>: TODO basics. (line 26) -* S- <3>: Multiple sets in one file. - (line 29) -* S- <4>: Property syntax. (line 62) -* S- <5>: Using column view. (line 26) -* S- <6>: Agenda commands. (line 168) -* S- <7>: Creating timestamps. (line 35) -* S-: The date/time prompt. +* S- <5>: The date/time prompt. + (line 45) +* S-: Agenda commands. (line 151) +* S- <1>: Property syntax. (line 62) +* S- <2>: The date/time prompt. (line 42) +* S- <3>: Editing and debugging formulas. + (line 67) +* S- <4>: Creating timestamps. (line 35) +* S- <5>: TODO basics. (line 26) +* S- <6>: Agenda commands. (line 169) +* S- <7>: Using column view. (line 26) +* S-: Multiple sets in one file. + (line 29) * S-: Built-in table editor. (line 146) -* S- <1>: Agenda commands. (line 160) -* S- <2>: TODO basics. (line 26) -* S- <3>: The date/time prompt. +* S- <1>: The date/time prompt. (line 39) -* S- <4>: Editing and debugging formulas. - (line 67) -* S- <5>: Multiple sets in one file. +* S- <2>: Multiple sets in one file. (line 29) -* S- <6>: Property syntax. (line 62) -* S- <7>: Using column view. (line 26) -* S-: Creating timestamps. (line 35) -* S- <1>: Built-in table editor. - (line 61) -* S-: Visibility cycling. (line 22) -* S- <1>: Creating timestamps. (line 40) -* S- <2>: Agenda commands. (line 144) -* S- <3>: Plain lists. (line 62) -* S- <4>: The date/time prompt. - (line 48) -* S- <5>: Editing and debugging formulas. +* S- <3>: Editing and debugging formulas. (line 67) +* S- <4>: Agenda commands. (line 161) +* S- <5>: Creating timestamps. (line 35) +* S- <6>: TODO basics. (line 26) +* S- <7>: Using column view. (line 26) +* S-: Property syntax. (line 62) +* S- <1>: Visibility cycling. (line 22) +* S-: Built-in table editor. + (line 61) +* S- <1>: Plain lists. (line 62) +* S- <2>: Creating timestamps. (line 40) +* S- <3>: The date/time prompt. + (line 48) +* S- <4>: Editing and debugging formulas. + (line 67) +* S- <5>: Agenda commands. (line 145) * S-: Priorities. (line 23) * S-M-: Using column view. (line 58) * S-M-: TODO basics. (line 56) * S-M-: Using column view. (line 55) -* t: Agenda commands. (line 111) -* T: Agenda commands. (line 124) +* t: Agenda commands. (line 112) +* T: Agenda commands. (line 125) * v: Using column view. (line 39) * w: Agenda commands. (line 66) -* X: Agenda commands. (line 184) -* x: Agenda commands. (line 240) +* X: Agenda commands. (line 185) +* x: Agenda commands. (line 244) * y: Agenda commands. (line 66) @@ -8347,170 +8400,172 @@ Ref: Internal links-Footnote-182559 Node: Radio targets82694 Node: External links83394 Node: Handling links85798 -Ref: Handling links-Footnote-191095 -Ref: Handling links-Footnote-291332 -Node: Using links outside Org-mode91406 -Node: Link abbreviations91916 -Node: Search options93609 -Ref: Search options-Footnote-195389 -Node: Custom searches95470 -Node: TODO items96501 -Node: TODO basics97539 -Node: TODO extensions99744 -Node: Workflow states100688 -Ref: Workflow states-Footnote-1101863 -Node: TODO types101956 -Ref: TODO types-Footnote-1103539 -Node: Multiple sets in one file103621 -Node: Fast access to TODO states105241 -Node: Per file keywords106384 -Ref: Per file keywords-Footnote-1107686 -Node: Faces for TODO keywords107887 -Node: Progress logging108593 -Node: Closing items109024 -Ref: Closing items-Footnote-1109958 -Ref: Closing items-Footnote-2110027 -Node: Tracking TODO state changes110100 -Node: Priorities111246 -Ref: Priorities-Footnote-1112896 -Node: Breaking down tasks112966 -Ref: Breaking down tasks-Footnote-1113486 -Node: Checkboxes113582 -Node: Tags116431 -Node: Tag inheritance117203 -Node: Setting tags118140 -Ref: Setting tags-Footnote-1122663 -Ref: Setting tags-Footnote-2122775 -Node: Tag searches122858 -Node: Properties and columns125575 -Node: Property syntax126680 -Node: Special properties129101 -Node: Property searches130017 -Node: Column view130672 -Node: Defining columns131839 -Node: Scope of column definitions132237 -Node: Column attributes133159 -Node: Using column view135407 -Node: Property API137394 -Node: Timestamps137748 -Node: Time stamps138159 -Ref: Time stamps-Footnote-1140513 -Node: Creating timestamps140629 -Node: The date/time prompt142703 -Ref: The date/time prompt-Footnote-1144691 -Node: Custom time format144797 -Node: Deadlines and scheduling146489 -Ref: Deadlines and scheduling-Footnote-1148562 -Node: Inserting deadline/schedule148717 -Node: Repeated tasks149655 -Node: Clocking work time151294 -Ref: Clocking work time-Footnote-1155650 -Ref: Clocking work time-Footnote-2155728 -Node: Remember155854 -Node: Setting up remember156736 -Node: Remember templates157339 -Ref: Remember templates-Footnote-1160856 -Ref: Remember templates-Footnote-2161039 -Node: Storing notes161137 -Ref: Storing notes-Footnote-1163616 -Node: Agenda views163718 -Node: Agenda files165669 -Ref: Agenda files-Footnote-1166761 -Ref: Agenda files-Footnote-2166910 -Node: Agenda dispatcher167103 -Node: Built-in agenda views168802 -Node: Weekly/Daily agenda169384 -Node: Global TODO list172328 -Node: Matching tags and properties174608 -Node: Timeline175699 -Node: Stuck projects176373 -Node: Presentation and sorting178226 -Node: Categories179019 -Ref: Categories-Footnote-1179730 -Node: Time-of-day specifications180050 -Node: Sorting of agenda items182023 -Node: Agenda commands183307 -Node: Custom agenda views190685 -Node: Storing searches191406 -Node: Block agenda193320 -Node: Setting Options194552 -Node: Exporting Agenda Views197293 -Ref: Exporting Agenda Views-Footnote-1201579 -Ref: Exporting Agenda Views-Footnote-2201636 -Node: Extracting Agenda Information for other programs201822 -Node: Embedded LaTeX205950 -Ref: Embedded LaTeX-Footnote-1207044 -Node: Math symbols207234 -Node: Subscripts and Superscripts208001 -Node: LaTeX fragments208847 -Ref: LaTeX fragments-Footnote-1211080 -Ref: LaTeX fragments-Footnote-2211341 -Node: Processing LaTeX fragments211475 -Node: CDLaTeX mode212423 -Ref: CDLaTeX mode-Footnote-1214909 -Node: Exporting215057 -Node: ASCII export216524 -Node: HTML export218025 -Node: HTML Export commands218651 -Node: Quoting HTML tags220438 -Node: Links221073 -Node: Images221770 -Ref: Images-Footnote-1222641 -Node: CSS support222702 -Ref: CSS support-Footnote-1224021 -Node: LaTeX export224134 -Node: LaTeX export commands224458 -Node: Quoting LaTeX code225620 -Node: XOXO export226125 -Node: iCalendar export226565 -Node: Text interpretation227784 -Node: Comment lines228375 -Node: Initial text228770 -Node: Footnotes230439 -Node: Enhancing text231230 -Ref: Enhancing text-Footnote-1233099 -Node: Export options233189 -Node: Publishing235542 -Ref: Publishing-Footnote-1236503 -Ref: Publishing-Footnote-2236647 -Node: Configuration236798 -Node: Project alist237516 -Node: Sources and destinations238582 -Node: Selecting files239312 -Node: Publishing action240060 -Node: Publishing options241394 -Node: Publishing links243769 -Node: Project page index245282 -Node: Sample configuration246060 -Node: Simple example246552 -Node: Complex example247225 -Node: Triggering publication249301 -Node: Miscellaneous249986 -Node: Completion250620 -Node: Customization252290 -Node: In-buffer settings252873 -Node: The very busy C-c C-c key258408 -Node: Clean view260263 -Node: TTY keys262840 -Node: Interaction264450 -Node: Cooperation264847 -Node: Conflicts267723 -Node: Bugs269726 -Node: Extensions and Hacking271222 -Node: Extensions271947 -Node: Adding hyperlink types274209 -Node: Tables in arbitrary syntax277871 -Node: Radio tables278960 -Node: A LaTeX example281463 -Ref: A LaTeX example-Footnote-1285109 -Ref: A LaTeX example-Footnote-2285257 -Node: Translator functions285692 -Ref: Translator functions-Footnote-1288801 -Node: Dynamic blocks288889 -Node: Special agenda views290861 -Node: Using the property API294106 -Node: History and Acknowledgments295587 -Node: Index302163 -Node: Key Index336794 +Ref: Handling links-Footnote-191114 +Ref: Handling links-Footnote-291351 +Node: Using links outside Org-mode91425 +Node: Link abbreviations91935 +Node: Search options93628 +Ref: Search options-Footnote-195408 +Node: Custom searches95489 +Node: TODO items96520 +Node: TODO basics97558 +Node: TODO extensions99763 +Node: Workflow states100707 +Ref: Workflow states-Footnote-1101882 +Node: TODO types101975 +Ref: TODO types-Footnote-1103558 +Node: Multiple sets in one file103640 +Node: Fast access to TODO states105260 +Node: Per file keywords106403 +Ref: Per file keywords-Footnote-1107705 +Node: Faces for TODO keywords107906 +Node: Progress logging108612 +Node: Closing items109043 +Ref: Closing items-Footnote-1109977 +Ref: Closing items-Footnote-2110182 +Node: Tracking TODO state changes110255 +Ref: Tracking TODO state changes-Footnote-1111440 +Node: Priorities111515 +Ref: Priorities-Footnote-1113165 +Node: Breaking down tasks113235 +Ref: Breaking down tasks-Footnote-1113755 +Node: Checkboxes113851 +Node: Tags116700 +Node: Tag inheritance117472 +Node: Setting tags118409 +Ref: Setting tags-Footnote-1122932 +Ref: Setting tags-Footnote-2123044 +Node: Tag searches123127 +Node: Properties and columns125844 +Node: Property syntax126949 +Node: Special properties129496 +Node: Property searches130412 +Node: Column view131067 +Node: Defining columns132234 +Node: Scope of column definitions132632 +Node: Column attributes133554 +Node: Using column view135802 +Node: Property API137789 +Node: Timestamps138143 +Node: Time stamps138554 +Ref: Time stamps-Footnote-1140908 +Node: Creating timestamps141024 +Node: The date/time prompt143098 +Ref: The date/time prompt-Footnote-1145086 +Node: Custom time format145192 +Node: Deadlines and scheduling146884 +Ref: Deadlines and scheduling-Footnote-1148957 +Node: Inserting deadline/schedule149112 +Node: Repeated tasks150230 +Ref: Repeated tasks-Footnote-1151908 +Node: Clocking work time152029 +Ref: Clocking work time-Footnote-1156690 +Ref: Clocking work time-Footnote-2156768 +Node: Remember156894 +Node: Setting up remember157776 +Node: Remember templates158379 +Ref: Remember templates-Footnote-1161896 +Ref: Remember templates-Footnote-2162079 +Node: Storing notes162177 +Ref: Storing notes-Footnote-1164656 +Node: Agenda views164758 +Node: Agenda files166709 +Ref: Agenda files-Footnote-1167801 +Ref: Agenda files-Footnote-2167950 +Node: Agenda dispatcher168143 +Node: Built-in agenda views169842 +Node: Weekly/Daily agenda170424 +Node: Global TODO list173761 +Node: Matching tags and properties176041 +Node: Timeline177132 +Node: Stuck projects177806 +Node: Presentation and sorting179659 +Node: Categories180452 +Ref: Categories-Footnote-1181163 +Node: Time-of-day specifications181483 +Node: Sorting of agenda items183456 +Node: Agenda commands184740 +Node: Custom agenda views192203 +Node: Storing searches192924 +Node: Block agenda194838 +Node: Setting Options196070 +Node: Exporting Agenda Views198811 +Ref: Exporting Agenda Views-Footnote-1203097 +Ref: Exporting Agenda Views-Footnote-2203154 +Node: Extracting Agenda Information for other programs203340 +Node: Embedded LaTeX207468 +Ref: Embedded LaTeX-Footnote-1208562 +Node: Math symbols208752 +Node: Subscripts and Superscripts209519 +Node: LaTeX fragments210365 +Ref: LaTeX fragments-Footnote-1212598 +Ref: LaTeX fragments-Footnote-2212859 +Node: Processing LaTeX fragments212993 +Node: CDLaTeX mode213941 +Ref: CDLaTeX mode-Footnote-1216427 +Node: Exporting216575 +Node: ASCII export218042 +Node: HTML export219543 +Node: HTML Export commands220169 +Node: Quoting HTML tags221956 +Node: Links222591 +Node: Images223288 +Ref: Images-Footnote-1224159 +Node: CSS support224220 +Ref: CSS support-Footnote-1225539 +Node: LaTeX export225652 +Node: LaTeX export commands225976 +Node: Quoting LaTeX code227138 +Node: XOXO export227643 +Node: iCalendar export228083 +Node: Text interpretation229552 +Node: Comment lines230143 +Node: Initial text230538 +Node: Footnotes232207 +Node: Enhancing text232998 +Ref: Enhancing text-Footnote-1234867 +Node: Export options234957 +Node: Publishing237310 +Ref: Publishing-Footnote-1238271 +Ref: Publishing-Footnote-2238415 +Node: Configuration238566 +Node: Project alist239284 +Node: Sources and destinations240350 +Node: Selecting files241080 +Node: Publishing action241828 +Node: Publishing options243162 +Node: Publishing links245537 +Node: Project page index247050 +Node: Sample configuration247828 +Node: Simple example248320 +Node: Complex example248993 +Node: Triggering publication251069 +Node: Miscellaneous251754 +Node: Completion252388 +Node: Customization254058 +Node: In-buffer settings254641 +Node: The very busy C-c C-c key260203 +Node: Clean view262058 +Node: TTY keys264635 +Node: Interaction266245 +Node: Cooperation266642 +Node: Conflicts269518 +Node: Bugs271521 +Node: Extensions and Hacking273017 +Node: Extensions273742 +Node: Adding hyperlink types276004 +Node: Tables in arbitrary syntax279666 +Node: Radio tables280755 +Node: A LaTeX example283258 +Ref: A LaTeX example-Footnote-1286904 +Ref: A LaTeX example-Footnote-2287052 +Node: Translator functions287487 +Ref: Translator functions-Footnote-1290596 +Node: Dynamic blocks290684 +Node: Special agenda views292656 +Node: Using the property API295901 +Node: History and Acknowledgments297382 +Node: Index303944 +Node: Key Index338721  End Tag Table diff --git a/org-export-latex.el b/org-export-latex.el index 0fbd514fc..95b03e523 100644 --- a/org-export-latex.el +++ b/org-export-latex.el @@ -1,10 +1,15 @@ -;;; org-export-latex.el --- latex exporter for org-mode + ;;; org-export-latex.el --- LaTeX exporter for org-mode +;; ;; copyright (c) 2007 free software foundation, inc. ;; +;; Emacs Lisp Archive Entry +;; Filename: org-export-latex.el +;; Version: 5.11 ;; Author: Bastien Guerry -;; Keywords: Org organizer latex export convert -;; Homepage: http://www.cognition.ens.fr/~guerry/u/org-export-latex.el -;; Version: 5.10 +;; Maintainer: Bastien Guerry +;; Keywords: org, wp, tex +;; Description: Converts an org-mode buffer into LaTeX +;; URL: http://www.cognition.ens.fr/~guerry/u/org-export-latex.el ;; ;; This file is part of GNU Emacs. ;; @@ -87,12 +92,12 @@ The %s formatter will be replaced by the title of the section." ("/" "\\emph{%s}" nil) ("_" "\\underline{%s}" nil) ("+" "\\texttt{%s}" nil) - ("=" "\\texttt{%s}" t)) + ("=" "\\texttt{%s}" nil)) "Alist of LaTeX expressions to convert emphasis fontifiers. Each element of the list is a list of three elements. The first element is the character used as a marker for fontification. The second element is a formatting string to wrap fontified text with. -If non-nil the third element tells to protect converted text from other +The third element decides whether to protect converted text from other conversions." :group 'org-export-latex :type 'alist) @@ -106,6 +111,14 @@ conversions." :group 'org-export-latex :type 'string) +(defcustom org-export-latex-title-command "\\maketitle" + "The command used to insert the title just after \\begin{document}. +If this string contains the formatting specification \"%s\" then +it will be used as a formatting string, passing the title as an +argument." + :group 'org-export-latex + :type 'string) + (defcustom org-export-latex-date-format "%d %B %Y" "Format string for \\date{...}." @@ -129,11 +142,14 @@ For example: :type 'alist) (defcustom org-export-latex-low-levels 'description - "Choice for converting sections that are below the current -admitted level of sectioning. This can be either nil (ignore the -sections), 'description (convert them as description lists) or a -string to be used instead of \\section{%s} (a %s for inserted the -headline is mandatory)." + "How to convert sections below the current level of sectioning, +as specified by `org-export-headline-levels' or the value of \"H:\" +in Org's #+OPTION line. + +This can be either nil (skip the sections), 'description (convert +the sections as descriptive lists) or a string to be used instead +of \\section{%s}. In this latter case, the %s stands here for the +inserted headline and is mandatory." :group 'org-export-latex :type '(choice (const :tag "Ignore" nil) (symbol :tag "Convert as descriptive list" description) @@ -253,7 +269,8 @@ in a window. A non-interactive call will only retunr the buffer." (message "Exporting to LaTeX...") (org-update-radio-target-regexp) (org-export-latex-set-initial-vars ext-plist) - (let* ((opt-plist org-latex-options-plist) + (let* ((wcf (current-window-configuration)) + (opt-plist org-latex-options-plist) (filename (concat (file-name-as-directory (org-export-directory :LaTeX ext-plist)) (file-name-sans-extension @@ -289,15 +306,27 @@ in a window. A non-interactive call will only retunr the buffer." region :emph-multiline t :for-LaTeX t :comments nil - :add-text text + :add-text (if (eq to-buffer 'string) nil text) :skip-before-1st-heading skip :LaTeX-fragments nil))) - (set-buffer buffer) + + (set-buffer buffer) (erase-buffer) - (unless body-only (insert preamble)) - (when text (insert (org-export-latex-content text) "\n\n")) - (unless skip (insert first-lines)) + (and (fboundp 'set-buffer-file-coding-system) + (set-buffer-file-coding-system coding-system-for-write)) + + ;; insert the preamble and initial document commands + (unless (or (eq to-buffer 'string) body-only) + (insert preamble)) + + ;; insert text found in #+TEXT + (when (and text (not (eq to-buffer 'string))) + (insert (org-export-latex-content text) "\n\n")) + + ;; insert lines before the first headline + (unless (or skip (eq to-buffer 'string)) + (insert first-lines)) ;; handle the case where the region does not begin with a section (when region-p @@ -305,25 +334,29 @@ in a window. A non-interactive call will only retunr the buffer." (insert string-for-export) (org-export-latex-first-lines)))) + ;; export the content of headlines (org-export-latex-global (with-temp-buffer (insert string-for-export) (goto-char (point-min)) - (re-search-forward "^\\(\\*+\\) " nil t) - (let* ((asters (length (match-string 1))) - (level (if odd (- asters 2) (- asters 1)))) - (setq org-latex-add-level - (if odd (1- (/ (1+ asters) 2)) (1- asters))) - (org-export-latex-parse-global level odd)))) - + (when (re-search-forward "^\\(\\*+\\) " nil t) + (let* ((asters (length (match-string 1))) + (level (if odd (- asters 2) (- asters 1)))) + (setq org-latex-add-level + (if odd (1- (/ (1+ asters) 2)) (1- asters))) + (org-export-latex-parse-global level odd))))) + + ;; finalization (unless body-only (insert "\n\\end{document}")) (or to-buffer (save-buffer)) (goto-char (point-min)) (message "Exporting to LaTeX...done") - (if (eq to-buffer 'string) - (prog1 (buffer-substring (point-min) (point-max)) - (kill-buffer (current-buffer))) - (current-buffer)))) + (prog1 + (if (eq to-buffer 'string) + (prog1 (buffer-substring (point-min) (point-max)) + (kill-buffer (current-buffer))) + (current-buffer)) + (set-window-configuration wcf)))) ;;; Parsing functions: @@ -490,8 +523,11 @@ and its content." ;;; Exporting internals: -(defun org-latex-protect (string) - (add-text-properties 0 (length string) '(org-protected t) string) string) +(defun org-export-latex-protect-string (string) + "Prevent further conversion for STRING by adding the +org-protect property." + (add-text-properties + 0 (length string) '(org-protected t) string) string) (defun org-export-latex-protect-char-in-string (char-list string) "Add org-protected text-property to char from CHAR-LIST in STRING." @@ -524,54 +560,65 @@ EXT-PLIST is an optional additional plist." "Make the LaTeX preamble and return it as a string. Argument OPT-PLIST is the options plist for current buffer." (let ((toc (plist-get opt-plist :table-of-contents))) - (concat (if (plist-get opt-plist :time-stamp-file) - (format-time-string "% Created %Y-%m-%d %a %H:%M\n")) - - ;; LaTeX custom preamble - org-export-latex-preamble "\n" - - ;; LaTeX packages - (if org-export-latex-packages-alist - (mapconcat (lambda(p) - (if (equal "" (car p)) - (format "\\usepackage{%s}" (cadr p)) - (format "\\usepackage[%s]{%s}" - (car p) (cadr p)))) - org-export-latex-packages-alist "\n") "") - "\n\\begin{document}\n\n" - - ;; title - (format - "\\title{%s}\n" - (or (plist-get opt-plist :title) - (and (not - (plist-get opt-plist :skip-before-1st-heading)) - (org-export-grab-title-from-buffer)) - (and buffer-file-name - (file-name-sans-extension - (file-name-nondirectory buffer-file-name))) - "UNTITLED")) - - ;; author info - (if (plist-get opt-plist :author-info) - (format "\\author{%s}\n" - (or (plist-get opt-plist :author) user-full-name)) - (format "%%\\author{%s}\n" - (or (plist-get opt-plist :author) user-full-name))) - - ;; date - (format "\\date{%s}\n" - (format-time-string - (or (plist-get opt-plist :date) - org-export-latex-date-format))) - - "\\maketitle\n\n" - ;; table of contents - (if (and (plist-get opt-plist :section-numbers) toc) - (format "\\setcounter{tocdepth}{%s}\n" - (min toc (plist-get opt-plist :headline-levels))) "") - (if (and (plist-get opt-plist :section-numbers) toc) - "\\tableofcontents\n" "\n")))) + (concat + (if (plist-get opt-plist :time-stamp-file) + (format-time-string "% Created %Y-%m-%d %a %H:%M\n")) + + ;; insert LaTeX custom preamble + org-export-latex-preamble "\n" + + ;; insert information on LaTeX packages + (when org-export-latex-packages-alist + (mapconcat (lambda(p) + (if (equal "" (car p)) + (format "\\usepackage{%s}" (cadr p)) + (format "\\usepackage[%s]{%s}" + (car p) (cadr p)))) + org-export-latex-packages-alist "\n")) + + ;; insert the title + (format + "\\title{%s}\n" + (or (plist-get opt-plist :title) + (and (not + (plist-get opt-plist :skip-before-1st-heading)) + (org-export-grab-title-from-buffer)) + (and buffer-file-name + (file-name-sans-extension + (file-name-nondirectory buffer-file-name))) + "UNTITLED")) + + ;; insert author info + (if (plist-get opt-plist :author-info) + (format "\\author{%s}\n" + (or (plist-get opt-plist :author) user-full-name)) + (format "%%\\author{%s}\n" + (or (plist-get opt-plist :author) user-full-name))) + + ;; insert the date + (format "\\date{%s}\n" + (format-time-string + (or (plist-get opt-plist :date) + org-export-latex-date-format))) + + ;; beginning of the document + "\n\\begin{document}\n\n" + + ;; insert the title command + (if (string-match "%s" org-export-latex-title-command) + (format org-export-latex-title-command + (plist-get opt-plist :title)) + org-export-latex-title-command) + "\n\n" + + ;; table of contents + (when (and org-export-with-toc + (plist-get opt-plist :section-numbers)) + (cond ((numberp toc) + (format "\\setcounter{tocdepth}{%s}\n\\tableofcontents\n\n" + (min toc (plist-get opt-plist :headline-levels)))) + (toc (format "\\setcounter{tocdepth}{%s}\n\\tableofcontents\n\n" + (plist-get opt-plist :headline-levels)))))))) (defun org-export-latex-first-lines (&optional comments) "Export the first lines before first headline. @@ -646,6 +693,7 @@ formatting string like %%%%s if we want to comment them out." (plist-get org-latex-options-plist :tables)) (org-export-latex-fixed-width (plist-get org-latex-options-plist :fixed-width)) + ;; return string (buffer-substring (point-min) (point-max)))) (defun org-export-latex-quotation-marks () @@ -664,7 +712,7 @@ Local definition of the language overrides (mapc (lambda(l) (goto-char (point-min)) (while (re-search-forward (car l) nil t) (let ((rpl (concat (match-string 1) (cadr l)))) - (org-latex-protect rpl) + (org-export-latex-protect-string rpl) (org-if-unprotected (replace-match rpl t t))))) quote-rpl))) @@ -694,42 +742,42 @@ See the `org-export-latex.el' code for a complete conversion table." ;; Put the point where to check for org-protected (unless (get-text-property (match-beginning 2) 'org-protected) (cond ((member (match-string 2) '("\\$" "$")) - (if (equal (match-string 2) "\\$") - (replace-match (concat (match-string 1) "$" - (match-string 3)) t t) - (replace-match (concat (match-string 1) "\\$" - (match-string 3)) t t))) - ((member (match-string 2) '("&" "#" "%")) - (if (equal (match-string 1) "\\") - (replace-match (match-string 2) t t) - (replace-match (concat (match-string 1) "\\" - (match-string 2)) t t))) - ((equal (match-string 2) "~") - (cond ((equal (match-string 1) "\\") nil) - ((eq 'org-link (get-text-property 0 'face (match-string 2))) - (replace-match (concat (match-string 1) "\\~") t t)) - (t (replace-match - (org-latex-protect - (concat (match-string 1) "\\~{}")) t t)))) - ((member (match-string 2) '("{" "}")) - (unless (save-match-data (org-inside-LaTeX-fragment-p)) - (if (equal (match-string 1) "\\") - (replace-match (match-string 2) t t) - (replace-match (concat (match-string 1) "\\" - (match-string 2)) t t))))) + (if (equal (match-string 2) "\\$") + (replace-match (concat (match-string 1) "$" + (match-string 3)) t t) + (replace-match (concat (match-string 1) "\\$" + (match-string 3)) t t))) + ((member (match-string 2) '("&" "%" "#")) + (if (equal (match-string 1) "\\") + (replace-match (match-string 2) t t) + (replace-match (concat (match-string 1) "\\" + (match-string 2)) t t))) + ((equal (match-string 2) "~") + (cond ((equal (match-string 1) "\\") nil) + ((eq 'org-link (get-text-property 0 'face (match-string 2))) + (replace-match (concat (match-string 1) "\\~") t t)) + (t (replace-match + (org-export-latex-protect-string + (concat (match-string 1) "\\~{}")) t t)))) + ((member (match-string 2) '("{" "}")) + (unless (save-match-data (org-inside-LaTeX-fragment-p)) + (if (equal (match-string 1) "\\") + (replace-match (match-string 2) t t) + (replace-match (concat (match-string 1) "\\" + (match-string 2)) t t))))) (unless (save-match-data (org-inside-LaTeX-fragment-p)) - (cond ((equal (match-string 2) "\\") - (replace-match (or (save-match-data - (org-export-latex-treat-backslash-char - (match-string 1) - (match-string 3))) "") t t)) - ((member (match-string 2) '("_" "^")) - (replace-match (or (save-match-data - (org-export-latex-treat-sub-super-char - sub-superscript - (match-string 1) - (match-string 2) - (match-string 3))) "") t t))))))) + (cond ((equal (match-string 2) "\\") + (replace-match (or (save-match-data + (org-export-latex-treat-backslash-char + (match-string 1) + (match-string 3))) "") t t)) + ((member (match-string 2) '("_" "^")) + (replace-match (or (save-match-data + (org-export-latex-treat-sub-super-char + sub-superscript + (match-string 1) + (match-string 2) + (match-string 3))) "") t t))))))) '("^\\([^\n$]*?\\|^\\)\\(\\\\?\\$\\)\\([^\n$]*\\)$" "\\([a-za-z0-9]+\\|[ \t\n]\\|\\b\\|\\\\\\)\\(_\\|\\^\\)\\([a-za-z0-9]+\\|[ \t\n]\\|[:punct:]\\|{[a-za-z0-9]+}\\|([a-za-z0-9]+)\\)" "\\(.\\|^\\)\\(\\\\\\)\\([ \t\n]\\|[a-zA-Z&#%{}\"]+\\)" @@ -738,7 +786,10 @@ See the `org-export-latex.el' code for a complete conversion table." "\\(.\\|^\\)\\(%\\)" "\\(.\\|^\\)\\({\\)" "\\(.\\|^\\)\\(}\\)" - "\\(.\\|^\\)\\(~\\)"))) + "\\(.\\|^\\)\\(~\\)" + ;; (?\< . "\\textless{}") + ;; (?\> . "\\textgreater{}") + ))) (defun org-export-latex-treat-sub-super-char (subsup string-before char string-after) @@ -765,9 +816,9 @@ Convert CHAR depending on STRING-BEFORE and STRING-AFTER." (format "$%s%s{%s}$" string-before char (match-string 1 string-after))) (subsup (concat "$" string-before char string-after "$")) - (t (org-latex-protect + (t (org-export-latex-protect-string (concat string-before "\\" char "{}" string-after))))) - (t (org-latex-protect + (t (org-export-latex-protect-string (concat string-before "\\" char "{}" string-after))))) (defun org-export-latex-treat-backslash-char (string-before string-after) @@ -781,17 +832,21 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER." ((and (not (string-match "^[ \n\t]" string-after)) (not (string-match "[ \t]\\'\\|^" string-before))) ;; backslash is inside a word - (concat string-before "$\\backslash$" string-after)) + (org-export-latex-protect-string + (concat string-before "\\textbackslash{}" string-after))) ((not (or (equal string-after "") (string-match "^[ \t\n]" string-after))) ;; backslash might escape a character (like \#) or a user TeX ;; macro (like \setcounter) - (concat string-before "\\" string-after)) + (org-export-latex-protect-string + (concat string-before "\\" string-after))) ((and (string-match "^[ \t\n]" string-after) (string-match "[ \t\n]\\'" string-before)) ;; backslash is alone, convert it to $\backslash$ - (concat string-before "$\\backslash$" string-after)) - (t (concat string-before "$\\backslash$" string-after)))) + (org-export-latex-protect-string + (concat string-before "\\textbackslash{}" string-after))) + (t (org-export-latex-protect-string + (concat string-before "\\textbackslash{}" string-after))))) (defun org-export-latex-keywords (timestamps) "Convert special keywords to LaTeX. @@ -807,6 +862,7 @@ Regexps are those from `org-latex-special-string-regexps'." (defun org-export-latex-fixed-width (opt) "When OPT is non-nil convert fixed-width sections to LaTeX." (goto-char (point-min)) + ;; FIXME the search shouldn't be performed on already converted text (while (re-search-forward "^[ \t]*:" nil t) (if opt (progn (goto-char (match-beginning 0)) @@ -822,7 +878,6 @@ Regexps are those from `org-latex-special-string-regexps'." (match-string 2)) t t) (forward-line)))))) -;; FIXME Use org-export-highlight-first-table-line ? (defun org-export-latex-lists () "Convert lists to LaTeX." (goto-char (point-min)) @@ -889,35 +944,68 @@ Valid parameters are ;; Add a trailing \n after list conversion "\n")) -(defun org-export-latex-tables (opt) - "When OPT is non-nil convert tables to LaTeX." +;; FIXME Use org-export-highlight-first-table-line ? +(defun org-export-latex-tables (insert) + "Convert tables to LaTeX and INSERT it." (goto-char (point-min)) (while (re-search-forward "^\\([ \t]*\\)|" nil t) - ;; Re-align the table to update org-table-last-alignment - (save-excursion (save-match-data (org-table-align))) - (let (tbl-list - (beg (match-beginning 0)) - (end (save-excursion - (re-search-forward - (concat "^" (regexp-quote (match-string 1)) - "[^|]\\|\\'") nil t) (match-beginning 0)))) - (beginning-of-line) + ;; FIXME really need to save-excursion? + (save-excursion (org-table-align)) + (let* ((beg (org-table-begin)) + (end (org-table-end)) + (raw-table (buffer-substring-no-properties beg end)) + fnum line lines olines gr colgropen line-fmt alignment) (if org-export-latex-tables-verbatim - (let* ((raw-table (buffer-substring beg end)) - (tbl (concat "\\begin{verbatim}\n" raw-table + (let* ((tbl (concat "\\begin{verbatim}\n" raw-table "\\end{verbatim}\n"))) (apply 'delete-region (list beg end)) (insert tbl)) - (progn - (while (not (eq end (point))) - (if (looking-at "[ \t]*|\\([^-|].+\\)|[ \t]*$") - (push (split-string (org-trim (match-string 1)) "|") tbl-list) - (push 'hline tbl-list)) - (forward-line)) - ;; comment region out instead of deleting it ? + (progn + (setq lines (split-string raw-table "\n" t)) (apply 'delete-region (list beg end)) - (when opt (insert (orgtbl-to-latex (nreverse tbl-list) - nil) "\n\n"))))))) + (when org-export-table-remove-special-lines + (setq lines (org-table-clean-before-export lines))) + ;; make a formatting string to reflect aligment + (setq olines lines) + (while (and (not line-fmt) (setq line (pop olines))) + (unless (string-match "^[ \t]*|-" line) + (setq fields (org-split-string line "[ \t]*|[ \t]*")) + (setq fnum (make-vector (length fields) 0)) + (setq line-fmt + (mapconcat + (lambda (x) + (setq gr (pop org-table-colgroup-info)) + (format "%s%%s%s" + (cond ((eq gr ':start) + (prog1 (if colgropen "|" "") + (setq colgropen t))) + ((eq gr ':startend) + (prog1 (if colgropen "|" "|") + (setq colgropen nil))) + (t "")) + (if (memq gr '(:end :startend)) + (progn (setq colgropen nil) "|") + ""))) + fnum "")))) + ;; maybe remove the first and last "|" + (when (string-match "^\\(|\\)?\\(.+\\)|$" line-fmt) + (setq line-fmt (match-string 2 line-fmt))) + ;; format alignment + (setq align (apply 'format + (cons line-fmt + (mapcar (lambda (x) (if x "r" "l")) + org-table-last-alignment)))) + ;; prepare the table to send to orgtbl-to-latex + (setq lines + (mapcar + (lambda(elem) + (or (and (string-match "[ \t]*|-+" elem) 'hline) + (split-string (org-trim elem) "|" t))) + lines)) + (when insert + (insert (orgtbl-to-latex + lines `(:tstart ,(concat "\\begin{tabular}{" align "}"))) + "\n\n"))))))) (defun org-export-latex-fontify () "Convert fontification to LaTeX." @@ -933,7 +1021,8 @@ Valid parameters are '("\\" "{" "}") (cadr emph)) (match-string 4)) (match-string 5))) - (if (caddr emph) (setq rpl (org-latex-protect rpl))) + (if (caddr emph) + (setq rpl (org-export-latex-protect-string rpl))) (replace-match rpl t t))) (backward-char))) @@ -999,13 +1088,13 @@ Valid parameters are (goto-char (point-min)) (let ((case-fold-search nil) rpl) (while (re-search-forward "\\([^+_]\\)LaTeX" nil t) - (replace-match (org-latex-protect + (replace-match (org-export-latex-protect-string (concat (match-string 1) "\\LaTeX{}")) t t))) ;; Convert horizontal rules (goto-char (point-min)) (while (re-search-forward "^----+.$" nil t) - (replace-match (org-latex-protect "\\hrule") t t)) + (replace-match (org-export-latex-protect-string "\\hrule") t t)) ;; Protect LaTeX \commands{...} (goto-char (point-min)) @@ -1019,7 +1108,7 @@ Valid parameters are (concat "<<>>?\\((INVISIBLE)\\)?") nil t) (replace-match - (org-latex-protect + (org-export-latex-protect-string (format "\\label{%s}%s"(match-string 1) (if (match-string 2) "" (match-string 1)))) t t)) diff --git a/org-mouse.el b/org-mouse.el index 62e7c0cfe..67ae37090 100644 --- a/org-mouse.el +++ b/org-mouse.el @@ -4,7 +4,7 @@ ;; ;; Author: Piotr Zielinski ;; Maintainer: Carsten Dominik -;; Version: 5.10 +;; Version: 5.11 ;; ;; This file is part of GNU Emacs. ;; diff --git a/org-publish.el b/org-publish.el index fb21e8e16..0eddd4028 100644 --- a/org-publish.el +++ b/org-publish.el @@ -4,7 +4,7 @@ ;; Author: David O'Toole ;; Keywords: hypermedia, outlines -;; Version: 1.80 +;; Version: 1.80a ;; This file is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by diff --git a/org.el b/org.el index 3dc5ceb58..c43d9f3ea 100644 --- a/org.el +++ b/org.el @@ -5,7 +5,7 @@ ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://orgmode.org -;; Version: 5.10b +;; Version: 5.11 ;; ;; This file is part of GNU Emacs. ;; @@ -83,7 +83,7 @@ ;;; Version -(defconst org-version "5.10b" +(defconst org-version "5.11" "The version number of the file org.el.") (defun org-version () (interactive) @@ -120,7 +120,16 @@ (unwind-protect (progn ,@body) (goto-line _line) - (move-to-column _col)))) + (move-to-column _col)))) + +(defmacro org-without-partial-completion (&rest body) + `(let ((pc-mode (and (boundp 'partial-completion-mode) + partial-completion-mode))) + (unwind-protect + (progn + (if pc-mode (partial-completion-mode -1)) + ,@body) + (if pc-mode (partial-completion-mode 1))))) ;;; The custom variables @@ -131,6 +140,13 @@ :group 'hypermedia :group 'calendar) +;; FIXME: Needs a separate group... +(defcustom org-completion-fallback-command 'hippie-expand + "The expansion command called by \\[org-complete] in normal context. +Normal means, no org-mode-specific context." + :group 'org + :type 'function) + (defgroup org-startup nil "Options concerning startup of Org-mode." :tag "Org Startup" @@ -415,7 +431,7 @@ contexts. See `org-show-hierarchy-above' for valid contexts." :tag "Org Cycle" :group 'org-structure) -(defcustom org-drawers '("PROPERTIES") +(defcustom org-drawers '("PROPERTIES" "CLOCK") "Names of drawers. Drawers are not opened by cycling on the headline above. Drawers only open with a TAB on the drawer line itself. A drawer looks like this: @@ -714,7 +730,9 @@ use the first keyword in its list that means done." (string :tag "Use this keyword"))) (defcustom org-archive-stamp-time t - "Non-nil means, add a time stamp to entries moved to an archive file." + "Non-nil means, add a time stamp to entries moved to an archive file. +This variable is obsolete and has no effect anymore, instead add ot remove +`time' from the variablle `org-archive-save-context-info'." :group 'org-archive :type 'boolean) @@ -736,7 +754,8 @@ For each symbol present in the list, a property will be created in the archived entry, with a prefix \"PRE_ARCHIVE_\", to remember this information." :group 'org-archive - :type '(set + :type '(set :greedy t + (const :tag "Time" time) (const :tag "File" file) (const :tag "Category" category) (const :tag "TODO state" todo) @@ -1599,7 +1618,10 @@ the following lines anywhere in the buffer: #+STARTUP: nologging #+STARTUP: lognotedone #+STARTUP: lognotestate - #+STARTUP: lognoteclock-out" + #+STARTUP: lognoteclock-out + +You can have local logging settings for a subtree by setting the LOGGING +property to one or more of these keywords." :group 'org-todo :group 'org-progress :type '(choice @@ -1646,11 +1668,32 @@ When nil, the notes will be orderer according to time." (defcustom org-log-repeat t "Non-nil means, prompt for a note when REPEAT is resetting a TODO entry. -When nil, no note will be taken." +When nil, no note will be taken. +This option can also be set with on a per-file-basis with + + #+STARTUP: logrepeat + #+STARTUP: nologrepeat + +You can have local logging settings for a subtree by setting the LOGGING +property to one or more of these keywords." :group 'org-todo :group 'org-progress :type 'boolean) +(defcustom org-clock-into-drawer 2 + "Should clocking info be wrapped into a drawer? +When t, clocking info will always be inserted into a :CLOCK: drawer. +If necessary, the drawer will be created. +When nil, the drawer will not be created, but used when present. +When an integer and the number of clocking entries in an item +reaches or exceeds this number, a drawer will be created." + :group 'org-todo + :group 'org-progress + :type '(choice + (const :tag "Always" t) + (const :tag "Only when drawer exists" nil) + (integer :tag "When at least N clock entries"))) + (defcustom org-clock-out-when-done t "When t, the clock will be stopped when the relevant entry is marked DONE. Nil means, clock will keep running until stopped explicitly with @@ -1701,15 +1744,6 @@ the time stamp will always be forced into the second line." :group 'org-time :type 'boolean) -(defcustom org-insert-labeled-timestamps-before-properties-drawer t - "Non-nil means, always insert planning info before property drawer. -When this is nil and there is a property drawer *directly* after -the headline, move the planning info into the drawer. If the property -drawer separated from the headline by at least one line, this variable -has no effect." - :group 'org-time - :type 'boolean) - (defconst org-time-stamp-formats '("<%Y-%m-%d %a>" . "<%Y-%m-%d %a %H:%M>") "Formats for `format-time-string' which are used for time stamps. It is not recommended to change this constant.") @@ -1831,11 +1865,11 @@ displaying the tags menu is not even shown, until you press C-c again." "Non-nil means, fast tags selection interface will also offer TODO states. This is an undocumented feature, you should not rely on it.") -(defcustom org-tags-column 48 +(defcustom org-tags-column -80 "The column to which tags should be indented in a headline. If this number is positive, it specifies the column. If it is negative, it means that the tags should be flushright to that column. For example, --79 works well for a normal 80 character screen." +-80 works well for a normal 80 character screen." :group 'org-tags :type 'integer) @@ -1969,6 +2003,12 @@ forth between agenda and calendar." :group 'org-agenda :type 'sexp) +(defcustom org-agenda-compact-blocks nil + "Non-nil means, make the block agenda more compact. +This is done by leaving out unnecessary lines." + :group 'org-agenda + :type nil) + (defgroup org-agenda-export nil "Options concerning exporting agenda views in Org-mode." :tag "Org Agenda Export" @@ -2199,7 +2239,7 @@ The idea behind this is that such items will appear in the agenda anyway." (defcustom org-agenda-skip-scheduled-if-done nil "Non-nil means don't show scheduled items in agenda when they are done. This is relevant for the daily/weekly agenda, not for the TODO list. And -it applied only to the actualy date of the scheduling. Warnings about +it applies only to the actual date of the scheduling. Warnings about an item with a past scheduling dates are always turned off when the item is DONE." :group 'org-agenda-skip @@ -2474,9 +2514,9 @@ agenda entries." :group 'org-agenda-sorting :type 'boolean) -(defgroup org-agenda-prefix nil +(defgroup org-agenda-line-format nil "Options concerning the entry prefix in the Org-mode agenda display." - :tag "Org Agenda Prefix" + :tag "Org Agenda Line Format" :group 'org-agenda) (defcustom org-agenda-prefix-format @@ -2539,7 +2579,7 @@ See also the variables `org-agenda-remove-times-when-in-prefix' and (cons (const timeline) (string :tag "Format")) (cons (const todo) (string :tag "Format")) (cons (const tags) (string :tag "Format")))) - :group 'org-agenda-prefix) + :group 'org-agenda-line-format) (defvar org-prefix-format-compiled nil "The compiled version of the most recently used prefix format. @@ -2556,7 +2596,7 @@ cluttered. The option can be t or nil. It may also be the symbol `beg', indicating that the time should only be removed what it is located at the beginning of the headline/diary entry." - :group 'org-agenda-prefix + :group 'org-agenda-line-format :type '(choice (const :tag "Always" t) (const :tag "Never" nil) @@ -2567,7 +2607,7 @@ the headline/diary entry." "Default duration for appointments that only have a starting time. When nil, no duration is specified in such cases. When non-nil, this must be the number of minutes, e.g. 60 for one hour." - :group 'org-agenda-prefix + :group 'org-agenda-line-format :type '(choice (integer :tag "Minutes") (const :tag "No default duration"))) @@ -2577,7 +2617,7 @@ When non-nil, this must be the number of minutes, e.g. 60 for one hour." "Non-nil means, remove the tags from the headline copy in the agenda. When this is the symbol `prefix', only remove tags when `org-agenda-prefix-format' contains a `%T' specifier." - :group 'org-agenda-prefix + :group 'org-agenda-line-format :type '(choice (const :tag "Always" t) (const :tag "Never" nil) @@ -2587,11 +2627,17 @@ When this is the symbol `prefix', only remove tags when (defvaralias 'org-agenda-remove-tags-when-in-prefix 'org-agenda-remove-tags)) -(defcustom org-agenda-align-tags-to-column 65 - "Shift tags in agenda items to this column." - :group 'org-agenda-prefix +(defcustom org-agenda-tags-column -80 + "Shift tags in agenda items to this column. +If this number is positive, it specifies the column. If it is negative, +it means that the tags should be flushright to that column. For example, +-80 works well for a normal 80 character screen." + :group 'org-agenda-line-format :type 'integer) +(if (fboundp 'defvaralias) + (defvaralias 'org-agenda-align-tags-to-column 'org-agenda-tags-column)) + (defgroup org-latex nil "Options for embedding LaTeX code into Org-mode" :tag "Org LaTeX" @@ -2617,7 +2663,7 @@ This is a property list with the following properties: \"$$\" find math expressions surrounded by $$....$$ \"\\(\" find math expressions surrounded by \\(...\\) \"\\ [\" find math expressions surrounded by \\ [...\\]" - :group 'org-export-latex + :group 'org-latex :type 'plist) (defcustom org-format-latex-header "\\documentclass{article} @@ -2629,7 +2675,7 @@ This is a property list with the following properties: \\usepackage[mathscr]{eucal} \\pagestyle{empty} % do not remove" "The document header used for processing LaTeX fragments." - :group 'org-export-latex + :group 'org-latex :type 'string) (defgroup org-export nil @@ -3126,7 +3172,7 @@ to a file." (defcustom org-combined-agenda-icalendar-file "~/org.ics" "The file name for the iCalendar file covering all agenda files. This file is created with the command \\[org-export-icalendar-all-agenda-files]. -The file name should be absolute." +The file name should be absolute, the file will be overwritten without warning." :group 'org-export-icalendar :type 'file) @@ -3304,8 +3350,6 @@ Use customize to modify this, or restart Emacs after changing it." :tag "Org Faces" :group 'org-font-lock) -;; FIXME: convert that into a macro? Not critical, because this -;; is only executed a few times at load time. (defun org-compatible-face (inherits specs) "Make a compatible face specification. If INHERITS is an existing face and if the Emacs version supports it, @@ -4185,7 +4229,6 @@ This is for getting out of special buffers like remember.") (overlay-get ovl prop))) (defun org-overlays-at (pos) (if (featurep 'xemacs) (extents-at pos) (overlays-at pos))) -;; FIXME: this is currently not used (defun org-overlays-in (&optional start end) (if (featurep 'xemacs) (extent-list nil start end) @@ -4194,7 +4237,6 @@ This is for getting out of special buffers like remember.") (if (featurep 'xemacs) (extent-start-position o) (overlay-start o))) (defun org-overlay-end (o) (if (featurep 'xemacs) (extent-end-position o) (overlay-end o))) -;; FIXME: this is currently not used (defun org-find-overlays (prop &optional pos delete) "Find all overlays specifying PROP at POS or point. If DELETE is non-nil, delete all those overlays." @@ -4248,7 +4290,6 @@ that can be added." (setq buffer-invisibility-spec (delete arg buffer-invisibility-spec))))) -;; FIXME: this is currently not used (defun org-in-invisibility-spec-p (arg) "Is ARG a member of `buffer-invisibility-spec'?" (if (consp buffer-invisibility-spec) @@ -4505,9 +4546,9 @@ This should be called after the variable `org-link-types' has changed." This one does not require the space after the date.") (defconst org-ts-regexp1 "\\(\\([0-9]\\{4\\}\\)-\\([0-9]\\{2\\}\\)-\\([0-9]\\{2\\}\\) \\([^]0-9>\r\n]*\\)\\(\\([0-9]\\{2\\}\\):\\([0-9]\\{2\\}\\)\\)?\\)" "Regular expression matching time strings for analysis.") -(defconst org-ts-regexp2 (concat "<" org-ts-regexp1 "[^>\n]\\{0,11\\}>") +(defconst org-ts-regexp2 (concat "<" org-ts-regexp1 "[^>\n]\\{0,16\\}>") "Regular expression matching time stamps, with groups.") -(defconst org-ts-regexp3 (concat "[[<]" org-ts-regexp1 "[^]>\n]\\{0,11\\}[]>]") +(defconst org-ts-regexp3 (concat "[[<]" org-ts-regexp1 "[^]>\n]\\{0,16\\}[]>]") "Regular expression matching time stamps (also [..]), with groups.") (defconst org-tr-regexp (concat org-ts-regexp "--?-?" org-ts-regexp) "Regular expression matching a time stamp range.") @@ -4592,6 +4633,9 @@ will be prompted for." (insert string) (and move (backward-char 1)))) +(defconst org-nonsticky-props + '(mouse-face highlight keymap invisible intangible help-echo org-linked-text)) + (defun org-activate-plain-links (limit) "Run through the buffer and add overlays to links." (catch 'exit @@ -4603,7 +4647,7 @@ will be prompted for." nil (add-text-properties (match-beginning 0) (match-end 0) (list 'mouse-face 'highlight - 'rear-nonsticky t + 'rear-nonsticky org-nonsticky-props 'keymap org-mouse-map )) (throw 'exit t)))))) @@ -4614,7 +4658,7 @@ will be prompted for." (progn (add-text-properties (match-beginning 0) (match-end 0) (list 'mouse-face 'highlight - 'rear-nonsticky t + 'rear-nonsticky org-nonsticky-props 'keymap org-mouse-map )) t))) @@ -4640,10 +4684,10 @@ We use a macro so that the test can happen at compilation time." ;; but that requires another match, protecting match data, ;; a lot of overhead for font-lock. (ip (org-maybe-intangible - (list 'invisible 'org-link 'rear-nonsticky t + (list 'invisible 'org-link 'rear-nonsticky org-nonsticky-props 'keymap org-mouse-map 'mouse-face 'highlight 'help-echo help))) - (vp (list 'rear-nonsticky t + (vp (list 'rear-nonsticky org-nonsticky-props 'keymap org-mouse-map 'mouse-face 'highlight 'help-echo help))) ;; We need to remove the invisible property here. Table narrowing @@ -4666,7 +4710,7 @@ We use a macro so that the test can happen at compilation time." (progn (add-text-properties (match-beginning 0) (match-end 0) (list 'mouse-face 'highlight - 'rear-nonsticky t + 'rear-nonsticky org-nonsticky-props 'keymap org-mouse-map)) (when org-display-custom-times (if (match-end 3) @@ -4691,7 +4735,7 @@ We use a macro so that the test can happen at compilation time." (progn (add-text-properties (match-beginning 0) (match-end 0) (list 'mouse-face 'highlight - 'rear-nonsticky t + 'rear-nonsticky org-nonsticky-props 'keymap org-mouse-map 'help-echo "Radio target link" 'org-linked-text t)) @@ -4718,7 +4762,6 @@ We use a macro so that the test can happen at compilation time." (defun org-restart-font-lock () "Restart font-lock-mode, to force refontification." (when (and (boundp 'font-lock-mode) font-lock-mode) - ;; FIXME: Could font-lock-fontify-buffer be enough??? (font-lock-mode -1) (font-lock-mode 1))) @@ -4754,7 +4797,7 @@ between words." (progn (add-text-properties (match-beginning 1) (match-end 1) (list 'mouse-face 'highlight - 'rear-nonsticky t + 'rear-nonsticky org-nonsticky-props 'keymap org-mouse-map)) t))) @@ -4877,7 +4920,6 @@ If KWD is a number, get the corresponding match group." deactivate-mark buffer-file-name buffer-file-truename) (remove-text-properties beg end '(mouse-face t keymap t org-linked-text t - rear-nonsticky t invisible t intangible t)))) ;;;; Visibility cycling, including org-goto and indirect buffer @@ -5198,6 +5240,7 @@ Optional argument N means, put the headline into the Nth line of the window." (let ((cmds '(isearch-forward isearch-backward kill-ring-save set-mark-command mouse-drag-region universal-argument org-occur)) cmd) (while (setq cmd (pop cmds)) (substitute-key-definition cmd cmd map global-map))) + (suppress-keymap map) (org-defkey map "\C-m" 'org-goto-ret) (org-defkey map [(left)] 'org-goto-left) (org-defkey map [(right)] 'org-goto-right) @@ -5218,9 +5261,6 @@ Optional argument N means, put the headline into the Nth line of the window." (org-defkey map "\C-c\C-f" 'outline-forward-same-level) (org-defkey map "\C-c\C-b" 'outline-backward-same-level) (org-defkey map "\C-c\C-u" 'outline-up-heading) - ;; FIXME: Could we use suppress-keymap? - (let ((l '(1 2 3 4 5 6 7 8 9 0))) - (while l (org-defkey map (int-to-string (pop l)) 'digit-argument))) map)) (defconst org-goto-help @@ -6410,7 +6450,7 @@ doing the renumbering." (org-at-item-p)) (if (match-beginning 3) (org-renumber-ordered-list 1) - (org-fix-bullet-type 1)))) + (org-fix-bullet-type)))) (defun org-maybe-renumber-ordered-list-safe () (condition-case nil @@ -6442,7 +6482,7 @@ If WHICH is a string, use that as the new bullet. If WHICH is an integer, ((string-match ")" current) "-") (t (error "This should not happen")))) (and (looking-at "\\([ \t]*\\)\\S-+") (replace-match (concat "\\1" new))) - (org-fix-bullet-type 1) + (org-fix-bullet-type) (org-maybe-renumber-ordered-list)))) (defun org-get-string-indentation (s) @@ -6493,10 +6533,9 @@ with something like \"1.\" or \"2)\"." (goto-line line) (move-to-column col))) -;; FIXME: use ARG to select bullet type. -(defun org-fix-bullet-type (arg) - "Make sure all items in this list have the same bullet." - (interactive "p") +(defun org-fix-bullet-type () + "Make sure all items in this list have the same bullet as the firsst item." + (interactive) (unless (org-at-item-p) (error "This is not a list")) (let ((line (org-current-line)) (col (current-column)) @@ -6589,7 +6628,7 @@ I.e. to the first item in this list." (delete-region (point-at-bol) (point)) (or (eolp) (indent-to-column (+ ind1 delta))) (beginning-of-line 2)))) - (org-fix-bullet-type 1) + (org-fix-bullet-type) (org-maybe-renumber-ordered-list-safe) (save-excursion (beginning-of-line 0) @@ -6597,7 +6636,10 @@ I.e. to the first item in this list." (org-maybe-renumber-ordered-list-safe))) (defun org-item-indent-positions () - "Assumes cursor in item line. FIXME" + "Return indentation for plain list items. +This returns a list with three values: The current indentation, the +parent indentation and the indentation a child should habe. +Assumes cursor in item line." (let* ((bolpos (point-at-bol)) (ind (org-get-indentation)) ind-down ind-up pos) @@ -6779,7 +6821,8 @@ to execute outside of tables." '('orgstruct-error)))))))) (defun org-context-p (&rest contexts) - "FIXME:" + "Check if local context is and of CONTEXTS. +Possible values in the list of contexts are `table', `headline', and `item'." (let ((pos (point))) (goto-char (point-at-bol)) (prog1 (or (and (memq 'table contexts) @@ -8494,8 +8537,8 @@ the table and kill the editing buffer." (defun org-trim (s) "Remove whitespace at beginning and end of string." - (if (string-match "^[ \t\n\r]+" s) (setq s (replace-match "" t t s))) - (if (string-match "[ \t\n\r]+$" s) (setq s (replace-match "" t t s))) + (if (string-match "\\`[ \t\n\r]+" s) (setq s (replace-match "" t t s))) + (if (string-match "[ \t\n\r]+\\'" s) (setq s (replace-match "" t t s))) s) (defun org-wrap (string &optional width lines) @@ -9388,8 +9431,6 @@ With prefix arg ALL, do this for all lines in the table." (goto-line (nth 1 a)) (org-table-goto-column (nth 2 a)) (push (append a (list (cdr eq))) eqlname1) -;; FIXME (org-table-eval-formula nil (cdr eq) 'noalign 'nocst -;; FIXME 'nostore 'noanalysis) (org-table-put-field-property :org-untouchable t))) ;; Now evauluate the column formulas, but skip fields covered by @@ -9615,7 +9656,7 @@ full TBLFM line." ((and (> (match-beginning 0) 0) (equal ?. (aref s (max (1- (match-beginning 0)) 0))) (not (equal ?. (aref s (max (- (match-beginning 0) 2) 0))))) - ;; 3.e5 or something like this. FIXME: is this ok???? + ;; 3.e5 or something like this. (setq start (match-end 0))) (t (setq start (match-beginning 0) @@ -11341,12 +11382,13 @@ is in the current directory or below. With three \\[universal-argument] prefixes, negate the meaning of `org-keep-stored-link-after-insertion'." (interactive "P") - (let ((wcf (current-window-configuration)) - (region (if (org-region-active-p) - (prog1 (buffer-substring (region-beginning) (region-end)) - (delete-region (region-beginning) (region-end))))) - tmphist ; byte-compile incorrectly complains about this - link desc entry remove file) + (let* ((wcf (current-window-configuration)) + (region (if (org-region-active-p) + (buffer-substring (region-beginning) (region-end)))) + (remove (and region (list (region-beginning) (region-end)))) + (desc region) + tmphist ; byte-compile incorrectly complains about this + link entry file) (cond ((org-in-regexp org-bracket-link-regexp 1) ;; We do have a link at point, and we are going to edit it. @@ -11384,7 +11426,7 @@ With three \\[universal-argument] prefixes, negate the meaning of (with-output-to-temp-buffer "*Org Links*" (princ "Insert a link. Use TAB to complete valid link prefixes.\n") (when org-stored-links - (princ "\nStored links are available with / (most recent with RET):\n\n") + (princ "\nStored links are available with / or M-p/n (most recent with RET):\n\n") (princ (mapconcat (lambda (x) (if (nth 1 x) (concat (car x) " (" (nth 1 x) ")") (car x))) @@ -11416,7 +11458,7 @@ With three \\[universal-argument] prefixes, negate the meaning of (not org-keep-stored-link-after-insertion)) (setq org-stored-links (delq (assoc link org-stored-links) org-stored-links))) - (setq desc (or region desc (nth 1 entry))))) + (setq desc (or desc (nth 1 entry))))) (if (string-match org-plain-link-re link) ;; URL-like link, normalize the use of angular brackets. @@ -11437,6 +11479,7 @@ With three \\[universal-argument] prefixes, negate the meaning of ;; Check if we can/should use a relative path. If yes, simplify the link (when (string-match "\\" t t cmd))) (if (or (not org-confirm-shell-link-function) @@ -12321,7 +12365,7 @@ If the file does not exist, an error is thrown." (setq cmd (replace-match "%s" t t cmd))) (setq cmd (format cmd (shell-quote-argument file))) (save-window-excursion - (shell-command (concat cmd " &")))) + (start-process-shell-command cmd nil cmd))) ((or (stringp cmd) (eq cmd 'emacs)) (funcall (cdr (assq 'file org-link-frame-setup)) file) @@ -12380,6 +12424,7 @@ RET at beg-of-buf -> Append to file as level 2 headline / -> before/after current headline, same headings level") (defvar org-remember-previous-location nil) +(defvar org-force-remember-template-char) ;; dynamically scoped ;;;###autoload (defun org-remember-apply-template (&optional use-char skip-interactive) @@ -12389,13 +12434,20 @@ to be run from that hook to fucntion properly." (if org-remember-templates (let* ((char (or use-char - (if (= (length org-remember-templates) 1) - (caar org-remember-templates) + (cond + ((= (length org-remember-templates) 1) + (caar org-remember-templates)) + ((and (boundp 'org-force-remember-template-char) + org-force-remember-template-char) + (if (string-p org-force-remember-template-char) + (string-to-char org-force-remember-template-char) + org-force-remember-template-char)) + (t (message "Select template: %s" (mapconcat (lambda (x) (char-to-string (car x))) org-remember-templates " ")) - (read-char-exclusive)))) + (read-char-exclusive))))) (entry (cdr (assoc char org-remember-templates))) (tpl (car entry)) (plist-p (if org-store-link-plist t nil)) @@ -12504,7 +12556,7 @@ to be run from that hook to fucntion properly." (org-set-local 'org-finish-function 'remember-buffer))) ;;;###autoload -(defun org-remember () +(defun org-remember (&optional org-force-remember-template-char) "Call `remember'. If this is already a remember buffer, re-apply template. If there is an active region, make sure remember uses it as initial content of the remember buffer." @@ -12561,6 +12613,8 @@ See also the variable `org-reverse-note-order'." (goto-char (point-min)) (while (looking-at "^[ \t]*\n\\|^##.*\n") (replace-match "")) + (goto-char (point-max)) + (unless (equal (char-before) ?\n) (insert "\n")) (catch 'quit (let* ((txt (buffer-substring (point-min) (point-max))) (fastp (org-xor (equal current-prefix-arg '(4)) @@ -12746,7 +12800,7 @@ the property list including an extra property :name with the block name." (unless (looking-at org-dblock-start-re) (error "Not at a dynamic block")) (let* ((begdel (1+ (match-end 0))) - (name (match-string 1)) + (name (org-no-properties (match-string 1))) (params (append (list :name name) (read (concat "(" (match-string 3) ")"))))) (unless (re-search-forward org-dblock-end-re nil t) @@ -12787,12 +12841,15 @@ blocks in the buffer." "Update the dynamic block at point This means to empty the block, parse for parameters and then call the correct writing function." - (let* ((pos (point)) - (params (org-prepare-dblock)) - (name (plist-get params :name)) - (cmd (intern (concat "org-dblock-write:" name)))) - (funcall cmd params) - (goto-char pos))) + (save-window-excursion + (let* ((pos (point)) + (params (org-prepare-dblock)) + (name (plist-get params :name)) + (cmd (intern (concat "org-dblock-write:" name)))) + (message "Updating dynamic block %s at %d..." name pos) + (funcall cmd params) + (message "Updating dynamic block %s at %d...done" name pos) + (goto-char pos)))) (defun org-beginning-of-dblock () "Find the beginning of the dynamic block at point. @@ -12817,6 +12874,10 @@ This function can be used in a hook." ;;;; Completion +(defconst org-additional-option-like-keywords + '("BEGIN_HTML" "BEGIN_LaTeX" "END_HTML" "END_LaTeX" + "ORGTBL" "HTML:" "LaTeX:")) + (defun org-complete (&optional arg) "Perform completion on word at point. At the beginning of a headline, this completes TODO keywords as given in @@ -12826,99 +12887,108 @@ that are supported for HTML support. If the current word is preceded by \"#+\", completes special words for setting file options. In the line after \"#+STARTUP:, complete valid keywords.\" -At all other locations, this simply calls `ispell-complete-word'." +At all other locations, this simply calls the value of +`org-completion-fallback-command'." (interactive "P") - (catch 'exit - (let* ((end (point)) - (beg1 (save-excursion - (skip-chars-backward (org-re "[:alnum:]_@")) + (org-without-partial-completion + (catch 'exit + (let* ((end (point)) + (beg1 (save-excursion + (skip-chars-backward (org-re "[:alnum:]_@")) + (point))) + (beg (save-excursion + (skip-chars-backward "a-zA-Z0-9_:$") (point))) - (beg (save-excursion - (skip-chars-backward "a-zA-Z0-9_:$") - (point))) - (confirm (lambda (x) (stringp (car x)))) - (searchhead (equal (char-before beg) ?*)) - (tag (and (equal (char-before beg1) ?:) - (equal (char-after (point-at-bol)) ?*))) - (prop (and (equal (char-before beg1) ?:) - (not (equal (char-after (point-at-bol)) ?*)))) - (texp (equal (char-before beg) ?\\)) - (link (equal (char-before beg) ?\[)) - (opt (equal (buffer-substring (max (point-at-bol) (- beg 2)) - beg) - "#+")) - (startup (string-match "^#\\+STARTUP:.*" - (buffer-substring (point-at-bol) (point)))) - (completion-ignore-case opt) - (type nil) - (tbl nil) - (table (cond - (opt - (setq type :opt) - (mapcar (lambda (x) - (string-match "^#\\+\\(\\([A-Z_]+:?\\).*\\)" x) - (cons (match-string 2 x) (match-string 1 x))) - (org-split-string (org-get-current-options) "\n"))) - (startup - (setq type :startup) - org-startup-options) - (link (append org-link-abbrev-alist-local - org-link-abbrev-alist)) - (texp - (setq type :tex) - org-html-entities) - ((string-match "\\`\\*+[ \t]+\\'" - (buffer-substring (point-at-bol) beg)) - (setq type :todo) - (mapcar 'list org-todo-keywords-1)) - (searchhead - (setq type :searchhead) - (save-excursion - (goto-char (point-min)) - (while (re-search-forward org-todo-line-regexp nil t) - (push (list - (org-make-org-heading-search-string - (match-string 3) t)) - tbl))) - tbl) - (tag (setq type :tag beg beg1) - (or org-tag-alist (org-get-buffer-tags))) - (prop (setq type :prop beg beg1) - (mapcar 'list (org-buffer-property-keys))) - (t (progn (ispell-complete-word arg) (throw 'exit nil))))) - (pattern (buffer-substring-no-properties beg end)) - (completion (try-completion pattern table confirm))) - (cond ((eq completion t) - (if (equal type :opt) - (insert (substring (cdr (assoc (upcase pattern) table)) - (length pattern))) - (if (memq type '(:tag :prop)) (insert ":")))) - ((null completion) - (message "Can't find completion for \"%s\"" pattern) - (ding)) - ((not (string= pattern completion)) - (delete-region beg end) - (if (string-match " +$" completion) - (setq completion (replace-match "" t t completion))) - (insert completion) - (if (get-buffer-window "*Completions*") - (delete-window (get-buffer-window "*Completions*"))) - (if (assoc completion table) - (if (eq type :todo) (insert " ") - (if (memq type '(:tag :prop)) (insert ":")))) - (if (and (equal type :opt) (assoc completion table)) - (message "%s" (substitute-command-keys - "Press \\[org-complete] again to insert example settings")))) - (t - (message "Making completion list...") - (let ((list (sort (all-completions pattern table confirm) - 'string<))) - (with-output-to-temp-buffer "*Completions*" - (condition-case nil - ;; Protection needed for XEmacs and emacs 21 - (display-completion-list list pattern) - (error (display-completion-list list))))) - (message "Making completion list...%s" "done")))))) + (confirm (lambda (x) (stringp (car x)))) + (searchhead (equal (char-before beg) ?*)) + (tag (and (equal (char-before beg1) ?:) + (equal (char-after (point-at-bol)) ?*))) + (prop (and (equal (char-before beg1) ?:) + (not (equal (char-after (point-at-bol)) ?*)))) + (texp (equal (char-before beg) ?\\)) + (link (equal (char-before beg) ?\[)) + (opt (equal (buffer-substring (max (point-at-bol) (- beg 2)) + beg) + "#+")) + (startup (string-match "^#\\+STARTUP:.*" + (buffer-substring (point-at-bol) (point)))) + (completion-ignore-case opt) + (type nil) + (tbl nil) + (table (cond + (opt + (setq type :opt) + (append + (mapcar + (lambda (x) + (string-match "^#\\+\\(\\([A-Z_]+:?\\).*\\)" x) + (cons (match-string 2 x) (match-string 1 x))) + (org-split-string (org-get-current-options) "\n")) + (mapcar 'list org-additional-option-like-keywords))) + (startup + (setq type :startup) + org-startup-options) + (link (append org-link-abbrev-alist-local + org-link-abbrev-alist)) + (texp + (setq type :tex) + org-html-entities) + ((string-match "\\`\\*+[ \t]+\\'" + (buffer-substring (point-at-bol) beg)) + (setq type :todo) + (mapcar 'list org-todo-keywords-1)) + (searchhead + (setq type :searchhead) + (save-excursion + (goto-char (point-min)) + (while (re-search-forward org-todo-line-regexp nil t) + (push (list + (org-make-org-heading-search-string + (match-string 3) t)) + tbl))) + tbl) + (tag (setq type :tag beg beg1) + (or org-tag-alist (org-get-buffer-tags))) + (prop (setq type :prop beg beg1) + (mapcar 'list (org-buffer-property-keys))) + (t (progn + (call-interactively org-completion-fallback-command) + (throw 'exit nil))))) + (pattern (buffer-substring-no-properties beg end)) + (completion (try-completion pattern table confirm))) + (cond ((eq completion t) + (if (not (assoc (upcase pattern) table)) + (message "Already complete") + (if (equal type :opt) + (insert (substring (cdr (assoc (upcase pattern) table)) + (length pattern))) + (if (memq type '(:tag :prop)) (insert ":"))))) + ((null completion) + (message "Can't find completion for \"%s\"" pattern) + (ding)) + ((not (string= pattern completion)) + (delete-region beg end) + (if (string-match " +$" completion) + (setq completion (replace-match "" t t completion))) + (insert completion) + (if (get-buffer-window "*Completions*") + (delete-window (get-buffer-window "*Completions*"))) + (if (assoc completion table) + (if (eq type :todo) (insert " ") + (if (memq type '(:tag :prop)) (insert ":")))) + (if (and (equal type :opt) (assoc completion table)) + (message "%s" (substitute-command-keys + "Press \\[org-complete] again to insert example settings")))) + (t + (message "Making completion list...") + (let ((list (sort (all-completions pattern table confirm) + 'string<))) + (with-output-to-temp-buffer "*Completions*" + (condition-case nil + ;; Protection needed for XEmacs and emacs 21 + (display-completion-list list pattern) + (error (display-completion-list list))))) + (message "Making completion list...%s" "done"))))))) ;;;; TODO, DEADLINE, Comments @@ -12942,6 +13012,15 @@ this is nil.") (defvar org-setting-tags nil) ; dynamically skiped +;; FIXME: better place +(defun org-property-or-variable-value (var &optional inherit) + "Check if there is a property fixing the value of VAR. +If yes, return this value. If not, return the current value of the variable." + (let ((prop (org-entry-get nil (symbol-name var) inherit))) + (if (and prop (stringp prop) (string-match "\\S-" prop)) + (read prop) + (symbol-value var)))) + (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, @@ -12972,7 +13051,10 @@ For calling through lisp, arg is also interpreted in the following way: (if (looking-at outline-regexp) (goto-char (1- (match-end 0)))) (or (looking-at (concat " +" org-todo-regexp " *")) (looking-at " *")) - (let* ((this (match-string 1)) + (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)) @@ -13075,9 +13157,6 @@ For calling through lisp, arg is also interpreted in the following way: ((and (member state org-done-keywords) (not (member this org-done-keywords))) ;; It is now done, and it was not done before - ;; FIXME: We used to remove scheduling info.... -; (org-add-planning-info 'closed (org-current-time) -; (if (org-get-repeat) nil 'scheduled)) (org-add-planning-info 'closed (org-current-time)) (org-add-log-maybe 'done state 'findpos)))) ;; Fixup tag positioning @@ -13251,19 +13330,25 @@ of `org-todo-keywords-1'." (message "%d TODO entries found" (org-occur (concat "^" outline-regexp " *" kwd-re ))))) -(defun org-deadline () - "Insert the DEADLINE: string to make a deadline. -A timestamp is also inserted - use \\[org-timestamp-up] and \\[org-timestamp-down] -to modify it to the correct date." - (interactive) - (org-add-planning-info 'deadline nil 'closed)) +(defun org-deadline (&optional remove) + "Insert the \"DEADLINE:\" string with a timestamp to make a deadline. +With argument REMOVE, remove any deadline from the item." + (interactive "P") + (if remove + (progn + (org-add-planning-info nil nil 'deadline) + (message "Item no longer has a deadline.")) + (org-add-planning-info 'deadline nil 'closed))) -(defun org-schedule () - "Insert the SCHEDULED: string to schedule a TODO item. -A timestamp is also inserted - use \\[org-timestamp-up] and \\[org-timestamp-down] -to modify it to the correct date." - (interactive) - (org-add-planning-info 'scheduled nil 'closed)) +(defun org-schedule (&optional remove) + "Insert the SCHEDULED: string with a timestamp to schedule a TODO item. +With argument REMOVE, remove any scheduling date from the item." + (interactive "P") + (if remove + (progn + (org-add-planning-info nil nil 'scheduled) + (message "Item is no longer scheduled.")) + (org-add-planning-info 'scheduled nil 'closed))) (defun org-add-planning-info (what &optional time &rest remove) "Insert new timestamp with keyword in the line directly after the headline. @@ -13291,11 +13376,6 @@ be removed." (goto-char (match-end 0)) (if (eobp) (insert "\n")) (forward-char 1) - (when (and (not org-insert-labeled-timestamps-before-properties-drawer) - (looking-at "[ \t]*:PROPERTIES:[ \t]*$")) - (goto-char (match-end 0)) - (if (eobp) (insert "\n")) - (forward-char 1)) (if (and (not (looking-at outline-regexp)) (looking-at (concat "[^\r\n]*?" org-keyword-time-regexp "[^\r\n]*")) @@ -13327,12 +13407,12 @@ be removed." ((eq what 'deadline) org-deadline-string) ((eq what 'closed) org-closed-string)) " ") - (org-insert-time-stamp - time - (or org-time-was-given - (and (eq what 'closed) org-log-done-with-time)) - (eq what 'closed) - nil nil (list org-end-time-was-given)) + (setq ts (org-insert-time-stamp + time + (or org-time-was-given + (and (eq what 'closed) org-log-done-with-time)) + (eq what 'closed) + nil nil (list org-end-time-was-given))) (end-of-line 1)) (goto-char (point-min)) (widen) @@ -13910,8 +13990,9 @@ With prefix ARG, realign all tags in headings in the current buffer." (if org-fast-tag-selection-include-todo org-todo-key-alist)) (let ((org-add-colon-after-tag-completion t)) (org-trim - (completing-read "Tags: " 'org-tags-completion-function - nil nil current 'org-tags-history)))))) + (org-without-partial-completion + (completing-read "Tags: " 'org-tags-completion-function + nil nil current 'org-tags-history))))))) (while (string-match "[-+&]+" tags) ;; No boolean logic, just a list (setq tags (replace-match ":" t t tags)))) @@ -14252,8 +14333,7 @@ Returns the new tags string, or nil to not change the current settings." ;;; Setting and retrieving properties (defconst org-special-properties - '("TODO" "TAGS" "ALLTAGS" "DEADLINE" "SCHEDULED" - "CLOCK" "PRIORITY") + '("TODO" "TAGS" "ALLTAGS" "DEADLINE" "SCHEDULED" "CLOCK" "PRIORITY") "The special properties valid in Org-mode. These are properties that are not defined in the property drawer, @@ -14478,28 +14558,32 @@ If the property is not present at all, nil is returned." ((eq value 'later) (org-timestamp-change 1 'day)) (t (call-interactively 'org-deadline))) (call-interactively 'org-deadline))) - ((and (member property org-special-properties) - (not (member property '("CATEGORY" "ARCHIVE")))) + ((member property org-special-properties) (error "The %s property can not yet be set with `org-entry-put'" property)) (t ; a non-special property - (setq range (org-get-property-block beg end 'force)) - (goto-char (car range)) - (if (re-search-forward - (concat "^[ \t]*:" property ":\\(.*\\)") (cdr range) t) - (progn - (delete-region (match-beginning 1) (match-end 1)) - (goto-char (match-beginning 1))) - (goto-char (cdr range)) - (insert "\n") - (backward-char 1) - (org-indent-line-function) - (insert ":" property ":")) - (and value (insert " " value)) - (org-indent-line-function)))))) + (let ((buffer-invisibility-spec (org-inhibit-invisibility))) ; Emacs 21 + (setq range (org-get-property-block beg end 'force)) + (goto-char (car range)) + (if (re-search-forward + (concat "^[ \t]*:" property ":\\(.*\\)") (cdr range) t) + (progn + (delete-region (match-beginning 1) (match-end 1)) + (goto-char (match-beginning 1))) + (goto-char (cdr range)) + (insert "\n") + (backward-char 1) + (org-indent-line-function) + (insert ":" property ":")) + (and value (insert " " value)) + (org-indent-line-function))))))) -(defun org-buffer-property-keys (&optional include-specials) - "Get all property keys in the current buffer." +(defun org-buffer-property-keys (&optional include-specials include-defaults) + "Get all property keys in the current buffer. +With INCLUDE-SPECIALS, also list the special properties that relect things +like tags and TODO state. +With INCLUDE-DEFAULTS, also include properties that has special meaning +internally: ARCHIVE, CATEGORY, SUMMARY, DESCRIPTION, LOCATION, and LOGGING." (let (rtn range) (save-excursion (save-restriction @@ -14515,6 +14599,9 @@ If the property is not present at all, nil is returned." (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")) (sort rtn (lambda (a b) (string< (upcase a) (upcase b)))))) (defun org-insert-property-drawer () @@ -14596,7 +14683,9 @@ If the property is not present at all, nil is returned." (defvar org-columns-current-fmt-compiled) ; defined below (defun org-compute-property-at-point () - "FIXME:" + "Compute the property at point. +This looks for an enclosing column format, extracts the operator and +then applies it to the proerty in the column format's scope." (interactive) (unless (org-at-property-p) (error "Not at a property")) @@ -14864,11 +14953,10 @@ This is the compiled version of the format.") (org-unmodified (org-columns-remove-overlays) (let ((inhibit-read-only t)) - ;; FIXME: is this safe??? - ;; or are there other reasons why there may be a read-only property???? (remove-text-properties (point-min) (point-max) '(read-only t)))) (when (eq major-mode 'org-agenda-mode) - (message "Modification not yet reflected in Agenda buffer, use `r' to refresh"))) + (message + "Modification not yet reflected in Agenda buffer, use `r' to refresh"))) (defun org-columns-check-computed () "Check if this column value is computed. @@ -15308,10 +15396,12 @@ display, or in the #+COLUMNS line of the current buffer." (when val (org-entry-put nil property (if flag str val))) ;; add current to current level accumulator - (aset lsum level (+ (aref lsum level) - (if flag sum (org-column-string-to-number - val format)))) - (if (or flag valflag) (aset lflag level t)) + (when (or flag valflag) + ;; FIXME: is this ok????????? + (aset lsum level (+ (aref lsum level) + (if flag sum (org-column-string-to-number + (if flag str val) format)))) + (aset lflag level t)) ;; clear accumulators for deeper levels (loop for l from (1+ level) to (1- lmax) do (aset lsum l 0) @@ -15396,7 +15486,14 @@ display, or in the #+COLUMNS line of the current buffer." (org-trim rtn))) (defun org-columns-compile-format (fmt) - "FIXME" + "Turn a column format string into an alist of specifications. +The alist has one entry for each column in the format. The elements of +that list are: +property the property +title the title field for the columns +width the column width in characters, can be nil for automatic +operator the operator if any +format the output format for computed results, derived from operator" (let ((start 0) width prop title op f) (setq org-columns-current-fmt-compiled nil) (while (string-match @@ -15615,16 +15712,20 @@ user." ;; Help matching am/pm times, because `parse-time-string' does not do that. ;; If there is a time with am/pm, and *no* time without it, we convert ;; so that matching will be successful. - ;; FIXME: make this replace twice, so that we catch the end time. - (when (and (not (string-match "\\(\\`\\|[^+]\\)[012]?[0-9]:[0-9][0-9]\\([ \t\n]\\|$\\)" ans)) - (string-match "\\([012]?[0-9]\\)\\(:\\([0-5][0-9]\\)\\)?\\(am\\|AM\\|pm\\|PM\\)\\>" ans)) - (setq hour (string-to-number (match-string 1 ans)) - minute (if (match-end 3) (string-to-number (match-string 3 ans)) 0) - pm (equal ?p (string-to-char (downcase (match-string 4 ans))))) - (if (and (= hour 12) (not pm)) - (setq hour 0) - (if (and pm (< hour 12)) (setq hour (+ 12 hour)))) - (setq ans (replace-match (format "%02d:%02d" hour minute) t t ans))) + (loop for i from 1 to 2 do ; twice, for end time as well + (when (and (not (string-match "\\(\\`\\|[^+]\\)[012]?[0-9]:[0-9][0-9]\\([ \t\n]\\|$\\)" ans)) + (string-match "\\([012]?[0-9]\\)\\(:\\([0-5][0-9]\\)\\)?\\(am\\|AM\\|pm\\|PM\\)\\>" ans)) + (setq hour (string-to-number (match-string 1 ans)) + minute (if (match-end 3) + (string-to-number (match-string 3 ans)) + 0) + pm (equal ?p + (string-to-char (downcase (match-string 4 ans))))) + (if (and (= hour 12) (not pm)) + (setq hour 0) + (if (and pm (< hour 12)) (setq hour (+ 12 hour)))) + (setq ans (replace-match (format "%02d:%02d" hour minute) + t t ans)))) ;; Check if a time range is given as a duration (when (string-match "\\([012]?[0-9]\\):\\([0-6][0-9]\\)\\+\\([012]?[0-9]\\)\\(:\\([0-5][0-9]\\)\\)?" ans) @@ -15991,7 +16092,8 @@ D may be an absolute day number, or a calendar-type list (month day year)." (t nil)))) (defun org-diary-to-ical-string (frombuf) - "FIXME" + "Get iCalendar entreis from diary entries in buffer FROMBUF. +This uses the icalendar.el library." (let* ((tmpdir (if (featurep 'xemacs) (temp-directory) temporary-file-directory)) @@ -16148,7 +16250,7 @@ With prefix ARG, change that many days." (ans (or (looking-at tsr) (save-excursion (skip-chars-backward "^[<\n\r\t") - (if (> (point) 1) (backward-char 1)) + (if (> (point) (point-min)) (backward-char 1)) (and (looking-at tsr) (> (- (match-end 0) pos) -1)))))) (and (boundp 'org-ts-what) @@ -16229,8 +16331,9 @@ in the timestamp determines what will be changed." (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) - "FIXME" + "Change the different parts of the lead-time and repeat fields in timestamp." (let ((idx '(("d" . 0) ("w" . 1) ("m" . 2) ("y" . 3) ("d" . -1) ("y" . 4))) ng h m new) (when (string-match "\\(-\\([012][0-9]\\):\\([0-5][0-9]\\)\\)?\\( \\+\\([0-9]+\\)\\([dmwy]\\)\\)?" s) @@ -16296,6 +16399,55 @@ If there is already a time stamp at the cursor position, update it." (interactive) (org-timestamp-change 0 'calendar)) +;; Make appt aware of appointments from the agenda +(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 +filter: only add entries if they match this regular expression. + +FILTER can be a string. In this case, use this string as a +regular expression to filter results. + +FILTER can also be an alist, with the car of each cell being +either 'headline or 'category. For example: + + '((headline \"IMPORTANT\") + (category \"Work\")) + +will only add headlines containing IMPORTANT or headlines +belonging to the category \"Work\"." + (interactive "P") + (require 'org) + (if (equal filter '(4)) + (setq filter (read-from-minibuffer "Regexp filter: "))) + (let* ((today (org-date-to-gregorian + (time-to-days (current-time)))) + (files org-agenda-files) entries file) + (while (setq file (pop files)) + (setq entries (append entries (org-agenda-get-day-entries + file today :timestamp)))) + (setq entries (delq nil entries)) + (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) + (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)) + (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)) + ;;; The clock for measuring work time. (defvar org-mode-line-string "") @@ -16332,15 +16484,8 @@ If necessary, clock-out of the currently active clock." (setq org-clock-heading (match-string 3)) (setq org-clock-heading "???")) (setq org-clock-heading (propertize org-clock-heading 'face nil)) - (beginning-of-line 2) - (while - (or (and (looking-at (concat "[ \t]*" org-keyword-time-regexp)) - (not (equal (match-string 1) org-clock-string))) - (and (looking-at "[ \t]*:PROPERTIES:") - (not org-insert-labeled-timestamps-before-properties-drawer))) - ;; Scheduling info, or properties drawer, move one line further - (beginning-of-line 2) - (or (bolp) (newline))) + (org-clock-find-position) + (insert "\n") (backward-char 1) (indent-relative) (insert org-clock-string " ") @@ -16355,6 +16500,57 @@ If necessary, clock-out of the currently active clock." (setq org-mode-line-timer (run-with-timer 60 60 'org-update-mode-line)) (message "Clock started at %s" ts)))) +(defun org-clock-find-position () + "Find the location where the next clock line should be inserted." + (org-back-to-heading t) + (beginning-of-line 2) + (catch 'exit + (let ((beg (point)) (end (progn (outline-next-heading) (point))) + (re (concat "^[ \t]*" org-clock-string)) + (cnt 0) + first last) + (goto-char beg) + (when (re-search-forward "^[ \t]*:CLOCK:" nil t) + ;; we seem to have a CLOCK drawer, so go there. + (beginning-of-line 2) + (throw 'exit t)) + ;; Lets count the CLOCK lines + (goto-char beg) + (while (re-search-forward re end t) + (setq first (or first (match-beginning 0)) + last (match-beginning 0) + cnt (1+ cnt))) + (when (and (integerp org-clock-into-drawer) + (>= (1+ cnt) org-clock-into-drawer)) + ;; Wrap current entries into a new drawer + (goto-char last) + (beginning-of-line 2) + (if (org-at-item-p) (org-end-of-item)) + (insert ":END:\n") + (beginning-of-line 0) + (org-indent-line-function) + (goto-char first) + (insert ":CLOCK:\n") + (beginning-of-line 0) + (org-indent-line-function) + (org-flag-drawer t) + (beginning-of-line 2) + (throw 'exit nil)) + + (goto-char beg) + (while (and (looking-at (concat "[ \t]*" org-keyword-time-regexp)) + (not (equal (match-string 1) org-clock-string))) + ;; Planning info, skip to after it + (beginning-of-line 2) + (or (bolp) (newline))) + (when (eq t org-clock-into-drawer) + (insert ":CLOCK:\n:END:\n") + (beginning-of-line -1) + (org-indent-line-function) + (org-flag-drawer t) + (beginning-of-line 2) + (org-indent-line-function))))) + (defun org-clock-out (&optional fail-quietly) "Stop the currently running clock. If there is no running clock, throw an error, unless FAIL-QUIETLY is set." @@ -16383,7 +16579,10 @@ If there is no running clock, throw an error, unless FAIL-QUIETLY is set." s (- s (* 60 s))) (insert " => " (format "%2d:%02d" h m)) (move-marker org-clock-marker nil) - (org-add-log-maybe 'clock-out) + (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))) + (org-add-log-maybe 'clock-out)) (when org-mode-line-timer (cancel-timer org-mode-line-timer) (setq org-mode-line-timer nil)) @@ -16403,6 +16602,19 @@ If there is no running clock, throw an error, unless FAIL-QUIETLY is set." (delete-region (1- (point-at-bol)) (point-at-eol))) (message "Clock canceled")) +(defun org-clock-goto (&optional delete-windows) + "Go to the currently clocked-in entry." + (interactive "P") + (if (not (marker-buffer org-clock-marker)) + (error "No active clock")) + (switch-to-buffer-other-window + (marker-buffer org-clock-marker)) + (if delete-windows (delete-other-windows)) + (goto-char org-clock-marker) + (org-show-entry) + (org-back-to-heading) + (recenter)) + (defvar org-clock-file-total-minutes nil "Holds the file total time in minutes, after a call to `org-clock-sum'.") (make-variable-buffer-local 'org-clock-file-total-minutes) @@ -16466,7 +16678,10 @@ in the echo area." (unless total-only (save-excursion (goto-char (point-min)) - (while (setq p (next-single-property-change (point) :org-clock-minutes)) + (while (or (and (equal (setq p (point)) (point-min)) + (get-text-property p :org-clock-minutes)) + (setq p (next-single-property-change + (point) :org-clock-minutes))) (goto-char p) (when (setq time (get-text-property p :org-clock-minutes)) (org-put-clock-overlay time (funcall outline-level)))) @@ -16551,32 +16766,29 @@ If yes, offer to stop it and to save the buffer with the changes." (defun org-clock-report () "Create a table containing a report about clocked time. -If the buffer contains lines -#+BEGIN: clocktable :maxlevel 3 :emphasize nil +If the cursor is inside an existing clocktable block, then the table +will be updated. If not, a new clocktable will be inserted. -#+END: clocktable -then the table will be inserted between these lines, replacing whatever -is was there before. If these lines are not in the buffer, the table -is inserted at point, surrounded by the special lines. -The BEGIN line can contain parameters. Allowed are: - -:maxlevel The maximum level to be included in the table. Default is 3. - -:emphasize t/nil, if level 1 and level 2 should be bold/italic in the table. - -:scope nil/subtree/tree/treeN/file/agenda/'(\"file\"...). - The scope of file content to be searched for clock entries. - The default nil means the entire file (or the region to - which it is currently narrowed). \"subtree\" means the - enclosing subtree, \"treeN\" means the surrounding tree of level N. - \"agenda\" are all agenda files, a list of files searches - these files." +The BEGIN line can contain parameters. See the manual for details." (interactive) (org-remove-clock-overlays) - (unless (org-find-dblock "clocktable") + (if (org-in-clocktable-p) + (progn + (goto-char (org-in-clocktable-p)) + (org-update-dblock)) (org-create-dblock (list :name "clocktable" - :maxlevel 2 :emphasize nil))) - (org-update-dblock)) + :maxlevel 2 :scope 'file)))) + +(defun org-in-clocktable-p () + "Check if the cursor is in a clocktable." + (let ((pos (point)) start) + (save-excursion + (end-of-line 1) + (and (re-search-backward "^#\\+BEGIN:[ \t]+clocktable" nil t) + (setq start (match-beginning 0)) + (re-search-forward "^#\\+END:.*" nil t) + (>= (match-end 0) pos) + start)))) (defun org-clock-update-time-maybe () "If this is a CLOCK line, update it and return t. @@ -16690,7 +16902,7 @@ the returned times will be formatted strings." (setq level (string-to-number (match-string 1 (symbol-name scope)))) (catch 'exit (while (org-up-heading-safe) - (looking-at outline-regexp) ;; FIXME do we need to test this? + (looking-at outline-regexp) (if (<= (org-reduced-level (funcall outline-level)) level) (throw 'exit nil)))) (org-narrow-to-subtree)) @@ -16759,8 +16971,12 @@ the returned times will be formatted strings." "*Total time*| " (format "*%d:%02d*" h m) "|\n|-\n") + (setq tbl (delq nil tbl)) + (if (and (stringp (car tbl)) (> (length (car tbl)) 1) + (equal (substring (car tbl) 0 2) "|-")) + (pop tbl)) (insert-before-markers (mapconcat - 'identity (delq nil (nreverse tbl)) + 'identity (delq nil tbl) (if (eq scope 'agenda) "\n|-\n" "\n"))) (backward-delete-char 1) (goto-char ipos) @@ -16926,12 +17142,13 @@ The following commands are available: (org-defkey org-agenda-mode-map "x" 'org-agenda-exit) (org-defkey org-agenda-mode-map "\C-x\C-w" 'org-write-agenda) (org-defkey org-agenda-mode-map "s" 'org-save-all-org-buffers) +(org-defkey org-agenda-mode-map "\C-x\C-s" 'org-save-all-org-buffers) (org-defkey org-agenda-mode-map "P" 'org-agenda-show-priority) (org-defkey org-agenda-mode-map "T" 'org-agenda-show-tags) (org-defkey org-agenda-mode-map "n" 'next-line) (org-defkey org-agenda-mode-map "p" 'previous-line) -(org-defkey org-agenda-mode-map "\C-n" 'org-agenda-next-date-line) -(org-defkey org-agenda-mode-map "\C-p" 'org-agenda-previous-date-line) +(org-defkey org-agenda-mode-map "\C-c\C-n" 'org-agenda-next-date-line) +(org-defkey org-agenda-mode-map "\C-c\C-p" 'org-agenda-previous-date-line) (org-defkey org-agenda-mode-map "," 'org-agenda-priority) (org-defkey org-agenda-mode-map "\C-c," 'org-agenda-priority) (org-defkey org-agenda-mode-map "i" 'org-agenda-diary-entry) @@ -16944,9 +17161,14 @@ The following commands are available: (org-defkey org-agenda-mode-map "S" 'org-agenda-sunrise-sunset) (org-defkey org-agenda-mode-map "h" 'org-agenda-holidays) (org-defkey org-agenda-mode-map "H" 'org-agenda-holidays) +(org-defkey org-agenda-mode-map "\C-c\C-x\C-i" 'org-agenda-clock-in) (org-defkey org-agenda-mode-map "I" 'org-agenda-clock-in) +(org-defkey org-agenda-mode-map "\C-c\C-x\C-o" 'org-agenda-clock-out) (org-defkey org-agenda-mode-map "O" 'org-agenda-clock-out) +(org-defkey org-agenda-mode-map "\C-c\C-x\C-x" 'org-agenda-clock-cancel) (org-defkey org-agenda-mode-map "X" 'org-agenda-clock-cancel) +(org-defkey org-agenda-mode-map "\C-c\C-x\C-j" 'org-clock-goto) +(org-defkey org-agenda-mode-map "J" 'org-clock-goto) (org-defkey org-agenda-mode-map "+" 'org-agenda-priority-up) (org-defkey org-agenda-mode-map "-" 'org-agenda-priority-down) (org-defkey org-agenda-mode-map [(shift up)] 'org-agenda-priority-up) @@ -16999,6 +17221,11 @@ The following commands are available: ["Change Date +1 day" org-agenda-date-later (org-agenda-check-type nil 'agenda 'timeline)] ["Change Date -1 day" org-agenda-date-earlier (org-agenda-check-type nil 'agenda 'timeline)] ["Change Date to ..." org-agenda-date-prompt (org-agenda-check-type nil 'agenda 'timeline)]) + ("Clock" + ["Clock in" org-agenda-clock-in t] + ["Clock out" org-agenda-clock-out t] + ["Clock cancel" org-agenda-clock-cancel t] + ["Goto running clock" org-clock-goto t]) ("Priority" ["Set Priority" org-agenda-priority t] ["Increase Priority" org-agenda-priority-up t] @@ -17133,7 +17360,7 @@ that have been changed along." "Dispatch agenda commands to collect entries to the agenda buffer. Prompts for a character to select a command. Any prefix arg will be passed on to the selected command. The default selections are: -g + a Call `org-agenda-list' to display the agenda for current day or week. t Call `org-todo-list' to display the global todo list. T Call `org-todo-list' to display the global todo list, select only @@ -17420,7 +17647,8 @@ agenda-day The day in the agenda where this is listed" (princ "\n")))))) (defun org-fix-agenda-info (props) - "FIXME" + "Make sure all properties on an agenda item have a canonical form, +so the the export commands caneasily use it." (let (tmp re) (when (setq tmp (plist-get props 'tags)) (setq props (plist-put props 'tags (mapconcat 'identity tmp ":")))) @@ -17711,7 +17939,7 @@ Optional argument FILE means, use this file instead of the current." (progn (setq buffer-read-only nil) (goto-char (point-max)) - (unless (bobp) + (unless (or (bobp) org-agenda-compact-blocks) (insert "\n" (make-string (window-width) ?=) "\n")) (narrow-to-region (point) (point-max))) (org-agenda-maybe-reset-markers 'force) @@ -18093,11 +18321,12 @@ NDAYS defaults to `org-agenda-ndays'." (add-text-properties (point-min) (1- (point)) (list 'face 'org-agenda-structure)) (insert (org-finalize-agenda-entries rtnall) "\n"))) - (setq s (point)) - (insert (capitalize (symbol-name (org-agenda-ndays-to-span nd))) - "-agenda:\n") - (add-text-properties s (1- (point)) (list 'face 'org-agenda-structure - 'org-date-line t)) + (unless org-agenda-compact-blocks + (setq s (point)) + (insert (capitalize (symbol-name (org-agenda-ndays-to-span nd))) + "-agenda:\n") + (add-text-properties s (1- (point)) (list 'face 'org-agenda-structure + 'org-date-line t))) (while (setq d (pop day-numbers)) (setq date (calendar-gregorian-from-absolute d) s (point)) @@ -18317,11 +18546,11 @@ to skip this subtree. This is a function that can be put into (and skip end))) (defun org-agenda-skip-entry-if (&rest conditions) - "Skip entry is any of CONDITIONS is true. + "Skip entry if any of CONDITIONS is true. See `org-agenda-skip-if for details." (org-agenda-skip-if nil conditions)) (defun org-agenda-skip-subtree-if (&rest conditions) - "Skip entry is any of CONDITIONS is true. + "Skip entry if any of CONDITIONS is true. See `org-agenda-skip-if for details." (org-agenda-skip-if t conditions)) @@ -18434,7 +18663,9 @@ MATCH is being ignored." (org-disable-agenda-to-diary t)) (save-excursion (save-window-excursion - (list-diary-entries date 1))) ;; Keep this name for now, compatibility + (funcall (if (fboundp 'diary-list-entries) + 'diary-list-entries 'list-diary-entries) + date 1))) (if (not (get-buffer fancy-diary-buffer)) (setq entries nil) (with-current-buffer fancy-diary-buffer @@ -18529,7 +18760,7 @@ items should be listed. The following arguments are allowed: date range matching the selected date. Deadlines will also be listed, on the expiration day. - :sexp FIXME + :sexp List entries resulting from diary-like sexps. :deadline List any deadlines past due, or due within `org-deadline-warning-days'. The listing occurs only @@ -18635,7 +18866,7 @@ the documentation of `org-diary'." (setq results (append results rtn)))))))) results)))) -;; FIXME: this works only if the cursor is not at the +;; 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?" @@ -19611,7 +19842,7 @@ so that the date SD will be in that range." sd)))) (cons sd nd))) -;; FIXME: this no longer works if user make date format that starts with a blank +;; FIXME: does not work if user makes date format that starts with a blank (defun org-agenda-next-date-line (&optional arg) "Jump to the next line indicating a date in agenda buffer." (interactive "p") @@ -19649,7 +19880,6 @@ so that the date SD will be in that range." (defun org-highlight-until-next-command (beg end &optional buffer) (org-highlight beg end buffer) (add-hook 'pre-command-hook 'org-unhighlight-once)) - (defun org-unhighlight-once () (remove-hook 'pre-command-hook 'org-unhighlight-once) (org-unhighlight)) @@ -19999,20 +20229,25 @@ the new TODO state." (beginning-of-line 0))) (org-finalize-agenda))) -;; FIXME: allow negative value for org-agenda-align-tags-to-column -;; See the code in set-tags for the way to do this. (defun org-agenda-align-tags (&optional line) - "Align all tags in agenda items to `org-agenda-align-tags-to-column'." - (let ((inhibit-read-only t)) + "Align all tags in agenda items to `org-agenda-tags-column'." + (let ((inhibit-read-only t) l c) (save-excursion (goto-char (if line (point-at-bol) (point-min))) - (while (re-search-forward (org-re "\\([ \t]+\\):[[:alnum:]_@:]+:[ \t]*$") + (while (re-search-forward (org-re "\\([ \t]+\\)\\(:[[:alnum:]_@:]+:\\)[ \t]*$") (if line (point-at-eol) nil) t) + (add-text-properties + (match-beginning 2) (match-end 2) + (list 'face (list 'org-tag (get-text-property + (match-beginning 2) 'face)))) + (setq l (- (match-end 2) (match-beginning 2)) + c (if (< org-agenda-tags-column 0) + (- (abs org-agenda-tags-column) l) + org-agenda-tags-column)) (delete-region (match-beginning 1) (match-end 1)) (goto-char (match-beginning 1)) (insert (org-add-props - (make-string (max 1 (- org-agenda-align-tags-to-column - (current-column))) ?\ ) + (make-string (max 1 (- c (current-column))) ?\ ) (text-properties-at (point)))))))) (defun org-agenda-priority-up () @@ -20156,11 +20391,11 @@ the tags of the current headline come last." (interactive "p") (org-agenda-date-later (- arg) what)) -(defun org-agenda-show-new-time (marker stamp) +(defun org-agenda-show-new-time (marker stamp &optional prefix) "Show new date stamp via text properties." ;; We use text properties to make this undoable (let ((inhibit-read-only t)) - (setq stamp (concat " => " stamp)) + (setq stamp (concat " " prefix " => " stamp)) (save-excursion (goto-char (point-max)) (while (not (bobp)) @@ -20216,8 +20451,9 @@ be used to request time specification in the time stamp." (with-current-buffer buffer (widen) (goto-char pos) - (setq ts (org-schedule)) - (message "Item scheduled for %s" ts))))) + (setq ts (org-schedule arg))) + (org-agenda-show-new-time marker ts "S")) + (message "Item scheduled for %s" ts))) (defun org-agenda-deadline (arg) "Schedule the item at point." @@ -20234,8 +20470,9 @@ be used to request time specification in the time stamp." (with-current-buffer buffer (widen) (goto-char pos) - (setq ts (org-deadline)) - (message "Deadline for this item set to %s" ts))))) + (setq ts (org-deadline arg))) + (org-agenda-show-new-time marker ts "S")) + (message "Deadline for this item set to %s" ts))) (defun org-get-heading (&optional no-tags) "Return the heading of the current entry, without the stars." @@ -21589,7 +21826,7 @@ underlined headlines. The default is 3." :archived-trees (plist-get opt-plist :archived-trees) :add-text (plist-get opt-plist :text)) - "[\r\n]")) ;; FIXME: why \r here???/ + "\n")) thetoc have-headings first-heading-pos table-open table-buffer) @@ -22478,7 +22715,7 @@ lang=\"%s\" xml:lang=\"%s\"> (org-solidify-link-text (save-match-data (org-link-unescape path)) target-alist) "\">" desc ""))) - ((member type '("http" "https")) ; FIXME: need to test this. + ((member type '("http" "https")) ;; standard URL, just check if we need to inline an image (if (and (or (eq t org-export-html-inline-images) (and org-export-html-inline-images (not descp))) @@ -22744,7 +22981,7 @@ lang=\"%s\" xml:lang=\"%s\"> (kill-buffer (current-buffer))) (current-buffer))))) -(defvar org-table-colgroup-info nil) ;; FIXME: mode to a better place +(defvar org-table-colgroup-info nil) (defun org-format-table-ascii (lines) "Format a table for ascii export." (if (stringp lines) @@ -22785,8 +23022,9 @@ lang=\"%s\" xml:lang=\"%s\"> (memq new '(:start :startend))) (push t vl) (push nil vl))) - (setq vl (cons nil (nreverse vl))))) - + (setq vl (nreverse vl)) + (and vl (setcar vl nil)) + vl)) (defun org-format-table-html (lines olines) "Find out which HTML converter to use and return the HTML code." @@ -23306,7 +23544,7 @@ When COMBINE is non nil, add the category to each line." (format-time-string (cdr org-time-stamp-formats) (current-time)) "DTSTART")) hd ts ts2 state status (inc t) pos b sexp rrule - scheduledp deadlinep tmp pri category entry + scheduledp deadlinep tmp pri category entry location summary desc (sexp-buffer (get-buffer-create "*ical-tmp*"))) (org-refresh-category-properties) (save-excursion @@ -23318,7 +23556,10 @@ When COMBINE is non nil, add the category to each line." ts (match-string 0) inc t hd (org-get-heading) - entry (org-get-cleaned-entry org-icalendar-include-body) + summary (org-entry-get nil "SUMMARY") + desc (or (org-entry-get nil "DESCRIPTION") + (org-get-cleaned-entry org-icalendar-include-body)) + location (org-entry-get nil "LOCATION") category (org-get-category)) (if (looking-at re2) (progn @@ -23348,26 +23589,31 @@ When COMBINE is non nil, add the category to each line." ("m" . "MONTHLY")("y" . "YEARLY")))) ";INTERVAL=" (match-string 1 ts))) (setq rrule "")) - (if (string-match org-bracket-link-regexp hd) - (setq hd (replace-match (if (match-end 3) (match-string 3 hd) - (match-string 1 hd)) - t t hd))) - (if deadlinep (setq hd (concat "DL: " hd))) - (if scheduledp (setq hd (concat "S: " hd))) + (setq summary (or summary hd)) + (if (string-match org-bracket-link-regexp summary) + (setq summary + (replace-match (if (match-end 3) + (match-string 3 summary) + (match-string 1 summary)) + t t summary))) + (if deadlinep (setq summary (concat "DL: " summary))) + (if scheduledp (setq summary (concat "S: " summary))) (if (string-match "\\`<%%" ts) (with-current-buffer sexp-buffer - (insert (substring ts 1 -1) " " hd "\n")) + (insert (substring ts 1 -1) " " summary "\n")) (princ (format "BEGIN:VEVENT %s %s%s -SUMMARY:%s%s +SUMMARY:%s%s%s CATEGORIES:%s END:VEVENT\n" (org-ical-ts-to-string ts "DTSTART") (org-ical-ts-to-string ts2 "DTEND" inc) - rrule hd - (if (and entry (string-match "\\S-" entry)) - (concat "\nDESCRIPTION: " entry) "") + rrule summary + (if (and desc (string-match "\\S-" desc)) + (concat "\nDESCRIPTION: " desc) "") + (if (and location (string-match "\\S-" location)) + (concat "\nLOCATION: " location) "") category))))) (when (and org-icalendar-include-sexps @@ -23401,7 +23647,10 @@ END:VEVENT\n" (not (member org-archive-tag (org-get-tags-at))) ) (setq hd (match-string 3) - entry (org-get-cleaned-entry org-icalendar-include-body)) + summary (org-entry-get nil "SUMMARY") + desc (or (org-entry-get nil "DESCRIPTION") + (org-get-cleaned-entry org-icalendar-include-body)) + location (org-entry-get nil "LOCATION")) (if (string-match org-bracket-link-regexp hd) (setq hd (replace-match (if (match-end 3) (match-string 3 hd) (match-string 1 hd)) @@ -23416,15 +23665,18 @@ END:VEVENT\n" (princ (format "BEGIN:VTODO %s -SUMMARY:%s%s +SUMMARY:%s%s%s CATEGORIES:%s SEQUENCE:1 PRIORITY:%d STATUS:%s END:VTODO\n" - dts hd - (if (and entry (string-match "\\S-" entry)) - (concat "\nDESCRIPTION: " entry) "") + dts + (or summary hd) + (if (and location (string-match "\\S-" location)) + (concat "\nLOCATION: " location) "") + (if (and desc (string-match "\\S-" desc)) + (concat "\nDESCRIPTION: " desc) "") category pri status))))))))) (defun org-get-cleaned-entry (what) @@ -23440,6 +23692,7 @@ END:VTODO\n" (if (string-match "[ \t\r\n]+\\'" s) (setq s (replace-match "" t t s))) (while (string-match "[ \t]*\n[ \t]*" s) (setq s (replace-match "\\n" t t s))) + (setq s (org-trim s)) (if (and (numberp what) (> (length s) what)) (substring s 0 what) @@ -23709,6 +23962,7 @@ The XOXO buffer is named *xoxo-*" (org-defkey org-mode-map "\C-c\C-x\C-t" 'org-toggle-time-stamp-overlays) (org-defkey org-mode-map "\C-c\C-x\C-i" 'org-clock-in) (org-defkey org-mode-map "\C-c\C-x\C-o" 'org-clock-out) +(org-defkey org-mode-map "\C-c\C-x\C-j" 'org-clock-goto) (org-defkey org-mode-map "\C-c\C-x\C-x" 'org-clock-cancel) (org-defkey org-mode-map "\C-c\C-x\C-d" 'org-clock-display) (org-defkey org-mode-map "\C-c\C-x\C-r" 'org-clock-report) @@ -24311,7 +24565,7 @@ See the individual commands for more information." ["Priority Down" org-shiftdown t]) ("TAGS and Properties" ["Set Tags" 'org-ctrl-c-ctrl-c (org-at-heading-p)] - ["Change tag in region" 'org-change-tag-in-region (org-region-active-p)] ;FIXME + ["Change tag in region" 'org-change-tag-in-region (org-region-active-p)] ["Column view of properties" org-columns t]) ("Dates and Scheduling" ["Timestamp" org-time-stamp t] @@ -24334,6 +24588,7 @@ See the individual commands for more information." ["Clock in" org-clock-in t] ["Clock out" org-clock-out t] ["Clock cancel" org-clock-cancel t] + ["Goto running clock" org-clock-goto t] ["Display times" org-clock-display t] ["Create clock table" org-clock-report t] "--" @@ -24546,7 +24801,7 @@ and :keyword." (setq clist (nreverse (delq nil clist))) clist)) -;; FIXME Compare with at-regexp-p +;; FIXME: Compare with at-regexp-p Do we need both? (defun org-in-regexp (re &optional nlines visually) "Check if point is inside a match of regexp. Normally only the current line is checked, but you can include NLINES extra @@ -24658,7 +24913,7 @@ ones and overrule settings in the other lists." (defun org-replace-escapes (string table) "Replace %-escapes in STRING with values in TABLE. -TABLE is an association list with keys line \"%a\" and string values. +TABLE is an association list with keys like \"%a\" and string values. The sequences in STRING may contain normal field width and padding information, for example \"%-5s\". Replacements happen in the sequence given by TABLE, so values can contain further %-escapes if they are define later in TABLE." @@ -24687,7 +24942,9 @@ Counting starts at 1." "Like `find-buffer-visiting' but alway return the base buffer and not an indirect buffer" (let ((buf (find-buffer-visiting file))) - (or (buffer-base-buffer buf) buf))) + (if buf + (or (buffer-base-buffer buf) buf) + nil))) (defun org-image-file-name-regexp () "Return regexp matching the file names of images." @@ -24768,7 +25025,6 @@ not an indirect buffer" ;; fill the headline as well. (org-set-local 'comment-start-skip "^#+[ \t]*") (org-set-local 'paragraph-separate "\f\\|\\*+ \\|[ ]*$\\|[ \t]*[:|]") -;; FIXME!!!!!!! (org-set-local 'paragraph-separate "\f\\|[ ]*$") ;; The paragraph starter includes hand-formatted lists. (org-set-local 'paragraph-start "\f\\|[ ]*$\\|\\*+ \\|\f\\|[ \t]*\\([-+*][ \t]+\\|[0-9]+[.)][ \t]+\\)\\|[ \t]*[:|]") @@ -25092,28 +25348,6 @@ Show the heading too, if it is currently invisible." ;;;; Experimental code -;; Make appt aware of appointments from the agenda -(defun org-agenda-to-appt () - "Activate appointments found in `org-agenda-files'." - (interactive) - (require 'org) - (let* ((today (org-date-to-gregorian - (time-to-days (current-time)))) - (files org-agenda-files) entries file) - (while (setq file (pop files)) - (setq entries (append entries (org-agenda-get-day-entries - file today :timestamp)))) - (setq entries (delq nil entries)) - (mapc (lambda(x) - (let* ((event (org-trim (get-text-property 1 'txt x))) - (time-of-day (get-text-property 1 'time-of-day x)) tod) - (when time-of-day - (setq tod (number-to-string time-of-day) - tod (when (string-match - "\\([0-9]\\{1,2\\}\\)\\([0-9]\\{2\\}\\)" tod) - (concat (match-string 1 tod) ":" - (match-string 2 tod)))) - (if tod (appt-add tod event))))) entries))) (defun org-closed-in-range () "Sparse tree of items closed in a certain time range. @@ -25179,6 +25413,27 @@ 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))))) + ;;;; Finish up (provide 'org) diff --git a/org.pdf b/org.pdf index ca8d1b9be..406ad4d0f 100644 Binary files a/org.pdf and b/org.pdf differ diff --git a/org.texi b/org.texi index 06011a080..9f09e0cfe 100644 --- a/org.texi +++ b/org.texi @@ -3,8 +3,8 @@ @setfilename ../info/org @settitle Org Mode Manual -@set VERSION 5.10 -@set DATE September 2007 +@set VERSION 5.11 +@set DATE October 2007 @dircategory Emacs @direntry @@ -2316,20 +2316,21 @@ Insert a link. This prompts for a link to be inserted into the buffer. You can just type a link, using text for an internal link, or one of the link type prefixes mentioned in the examples above. All links stored during the current session are part of the history for this prompt, so -you can access them with @key{up} and @key{down}. Completion, on the -other hand, will help you to insert valid link prefixes like -@samp{http:} or @samp{ftp:}, including the prefixes defined through link -abbreviations (@pxref{Link abbreviations}). The link will be inserted -into the buffer@footnote{After insertion of a stored link, the link will -be removed from the list of stored links. To keep it in the list later -use, use a triple @kbd{C-u} prefix to @kbd{C-c C-l}, or configure the -option @code{org-keep-stored-link-after-insertion}.}, along with a -descriptive text. If some text was selected when this command is -called, the selected text becomes the default description.@* Note that -you don't have to use this command to insert a link. Links in Org-mode -are plain text, and you can type or paste them straight into the buffer. -By using this command, the links are automatically enclosed in double -brackets, and you will be asked for the optional descriptive text. +you can access them with @key{up} and @key{down} (or @kbd{M-p/n}). +Completion, on the other hand, will help you to insert valid link +prefixes like @samp{http:} or @samp{ftp:}, including the prefixes +defined through link abbreviations (@pxref{Link abbreviations}). The +link will be inserted into the buffer@footnote{After insertion of a +stored link, the link will be removed from the list of stored links. To +keep it in the list later use, use a triple @kbd{C-u} prefix to @kbd{C-c +C-l}, or configure the option +@code{org-keep-stored-link-after-insertion}.}, along with a descriptive +text. If some text was selected when this command is called, the +selected text becomes the default description.@* Note that you don't +have to use this command to insert a link. Links in Org-mode are plain +text, and you can type or paste them straight into the buffer. By using +this command, the links are automatically enclosed in double brackets, +and you will be asked for the optional descriptive text. @c @c If the link is a @samp{file:} link and @c the linked file is located in the same directory as the current file or @@ -2855,6 +2856,7 @@ special faces for some of them. This can be done using the variable ("CANCELED" . (:foreground "blue" :weight bold)))) @end lisp +@page @node Progress logging, Priorities, TODO extensions, TODO items @section Progress Logging @cindex progress logging @@ -2874,7 +2876,9 @@ a TODO item. If you want to keep track of @emph{when} a certain TODO item was finished, turn on logging with@footnote{The corresponding in-buffer -setting is: @code{#+STARTUP: logdone}} +setting is: @code{#+STARTUP: logdone}. You may also set this for the +scope of a subtree by adding a @code{LOGGING} property with one or more +of the logging keywords in the value.} @lisp (setq org-log-done t) @@ -2901,7 +2905,8 @@ setting is: @code{#+STARTUP: lognotedone}} When TODO keywords are used as workflow states (@pxref{Workflow states}), you might want to keep track of when a state change occurred -and record a note about this change. With the setting +and record a note about this change. With the setting@footnote{The +corresponding in-buffer setting is: @code{#+STARTUP: lognotestate}.} @lisp (setq org-log-done '(state)) @@ -3421,6 +3426,9 @@ Switch property at point to the next/previous allowed value. Remove a property from the current entry. @item C-c C-c D Globally remove a property, from all entries in the current file. +@item C-c C-c c +Compute the property at point, using the operator and scope from the +nearest column format definition. @end table @node Special properties, Property searches, Property syntax, Properties and columns @@ -3987,7 +3995,8 @@ an item: @kindex C-c C-d @item C-c C-d Insert @samp{DEADLINE} keyword along with a stamp. The insertion will -happen in the line directly following the headline. +happen in the line directly following the headline. When called with a +prefix arg, an existing deadline will be removed from the entry. @c FIXME Any CLOSED timestamp will be removed.???????? @c @kindex C-c C-w @@ -4003,7 +4012,8 @@ all deadlines due tomorrow. @item C-c C-s Insert @samp{SCHEDULED} keyword along with a stamp. The insertion will happen in the line directly following the headline. Any CLOSED -timestamp will be removed. +timestamp will be removed. When called with a prefix argument, remove +the scheduling date from the entry. @end table @node Repeated tasks, , Inserting deadline/schedule, Deadlines and scheduling @@ -4034,9 +4044,11 @@ actually switch the date like this: DEADLINE: <2005-11-01 Tue +1m> @end example -You will also be prompted for a note that will be put under the DEADLINE -line to keep a record that you actually acted on the previous instance -of this deadline. +You will also be prompted for a note@footnote{You can change this using +the option @code{org-log-repeat}, or the @code{#+STARTUP} options +@code{logrepeat} and @code{nologrepeat}.} that will be put under the +DEADLINE line to keep a record that you actually acted on the previous +instance of this deadline. As a consequence of shifting the base date, this entry will no longer be visible in the agenda when checking past dates, but all future instances @@ -4058,7 +4070,10 @@ also computes the total time spent on each subtree of a project. @kindex C-c C-x C-i @item C-c C-x C-i Start the clock on the current item (clock-in). This inserts the CLOCK -keyword together with a timestamp. +keyword together with a timestamp. If this is not the first clocking of +this item, the multiple CLOCK lines will be wrapped into a +@code{:CLOCK:} drawer (see also the variable +@code{org-clock-into-drawer}. @kindex C-c C-x C-o @item C-c C-x C-o Stop the clock (clock-out). The inserts another timestamp at the same @@ -4081,6 +4096,10 @@ if it is running in this same item. @item C-c C-x C-x Cancel the current clock. This is useful if a clock was started by mistake, or if you ended up working on something else. +@kindex C-c C-x C-j +@item C-c C-x C-j +Jump to the entry that contains the currently running clock, an another +window. @kindex C-c C-x C-d @item C-c C-x C-d Display time summaries for each subtree in the current buffer. This @@ -4094,13 +4113,13 @@ when you change the buffer (see variable Insert a dynamic block (@pxref{Dynamic blocks}) containing a clock report as an org-mode table into the current file. @example -#+BEGIN: clocktable :maxlevel 2 :emphasize nil +#+BEGIN: clocktable :maxlevel 2 :emphasize nil :scope file #+END: clocktable @end example @noindent -If such a block already exists, its content is replaced by the new -table. The @samp{BEGIN} line can specify options: +If such a block already exists at point, its content is replaced by the +new table. The @samp{BEGIN} line can specify options: @example :maxlevel @r{Maximum level depth to which times are listed in the table.} :emphasize @r{When @code{t}, emphasize level one and level two items} @@ -4552,6 +4571,18 @@ will be made in the agenda: %%(diary-anniversary 2 10 1869) Mahatma Gandhi would be %d years old @end example +@subsubheading Appointment reminders +@cindex @file{appt.el} +@cindex appointment reminders + +Org can interact with Emacs appointments notification facility. + +To add all the appointments of your agenda files, use the command +@code{org-agenda-to-appt}. This commands also lets you filter through +the list of your appointments and add only those belonging to a specific +category or matching a regular expression. See the docstring for +details. + @node Global TODO list, Matching tags and properties, Weekly/Daily agenda, Built-in agenda views @subsection The global TODO list @cindex global TODO list @@ -4843,10 +4874,10 @@ the other commands, the cursor needs to be in the desired line. @cindex motion commands in agenda @kindex n @item n -Next line (same as @key{up}). +Next line (same as @key{up} and @kbd{C-p}). @kindex p @item p -Previous line (same as @key{down}). +Previous line (same as @key{down} and @kbd{C-n}). @tsubheading{View/GoTo org file} @kindex mouse-3 @kindex @key{SPC} @@ -4925,7 +4956,9 @@ argument is interpreted to create a selective list for a specific TODO keyword. @c @kindex s +@kindex C-x C-s @item s +@itemx C-x C-s Save all Org-mode buffers in the current Emacs session. @c @kindex @key{right} @@ -5050,6 +5083,10 @@ Stop the previously started clock. @item X Cancel the currently running clock. +@kindex J +@item J +Jump to the running clock in another window. + @tsubheading{Calendar commands} @cindex calendar commands, from agenda @kindex c @@ -6104,6 +6141,11 @@ Create a single large iCalendar file from all files in @code{org-combined-agenda-icalendar-file}. @end table +The export will honor SUMMARY, DESCRIPTION and LOCATION properties if +the selected entries have them. If not, the summary will be derived +from the headline, and the description from the body (limited to +@code{org-icalendar-include-body} characters). + How this calendar is best read and updated, depends on the application you are using. The FAQ covers this issue. @@ -6843,8 +6885,9 @@ variable is @code{org-startup-align-all-tables}, with a default value align @r{align all tables} noalign @r{don't align tables on startup} @end example -Logging TODO state changes and clock intervals (variable -@code{org-log-done}) can be configured using these options. +Logging TODO state changes and clock intervals (variables +@code{org-log-done} and @code{org-log-repeat}) can be configured using +these options. @cindex @code{logdone}, STARTUP keyword @cindex @code{nologging}, STARTUP keyword @cindex @code{lognotedone}, STARTUP keyword @@ -7948,7 +7991,6 @@ around a match in a hidden outline tree. @item @i{Bastien Guerry} wrote the La@TeX{} exporter and has been prolific with patches, ideas, and bug reports. -to Org-mode. @item @i{Kai Grossjohann} pointed out key-binding conflicts with other packages. @item diff --git a/orgcard.pdf b/orgcard.pdf index e588c5ae2..2bd7801d4 100644 Binary files a/orgcard.pdf and b/orgcard.pdf differ diff --git a/orgcard.tex b/orgcard.tex index 2260c9f39..c17e69605 100644 --- a/orgcard.tex +++ b/orgcard.tex @@ -1,5 +1,5 @@ % Reference Card for Org Mode -\def\orgversionnumber{5.10} +\def\orgversionnumber{5.11} \def\versionyear{2007} % latest update \def\year{2007} % latest copyright year @@ -664,9 +664,8 @@ after ``{\tt :}'', and dictionary words elsewhere. \key{insert new entry into diary}{i} \newcolumn -\key{start the clock on current item (clock-in)}{I} -\key{stop the clock (clock-out)}{O} -\key{cancel current clock}{X} +\key{start/stop/cancel the clock on current item}{I / O / X} +\key{jump to running clock entry}{J} {\bf Misc} diff --git a/orgcard_letter.pdf b/orgcard_letter.pdf index a31975e08..9055cce20 100644 Binary files a/orgcard_letter.pdf and b/orgcard_letter.pdf differ