diff --git a/org b/org index f82b69a20..5f45e44e4 100644 --- a/org +++ b/org @@ -5,7 +5,7 @@ START-INFO-DIR-ENTRY * Org Mode: (org). Outline-based notes management and organizer END-INFO-DIR-ENTRY - This manual is for Org-mode (version 4.74). + This manual is for Org-mode (version 4.75). Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation @@ -27,7 +27,7 @@ File: org, Node: Top, Next: Introduction, Prev: (dir), Up: (dir) Org Mode Manual *************** -This manual is for Org-mode (version 4.74). +This manual is for Org-mode (version 4.75). Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation @@ -145,13 +145,18 @@ Timestamps * Time stamps:: Assigning a time to a tree entry * Creating timestamps:: Commands which insert timestamps -* Custom time format:: If you cannot work with the ISO format -* Repeating items:: Deadlines that come back again and again +* Deadlines and scheduling:: Planning your work * Progress logging:: Documenting when what work was done. Creating timestamps * The date/time prompt:: How org-mode helps you entering date and time +* Custom time format:: Making dates look differently + +Deadlines and Scheduling + +* Inserting deadline/schedule:: +* Repeated tasks:: Progress Logging @@ -1927,10 +1932,12 @@ 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 - , or with completion(1). The link will be inserted into the - buffer, along with a descriptive text. If some text was selected - when this command is called, the selected text becomes the default - description. + . 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 @@ -2539,6 +2546,14 @@ agenda (*note Weekly/Daily agenda::). timestamps::). Furthermore, these keys are also used by CUA-mode (*note Conflicts::). + You can change the range of allowed priorities by setting the +variables `org-highest-priority', `org-lowest-priority', and +`org-default-priority'. For an individual buffer, you may set these +values (highest, lowest, default) like this (please make sure that the +highest priority is earlier in the alphabet than the lowest priority): + + #+PRIORITIES: A C B +  File: org, Node: Breaking down tasks, Next: Checkboxes, Prev: Priorities, Up: TODO items @@ -2636,8 +2651,7 @@ planning. * Time stamps:: Assigning a time to a tree entry * Creating timestamps:: Commands which insert timestamps -* Custom time format:: If you cannot work with the ISO format -* Repeating items:: Deadlines that come back again and again +* Deadlines and scheduling:: Planning your work * Progress logging:: Documenting when what work was done.  @@ -2649,7 +2663,7 @@ File: org, Node: Time stamps, Next: Creating timestamps, Prev: Timestamps, U A time stamp is a specification of a date (possibly with time) in a special format, either `<2003-09-16 Tue>' or `<2003-09-16 Tue 09:39>'(1). A time stamp can appear anywhere in the headline or body -of an org-tree entry. Its presence allows entries to be shown on +of an org-tree entry. Its presence causes entries to be shown on specific dates in the agenda (*note Weekly/Daily agenda::). We distinguish: @@ -2663,6 +2677,31 @@ PLAIN TIME STAMP * Meet Peter at the movies <2006-11-01 Wed 19:15> +TIME STAMP WITH REPEATER INTERVAL + A time stamp may contain a _repeater interval_, indicating that it + applies not only on the given date, but again and again after a + certain interval of N days (d), weeks (w), months(m), or years(y). + The following will show up in the agenda every Wednesday: + + * Pick up Sam at school <2007-05-16 Wed 12:30 +1w> + +DIARY-STYLE SEXP ENTRIES + For more complex date specifications, Org-mode supports using the + special sexp diary entries implemented in the Emacs calendar/diary + package. For example + + * The nerd meeting on every 2nd Thursday of the month + <%%(diary-float t 4 2)> + +TIME/DATE RANGE + Two time stamps connected by `--' denote a range. The headline + will be shown on the first and last day of the range, and on any + dates that are displayed and fall in the range. Here is an + example: + + ** Meeting in Amsterdam + <2004-08-23 Mon>--<2004-08-26 Thu> + INACTIVE TIME STAMP Just like a plain time stamp, but with square brackets instead of angular ones. These time stamps are inactive in the sense that @@ -2670,64 +2709,14 @@ INACTIVE TIME STAMP * Gillian comes late for the fifth time [2006-11-01 Wed] -TIME STAMP RANGE - Two time stamps connected by `--' denote a time range. The - headline will be shown on the first and last day of the range, and - on any dates that are displayed and fall in the range. Here is an - example: - - ** Meeting in Amsterdam - <2004-08-23 Mon>--<2004-08-26 Thu> - -TIME STAMP WITH SCHEDULED KEYWORD - If a time stamp is preceded by the word `SCHEDULED:', it means you - are planning to start working on that task on the given date. So - this is not about recording an event, but about planning your - work. The headline will be listed under the given date(2). In - addition, a reminder that the scheduled date has passed will be - present in the compilation for _today_, until the entry is marked - DONE. I.e., the task will automatically be forwarded until - completed. - - *** TODO Call Trillian for a date on New Years Eve. - SCHEDULED: <2004-12-25 Sat> - -TIME STAMP WITH DEADLINE KEYWORD - If a time stamp is preceded by the word `DEADLINE:', the task - (most likely a TODO item) is supposed to be finished on that date, - and it will be listed then. In addition, the compilation for - _today_ will carry a warning about the approaching or missed - deadline, starting `org-deadline-warning-days' before the due - date, and continuing until the entry is marked DONE. An example: - - *** TODO write article about the Earth for the Guide - The editor in charge is [[bbdb:Ford Prefect]] - DEADLINE: <2004-02-29 Sun> - -TIME STAMP WITH CLOSED KEYWORD - When `org-log-done' is non-nil, Org-mode will automatically insert - a special time stamp each time a TODO entry is marked done (*note - Progress logging::). This time stamp is enclosed in square - brackets instead of angular brackets. - -TIME RANGE WITH CLOCK KEYWORD - When using the clock to time the work that is being done on - specific items, time ranges preceded by the CLOCK keyword are - inserted automatically into the file. The time stamps are - enclosed in square brackets instead of angular brackets. *Note - Clocking work time::. ---------- Footnotes ---------- (1) This is the standard ISO date/time format. If you cannot get used to these, see *Note Custom time format:: - (2) It will still be listed on that date after it has been marked -DONE. If you don't like this, set the variable -`org-agenda-skip-scheduled-if-done'. -  -File: org, Node: Creating timestamps, Next: Custom time format, Prev: Time stamps, Up: Timestamps +File: org, Node: Creating timestamps, Next: Deadlines and scheduling, Prev: Time stamps, Up: Timestamps 6.2 Creating timestamps ======================= @@ -2763,22 +2752,6 @@ format. Access the agenda for the date given by the time stamp or -range at point (*note Weekly/Daily agenda::). -`C-c C-d' - Insert `DEADLINE' keyword along with a stamp. The insertion will - happen in the line directly following the headline. - -`C-c C-w' - Create a sparse tree with all deadlines that are either past-due, - or which will become due within `org-deadline-warning-days'. With - `C-u' prefix, show all deadlines in the file. With a numeric - prefix, check that many days. For example, `C-1 C-c C-w' shows - all deadlines due tomorrow. - -`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. - `S-' `S-' Change date at cursor by one day. These key bindings conflict with @@ -2800,9 +2773,10 @@ format. * Menu: * The date/time prompt:: How org-mode helps you entering date and time +* Custom time format:: Making dates look differently  -File: org, Node: The date/time prompt, Prev: Creating timestamps, Up: Creating timestamps +File: org, Node: The date/time prompt, Next: Custom time format, Prev: Creating timestamps, Up: Creating timestamps 6.2.1 The date/time prompt -------------------------- @@ -2870,10 +2844,10 @@ the calendar fully from the minibuffer: `org-popup-calendar-for-date-prompt'.  -File: org, Node: Custom time format, Next: Repeating items, Prev: Creating timestamps, Up: Timestamps +File: org, Node: Custom time format, Prev: The date/time prompt, Up: Creating timestamps -6.3 Custom time format -====================== +6.2.2 Custom time format +------------------------ Org-mode uses the standard ISO notation for dates and times as it is defined in ISO 8601. If you cannot get used to this and require another @@ -2906,48 +2880,114 @@ consequences: the custom format is shorter, things do work as expected.  -File: org, Node: Repeating items, Next: Progress logging, Prev: Custom time format, Up: Timestamps +File: org, Node: Deadlines and scheduling, Next: Progress logging, Prev: Creating timestamps, Up: Timestamps -6.4 Repeating items -=================== +6.3 Deadlines and Scheduling +============================ -Org-mode integrates with the Emacs calendar and diary to display cyclic -appointments, anniversaries and other special entries in the agenda -(*note Weekly/Daily agenda::). However, it can be useful to have -certain deadlines and scheduling items to auto-repeat. The advantage of -a deadline or scheduled item is that the they produce warnings ahead of -time and automatically forward themselves in the agenda until they are -done. The abstract difference is therefore between cyclic appointments -and cyclic action items. For appointments you should use the diary, -for actions you can uses an org-mode deadline or scheduling time stamp -together with a REPEAT cookie. For example: +A time stamp may be preceded by special keywords to facilitate planning +of work: - * TODO Replace batteries in smoke detector REPEAT(+18m) - SCHEDULED: <2007-01-01 Mon> +DEADLINE + The task (most likely a TODO item) is supposed to be finished on + that date, and it will be listed then. In addition, the + compilation for _today_ will carry a warning about the approaching + or missed deadline, starting `org-deadline-warning-days' before + the due date, and continuing until the entry is marked DONE. An + example: - * TODO Get dentist appointment REPEAT(+6m) - SCHEDULED: <2006-12-19 Tue> + *** TODO write article about the Earth for the Guide + The editor in charge is [[bbdb:Ford Prefect]] + DEADLINE: <2004-02-29 Sun> - * TODO Tax report to IRS REPEAT(+1y) - DEADLINE: <2007-04-01 Sun> +SCHEDULED + You are planning to start working on that task on the given date. + The headline will be listed under the given date(1). In addition, + a reminder that the scheduled date has passed will be present in + the compilation for _today_, until the entry is marked DONE. + I.e., the task will automatically be forwarded until completed. - Each time you try to mark one of these entries DONE using `C-c C-t', -they will automatically switch back to the state TODO, and the -deadline/scheduling will be shifted accordingly. The time units -recognized by org-mode are year (y), month (m), week (w), and day (d). -Org-mode will also prompt you for a note and record the fact that you -have closed this item in a note under the headline. + *** TODO Call Trillian for a date on New Years Eve. + SCHEDULED: <2004-12-25 Sat> - One unusual property of these repeating items is that only one -instance of each exist at any given time. So if you look back or ahead -in the agenda, you will not find past and future instances, only the -current one will show up. Use a cyclic diary entry if you need all -past and future instances to be visible in the agenda. +* Menu: + +* Inserting deadline/schedule:: +* Repeated tasks:: + + ---------- Footnotes ---------- + + (1) It will still be listed on that date after it has been marked +DONE. If you don't like this, set the variable +`org-agenda-skip-scheduled-if-done'.  -File: org, Node: Progress logging, Prev: Repeating items, Up: Timestamps +File: org, Node: Inserting deadline/schedule, Next: Repeated tasks, Prev: Deadlines and scheduling, Up: Deadlines and scheduling -6.5 Progress Logging +6.3.1 Inserting deadline/schedule +--------------------------------- + +The following commands allow to quickly insert a deadline or to schedule +an item: + +`C-c C-d' + Insert `DEADLINE' keyword along with a stamp. The insertion will + happen in the line directly following the headline. + +`C-c C-w' + Create a sparse tree with all deadlines that are either past-due, + or which will become due within `org-deadline-warning-days'. With + `C-u' prefix, show all deadlines in the file. With a numeric + prefix, check that many days. For example, `C-1 C-c C-w' shows + all deadlines due tomorrow. + +`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. + + +File: org, Node: Repeated tasks, Prev: Inserting deadline/schedule, Up: Deadlines and scheduling + +6.3.2 Repeated Tasks +-------------------- + +Some tasks need to be repeated again and again, and Org-mode therefore +allows to use a repeater in a DEADLINE or SCHEDULED time stamp, for +example: + ** TODO Pay the rent + DEADLINE: <2005-10-01 Sat +1m> + + Deadlines and scheduled items produce entries in the agenda when they +are over-due, so it is important to be able to mark such an entry as +completed once you have done so. When you mark a DEADLINE or a SCHEDULE +with the todo keyword DONE, it will no longer produce entries in the +agenda. The problem with this is, however, that then also the _next_ +instance of the repeated entry will not be active. Org-mode deals with +this in the following way: When you try to mark such an entry DONE +(using `C-c C-t'), it will shift the base date of the repeating time +stamp by the repeater interval, and immediately set the entry state +back to TODO. In the example above, setting the state to DONE would +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 +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 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. + + +File: org, Node: Progress logging, Prev: Deadlines and scheduling, Up: Timestamps + +6.4 Progress Logging ==================== Org-mode can automatically record a time stamp when you mark a TODO item @@ -2965,7 +3005,7 @@ on an aspect of a project.  File: org, Node: Closing items, Next: Tracking TODO state changes, Prev: Progress logging, Up: Progress logging -6.5.1 Closing items +6.4.1 Closing items ------------------- If you want to keep track of _when_ a certain TODO item was finished, @@ -2994,7 +3034,7 @@ the timestamp, use(2)  File: org, Node: Tracking TODO state changes, Next: Clocking work time, Prev: Closing items, Up: Progress logging -6.5.2 Tracking TODO state changes +6.4.2 Tracking TODO state changes --------------------------------- When TODO keywords are used as workflow states (*note Workflow @@ -3016,7 +3056,7 @@ these into a separate file that starts with:  File: org, Node: Clocking work time, Prev: Tracking TODO state changes, Up: Progress logging -6.5.3 Clocking work time +6.4.3 Clocking work time ------------------------ Org-mode allows you to clock the time you spent on specific tasks in a @@ -3533,6 +3573,22 @@ date works in the agenda buffer, as well as the commands `S', `M', and to other calendars, respectively. `c' can be used to switch back and forth between calendar and agenda. + If you are using the diary only for sexp entries and holidays, it is +faster to not use the above setting, but instead to copy or even move +the entries into an Org-mode file. Org-mode evaluates diary-style sexp +entries, and does it faster because there is no overhead for first +creating the diary display. Note that the sexp entries must start at +the left margin, no white space is allowed before them. For example, +the following segment of an Org-mode file will be processed and entries +will be made in the agenda: + + * Birthdays and similar stuff + #+CATEGORY: Holiday + %%(org-calendar-holiday) ; special function for holiday names + #+CATEGORY: Ann + %%(diary-anniversary 14 5 1956) Artur Dent %d is years old + %%(diary-anniversary 2 10 1869) Mahatma Gandhi would be %d years old +  File: org, Node: Global TODO list, Next: Matching headline tags, Prev: Weekly/Daily agenda, Up: Built-in agenda views @@ -4681,13 +4737,25 @@ File: org, Node: Export commands, Next: Quoting HTML tags, Prev: HTML export, `C-c C-e H' Export to a temporary buffer, do not create a file. +`C-c C-e H' + Export the active region to a temporary buffer. With prefix arg, + do not produce file header and foot, but just the plain HTML + section for the region. This is good for cut-and-paste operations. + `C-c C-e v h' `C-c C-e v b' `C-c C-e v H' + +`C-c C-e v R' Export only the visible part of the document. +`M-x org-export-region-as-html' + Convert the region to HTML under the assumption that it was + org-mode syntax before. This is a global command that can be + invoked in any buffer. + In the exported version, the first 3 outline levels will become headlines, defining a general document structure. Additional levels will be exported as itemized lists. If you want that transition to @@ -5491,6 +5559,11 @@ file is visited again in a new Emacs session. entries before it. The corresponding variable is `org-archive-location'. +`#+PRIORITIES: highest lowest default' + This line sets the limits and the default for the priorities. All + three must be either letters A-Z or numbers 0-9. The highest + priority must have a lower ASCII number that the lowest priority. + `#+TBLFM:' This line contains the formulas for the table directly above the line. @@ -6284,6 +6357,9 @@ if I have forgotten someone, please accept my apologies and let me know. patched CSS formatting into the HTML exporter, and inspired the agenda. + * David Emery provided a patch for custom CSS support in exported + HTML agendas. + * Nic Ferrier contributed mailcap and XOXO support. * John Foerch figured out how to make incremental search show context @@ -6300,6 +6376,11 @@ if I have forgotten someone, please accept my apologies and let me know. * Shidai Liu ("Leo") asked for embedded LaTeX and tested it. He also provided frequent feedback and some patches. + * Jason F. McBrayer suggested agenda export to CSV format. + + * Dmitri Minaev sent a patch to set priority limits on a per-file + basis. + * Stefan Monnier provided a patch to keep the Emacs-Lisp compiler happy. @@ -6442,13 +6523,11 @@ Index * checkboxes: Checkboxes. (line 6) * children, subtree visibility state: Visibility cycling. (line 10) * clean outline view: Clean view. (line 6) -* CLOCK keyword: Time stamps. (line 71) -* CLOSED keyword: Time stamps. (line 65) * column formula: Column formulas. (line 6) * 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 41) +* completion, of file names: Handling links. (line 43) * completion, of link abbreviations: Completion. (line 6) * completion, of links: Handling links. (line 25) * completion, of option keywords <1>: Completion. (line 6) @@ -6478,13 +6557,14 @@ Index * 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, reading in minibuffer: The date/time prompt. (line 6) -* DEADLINE keyword: Time stamps. (line 53) +* DEADLINE keyword: Deadlines and scheduling. + (line 10) * deadlines: Time stamps. (line 6) -* deadlines, repeating: Repeating items. (line 6) * debugging, of table formulas: Editing and debugging formulas. (line 97) * demotion, of subtrees: Structure editing. (line 6) @@ -6504,7 +6584,7 @@ Index * elisp links: External links. (line 6) * emphasized text: Export options. (line 25) * enhancing text: Enhancing text. (line 6) -* evaluate time range: Creating timestamps. (line 64) +* evaluate time range: Creating timestamps. (line 48) * even, STARTUP keyword: In-buffer settings. (line 44) * exporting: Exporting. (line 6) * exporting agenda views <1>: Exporting Agenda Views. @@ -6522,7 +6602,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 41) +* file name completion: Handling links. (line 43) * files for agenda: Agenda files. (line 6) * files, adding to agenda list: Agenda files. (line 12) * files, selecting for publishing: Selecting files. (line 6) @@ -6530,7 +6610,7 @@ Index * fixed-width sections: Export options. (line 25) * folded, subtree visibility state: Visibility cycling. (line 10) * folding, sparse trees: Sparse trees. (line 6) -* following links: Handling links. (line 56) +* following links: Handling links. (line 58) * format specifier: Formula syntax for Calc. (line 14) * format, of links: Link format. (line 6) @@ -6551,7 +6631,7 @@ Index * GNUS links: External links. (line 6) * hand-formatted lists: Enhancing text. (line 11) * headline levels: Export options. (line 25) -* headline levels, for exporting <1>: Export commands. (line 22) +* headline levels, for exporting <1>: Export commands. (line 34) * headline levels, for exporting: ASCII export. (line 18) * headline navigation: Motion. (line 6) * headline tagging: Tags. (line 6) @@ -6570,7 +6650,7 @@ Index * iCalendar export: iCalendar export. (line 6) * images, inline in HTML: Images. (line 6) * in-buffer settings: In-buffer settings. (line 6) -* inactive timestamp: Time stamps. (line 24) +* inactive timestamp: Time stamps. (line 49) * index, of published pages: Project page index. (line 6) * Info links: External links. (line 6) * inheritance, of tags: Tag inheritance. (line 6) @@ -6600,13 +6680,13 @@ 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 89) +* links, finding next/previous: Handling links. (line 91) * 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 83) +* links, returning to: Handling links. (line 85) * Lisp forms, as table formulas: Formula syntax for Lisp. (line 6) * lists, hand-formatted: Enhancing text. (line 11) @@ -6619,7 +6699,7 @@ Index * lognotestate, STARTUP keyword: In-buffer settings. (line 33) * logrepeat, STARTUP keyword: In-buffer settings. (line 33) * maintainer: Feedback. (line 6) -* mark ring: Handling links. (line 79) +* mark ring: Handling links. (line 81) * marking characters, tables: Advanced features. (line 40) * matching, of tags: Matching headline tags. (line 6) @@ -6698,9 +6778,9 @@ Index * remote editing, undo: Agenda commands. (line 107) * richer text: Enhancing text. (line 6) * RMAIL links: External links. (line 6) -* SCHEDULED keyword: Time stamps. (line 40) +* SCHEDULED keyword: Deadlines and scheduling. + (line 22) * scheduling: Time stamps. (line 6) -* scheduling, repeating: Repeating items. (line 6) * Scripts, for agenda processing: Extracting Agenda Information for other programs. (line 6) * search option in file links: Search options. (line 6) @@ -6716,7 +6796,8 @@ Index * showstars, STARTUP keyword: In-buffer settings. (line 44) * sorting, of agenda items: Sorting of agenda items. (line 6) -* sparse tree, for deadlines: Creating timestamps. (line 39) +* sparse tree, for deadlines: Inserting deadline/schedule. + (line 11) * sparse tree, for TODO: TODO basics. (line 26) * sparse tree, tag based: Tags. (line 6) * sparse trees: Sparse trees. (line 6) @@ -6779,12 +6860,12 @@ Index (line 6) * time-sorted view: Timeline. (line 6) * timeline, single file: Timeline. (line 6) -* timerange: Time stamps. (line 31) +* timerange: Time stamps. (line 40) * timestamp: Time stamps. (line 14) -* timestamp, inactive: Time stamps. (line 24) +* timestamp, inactive: Time stamps. (line 49) +* timestamp, with repeater interval: Time stamps. (line 24) * timestamps, creating: Creating timestamps. (line 6) * TODO items: TODO items. (line 6) -* TODO items, repeating: Repeating items. (line 6) * TODO keyword matching: Global TODO list. (line 17) * TODO keyword matching, with tags search: Tag searches. (line 40) * todo keyword sets: Multiple sets in one file. @@ -6876,8 +6957,8 @@ Key Index * C-a a L: Timeline. (line 10) * C-c !: Creating timestamps. (line 19) * C-c #: Checkboxes. (line 56) -* C-c %: Handling links. (line 79) -* C-c &: Handling links. (line 83) +* C-c %: Handling links. (line 81) +* C-c &: Handling links. (line 85) * C-c ': Editing and debugging formulas. (line 36) * C-c *: Updating the table. (line 13) @@ -6937,7 +7018,8 @@ Key Index (line 54) * C-c C-c: Plain lists. (line 78) * C-c C-d <1>: Agenda commands. (line 156) -* C-c C-d: Creating timestamps. (line 35) +* C-c C-d: Inserting deadline/schedule. + (line 9) * C-c C-e: Exporting. (line 19) * C-c C-e a: ASCII export. (line 9) * C-c C-e b: Export commands. (line 7) @@ -6946,20 +7028,22 @@ Key Index * C-c C-e h: 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 R: Export commands. (line 13) * C-c C-e t: Export options. (line 13) * C-c C-e v <1>: XOXO export. (line 11) * C-c C-e v: Sparse trees. (line 41) * C-c C-e v a: ASCII export. (line 13) -* C-c C-e v b: Export commands. (line 13) -* C-c C-e v H: Export commands. (line 13) -* C-c C-e v h: Export commands. (line 13) +* C-c C-e v b: Export commands. (line 18) +* C-c C-e v H: Export commands. (line 18) +* C-c C-e v h: Export commands. (line 18) +* C-c C-e v R: Export commands. (line 18) * C-c C-e x: XOXO export. (line 10) * C-c C-f: Motion. (line 12) * 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>: Creating timestamps. (line 31) -* C-c C-o: Handling links. (line 56) +* C-c C-o: Handling links. (line 58) * C-c C-p: Motion. (line 9) * C-c C-q <1>: Editing and debugging formulas. (line 50) @@ -6969,12 +7053,14 @@ Key Index (line 53) * C-c C-r: Visibility cycling. (line 34) * C-c C-s <1>: Agenda commands. (line 153) -* C-c C-s: Creating timestamps. (line 46) +* 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-u: Motion. (line 18) * C-c C-v: TODO basics. (line 26) -* C-c C-w: Creating timestamps. (line 39) +* C-c C-w: Inserting deadline/schedule. + (line 11) * 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 38) @@ -6984,9 +7070,9 @@ Key Index * C-c C-x C-k: Structure editing. (line 39) * C-c C-x C-l: Processing LaTeX fragments. (line 9) -* C-c C-x C-n: Handling links. (line 89) +* 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 89) +* 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-s: Moving subtrees. (line 10) * C-c C-x C-t: Custom time format. (line 12) @@ -7002,7 +7088,7 @@ Key Index (line 111) * C-c C-x M-w: Structure editing. (line 43) * C-c C-y <1>: Clocking work time. (line 22) -* C-c C-y: Creating timestamps. (line 64) +* C-c C-y: Creating timestamps. (line 48) * C-c l: Handling links. (line 9) * C-c { <1>: CDLaTeX mode. (line 21) * C-c {: Editing and debugging formulas. @@ -7024,7 +7110,7 @@ Key Index (line 14) * C-u C-c =: Field formulas. (line 24) * C-u C-c C-c: Updating the table. (line 19) -* C-u C-c C-l: Handling links. (line 41) +* C-u C-c C-l: Handling links. (line 43) * C-u C-c C-x C-a: ARCHIVE tag. (line 31) * C-u C-c C-x C-s: Moving subtrees. (line 12) * C-u C-c C-x C-u <1>: Dynamic blocks. (line 22) @@ -7098,11 +7184,11 @@ Key Index * mouse-1 <1>: Agenda commands. (line 33) * mouse-1 <2>: The date/time prompt. (line 36) -* mouse-1: Handling links. (line 70) +* mouse-1: Handling links. (line 72) * mouse-2 <1>: Agenda commands. (line 33) -* mouse-2: Handling links. (line 70) +* mouse-2: Handling links. (line 72) * mouse-3 <1>: Agenda commands. (line 28) -* mouse-3: Handling links. (line 75) +* mouse-3: Handling links. (line 77) * n: Agenda commands. (line 19) * O: Agenda commands. (line 180) * o: Agenda commands. (line 65) @@ -7116,7 +7202,7 @@ Key Index * S- <1>: Agenda commands. (line 149) * S- <2>: The date/time prompt. (line 45) -* S- <3>: Creating timestamps. (line 56) +* S- <3>: Creating timestamps. (line 40) * S- <4>: Priorities. (line 23) * S- <5>: Editing and debugging formulas. (line 67) @@ -7124,7 +7210,7 @@ Key Index * S- <1>: Agenda commands. (line 167) * S- <2>: The date/time prompt. (line 42) -* S- <3>: Creating timestamps. (line 51) +* S- <3>: Creating timestamps. (line 35) * S- <4>: Multiple sets in one file. (line 29) * S- <5>: TODO basics. (line 20) @@ -7135,7 +7221,7 @@ Key Index * S- <1>: Agenda commands. (line 159) * S- <2>: The date/time prompt. (line 39) -* S- <3>: Creating timestamps. (line 51) +* S- <3>: Creating timestamps. (line 35) * S- <4>: Multiple sets in one file. (line 29) * S- <5>: TODO basics. (line 20) @@ -7147,7 +7233,7 @@ Key Index * S- <1>: Agenda commands. (line 143) * S- <2>: The date/time prompt. (line 48) -* S- <3>: Creating timestamps. (line 56) +* S- <3>: Creating timestamps. (line 40) * S- <4>: Priorities. (line 23) * S- <5>: Editing and debugging formulas. (line 67) @@ -7162,190 +7248,192 @@ Key Index  Tag Table: Node: Top970 -Node: Introduction11580 -Node: Summary11995 -Node: Installation15004 -Node: Activation16382 -Node: Feedback17631 -Node: Document structure19707 -Node: Outlines20481 -Node: Headlines21141 -Ref: Headlines-Footnote-122149 -Node: Visibility cycling22248 -Ref: Visibility cycling-Footnote-124458 -Ref: Visibility cycling-Footnote-224516 -Ref: Visibility cycling-Footnote-324566 -Node: Motion24836 -Node: Structure editing25790 -Node: Archiving28616 -Node: ARCHIVE tag29174 -Node: Moving subtrees30967 -Node: Sparse trees32278 -Ref: Sparse trees-Footnote-134410 -Ref: Sparse trees-Footnote-234592 -Node: Plain lists34707 -Ref: Plain lists-Footnote-138476 -Ref: Plain lists-Footnote-238834 -Node: Tables39018 -Node: Built-in table editor39532 -Node: Narrow columns46771 -Ref: Narrow columns-Footnote-148704 -Node: orgtbl-mode48750 -Node: The spreadsheet49554 -Node: References50641 -Ref: References-Footnote-154770 -Node: Formula syntax for Calc55059 -Node: Formula syntax for Lisp57516 -Node: Field formulas58785 -Node: Column formulas60093 -Node: Editing and debugging formulas61692 -Node: Updating the table65845 -Node: Advanced features66880 -Node: Hyperlinks71405 -Node: Link format72178 -Node: Internal links73471 -Ref: Internal links-Footnote-175396 -Node: Radio targets75528 -Node: External links76219 -Node: Handling links78623 -Ref: Handling links-Footnote-183733 -Ref: Handling links-Footnote-283970 -Node: Link abbreviations84044 -Node: Search options85723 -Ref: Search options-Footnote-187503 -Node: Custom searches87584 -Node: Remember88632 -Node: Setting up remember89619 -Node: Remember templates90201 -Ref: Remember templates-Footnote-193493 -Node: Storing notes93591 -Node: TODO items95478 -Node: TODO basics96461 -Node: TODO extensions98158 -Node: Workflow states98977 -Ref: Workflow states-Footnote-1100152 -Node: TODO types100245 -Ref: TODO types-Footnote-1101828 -Node: Multiple sets in one file101910 -Node: Per file keywords103521 -Ref: Per file keywords-Footnote-1104810 -Node: Priorities105011 -Node: Breaking down tasks106257 -Ref: Breaking down tasks-Footnote-1106777 -Node: Checkboxes106873 -Node: Timestamps109628 -Node: Time stamps110162 -Ref: Time stamps-Footnote-1113656 -Ref: Time stamps-Footnote-2113772 -Node: Creating timestamps113927 -Node: The date/time prompt116585 -Ref: The date/time prompt-Footnote-1118546 -Node: Custom time format118652 -Node: Repeating items120210 -Node: Progress logging122020 -Node: Closing items122666 -Ref: Closing items-Footnote-1123600 -Ref: Closing items-Footnote-2123669 -Node: Tracking TODO state changes123742 -Node: Clocking work time124598 -Ref: Clocking work time-Footnote-1128244 -Ref: Clocking work time-Footnote-2128322 -Node: Tags128448 -Node: Tag inheritance129210 -Node: Setting tags130147 -Ref: Setting tags-Footnote-1134670 -Ref: Setting tags-Footnote-2134782 -Node: Tag searches134865 -Node: Agenda views137576 -Node: Agenda files139521 -Ref: Agenda files-Footnote-1140487 -Ref: Agenda files-Footnote-2140636 -Node: Agenda dispatcher140829 -Node: Built-in agenda views142520 -Node: Weekly/Daily agenda143098 -Node: Global TODO list145227 -Node: Matching headline tags147499 -Node: Timeline148570 -Node: Stuck projects149236 -Node: Presentation and sorting151087 -Node: Categories151878 -Node: Time-of-day specifications152542 -Node: Sorting of agenda items154513 -Node: Agenda commands155795 -Node: Custom agenda views162949 -Node: Storing searches163668 -Node: Block agenda165580 -Node: Setting Options166810 -Node: Exporting Agenda Views169549 -Ref: Exporting Agenda Views-Footnote-1173840 -Ref: Exporting Agenda Views-Footnote-2173897 -Node: Extracting Agenda Information for other programs174083 -Node: Embedded LaTeX178209 -Ref: Embedded LaTeX-Footnote-1179301 -Node: Math symbols179491 -Node: Subscripts and Superscripts180256 -Node: LaTeX fragments181100 -Ref: LaTeX fragments-Footnote-1183334 -Node: Processing LaTeX fragments183596 -Node: CDLaTeX mode184542 -Ref: CDLaTeX mode-Footnote-1187026 -Node: Exporting187174 -Node: ASCII export188488 -Node: HTML export189778 -Node: Export commands190397 -Node: Quoting HTML tags191208 -Node: Links191838 -Node: Images192535 -Ref: Images-Footnote-1193406 -Node: CSS support193467 -Ref: CSS support-Footnote-1194786 -Node: XOXO export194899 -Node: iCalendar export195338 -Node: Text interpretation196557 -Node: Comment lines197099 -Node: Initial text197494 -Node: Enhancing text199168 -Ref: Enhancing text-Footnote-1201030 -Node: Export options201120 -Node: Publishing203013 -Ref: Publishing-Footnote-1203809 -Node: Configuration204005 -Node: Project alist204723 -Node: Sources and destinations205789 -Node: Selecting files206519 -Node: Publishing action207267 -Node: Publishing options208500 -Node: Publishing links210652 -Node: Project page index212165 -Node: Sample configuration212943 -Node: Simple example213435 -Node: Complex example214108 -Node: Triggering publication216184 -Node: Miscellaneous216869 -Node: Completion217503 -Node: Customization218974 -Node: In-buffer settings219557 -Node: The very busy C-c C-c key224183 -Node: Clean view225827 -Node: TTY keys228404 -Node: Interaction230014 -Node: Cooperation230411 -Node: Conflicts233153 -Node: Bugs234716 -Node: Extensions and Hacking236212 -Node: Extensions236808 -Node: Tables in arbitrary syntax238755 -Node: Radio tables239832 -Node: A LaTeX example242335 -Ref: A LaTeX example-Footnote-1245981 -Ref: A LaTeX example-Footnote-2246129 -Node: Translator functions246564 -Ref: Translator functions-Footnote-1249673 -Node: Dynamic blocks249761 -Node: Special agenda views251733 -Ref: Special agenda views-Footnote-1254012 -Node: History and Acknowledgments254272 -Node: Index260132 -Node: Key Index291936 +Node: Introduction11627 +Node: Summary12042 +Node: Installation15051 +Node: Activation16429 +Node: Feedback17678 +Node: Document structure19754 +Node: Outlines20528 +Node: Headlines21188 +Ref: Headlines-Footnote-122196 +Node: Visibility cycling22295 +Ref: Visibility cycling-Footnote-124505 +Ref: Visibility cycling-Footnote-224563 +Ref: Visibility cycling-Footnote-324613 +Node: Motion24883 +Node: Structure editing25837 +Node: Archiving28663 +Node: ARCHIVE tag29221 +Node: Moving subtrees31014 +Node: Sparse trees32325 +Ref: Sparse trees-Footnote-134457 +Ref: Sparse trees-Footnote-234639 +Node: Plain lists34754 +Ref: Plain lists-Footnote-138523 +Ref: Plain lists-Footnote-238881 +Node: Tables39065 +Node: Built-in table editor39579 +Node: Narrow columns46818 +Ref: Narrow columns-Footnote-148751 +Node: orgtbl-mode48797 +Node: The spreadsheet49601 +Node: References50688 +Ref: References-Footnote-154817 +Node: Formula syntax for Calc55106 +Node: Formula syntax for Lisp57563 +Node: Field formulas58832 +Node: Column formulas60140 +Node: Editing and debugging formulas61739 +Node: Updating the table65892 +Node: Advanced features66927 +Node: Hyperlinks71452 +Node: Link format72225 +Node: Internal links73518 +Ref: Internal links-Footnote-175443 +Node: Radio targets75575 +Node: External links76266 +Node: Handling links78670 +Ref: Handling links-Footnote-183957 +Ref: Handling links-Footnote-284194 +Node: Link abbreviations84268 +Node: Search options85947 +Ref: Search options-Footnote-187727 +Node: Custom searches87808 +Node: Remember88856 +Node: Setting up remember89843 +Node: Remember templates90425 +Ref: Remember templates-Footnote-193717 +Node: Storing notes93815 +Node: TODO items95702 +Node: TODO basics96685 +Node: TODO extensions98382 +Node: Workflow states99201 +Ref: Workflow states-Footnote-1100376 +Node: TODO types100469 +Ref: TODO types-Footnote-1102052 +Node: Multiple sets in one file102134 +Node: Per file keywords103745 +Ref: Per file keywords-Footnote-1105034 +Node: Priorities105235 +Node: Breaking down tasks106845 +Ref: Breaking down tasks-Footnote-1107365 +Node: Checkboxes107461 +Node: Timestamps110216 +Node: Time stamps110657 +Ref: Time stamps-Footnote-1112962 +Node: Creating timestamps113078 +Node: The date/time prompt115152 +Ref: The date/time prompt-Footnote-1117140 +Node: Custom time format117246 +Node: Deadlines and scheduling118794 +Ref: Deadlines and scheduling-Footnote-1120144 +Node: Inserting deadline/schedule120299 +Node: Repeated tasks121237 +Node: Progress logging122876 +Node: Closing items123531 +Ref: Closing items-Footnote-1124465 +Ref: Closing items-Footnote-2124534 +Node: Tracking TODO state changes124607 +Node: Clocking work time125463 +Ref: Clocking work time-Footnote-1129109 +Ref: Clocking work time-Footnote-2129187 +Node: Tags129313 +Node: Tag inheritance130075 +Node: Setting tags131012 +Ref: Setting tags-Footnote-1135535 +Ref: Setting tags-Footnote-2135647 +Node: Tag searches135730 +Node: Agenda views138441 +Node: Agenda files140386 +Ref: Agenda files-Footnote-1141352 +Ref: Agenda files-Footnote-2141501 +Node: Agenda dispatcher141694 +Node: Built-in agenda views143385 +Node: Weekly/Daily agenda143963 +Node: Global TODO list146904 +Node: Matching headline tags149176 +Node: Timeline150247 +Node: Stuck projects150913 +Node: Presentation and sorting152764 +Node: Categories153555 +Node: Time-of-day specifications154219 +Node: Sorting of agenda items156190 +Node: Agenda commands157472 +Node: Custom agenda views164626 +Node: Storing searches165345 +Node: Block agenda167257 +Node: Setting Options168487 +Node: Exporting Agenda Views171226 +Ref: Exporting Agenda Views-Footnote-1175517 +Ref: Exporting Agenda Views-Footnote-2175574 +Node: Extracting Agenda Information for other programs175760 +Node: Embedded LaTeX179886 +Ref: Embedded LaTeX-Footnote-1180978 +Node: Math symbols181168 +Node: Subscripts and Superscripts181933 +Node: LaTeX fragments182777 +Ref: LaTeX fragments-Footnote-1185011 +Node: Processing LaTeX fragments185273 +Node: CDLaTeX mode186219 +Ref: CDLaTeX mode-Footnote-1188703 +Node: Exporting188851 +Node: ASCII export190165 +Node: HTML export191455 +Node: Export commands192074 +Node: Quoting HTML tags193318 +Node: Links193948 +Node: Images194645 +Ref: Images-Footnote-1195516 +Node: CSS support195577 +Ref: CSS support-Footnote-1196896 +Node: XOXO export197009 +Node: iCalendar export197448 +Node: Text interpretation198667 +Node: Comment lines199209 +Node: Initial text199604 +Node: Enhancing text201278 +Ref: Enhancing text-Footnote-1203140 +Node: Export options203230 +Node: Publishing205123 +Ref: Publishing-Footnote-1205919 +Node: Configuration206115 +Node: Project alist206833 +Node: Sources and destinations207899 +Node: Selecting files208629 +Node: Publishing action209377 +Node: Publishing options210610 +Node: Publishing links212762 +Node: Project page index214275 +Node: Sample configuration215053 +Node: Simple example215545 +Node: Complex example216218 +Node: Triggering publication218294 +Node: Miscellaneous218979 +Node: Completion219613 +Node: Customization221084 +Node: In-buffer settings221667 +Node: The very busy C-c C-c key226543 +Node: Clean view228187 +Node: TTY keys230764 +Node: Interaction232374 +Node: Cooperation232771 +Node: Conflicts235513 +Node: Bugs237076 +Node: Extensions and Hacking238572 +Node: Extensions239168 +Node: Tables in arbitrary syntax241115 +Node: Radio tables242192 +Node: A LaTeX example244695 +Ref: A LaTeX example-Footnote-1248341 +Ref: A LaTeX example-Footnote-2248489 +Node: Translator functions248924 +Ref: Translator functions-Footnote-1252033 +Node: Dynamic blocks252121 +Node: Special agenda views254093 +Ref: Special agenda views-Footnote-1256372 +Node: History and Acknowledgments256632 +Node: Index262726 +Node: Key Index294515  End Tag Table diff --git a/org-install.el b/org-install.el index 1489a3f5a..31b626cd3 100644 --- a/org-install.el +++ b/org-install.el @@ -22,6 +22,7 @@ (autoload 'org-export-icalendar-combine-agenda-files "org" "Export all files in `org-agenda-files' to a single combined iCalendar file." t) (autoload 'org-batch-agenda "org") +(autoload 'org-batch-agenda-csv "org") (autoload 'org-store-agenda-views "org" "Store agenda views to files" t) (autoload 'org-batch-store-agenda-views "org") diff --git a/org.el b/org.el index 2005e3378..9cce6e9c2 100644 --- a/org.el +++ b/org.el @@ -5,7 +5,7 @@ ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/ -;; Version: 4.74 +;; Version: 4.75 ;; ;; This file is part of GNU Emacs. ;; @@ -83,7 +83,7 @@ ;;; Version -(defconst org-version "4.74" +(defconst org-version "4.75" "The version number of the file org.el.") (defun org-version () (interactive) @@ -273,7 +273,9 @@ An entry can be toggled between QUOTE and normal with :group 'org-keywords :type 'string) -(defvar org-repeat-re "\\\n]*\\)\\(\\+[0-9]+[dwmy]\\)") "Regular expression for specifying repeated events. After a match, group 1 contains the repeat expression.") @@ -404,6 +406,7 @@ nil Never white Only in completely white lines whitestart Only at the beginning of lines, before the first non-white char. t Everywhere except in headlines +exc-hl-bol Everywhere except at the start of a headline If TAB is used in a place where it does not emulate TAB, the current subtree visibility is cycled." :group 'org-cycle @@ -411,6 +414,7 @@ visibility is cycled." (const :tag "Only in completely white lines" white) (const :tag "Before first char in a line" whitestart) (const :tag "Everywhere except in headlines" t) + (const :tag "Everywhere except at bol in headlines" exc-hl-bol) )) (defcustom org-cycle-separator-lines 2 @@ -904,7 +908,7 @@ Automatically means, when TAB or RET or C-c C-c are pressed in the line." :group 'org) (defvar org-link-abbrev-alist-local nil - "buffer-local version of `org-link-abbrev-alist', which see. + "Buffer-local version of `org-link-abbrev-alist', which see. The value of this is taken from the #+LINK lines.") (make-variable-buffer-local 'org-link-abbrev-alist-local) @@ -1506,15 +1510,6 @@ empty string. state) string) (cons (const :tag "Heading when clocking out" clock-out) string))) -(defcustom org-allow-auto-repeat t - "Non-nil means, find REPEAT cookies in entries and apply them. -A repeat cookie looks like REPEAT(+1m) and causes deadlines and schedules -to repeat themselves shifted by a certain amount of time, each time an -entry is marked DONE." - :group 'org-todo - :group 'org-progress - :type 'boolean) - (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." @@ -1527,14 +1522,21 @@ When nil, no note will be taken." :tag "Org Priorities" :group 'org-todo) -(defcustom org-default-priority ?B - "The default priority of TODO items. -This is the priority an item get if no explicit priority is given." +(defcustom org-highest-priority ?A + "The highest priority of TODO items. A character like ?A, ?B etc. +Must have a smaller ASCII number than `org-lowest-priority'." :group 'org-priorities :type 'character) (defcustom org-lowest-priority ?C - "The lowest priority of TODO items. A character like ?A, ?B etc." + "The lowest priority of TODO items. A character like ?A, ?B etc. +Must have a larger ASCII number than `org-highest-priority'." + :group 'org-priorities + :type 'character) + +(defcustom org-default-priority ?B + "The default priority of TODO items. +This is the priority an item get if no explicit priority is given." :group 'org-priorities :type 'character) @@ -1772,6 +1774,45 @@ This is a good place to set uptions for ps-print and for htmlize." (variable) (sexp :tag "Value")))) +(defcustom org-agenda-export-html-style "" + "The style specification for exported HTML Agenda files. +If this variable contains a string, it will replace the default + +or, if you want to keep the style in a file, + + + +As the value of this option simply gets inserted into the HTML header, +you can \"misuse\" it to also add other text to the header. However, + is required, if not present the variable will be ignored." + :group 'org-agenda-export + :group 'org-export-html + :type 'string) + (defgroup org-agenda-custom-commands nil "Options concerning agenda views in Org-mode." :tag "Org Agenda Custom Commands" @@ -2708,6 +2749,7 @@ you can \"misuse\" it to add arbitrary text to the header." :group 'org-export-html :type 'string) + (defcustom org-export-html-title-format "

%s

\n" "Format for typesetting the document title in HTML export." :group 'org-export-html @@ -2804,6 +2846,12 @@ The file name should be absolute." (const :tag "Unfinished" t) (const :tag "All" all))) +(defcustom org-icalendar-include-sexps t + "Non-nil means, export to iCalendar files should also cover sexp entries. +These are entries like in the diary, but directly in an Org-mode file." + :group 'org-export-icalendar + :type 'boolean) + (defcustom org-icalendar-combined-name "OrgMode" "Calendar name for the combined iCalendar representing all agenda files." :group 'org-export-icalendar @@ -2930,11 +2978,11 @@ Use customize to modify this, or restart Emacs after changing it." ("_" underline "" "") ("=" shadow "" "") ("+" (:strike-through t) "" "") -) + ) "Special syntax for emphasized text. Text starting and ending with a special character will be emphasized, for example *bold*, _underlined_ and /italic/. This variable sets the marker -characters, the face to bbe used by font-lock for highlighting in Org-mode +characters, the face to be used by font-lock for highlighting in Org-mode Emacs buffers, and the HTML tags to be used for this. Use customize to modify this, or restart Emacs after changing it." :group 'org-font-lock @@ -3106,6 +3154,13 @@ color of the frame." "Face for links." :group 'org-faces) +(defface org-sexp-date + '((((class color) (background light)) (:foreground "Purple")) + (((class color) (background dark)) (:foreground "Cyan")) + (t (:underline t))) + "Face for links." + :group 'org-faces) + (defface org-tag '((t (:bold t))) "Face for tags." @@ -3161,6 +3216,17 @@ to the part of the headline after the DONE keyword." "Face for formulas." :group 'org-faces) +(defface org-agenda-structure ;; font-lock-function-name-face + (org-compatible-face + '((((class color) (min-colors 88) (background light)) (:foreground "Blue1")) + (((class color) (min-colors 88) (background dark)) (:foreground "LightSkyBlue")) + (((class color) (min-colors 16) (background light)) (:foreground "Blue")) + (((class color) (min-colors 16) (background dark)) (:foreground "LightSkyBlue")) + (((class color) (min-colors 8)) (:foreground "blue" :bold t)) + (t (:bold t)))) + "Face used in agenda for captions and dates." + :group 'org-faces) + (defface org-scheduled-today (org-compatible-face '((((class color) (min-colors 88) (background light)) (:foreground "DarkGreen")) @@ -3346,9 +3412,9 @@ means to push this value onto the list in the variable.") (org-set-local 'org-todo-sets nil) (let ((re (org-make-options-regexp '("CATEGORY" "SEQ_TODO" "PRI_TODO" "TYP_TODO" - "STARTUP" "ARCHIVE" "TAGS" "LINK"))) + "STARTUP" "ARCHIVE" "TAGS" "LINK" "PRIORITIES"))) (splitre "[ \t]+") - kwds key value cat arch tags links hw dws tail sep kws1) + kwds key value cat arch tags links hw dws tail sep kws1 prio) (save-excursion (save-restriction (widen) @@ -3371,6 +3437,8 @@ means to push this value onto the list in the variable.") (push (cons (match-string 1 value) (org-trim (match-string 2 value))) links))) + ((equal key "PRIORITIES") + (setq prio (org-split-string " +" value))) ((equal key "STARTUP") (let ((opts (org-split-string value splitre)) l var val) @@ -3390,6 +3458,12 @@ means to push this value onto the list in the variable.") '(face t fontified t) arch))) ))) (and cat (org-set-local 'org-category cat)) + (when prio + (if (< (length prio) 3) (setq prio '("A" "C" "B"))) + (setq prio (mapcar 'string-to-char prio)) + (org-set-local 'org-highest-priority (aref (nth 0 prio) 0)) + (org-set-local 'org-lowest-priority (aref (nth 1 prio) 0)) + (org-set-local 'org-default-priority (aref (nth 2 prio) 0))) (and arch (org-set-local 'org-archive-location arch)) (and links (setq org-link-abbrev-alist-local (nreverse links))) ;; Process the TODO keywords @@ -3490,7 +3564,7 @@ means to push this value onto the list in the variable.") "\\|" org-deadline-string "\\|" org-closed-string "\\|" org-clock-string "\\)\\)?" - " *\\([[<][0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}[^]\r\n>]*?[]>]\\)") + " *\\([[<][0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [^]\r\n>]*?[]>]\\|<%%([^\r\n>]*>\\)") org-planning-or-clock-line-re (concat "\\(?:^[ \t]*\\(" org-scheduled-string "\\|" org-deadline-string @@ -3855,7 +3929,7 @@ that will be added to PLIST. Returns the string that was modified." (require 'font-lock) (defconst org-non-link-chars "]\t\n\r<>") -(defconst org-link-types '("https?" "ftp" "mailto" "file" "news" "bbdb" "vm" +(defconst org-link-types '("http" "https" "ftp" "mailto" "file" "news" "bbdb" "vm" "wl" "mhe" "rmail" "gnus" "shell" "info" "elisp")) (defconst org-link-re-with-space (concat @@ -3914,15 +3988,15 @@ that will be added to PLIST. Returns the string that was modified." (cons (length (format-time-string (car org-time-stamp-formats))) (length (format-time-string (cdr org-time-stamp-formats)))) "This holds the lengths of the two different time formats.") -(defconst org-ts-regexp "<\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}[^\r\n>]*?\\)>" +(defconst org-ts-regexp "<\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [^\r\n>]*?\\)>" "Regular expression for fast time stamp matching.") -(defconst org-ts-regexp-both "[[<]\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}[^\r\n>]*?\\)[]>]" +(defconst org-ts-regexp-both "[[<]\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [^\r\n>]*?\\)[]>]" "Regular expression for fast time stamp matching.") -(defconst org-ts-regexp1 "\\(\\([0-9]\\{4\\}\\)-\\([0-9]\\{2\\}\\)-\\([0-9]\\{2\\}\\)\\([^]0-9>\r\n]*\\)\\(\\([0-9]\\{2\\}\\):\\([0-9]\\{2\\}\\)\\)?\\)" +(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 ">") +(defconst org-ts-regexp2 (concat "<" org-ts-regexp1 "[^>\n]\\{0,5\\}>") "Regular expression matching time stamps, with groups.") -(defconst org-ts-regexp3 (concat "[[<]" org-ts-regexp1 "[]>]") +(defconst org-ts-regexp3 (concat "[[<]" org-ts-regexp1 "[^>\n]\\{0,5\\}[]>]") "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.") @@ -3956,6 +4030,57 @@ The time stamps may be either active or inactive.") (backward-char 1)))) rtn)) +(defun org-emphasize (&optional char) + "Insert or change an emphasis, i.e. a font like bold or italic. +If there is an active region, change that region to a new emphasis. +If there is no region, just insert the marker characters and position +the cursor between them. +CHAR should be either the marker character, or the first character of the +HTML tag associated with that emphasis. If CHAR is a space, the means +to remove the emphasis of the selected region. +If char is not given (for example in an interactive call) it +will be prompted for." + (interactive) + (let ((eal org-emphasis-alist) e det + (erc org-emphasis-regexp-components) + (prompt "") + (string "") beg end move tag c s) + (if (org-region-active-p) + (setq beg (region-beginning) end (region-end) + string (buffer-substring beg end)) + (setq move t)) + + (while (setq e (pop eal)) + (setq tag (car (org-split-string (nth 2 e) "[ <>/]+")) + c (aref tag 0)) + (push (cons c (string-to-char (car e))) det) + (setq prompt (concat prompt (format " [%s%c]%s" (car e) c + (substring tag 1))))) + (unless char + (message "%s" (concat "Emphasis marker or tag:" prompt)) + (setq char (read-char-exclusive))) + (setq char (or (cdr (assoc char det)) char)) + (if (equal char ?\ ) + (setq s "" move nil) + (unless (assoc (char-to-string char) org-emphasis-alist) + (error "No such emphasis marker: \"%c\"" char)) + (setq s (char-to-string char))) + (while (and (> (length string) 1) + (equal (substring string 0 1) (substring string -1)) + (assoc (substring string 0 1) org-emphasis-alist)) + (setq string (substring string 1 -1))) + (setq string (concat s string s)) + (if beg (delete-region beg end)) + (unless (or (bolp) + (string-match (concat "[" (nth 0 erc) "\n]") + (char-to-string (char-before (point))))) + (insert " ")) + (unless (string-match (concat "[" (nth 1 erc) "\n]") + (char-to-string (char-after (point)))) + (insert " ") (backward-char 1)) + (insert string) + (and move (backward-char 1)))) + (defun org-activate-plain-links (limit) "Run through the buffer and add overlays to links." (catch 'exit @@ -4145,12 +4270,13 @@ between words." (if (memq 'bracket lk) '(org-activate-bracket-links (0 'org-link t))) (if (memq 'radio lk) '(org-activate-target-links (0 'org-link t))) (if (memq 'date lk) '(org-activate-dates (0 'org-date t))) + '("^&?%%(.*\\|<%%([^>\n]*?>" (0 'org-sexp-date t)) '(org-hide-wide-columns (0 nil append)) ;; TODO lines (list (concat "^\\*+[ \t]*" org-not-done-regexp) '(1 'org-todo t)) ;; Priorities - (list (concat "\\[#[A-Z]\\]") '(0 'org-special-keyword t)) + (list (concat "\\[#[A-Z0-9]\\]") '(0 'org-special-keyword t)) ;; Special keywords (list org-repeat-re '(0 'org-special-keyword t)) (list (concat "\\<" org-deadline-string) '(0 'org-special-keyword t)) @@ -4325,7 +4451,8 @@ between words." (- (funcall outline-level) arg))) (org-show-subtree))) - ((save-excursion (beginning-of-line 1) (looking-at outline-regexp)) + ((and (save-excursion (beginning-of-line 1) (looking-at outline-regexp)) + (or (bolp) (not (eq org-cycle-emulate-tab 'exc-hl-bol)))) ;; At a heading: rotate between three different views (org-back-to-heading) (let ((goal-column 0) eoh eol eos) @@ -4374,6 +4501,11 @@ between words." ((org-try-cdlatex-tab)) + ((and (eq org-cycle-emulate-tab 'exc-hl-bol) + (or (not (bolp)) + (not (looking-at outline-regexp)))) + (call-interactively (global-key-binding "\t"))) + ((if (and (memq org-cycle-emulate-tab '(white whitestart)) (save-excursion (beginning-of-line 1) (looking-at "[ \t]*")) (or (and (eq org-cycle-emulate-tab 'white) @@ -4388,8 +4520,8 @@ between words." (progn (beginning-of-line 1) (and (looking-at "[ \t]+") (replace-match "")))) - (indent-relative)) - + (call-interactively (global-key-binding "\t"))) + (t (save-excursion (org-back-to-heading) (org-cycle)))))) @@ -4483,7 +4615,15 @@ are at least `org-cycle-separator-lines' empty lines before the headeline." (while (re-search-forward re end t) (if (not (get-char-property (match-end 1) 'invisible)) (outline-flag-region - (match-beginning 1) (match-end 1) nil)))))))) + (match-beginning 1) (match-end 1) nil))))))) + ;; Never hide empty lines at the end of the file. + (save-excursion + (goto-char (point-max)) + (outline-previous-heading) + (outline-end-of-heading) + (if (and (looking-at "[ \t\n]+") + (= (match-end 0) (point-max))) + (outline-flag-region (point) (match-end 0) nil)))) (defun org-subtree-end-visible-p () "Is the end of the current subtree visible?" @@ -5021,7 +5161,9 @@ This is a short-hand for marking the subtree and then copying it. If CUT is non-nil, actually cut the subtree." (interactive) (let (beg end folded) - (org-back-to-heading) + (if (interactive-p) + (org-back-to-heading nil) ; take what looks like a subtree + (org-back-to-heading t)) ; take what is really there (setq beg (point)) (save-match-data (save-excursion (outline-end-of-heading) @@ -10061,8 +10203,18 @@ With three \\[universal-argument] prefixes, negate the meaning of ;; Fake a link history (setq tmphist (append (mapcar 'car org-stored-links) org-insert-link-history)) +; (setq link (org-completing-read +; "Link: " org-stored-links nil nil nil +; 'tmphist +; (or (car (car org-stored-links))))) (setq link (org-completing-read - "Link: " org-stored-links nil nil nil + "Link: " + (append + (mapcar (lambda (x) (concat (car x) ":")) + (append org-link-abbrev-alist-local org-link-abbrev-alist)) + (mapcar (lambda (x) (concat x ":")) org-link-types)) +; org-stored-links + nil nil nil 'tmphist (or (car (car org-stored-links))))) (setq entry (assoc link org-stored-links)) @@ -10656,7 +10808,7 @@ onto the ring." (funcall (cdr (assq 'gnus org-link-frame-setup))) (if gnus-other-frame-object (select-frame gnus-other-frame-object)) (cond ((and group article) - (gnus-group-read-group 0 nil group) + (gnus-group-read-group 1 nil group) (gnus-summary-goto-article (string-to-number article) nil t)) (group (gnus-group-jump-to-group group)))) @@ -11224,7 +11376,7 @@ See also the variable `org-reverse-note-order'." (re-search-forward "^\\*" nil t) (beginning-of-line 1) (org-paste-subtree 1 txt))) - ((and (org-on-heading-p nil) (not current-prefix-arg)) + ((and (org-on-heading-p t) (not current-prefix-arg)) ;; Put it below this entry, at the beg/end of the subtree (org-back-to-heading t) (setq level (funcall outline-level)) @@ -11637,7 +11789,7 @@ right sequence." (t (nth 2 (assoc kwd org-todo-kwd-alist)))))) (defun org-get-repeat () - "Return the REPEAT statement of this entry." + "Check if tere is a deadline/schedule with repeater in this entry." (save-match-data (save-excursion (org-back-to-heading t) @@ -11648,9 +11800,9 @@ right sequence." (defvar org-last-changed-timestamp) (defvar org-log-post-message) (defun org-auto-repeat-maybe () - "Check if the current headline contains a REPEAT key. -If yes, set TODO state back to what it was and change any SCHEDULED -or DEADLINE times the new date. + "Check if the current headline contains a repeated deadline/schedule. +If yes, set TODO state back to what it was and change the base date +of repeating deadline/scheduled time stamps to new date. This function should be run in the `org-after-todo-state-change-hook'." ;; last-state is dynamically scoped into this function (let* ((repeat (org-get-repeat)) @@ -11661,7 +11813,7 @@ This function should be run in the `org-after-todo-state-change-hook'." (whata '(("d" . day) ("m" . month) ("y" . year))) (msg "Entry repeats: ") (org-log-done) - re type n what start) + re type n what ts) (when repeat (org-todo (if (eq interpret 'type) last-state head)) (when (and org-log-repeat @@ -11678,11 +11830,10 @@ This function should be run in the `org-after-todo-state-change-hook'." (while (re-search-forward re (save-excursion (outline-next-heading) (point)) t) (setq type (if (match-end 1) org-scheduled-string org-deadline-string) - start 0) - (while (string-match "\\([-+]?[0-9]+\\)\\([dwmy]\\)" repeat start) - (setq start (match-end 0) - n (string-to-number (match-string 1 repeat)) - what (match-string 2 repeat)) + ts (match-string (if (match-end 2) 2 4))) + (when (string-match "\\([-+]?[0-9]+\\)\\([dwmy]\\)" ts) + (setq n (string-to-number (match-string 1 ts)) + what (match-string 2 ts)) (if (equal what "w") (setq n (* n 7) what "d")) (org-timestamp-change n (cdr (assoc what whata)))) (setq msg (concat msg type org-last-changed-timestamp " "))) @@ -11983,7 +12134,7 @@ from the `before-change-functions' in the current buffer." ;;;; Priorities -(defvar org-priority-regexp ".*?\\(\\[#\\([A-Z]\\)\\] ?\\)" +(defvar org-priority-regexp ".*?\\(\\[#\\([A-Z0-9]\\)\\] ?\\)" "Regular expression matching the priority indicator.") (defvar org-remove-priority-next-time nil) @@ -12012,18 +12163,18 @@ ACTION can be set, up, or down." (setq current org-default-priority)) (cond ((eq action 'set) - (message "Priority A-%c, SPC to remove: " org-lowest-priority) + (message "Priority %c-%c, SPC to remove: " org-highest-priority org-lowest-priority) (setq new (read-char-exclusive)) (cond ((equal new ?\ ) (setq remove t)) - ((or (< (upcase new) ?A) (> (upcase new) org-lowest-priority)) + ((or (< (upcase new) org-highest-priority) (> (upcase new) org-lowest-priority)) (error "Priority must be between `%c' and `%c'" - ?A org-lowest-priority)))) + org-highest-priority org-lowest-priority)))) ((eq action 'up) (setq new (1- current))) ((eq action 'down) (setq new (1+ current))) (t (error "Invalid action"))) - (setq new (min (max ?A (upcase new)) org-lowest-priority)) + (setq new (min (max org-highest-priority (upcase new)) org-lowest-priority)) (setq news (format "%c" new)) (if have (if remove @@ -12801,7 +12952,7 @@ This is used by `org-read-date' in a temporary keymap for the calendar buffer." (setq org-ans1 (format-time-string "%Y-%m-%d" time))) (if (active-minibuffer-window) (exit-minibuffer)))) -(defun org-insert-time-stamp (time &optional with-hm inactive pre post) +(defun org-insert-time-stamp (time &optional with-hm inactive pre post extra) "Insert a date stamp for the date given by the internal TIME. WITH-HM means, use the stamp format that includes the time of the day. INACTIVE means use square brackets instead of angular ones, so that the @@ -12814,6 +12965,10 @@ The command returns the inserted time stamp." (if inactive (setq fmt (concat "[" (substring fmt 1 -1) "]"))) (insert (or pre "")) (insert (setq stamp (format-time-string fmt time))) + (when extra + (backward-char 1) + (insert extra) + (forward-char 1)) (insert (or post "")) stamp)) @@ -12838,6 +12993,7 @@ The command returns the inserted time stamp." (message "Time stamps are overlayed with custom format") (message "Time stamp overlays removed"))) +;; FIXME: do something about the repeaters (defun org-display-custom-time (beg end) "Overlay modified time stamp format over timestamp between BED and END." (let* ((t1 (save-match-data @@ -13014,6 +13170,133 @@ days in order to avoid rounding problems." (defun org-time-string-to-time (s) (apply 'encode-time (org-parse-time-string s))) +(defun org-time-string-to-absolute (s &optional daynr) + "Convert a time stamp to an absolute day number. +If there is a specifyer for a cyclic time stamp, get the closest date to +DATE." + (cond + ((and daynr (string-match "\\`%%\\((.*)\\)" s)) + (if (org-diary-sexp-entry (match-string 1 s) "" date) + daynr + (+ daynr 1000))) + ((and daynr (string-match "\\+[0-9]+[dwmy]" s)) + (org-closest-date s (if (and (boundp 'daynr) (integerp daynr)) daynr + (time-to-days (current-time))) (match-string 0 s))) + (t (time-to-days (apply 'encode-time (org-parse-time-string s)))))) + +(defun org-calendar-holiday () + "List of holidays, for Diary display in Org-mode." + (let ((hl (check-calendar-holidays date))) + (if hl (mapconcat 'identity hl "; ")))) + +(defun org-diary-sexp-entry (sexp entry date) + "Process a SEXP diary ENTRY for DATE." + (let ((result (if calendar-debug-sexp + (let ((stack-trace-on-error t)) + (eval (car (read-from-string sexp)))) + (condition-case nil + (eval (car (read-from-string sexp))) + (error + (beep) + (message "Bad sexp at line %d in %s: %s" + (org-current-line) + (buffer-file-name) sexp) + (sleep-for 2)))))) + (cond ((stringp result) result) + ((and (consp result) + (stringp (cdr result))) (cdr result)) + (result entry) + (t nil)))) + +(defun org-diary-to-ical-string (frombuf) + "FIXME" + (let* ((tmpdir (if (featurep 'xemacs) + (temp-directory) + temporary-file-directory)) + (tmpfile (make-temp-name + (expand-file-name "orgics" tmpdir))) + buf rtn b e) + (save-excursion + (set-buffer frombuf) + (icalendar-export-region (point-min) (point-max) tmpfile) + (setq buf (find-buffer-visiting tmpfile)) + (set-buffer buf) + (goto-char (point-min)) + (if (re-search-forward "^BEGIN:VEVENT" nil t) + (setq b (match-beginning 0))) + (goto-char (point-max)) + (if (re-search-backward "^END:VEVENT" nil t) + (setq e (match-end 0))) + (setq rtn (if (and b e) (concat (buffer-substring b e) "\n") ""))) + (kill-buffer buf) + (kill-buffer frombuf) + (delete-file tmpfile) + rtn)) + +(defun org-closest-date (start current change) + "Find the date closest to CURRENT that is consistent with START and CHANGE." + ;; Make the proper lists from the dates + (catch 'exit + (let ((a1 '(("d" . day) ("w" . week) ("m" . month) ("y" . year))) + dn dw sday cday n1 n2 + d m y y1 y2 date1 date2 nmonths nm ny m2) + + (setq start (org-date-to-gregorian start) + current (org-date-to-gregorian current) + sday (calendar-absolute-from-gregorian start) + cday (calendar-absolute-from-gregorian current)) + + (if (<= cday sday) (throw 'exit sday)) + + (if (string-match "\\(\\+[0-9]+\\)\\([dwmy]\\)" change) + (setq dn (string-to-number (match-string 1 change)) + dw (cdr (assoc (match-string 2 change) a1))) + (error "Invalid change specifyer: %s" change)) + (if (eq dw 'week) (setq dw 'day dn (* 7 dn))) + (cond + ((eq dw 'day) + (setq n1 (+ sday (* dn (floor (/ (- cday sday) dn)))) + n2 (+ n1 dn))) + ((eq dw 'year) + (setq d (nth 1 start) m (car start) y1 (nth 2 start) y2 (nth 2 current)) + (setq y1 (+ (* (floor (/ (- y2 y1) dn)) dn) y1)) + (setq date1 (list m d y1) + n1 (calendar-absolute-from-gregorian date1) + date2 (list m d (+ y1 (* (if (< n1 cday) 1 -1) dn))) + n2 (calendar-absolute-from-gregorian date2))) + ((eq dw 'month) + ;; approx number of month between the tow dates + (setq nmonths (floor (/ (- cday sday) 30.436875))) + ;; How often does dn fit in there? + (setq d (nth 1 start) m (car start) y (nth 2 start) + nm (* dn (max 0 (1- (floor (/ nmonths dn))))) + m (+ m nm) + ny (floor (/ m 12)) + y (+ y ny) + m (- m (* ny 12))) + (while (> m 12) (setq m (- m 12) y (1+ y))) + (setq n1 (calendar-absolute-from-gregorian (list m d y))) + (setq m2 (+ m dn) y2 y) + (if (> m2 12) (setq y2 (1+ y2) m2 (- m2 12))) + (setq n2 (calendar-absolute-from-gregorian (list m2 d y2))) + (while (< n2 cday) + (setq n1 n2 m m2 y y2) + (setq m2 (+ m dn) y2 y) + (if (> m2 12) (setq y2 (1+ y2) m2 (- m2 12))) + (setq n2 (calendar-absolute-from-gregorian (list m2 d y2)))))) + + (if (> (abs (- cday n1)) (abs (- cday n2))) n2 n1)))) + +(defun org-date-to-gregorian (date) + "Turn any specification of DATE into a gregorian date for the calendar." + (cond ((integerp date) (calendar-gregorian-from-absolute date)) + ((and (listp date) (= (length date) 3)) date) + ((stringp date) + (setq date (org-parse-time-string date)) + (list (nth 4 date) (nth 3 date) (nth 5 date))) + ((listp date) + (list (nth 4 date) (nth 3 date) (nth 5 date))))) + (defun org-parse-time-string (s &optional nodefault) "Parse the standard Org-mode time string. This should be a lot faster than the normal `parse-time-string'. @@ -13101,6 +13384,7 @@ in the timestamp determines what will be changed." (let ((pos (point)) with-hm inactive org-ts-what + extra ts time time0) (if (not (org-at-timestamp-p t)) (error "Not at a timestamp")) @@ -13116,6 +13400,8 @@ in the timestamp determines what will be changed." inactive (= (char-after (match-beginning 0)) ?\[) ts (match-string 0)) (replace-match "") + (if (string-match " \\+[0-9]+[dwmy]" ts) + (setq extra (match-string 0 ts))) (setq time0 (org-parse-time-string ts)) (setq time (apply 'encode-time @@ -13141,7 +13427,7 @@ in the timestamp determines what will be changed." (setcar (nthcdr 2 time0) (or (nth 1 time0) 0)) (setq time (apply 'encode-time time0)))) (setq org-last-changed-timestamp - (org-insert-time-stamp time with-hm inactive)) + (org-insert-time-stamp time with-hm inactive nil nil extra)) (org-clock-update-time-maybe) (goto-char pos) ;; Try to recenter the calendar window, if any @@ -13198,8 +13484,8 @@ If there is already a time stamp at the cursor position, update it." (defvar org-clock-start-time "") (defun org-update-mode-line () - (let* ((now (current-time)) - (delta (- (time-to-seconds (current-time)) (time-to-seconds org-clock-start-time))) + (let* ((delta (- (time-to-seconds (current-time)) + (time-to-seconds org-clock-start-time))) (h (floor delta 3600)) (m (floor (- delta (* 3600 h)) 60))) (setq org-mode-line-string @@ -14219,7 +14505,7 @@ priority-n The computed numerical priority" (setq tmp (calendar-date-string tmp))) (setq props (plist-put props 'date tmp))) (when (setq tmp (plist-get props 'txt)) - (when (string-match "\\[#\\([A-Z]\\)\\] ?" tmp) + (when (string-match "\\[#\\([A-Z0-9]\\)\\] ?" tmp) (plist-put props 'priority-letter (match-string 1 tmp)) (setq tmp (replace-match "" t t tmp))) (when (and (setq re (plist-get props 'org-todo-regexp)) @@ -14245,7 +14531,7 @@ priority-n The computed numerical priority" ;;;###autoload (defun org-store-agenda-views (&rest parameters) (interactive) - (org-batch-store-agenda-views)) + (funcall (intern "org-batch-store-agenda-views"))) (defvar org-agenda-buffer-name) @@ -14253,7 +14539,7 @@ priority-n The computed numerical priority" (defmacro org-batch-store-agenda-views (&rest parameters) "Run all custom agenda commands that have a file argument." (let ((cmds org-agenda-custom-commands) - pars cmd thiscmdkey files file bs opts) + pars cmd thiscmdkey files opts) (while parameters (push (list (pop parameters) (if parameters (pop parameters))) pars)) (setq pars (reverse pars)) @@ -14271,7 +14557,7 @@ priority-n The computed numerical priority" (set-buffer "*Org Agenda*") (while files (eval (list 'let (append org-agenda-exporter-settings opts pars) - (list 'org-write-agenda (pop files) 'nosettings))))) + (list 'org-write-agenda (pop files) t))))) (kill-buffer org-agenda-buffer-name))))) (defun org-write-agenda (file &optional nosettings) @@ -14285,18 +14571,27 @@ higher priority settings." (interactive "FWrite agenda to file: ") (if (not (file-writable-p file)) (error "Cannot write agenda to file %s" file)) + (cond + ((string-match "\\.html?\\'" file) (require 'htmlize)) + ((string-match "\\.ps\\'" file) (require 'ps-print))) (org-let (if nosettings nil org-agenda-exporter-settings) '(save-excursion (save-window-excursion (cond ((string-match "\\.html?\\'" file) - (require 'htmlize) (set-buffer (htmlize-buffer (current-buffer))) + + (when (and org-agenda-export-html-style + (string-match "")) + (insert org-agenda-export-html-style)) (write-file file) (kill-buffer (current-buffer)) (message "HTML written to %s" file)) ((string-match "\\.ps\\'" file) - (require 'ps-print) (ps-print-buffer-with-faces file) (message "Postscript written to %s" file)) (t @@ -14695,13 +14990,14 @@ dates." (org-prepare-agenda) (if doclosed (push :closed args)) (push :timestamp args) + (push :sexp args) (if dotodo (push :todo args)) (while (setq d (pop day-numbers)) (if (and (listp d) (eq (car d) :omitted)) (progn (setq s (point)) (insert (format "\n[... %d empty days omitted]\n\n" (cdr d))) - (put-text-property s (1- (point)) 'face 'org-level-3)) + (put-text-property s (1- (point)) 'face 'org-agenda-structure)) (if (listp d) (setq d (car d) emptyp t) (setq emptyp nil)) (if (and (>= d today) dopast @@ -14724,7 +15020,7 @@ dates." ; (insert (format-time-string org-agenda-date-format ; (calendar-time-from-absolute d 0)) ; "\n") - (put-text-property s (1- (point)) 'face 'org-level-3) + (put-text-property s (1- (point)) 'face 'org-agenda-structure) (put-text-property s (1- (point)) 'org-date-line t) (if (equal d today) (put-text-property s (1- (point)) 'org-today t)) @@ -14853,11 +15149,11 @@ NDAYS defaults to `org-agenda-ndays'." (when rtnall (insert "ALL CURRENTLY OPEN TODO ITEMS:\n") (add-text-properties (point-min) (1- (point)) - (list 'face 'org-level-3)) + (list 'face 'org-agenda-structure)) (insert (org-finalize-agenda-entries rtnall) "\n"))) (setq s (point)) (insert (if (= nd 7) "Week-" "Day-") "agenda:\n") - (add-text-properties s (1- (point)) (list 'face 'org-level-3 + (add-text-properties s (1- (point)) (list 'face 'org-agenda-structure 'org-date-line t)) (while (setq d (pop day-numbers)) (setq date (calendar-gregorian-from-absolute d) @@ -14875,10 +15171,10 @@ NDAYS defaults to `org-agenda-ndays'." (if org-agenda-show-log (setq rtn (org-agenda-get-day-entries file date - :deadline :scheduled :timestamp :closed)) + :deadline :scheduled :timestamp :sexp :closed)) (setq rtn (org-agenda-get-day-entries file date - :deadline :scheduled :timestamp))) + :deadline :scheduled :sexp :timestamp))) (setq rtnall (append rtnall rtn)))) (if org-agenda-include-diary (progn @@ -14895,7 +15191,7 @@ NDAYS defaults to `org-agenda-ndays'." ; FIXME: this gives a timezone problem ; (insert (format-time-string org-agenda-date-format ; (calendar-time-from-absolute d 0)) "\n") - (put-text-property s (1- (point)) 'face 'org-level-3) + (put-text-property s (1- (point)) 'face 'org-agenda-structure) (put-text-property s (1- (point)) 'org-date-line t) (if todayp (put-text-property s (1- (point)) 'org-today t)) (if rtnall (insert @@ -14964,10 +15260,10 @@ for a keyword. A numeric prefix directly selects the Nth keyword in (setq rtnall (append rtnall rtn)))) (if org-agenda-overriding-header (insert (org-add-props (copy-sequence org-agenda-overriding-header) - nil 'face 'org-level-3) "\n") + nil 'face 'org-agenda-structure) "\n") (insert "Global list of TODO items of type: ") (add-text-properties (point-min) (1- (point)) - (list 'face 'org-level-3)) + (list 'face 'org-agenda-structure)) (setq pos (point)) (insert (or org-select-this-todo-keyword "ALL") "\n") (add-text-properties pos (1- (point)) (list 'face 'org-warning)) @@ -14982,7 +15278,7 @@ for a keyword. A numeric prefix directly selects the Nth keyword in (insert " " s)) kwds)) (insert "\n")) - (add-text-properties pos (1- (point)) (list 'face 'org-level-3))) + (add-text-properties pos (1- (point)) (list 'face 'org-agenda-structure))) (when rtnall (insert (org-finalize-agenda-entries rtnall) "\n")) (goto-char (point-min)) @@ -15038,17 +15334,17 @@ The prefix arg TODO-ONLY limits the search to TODO entries." (setq rtnall (append rtnall rtn)))))))) (if org-agenda-overriding-header (insert (org-add-props (copy-sequence org-agenda-overriding-header) - nil 'face 'org-level-3) "\n") + nil 'face 'org-agenda-structure) "\n") (insert "Headlines with TAGS match: ") (add-text-properties (point-min) (1- (point)) - (list 'face 'org-level-3)) + (list 'face 'org-agenda-structure)) (setq pos (point)) (insert match "\n") (add-text-properties pos (1- (point)) (list 'face 'org-warning)) (setq pos (point)) (unless org-agenda-multi (insert "Press `C-u r' to search again with new search string\n")) - (add-text-properties pos (1- (point)) (list 'face 'org-level-3))) + (add-text-properties pos (1- (point)) (list 'face 'org-agenda-structure))) (when rtnall (insert (org-finalize-agenda-entries rtnall) "\n")) (goto-char (point-min)) @@ -15233,6 +15529,8 @@ 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 + :deadline List any deadlines past due, or due within `org-deadline-warning-days'. The listing occurs only in the diary for *today*, not at any other date. If @@ -15257,10 +15555,10 @@ all files listed in `org-agenda-files' will be checked automatically: &%%(org-diary) If you don't give any arguments (as in the example above), the default -arguments (:deadline :scheduled :timestamp) are used. So the example above may -also be written as +arguments (:deadline :scheduled :timestamp :sexp) are used. +So the example above may also be written as - &%%(org-diary :deadline :timestamp :scheduled) + &%%(org-diary :deadline :timestamp :sexp :scheduled) The function expects the lisp variables `entry' and `date' to be provided by the caller, because this is how the calendar works. Don't use this @@ -15268,7 +15566,7 @@ function from a program - use `org-agenda-get-day-entries' instead." (org-agenda-maybe-reset-markers) (org-compile-prefix-format 'agenda) (org-set-sorting-strategy 'agenda) - (setq args (or args '(:deadline :scheduled :timestamp))) + (setq args (or args '(:deadline :scheduled :timestamp :sexp))) (let* ((files (if (and entry (stringp entry) (string-match "\\S-" entry)) (list entry) (org-agenda-files t))) @@ -15291,7 +15589,7 @@ FILE is the path to a file to be checked for entries. DATE is date like the one returned by `calendar-current-date'. ARGS are symbols indicating which kind of entries should be extracted. For details about these, see the documentation of `org-diary'." - (setq args (or args '(:deadline :scheduled :timestamp))) + (setq args (or args '(:deadline :scheduled :timestamp :sexp))) (let* ((org-startup-folded nil) (org-startup-align-all-tables nil) (buffer (if (file-exists-p file) @@ -15324,6 +15622,9 @@ the documentation of `org-diary'." (setq results (append results rtn)) (setq rtn (org-agenda-get-timestamps)) (setq results (append results rtn))) + ((eq arg :sexp) + (setq rtn (org-agenda-get-sexps)) + (setq results (append results rtn))) ((eq arg :scheduled) (setq rtn (org-agenda-get-scheduled)) (setq results (append results rtn))) @@ -15426,27 +15727,46 @@ the documentation of `org-diary'." 'help-echo (format "mouse-2 or RET jump to org file %s" (abbreviate-file-name buffer-file-name)))) - (regexp (regexp-quote - (substring - (format-time-string - (car org-time-stamp-formats) - (apply 'encode-time ; DATE bound by calendar - (list 0 0 0 (nth 1 date) (car date) (nth 2 date)))) - 0 11))) +;???? (regexp (regexp-quote +; (substring +; (format-time-string +; (car org-time-stamp-formats) +; (apply 'encode-time ; DATE bound by calendar +; (list 0 0 0 (nth 1 date) (car date) (nth 2 date)))) +; 0 11))) + (d1 (calendar-absolute-from-gregorian date)) + (regexp + (concat + (regexp-quote + (substring + (format-time-string + (car org-time-stamp-formats) + (apply 'encode-time ; DATE bound by calendar + (list 0 0 0 (nth 1 date) (car date) (nth 2 date)))) + 0 11)) + "\\|\\(<[0-9]+-[0-9]+-[0-9]+[^>\n]+?\\+[0-9]+[dwmy]>\\)" + "\\|\\(<%%\\(([^>\n]+)\\)>\\)")) marker hdmarker deadlinep scheduledp donep tmp priority category - ee txt timestr tags) + ee txt timestr tags b0 b3 e3) (goto-char (point-min)) (while (re-search-forward regexp nil t) + (setq b0 (match-beginning 0) + b3 (match-beginning 3) e3 (match-end 3)) (catch :skip - (and (save-match-data (org-at-date-range-p)) (throw :skip nil)) + (and (org-at-date-range-p) (throw :skip nil)) (org-agenda-skip) - (setq marker (org-agenda-new-marker (match-beginning 0)) - category (org-get-category (match-beginning 0)) + (if (and (match-end 1) + (not (= d1 (org-time-string-to-absolute (match-string 1) d1)))) + (throw :skip nil)) + (if (and e3 + (not (org-diary-sexp-entry (buffer-substring b3 e3) "" date))) + (throw :skip nil)) + (setq marker (org-agenda-new-marker b0) + category (org-get-category b0) tmp (buffer-substring (max (point-min) - (- (match-beginning 0) - org-ds-keyword-length)) - (match-beginning 0)) - timestr (buffer-substring (match-beginning 0) (point-at-eol)) + (- b0 org-ds-keyword-length)) + b0) + timestr (if b3 "" (buffer-substring b0 (point-at-eol))) deadlinep (string-match org-deadline-regexp tmp) scheduledp (string-match org-scheduled-regexp tmp) donep (org-entry-is-done-p)) @@ -15494,6 +15814,47 @@ the documentation of `org-diary'." (outline-next-heading))) (nreverse ee))) +(defun org-agenda-get-sexps () + "Return the sexp information for agenda display." + (require 'diary-lib) + (let* ((props (list 'face nil + 'mouse-face 'highlight + 'keymap org-agenda-keymap + 'help-echo + (format "mouse-2 or RET jump to org file %s" + (abbreviate-file-name buffer-file-name)))) + (regexp "^&?%%(") + marker category ee txt tags entry result beg b sexp sexp-entry) + (goto-char (point-min)) + (while (re-search-forward regexp nil t) + (catch :skip + (org-agenda-skip) + (setq beg (match-beginning 0)) + (goto-char (1- (match-end 0))) + (setq b (point)) + (forward-sexp 1) + (setq sexp (buffer-substring b (point))) + (setq sexp-entry (if (looking-at "[ \t]*\\(\\S-.*\\)") + (org-trim (match-string 1)) + "")) + (setq result (org-diary-sexp-entry sexp sexp-entry date)) + (when result + (setq marker (org-agenda-new-marker beg) + category (org-get-category beg)) + + (if (string-match "\\S-" result) + (setq txt result) + (setq txt "SEXP entry returned empty string")) + + (setq txt (org-format-agenda-item + "" txt category tags 'time)) + (org-add-props txt props 'org-marker marker) + (org-add-props txt nil + 'org-category category 'date date + 'type "sexp") + (push txt ee)))) + (nreverse ee))) + (defun org-agenda-get-closed () "Return the logged TODO entries for agenda display." (let* ((props (list 'mouse-face 'highlight @@ -15568,8 +15929,9 @@ the documentation of `org-diary'." (catch :skip (org-agenda-skip) (setq pos (1- (match-beginning 1)) - d2 (time-to-days - (org-time-string-to-time (match-string 1))) +;??? d2 (time-to-days +;??? (org-time-string-to-time (match-string 1))) + d2 (org-time-string-to-absolute (match-string 1) d1) diff (- d2 d1)) ;; When to show a deadline in the calendar: ;; If the expiration is within wdays warning time. @@ -15627,8 +15989,9 @@ the documentation of `org-diary'." (catch :skip (org-agenda-skip) (setq pos (1- (match-beginning 1)) - d2 (time-to-days - (org-time-string-to-time (match-string 1))) + d2 (org-time-string-to-absolute (match-string 1) d1) +;??? d2 (time-to-days +;??? (org-time-string-to-time (match-string 1))) diff (- d2 d1)) ;; When to show a scheduled item in the calendar: ;; If it is on or past the date. @@ -16286,12 +16649,13 @@ and by additional input from the age of a schedules or deadline entry." (org-agenda-error))) (buffer (marker-buffer marker)) (pos (marker-position marker)) + (type (get-text-property (point) 'type)) dbeg dend (n 0) conf) (org-with-remote-undo buffer (with-current-buffer buffer (save-excursion (goto-char pos) - (if (org-mode-p) + (if (and (org-mode-p) (not (member type '("sexp")))) (setq dbeg (progn (org-back-to-heading t) (point)) dend (org-end-of-subtree t)) (setq dbeg (point-at-bol) @@ -17269,6 +17633,7 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]." (:tables . org-export-with-tables) (:table-auto-headline . org-export-highlight-first-table-line) (:style . org-export-html-style) + (:agenda-style . org-agenda-export-html-style) ;; FIXME: Does this work???? (:convert-org-links . org-export-html-link-org-files-as-html) (:inline-images . org-export-html-inline-images) (:expand-quoted-html . org-export-html-expand) @@ -17391,6 +17756,7 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]." (?h . org-export-as-html) (?b . org-export-as-html-and-open) (?H . org-export-as-html-to-buffer) + (?R . org-export-region-as-html) (?x . org-export-as-xoxo) (?i . org-export-icalendar-this-file) (?I . org-export-icalendar-all-agenda-files) @@ -18208,7 +18574,7 @@ continue to use it. The prefix arg ARG is passed through to the exporting command." (interactive (list (progn - (message "Export visible: [a]SCII [h]tml [b]rowse HTML [H]uffer with HTML [x]OXO [ ]keep buffer") + (message "Export visible: [a]SCII [h]tml [b]rowse HTML [H/R]uffer with HTML [x]OXO [ ]keep buffer") (read-char-exclusive)) current-prefix-arg)) (if (not (member type '(?a ?\C-a ?b ?\C-b ?h ?x ?\ ))) @@ -18220,6 +18586,7 @@ command." (?\C-b . org-export-as-html-and-open) (?h . org-export-as-html) (?H . org-export-as-html-to-buffer) + (?R . org-export-region-as-html) (?x . org-export-as-xoxo))))) (keepp (equal type ?\ )) (file buffer-file-name) @@ -18279,6 +18646,7 @@ Does include HTML export options as well as TODO and CATEGORY stuff." #+CATEGORY: %s #+SEQ_TODO: %s #+TYP_TODO: %s +#+PRIORITIES: %c %c %c #+STARTUP: %s %s %s %s %s #+TAGS: %s #+ARCHIVE: %s @@ -18300,6 +18668,7 @@ Does include HTML export options as well as TODO and CATEGORY stuff." (file-name-nondirectory buffer-file-name) "TODO FEEDBACK VERIFY DONE" "Me Jason Marie DONE" + org-highest-priority org-lowest-priority org-default-priority (cdr (assoc org-startup-folded '((nil . "showall") (t . "overview") (content . "content")))) (if org-odd-levels-only "odd" "oddeven") @@ -18395,10 +18764,64 @@ emacs --batch "Call `org-exort-as-html` with output to a temporary buffer. No file is created. The prefix ARG is passed through to `org-export-as-html'." (interactive "P") - (org-export-as-html arg nil nil t) + (org-export-as-html arg nil nil "*Org HTML Export*") (switch-to-buffer-other-window "*Org HTML Export*")) -(defun org-export-as-html (arg &optional hidden ext-plist temp-buffer-only) +(defun org-replace-region-by-html (beg end) + "Assume the current region has org-mode syntax, and convert it to HTML. +This can be used in any buffer. For example, you could write an +itemized list in org-mode syntax in an HTML buffer and then use this +command to convert it." + (interactive "r") + (let (reg html buf) + (if (org-mode-p) + (setq html (org-export-region-as-html + beg end t 'string)) + (setq reg (buffer-substring beg end) + buf (get-buffer-create "*Org tmp*")) + (save-excursion + (set-buffer buf) + (erase-buffer) + (insert reg) + (org-mode) + (setq html (org-export-region-as-html + (point-min) (point-max) t 'string))) + (kill-buffer buf)) + (delete-region beg end) + (insert html))) + +(defun org-export-region-as-html (beg end &optional body-only buffer) + "Convert region from BEG to END in org-mode buffer to HTML. +If prefix arg BODY-ONLY is set, omit file header, footer, and table of +contents, and only produce the region of converted text, useful for +cut-and-paste operations. +If BUFFER is a buffer or a string, use/create that buffer as a target +of the converted HTML. If BUFFER is the symbol `string', return the +produced HTML as a string and leave not buffer behind. For example, +a Lisp program could call this function in the following way: + + (setq html (org-export-region-as-html beg end t 'string)) + +When called interactively, the output buffer is selected, and shown +in a window. A non-interactive call will only retunr the buffer." + (interactive "r\nP") + (when (interactive-p) + (setq buffer "*Org HTML EXPORT*")) + (let ((transient-mark-mode t) (zmacs-regions t) + rtn) + (goto-char end) + (set-mark (point)) ;; to activate the region + (goto-char beg) + (setq rtn (org-export-as-html + nil nil nil + buffer body-only)) + (if (fboundp 'deactivate-mark) (deactivate-mark)) + (if (and (interactive-p) (bufferp rtn)) + (switch-to-buffer-other-window rtn) + rtn))) + +(defun org-export-as-html (arg &optional hidden ext-plist + to-buffer body-only) "Export the outline as a pretty HTML file. If there is an active region, export only the region. The prefix ARG specifies how many levels of the outline should become @@ -18406,8 +18829,12 @@ headlines. The default is 3. Lower levels will become bulleted lists. When HIDDEN is non-nil, don't display the HTML buffer. EXT-PLIST is a property list with external parameters overriding org-mode's default settings, but still inferior to file-local -settings. Wehn TEMP-BUFFER-ONLY is non-nil, export to a buffer not -associated with a file." +settings. When TO-BUFFER is non-nil, create a buffer with that +name and export to that buffer. If TO-BUFFER is the symbol `string', +don't leave any buffer behind but just return the resulting HTML as +a string. When BODY-ONLY is set, don't produce the file header and footer, +simply return the content of ..., without even +the body tags themselves." (interactive "P") (message "Exporting...") (setq-default org-todo-line-regexp org-todo-line-regexp) @@ -18423,10 +18850,6 @@ associated with a file." valid thetoc have-headings first-heading-pos (odd org-odd-levels-only) (region-p (org-region-active-p)) - (region - (buffer-substring - (if region-p (region-beginning) (point-min)) - (if region-p (region-end) (point-max)))) ;; The following two are dynamically scoped into other ;; routines below. (org-current-export-dir (org-export-directory :html opt-plist)) @@ -18434,14 +18857,19 @@ associated with a file." (level 0) (line "") (origline "") txt todo (umax nil) (umax-toc nil) - (filename (concat (file-name-as-directory - (org-export-directory :html opt-plist)) - (file-name-sans-extension - (file-name-nondirectory buffer-file-name)) - ".html")) - (current-dir (file-name-directory buffer-file-name)) - (buffer (if temp-buffer-only - (get-buffer-create "*Org HTML Export*") + (filename (if to-buffer nil + (concat (file-name-as-directory + (org-export-directory :html opt-plist)) + (file-name-sans-extension + (file-name-nondirectory buffer-file-name)) + ".html"))) + (current-dir (if buffer-file-name + (file-name-directory buffer-file-name) + default-directory)) + (buffer (if to-buffer + (cond + ((eq to-buffer 'string) (get-buffer-create "*Org HTML Export*")) + (t (get-buffer-create to-buffer))) (find-file-noselect filename))) (org-levels-open (make-vector org-level-max nil)) (date (format-time-string "%Y/%m/%d" (current-time))) @@ -18451,8 +18879,10 @@ associated with a file." (and (not (plist-get opt-plist :skip-before-1st-heading)) (org-export-grab-title-from-buffer)) - (file-name-sans-extension - (file-name-nondirectory buffer-file-name)))) + (and buffer-file-name + (file-name-sans-extension + (file-name-nondirectory buffer-file-name))) + "UNTITLED")) (quote-re0 (concat "^[ \t]*" org-quote-string "\\>")) (quote-re (concat "^\\(\\*+\\)\\([ \t]*" org-quote-string "\\>\\)")) (inquote nil) @@ -18474,6 +18904,10 @@ associated with a file." (charset (and coding-system (fboundp 'coding-system-get) (coding-system-get coding-system 'mime-charset))) + (region + (buffer-substring + (if region-p (region-beginning) (point-min)) + (if region-p (region-end) (point-max)))) (lines (org-skip-comments (org-split-string (org-cleaned-string-for-export @@ -18508,9 +18942,7 @@ associated with a file." (assoc "en" org-export-language-setup))) ;; Switch to the output buffer - (if (or hidden t) - (set-buffer buffer) - (switch-to-buffer-other-window buffer)) + (set-buffer buffer) (erase-buffer) (fundamental-mode) (let ((case-fold-search nil) @@ -18526,9 +18958,10 @@ associated with a file." (setq umax-toc (if (integerp org-export-with-toc) (min org-export-with-toc umax) umax)) - ;; File header - (insert (format - " @@ -18541,17 +18974,16 @@ lang=\"%s\" xml:lang=\"%s\"> %s " - language language (org-html-expand title) (or charset "iso-8859-1") - date time author style)) - - - (insert (or (plist-get opt-plist :preamble) "")) - - (when (plist-get opt-plist :auto-preamble) - (if title (insert (format org-export-html-title-format - (org-html-expand title))))) - - (if org-export-with-toc + language language (org-html-expand title) + (or charset "iso-8859-1") date time author style)) + + (insert (or (plist-get opt-plist :preamble) "")) + + (when (plist-get opt-plist :auto-preamble) + (if title (insert (format org-export-html-title-format + (org-html-expand title)))))) + + (if (and org-export-with-toc (not body-only)) (progn (push (format "%s\n" org-export-html-toplevel-hlevel @@ -18560,77 +18992,78 @@ lang=\"%s\" xml:lang=\"%s\"> thetoc) (push "
    \n
  • " thetoc) (setq lines - (mapcar '(lambda (line) - (if (string-match org-todo-line-regexp line) - ;; This is a headline - (progn - (setq have-headings t) - (setq level (- (match-end 1) (match-beginning 1)) - level (org-tr-level level) - txt (save-match-data - (org-html-expand - (org-export-cleanup-toc-line - (match-string 3 line)))) - todo - (or (and org-export-mark-todo-in-toc - (match-beginning 2) - (not (member (match-string 2 line) - org-done-keywords))) + (mapcar '(lambda (line) + (if (string-match org-todo-line-regexp line) + ;; This is a headline + (progn + (setq have-headings t) + (setq level (- (match-end 1) (match-beginning 1)) + level (org-tr-level level) + txt (save-match-data + (org-html-expand + (org-export-cleanup-toc-line + (match-string 3 line)))) + todo + (or (and org-export-mark-todo-in-toc + (match-beginning 2) + (not (member (match-string 2 line) + org-done-keywords))) ; TODO, not DONE - (and org-export-mark-todo-in-toc - (= level umax-toc) - (org-search-todo-below - line lines level)))) - (if (and (memq org-export-with-tags '(not-in-toc nil)) - (string-match "[ \t]+:[a-zA-Z0-9_@:]+:[ \t]*$" txt)) - (setq txt (replace-match "" t t txt))) - (if (string-match quote-re0 txt) - (setq txt (replace-match "" t t txt))) - (if org-export-with-section-numbers - (setq txt (concat (org-section-number level) - " " txt))) - (if (<= level (max umax umax-toc)) - (setq head-count (+ head-count 1))) - (if (<= level umax-toc) - (progn - (if (> level org-last-level) - (progn - (setq cnt (- level org-last-level)) - (while (>= (setq cnt (1- cnt)) 0) - (push "\n
      \n
    • " thetoc)) - (push "\n" thetoc))) - (if (< level org-last-level) - (progn - (setq cnt (- org-last-level level)) - (while (>= (setq cnt (1- cnt)) 0) - (push "
    • \n
    " thetoc)) - (push "\n" thetoc))) - ;; Check for targets - (while (string-match org-target-regexp line) - (setq tg (match-string 1 line) - line (replace-match - (concat "@" tg "@ ") - t t line)) - (push (cons (org-solidify-link-text tg) - (format "sec-%d" head-count)) - target-alist)) - (while (string-match "<\\(<\\)+\\|>\\(>\\)+" txt) - (setq txt (replace-match "" t t txt))) - (push - (format - (if todo - "
  • \n
  • %s" - "
  • \n
  • %s") - head-count txt) thetoc) - - (setq org-last-level level)) - ))) - line) - lines)) + (and org-export-mark-todo-in-toc + (= level umax-toc) + (org-search-todo-below + line lines level)))) + (if (and (memq org-export-with-tags '(not-in-toc nil)) + (string-match "[ \t]+:[a-zA-Z0-9_@:]+:[ \t]*$" txt)) + (setq txt (replace-match "" t t txt))) + (if (string-match quote-re0 txt) + (setq txt (replace-match "" t t txt))) + (if org-export-with-section-numbers + (setq txt (concat (org-section-number level) + " " txt))) + (if (<= level (max umax umax-toc)) + (setq head-count (+ head-count 1))) + (if (<= level umax-toc) + (progn + (if (> level org-last-level) + (progn + (setq cnt (- level org-last-level)) + (while (>= (setq cnt (1- cnt)) 0) + (push "\n
      \n
    • " thetoc)) + (push "\n" thetoc))) + (if (< level org-last-level) + (progn + (setq cnt (- org-last-level level)) + (while (>= (setq cnt (1- cnt)) 0) + (push "
    • \n
    " thetoc)) + (push "\n" thetoc))) + ;; Check for targets + (while (string-match org-target-regexp line) + (setq tg (match-string 1 line) + line (replace-match + (concat "@" tg "@ ") + t t line)) + (push (cons (org-solidify-link-text tg) + (format "sec-%d" head-count)) + target-alist)) + (while (string-match "<\\(<\\)+\\|>\\(>\\)+" txt) + (setq txt (replace-match "" t t txt))) + (push + (format + (if todo + "
  • \n
  • %s" + "
  • \n
  • %s") + head-count txt) thetoc) + + (setq org-last-level level)) + ))) + line) + lines)) (while (> org-last-level 0) (setq org-last-level (1- org-last-level)) (push "
  • \n
\n" thetoc)) (setq thetoc (if have-headings (nreverse thetoc) nil)))) + (setq head-count 0) (org-init-section-numbers) @@ -18729,7 +19162,8 @@ lang=\"%s\" xml:lang=\"%s\"> (setq rpl (concat "" desc ""))) ((member type '("http" "https")) ; FIXME: need to test this. ;; standard URL, just check if we need to inline an image @@ -18922,24 +19356,28 @@ lang=\"%s\" xml:lang=\"%s\"> (and org-export-with-toc (<= level umax)) head-count) - (when (plist-get opt-plist :auto-postamble) - (when author - (insert "

" - (nth 1 lang-words) ": " author "\n") - (when email - (insert "<" - email ">\n")) - (insert "

\n")) - (when (and date time) - (insert "

" - (nth 2 lang-words) ": " - date " " time "

\n"))) + (unless body-only + (when (plist-get opt-plist :auto-postamble) + (when author + (insert "

" + (nth 1 lang-words) ": " author "\n") + (when email + (insert "<" + email ">\n")) + (insert "

\n")) + (when (and date time) + (insert "

" + (nth 2 lang-words) ": " + date " " time "

\n"))) + + (if org-export-html-with-timestamp + (insert org-export-html-html-helper-timestamp)) + (insert (or (plist-get opt-plist :postamble) "")) + (insert "\n\n")) - (if org-export-html-with-timestamp - (insert org-export-html-html-helper-timestamp)) - (insert (or (plist-get opt-plist :postamble) "")) - (insert "\n\n") (normal-mode) + (if (eq major-mode default-major-mode) (html-mode)) + ;; insert the table of contents (goto-char (point-min)) (when thetoc @@ -18962,9 +19400,13 @@ lang=\"%s\" xml:lang=\"%s\"> (goto-char (point-min)) (while (re-search-forward "
  • [ \r\n\t]*
  • \n?" nil t) (replace-match "")) - (or temp-buffer-only (save-buffer)) + (or to-buffer (save-buffer)) (goto-char (point-min)) - (message "Exporting... done")))) + (message "Exporting... done") + (if (eq to-buffer 'string) + (prog1 (buffer-substring (point-min) (point-max)) + (kill-buffer (current-buffer))) + (current-buffer))))) (defun org-format-table-html (lines olines) "Find out which HTML converter to use and return the HTML code." @@ -19187,6 +19629,9 @@ But it has the disadvantage, that Org-mode's HTML conversions cannot be used." (when org-export-remove-timestamps-from-toc (while (string-match org-maybe-keyword-time-regexp s) (setq s (replace-match "" t t s)))) + (while (string-match org-bracket-link-regexp s) + (setq s (replace-match (match-string (if (match-end 3) 3 1) s) + t t s))) s) (defun org-html-expand (string) @@ -19383,11 +19828,13 @@ The file is stored under the name `org-combined-agenda-icalendar-file'." If COMBINE is non-nil, combine all calendar entries into a single large file and store it under the name `org-combined-agenda-icalendar-file'." (save-excursion + (org-prepare-agenda-buffers files) (let* ((dir (org-export-directory :ical (list :publishing-directory org-export-publishing-directory))) file ical-file ical-buffer category started org-agenda-new-buffers) - + + (and (get-buffer "*ical-tmp*") (kill-buffer "*ical-tmp*")) (when combine (setq ical-file (if (file-name-absolute-p org-combined-agenda-icalendar-file) @@ -19432,76 +19879,112 @@ the iCalendar file.") (defun org-print-icalendar-entries (&optional combine) "Print iCalendar entries for the current Org-mode file to `standard-output'. When COMBINE is non nil, add the category to each line." - (let ((re2 (concat "--?-?\\(" org-ts-regexp "\\)")) + (let ((re1 (concat org-ts-regexp "\\|<%%([^>\n]+>")) + (re2 (concat "--?-?\\(" org-ts-regexp "\\)")) (org-category-table (org-get-category-table)) (dts (org-ical-ts-to-string (format-time-string (cdr org-time-stamp-formats) (current-time)) "DTSTART")) - hd ts ts2 state status (inc t) pos - scheduledp deadlinep tmp pri category) + hd ts ts2 state status (inc t) pos b sexp rrule + scheduledp deadlinep tmp pri category + (sexp-buffer (get-buffer-create "*ical-tmp*"))) (save-excursion (goto-char (point-min)) - (while (re-search-forward org-ts-regexp nil t) - (setq pos (match-beginning 0) - ts (match-string 0) - inc t - hd (org-get-heading) - category (org-get-category)) - (if (looking-at re2) - (progn - (goto-char (match-end 0)) - (setq ts2 (match-string 1) inc nil)) - (setq ts2 ts - tmp (buffer-substring (max (point-min) + (while (re-search-forward re1 nil t) + (catch :skip + (org-agenda-skip) + (setq pos (match-beginning 0) + ts (match-string 0) + inc t + hd (org-get-heading) + category (org-get-category)) + (if (looking-at re2) + (progn + (goto-char (match-end 0)) + (setq ts2 (match-string 1) inc nil)) + (setq ts2 ts + tmp (buffer-substring (max (point-min) (- pos org-ds-keyword-length)) - pos) - deadlinep (string-match org-deadline-regexp tmp) - scheduledp (string-match org-scheduled-regexp tmp) - ;; donep (org-entry-is-done-p) - )) - (if (or (string-match org-tr-regexp hd) - (string-match org-ts-regexp hd)) - (setq hd (replace-match "" t t hd))) - (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))) - (princ (format "BEGIN:VEVENT -%s + pos) + deadlinep (string-match org-deadline-regexp tmp) + scheduledp (string-match org-scheduled-regexp tmp) + ;; donep (org-entry-is-done-p) + )) + (if (or (string-match org-tr-regexp hd) + (string-match org-ts-regexp hd)) + (setq hd (replace-match "" t t hd))) + (if (string-match "\\+\\([0-9]+\\)\\([dwmy]\\)>" ts) + (setq rrule + (concat "\nRRULE:FREQ=" + (cdr (assoc + (match-string 2 ts) + '(("d" . "DAILY")("w" . "WEEKLY") + ("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))) + (if (string-match "\\`<%%" ts) + (with-current-buffer sexp-buffer + (insert (substring ts 1 -1) " " hd "\n")) + (princ (format "BEGIN:VEVENT %s +%s%s SUMMARY:%s CATEGORIES:%s END:VEVENT\n" - (org-ical-ts-to-string ts "DTSTART") - (org-ical-ts-to-string ts2 "DTEND" inc) - hd category))) + (org-ical-ts-to-string ts "DTSTART") + (org-ical-ts-to-string ts2 "DTEND" inc) + rrule hd category))))) + + (when (and org-icalendar-include-sexps + (condition-case nil (require 'icalendar) (error nil)) + (fboundp 'icalendar-export-region)) + ;; Get all the literal sexps + (goto-char (point-min)) + (while (re-search-forward "^&?%%(" nil t) + (catch :skip + (org-agenda-skip) + (setq b (match-beginning 0)) + (goto-char (1- (match-end 0))) + (forward-sexp 1) + (end-of-line 1) + (setq sexp (buffer-substring b (point))) + (with-current-buffer sexp-buffer + (insert sexp "\n")) + (princ (org-diary-to-ical-string sexp-buffer))))) + (when org-icalendar-include-todo (goto-char (point-min)) (while (re-search-forward org-todo-line-regexp nil t) - (setq state (match-string 2)) - (setq status (if (member state org-done-keywords) - "COMPLETED" "NEEDS-ACTION")) - (when (and state - (or (not (member state org-done-keywords)) - (eq org-icalendar-include-todo 'all)) - (not (member org-archive-tag (org-get-tags-at))) - ) - (setq hd (match-string 3)) - (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 (string-match org-priority-regexp hd) - (setq pri (string-to-char (match-string 2 hd)) - hd (concat (substring hd 0 (match-beginning 1)) - (substring hd (match-end 1)))) - (setq pri org-default-priority)) - (setq pri (floor (1+ (* 8. (/ (float (- org-lowest-priority pri)) - (- org-lowest-priority ?A)))))) - - (princ (format "BEGIN:VTODO + (catch :skip + (org-agenda-skip) + (setq state (match-string 2)) + (setq status (if (member state org-done-keywords) + "COMPLETED" "NEEDS-ACTION")) + (when (and state + (or (not (member state org-done-keywords)) + (eq org-icalendar-include-todo 'all)) + (not (member org-archive-tag (org-get-tags-at))) + ) + (setq hd (match-string 3)) + (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 (string-match org-priority-regexp hd) + (setq pri (string-to-char (match-string 2 hd)) + hd (concat (substring hd 0 (match-beginning 1)) + (substring hd (match-end 1)))) + (setq pri org-default-priority)) + (setq pri (floor (1+ (* 8. (/ (float (- org-lowest-priority pri)) + (- org-lowest-priority org-highest-priority)))))) + + (princ (format "BEGIN:VTODO %s SUMMARY:%s CATEGORIES:%s @@ -19509,7 +19992,7 @@ SEQUENCE:1 PRIORITY:%d STATUS:%s END:VTODO\n" - dts hd category pri status)))))))) + dts hd category pri status))))))))) (defun org-start-icalendar-file (name) "Start an iCalendar file by inserting the header." @@ -19760,6 +20243,7 @@ The XOXO buffer is named *xoxo-*" (org-defkey org-mode-map "\C-c{" 'org-table-toggle-formula-debugger) (org-defkey org-mode-map "\C-c\C-e" 'org-export) (org-defkey org-mode-map "\C-c:" 'org-toggle-fixed-width-section) +(org-defkey org-mode-map "\C-c\C-x\C-f" 'org-emphasize) (org-defkey org-mode-map "\C-c\C-x\C-k" 'org-cut-special) (org-defkey org-mode-map "\C-c\C-x\C-w" 'org-cut-special) @@ -20270,7 +20754,11 @@ See the individual commands for more information." ["Next Same Level" outline-forward-same-level t] ["Previous Same Level" outline-backward-same-level t] "--" - ["Jump" org-goto t]) + ["Jump" org-goto t] + "--" + ["C-a finds headline start" + (setq org-special-ctrl-a (not org-special-ctrl-a)) + :style toggle :selected org-special-ctrl-a]) ("Edit Structure" ["Move Subtree Up" org-shiftmetaup (not (org-at-table-p))] ["Move Subtree Down" org-shiftmetadown (not (org-at-table-p))] @@ -20288,6 +20776,8 @@ See the individual commands for more information." "--" ["Convert to odd levels" org-convert-to-odd-levels t] ["Convert to odd/even levels" org-convert-to-oddeven-levels t]) + ("Editing" + ["Emphasis..." org-emphasize t]) ("Archive" ["Toggle ARCHIVE tag" org-toggle-archive-tag t] ; ["Check and Tag Children" (org-toggle-archive-tag (4)) @@ -20509,7 +20999,7 @@ and :keyword." (push (org-point-in-group p 4 :tags) clist)) (goto-char p) (skip-chars-backward "^[\n\r \t") (or (eobp) (backward-char 1)) - (if (looking-at "\\[#[A-Z]\\]") + (if (looking-at "\\[#[A-Z0-9]\\]") (push (org-point-in-group p 0 :priority) clist))) ((org-at-item-p) @@ -21000,14 +21490,6 @@ Show the heading too, if it is currently invisible." ;;;; Experimental code -(defun org-get-item-columns () - (save-excursion - (when (condition-case nil - (org-beginning-of-item) - (error nil)) - (if (looking-at "\\([ \t]*\\)[-+*0-9.)]+") - (cons (progn (goto-char (match-end 1)) (current-column)) - (progn (goto-char (match-end 0)) (1+ (current-column)))))))) ;;;; Finish up diff --git a/org.pdf b/org.pdf index 0fe944221..838076cb9 100644 Binary files a/org.pdf and b/org.pdf differ diff --git a/org.texi b/org.texi index bb72cd4e4..e495d07ab 100644 --- a/org.texi +++ b/org.texi @@ -3,8 +3,8 @@ @setfilename ../info/org @settitle Org Mode Manual -@set VERSION 4.74 -@set DATE April 2007 +@set VERSION 4.75 +@set DATE May 2007 @dircategory Emacs @direntry @@ -176,13 +176,18 @@ Timestamps * Time stamps:: Assigning a time to a tree entry * Creating timestamps:: Commands which insert timestamps -* Custom time format:: If you cannot work with the ISO format -* Repeating items:: Deadlines that come back again and again +* Deadlines and scheduling:: Planning your work * Progress logging:: Documenting when what work was done. Creating timestamps * The date/time prompt:: How org-mode helps you entering date and time +* Custom time format:: Making dates look differently + +Deadlines and Scheduling + +* Inserting deadline/schedule:: +* Repeated tasks:: Progress Logging @@ -2150,18 +2155,20 @@ 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}, or with -completion@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 +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}.}. The link will be -inserted into the buffer, 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. +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 @@ -2818,6 +2825,17 @@ are also used to modify time stamps (@pxref{Creating timestamps}). Furthermore, these keys are also used by CUA-mode (@pxref{Conflicts}). @end table +You can change the range of allowed priorities by setting the variables +@code{org-highest-priority}, @code{org-lowest-priority}, and +@code{org-default-priority}. For an individual buffer, you may set +these values (highest, lowest, default) like this (please make sure that +the highest priority is earlier in the alphabet than the lowest +priority): + +@example +#+PRIORITIES: A C B +@end example + @node Breaking down tasks, Checkboxes, Priorities, TODO items @section Breaking tasks down into subtasks @cindex tasks, breaking down @@ -2915,8 +2933,7 @@ planning. @menu * Time stamps:: Assigning a time to a tree entry * Creating timestamps:: Commands which insert timestamps -* Custom time format:: If you cannot work with the ISO format -* Repeating items:: Deadlines that come back again and again +* Deadlines and scheduling:: Planning your work * Progress logging:: Documenting when what work was done. @end menu @@ -2934,7 +2951,7 @@ special format, either @samp{<2003-09-16 Tue>} or @samp{<2003-09-16 Tue 09:39>}@footnote{This is the standard ISO date/time format. If you cannot get used to these, see @ref{Custom time format}}. A time stamp can appear anywhere in the headline or body of an org-tree entry. Its -presence allows entries to be shown on specific dates in the agenda +presence causes entries to be shown on specific dates in the agenda (@pxref{Weekly/Daily agenda}). We distinguish: @table @var @@ -2950,6 +2967,39 @@ associated with a plain time stamp will be shown exactly on that date. * Meet Peter at the movies <2006-11-01 Wed 19:15> @end example +@item Time stamp with repeater interval +@cindex timestamp, with repeater interval +A time stamp may contain a @emph{repeater interval}, indicating that it +applies not only on the given date, but again and again after a certain +interval of N days (d), weeks (w), months(m), or years(y). The +following will show up in the agenda every Wednesday: + +@example +* Pick up Sam at school <2007-05-16 Wed 12:30 +1w> +@end example + +@item Diary-style sexp entries +For more complex date specifications, Org-mode supports using the +special sexp diary entries implemented in the Emacs calendar/diary +package. For example + +@example +* The nerd meeting on every 2nd Thursday of the month + <%%(diary-float t 4 2)> +@end example + +@item Time/Date range +@cindex timerange +@cindex date range +Two time stamps connected by @samp{--} denote a range. The headline +will be shown on the first and last day of the range, and on any dates +that are displayed and fall in the range. Here is an example: + +@example +** Meeting in Amsterdam + <2004-08-23 Mon>--<2004-08-26 Thu> +@end example + @item Inactive time stamp @cindex timestamp, inactive @cindex inactive timestamp @@ -2961,65 +3011,9 @@ angular ones. These time stamps are inactive in the sense that they do * Gillian comes late for the fifth time [2006-11-01 Wed] @end example -@item Time stamp range -@cindex timerange -Two time stamps connected by @samp{--} denote a time range. The -headline will be shown on the first and last day of the range, and on -any dates that are displayed and fall in the range. Here is an -example: - -@example -** Meeting in Amsterdam - <2004-08-23 Mon>--<2004-08-26 Thu> -@end example - -@item Time stamp with SCHEDULED keyword -@cindex SCHEDULED keyword -If a time stamp is preceded by the word @samp{SCHEDULED:}, it means you -are planning to start working on that task on the given date. So this is -not about recording an event, but about planning your work. The -headline will be listed under the given date@footnote{It will still be -listed on that date after it has been marked DONE. If you don't like -this, set the variable @code{org-agenda-skip-scheduled-if-done}.}. In -addition, a reminder that the scheduled date has passed will be present -in the compilation for @emph{today}, until the entry is marked DONE. -I.e., the task will automatically be forwarded until completed. - -@example -*** TODO Call Trillian for a date on New Years Eve. - SCHEDULED: <2004-12-25 Sat> -@end example - -@item Time stamp with DEADLINE keyword -@cindex DEADLINE keyword -If a time stamp is preceded by the word @samp{DEADLINE:}, the task -(most likely a TODO item) is supposed to be finished on that date, and -it will be listed then. In addition, the compilation for @emph{today} -will carry a warning about the approaching or missed deadline, -starting @code{org-deadline-warning-days} before the due date, and -continuing until the entry is marked DONE. An example: - -@example -*** TODO write article about the Earth for the Guide - The editor in charge is [[bbdb:Ford Prefect]] - DEADLINE: <2004-02-29 Sun> -@end example -@item Time stamp with CLOSED keyword -@cindex CLOSED keyword -When @code{org-log-done} is non-nil, Org-mode will automatically insert -a special time stamp each time a TODO entry is marked done -(@pxref{Progress logging}). This time stamp is enclosed in square -brackets instead of angular brackets. - -@item Time range with CLOCK keyword -@cindex CLOCK keyword -When using the clock to time the work that is being done on specific -items, time ranges preceded by the CLOCK keyword are inserted -automatically into the file. The time stamps are enclosed in square -brackets instead of angular brackets. @xref{Clocking work time}. @end table -@node Creating timestamps, Custom time format, Time stamps, Timestamps +@node Creating timestamps, Deadlines and scheduling, Time stamps, Timestamps @section Creating timestamps @cindex creating timestamps @cindex timestamps, creating @@ -3061,27 +3055,6 @@ instead. Access the agenda for the date given by the time stamp or -range at point (@pxref{Weekly/Daily agenda}). @c -@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. -@c FIXME Any CLOSED timestamp will be removed.???????? -@c -@kindex C-c C-w -@cindex sparse tree, for deadlines -@item C-c C-w -Create a sparse tree with all deadlines that are either past-due, or -which will become due within @code{org-deadline-warning-days}. -With @kbd{C-u} prefix, show all deadlines in the file. With a numeric -prefix, check that many days. For example, @kbd{C-1 C-c C-w} shows -all deadlines due tomorrow. -@c -@kindex C-c C-s -@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. -@c @kindex S-@key{left} @kindex S-@key{right} @item S-@key{left} @@ -3110,9 +3083,10 @@ into the following column). @menu * The date/time prompt:: How org-mode helps you entering date and time +* Custom time format:: Making dates look differently @end menu -@node The date/time prompt, , Creating timestamps, Creating timestamps +@node The date/time prompt, Custom time format, Creating timestamps, Creating timestamps @subsection The date/time prompt @cindex date, reading in minibuffer @cindex time, reading in minibuffer @@ -3181,8 +3155,8 @@ One month back. Choose date in calendar (only if nothing was typed into minibuffer). @end table -@node Custom time format, Repeating items, Creating timestamps, Timestamps -@section Custom time format +@node Custom time format, , The date/time prompt, Creating timestamps +@subsection Custom time format @cindex custom date/time format @cindex time format, custom @cindex date format, custom @@ -3224,50 +3198,119 @@ using dates in tables, table alignment will be messed up. If the custom format is shorter, things do work as expected. @end itemize -@node Repeating items, Progress logging, Custom time format, Timestamps -@section Repeating items -@cindex TODO items, repeating -@cindex deadlines, repeating -@cindex scheduling, repeating -Org-mode integrates with the Emacs calendar and diary to display cyclic -appointments, anniversaries and other special entries in the agenda -(@pxref{Weekly/Daily agenda}). However, it can be useful to have -certain deadlines and scheduling items to auto-repeat. The advantage of -a deadline or scheduled item is that the they produce warnings ahead of -time and automatically forward themselves in the agenda until they are -done. The abstract difference is therefore between cyclic -@i{appointments} and cyclic @i{action items}. For appointments you -should use the diary, for actions you can uses an org-mode deadline or -scheduling time stamp together with a REPEAT cookie. For example: +@node Deadlines and scheduling, Progress logging, Creating timestamps, Timestamps +@section Deadlines and Scheduling + +A time stamp may be preceded by special keywords to facilitate planning +of work: + +@table @var +@item DEADLINE +@cindex DEADLINE keyword +The task (most likely a TODO item) is supposed to be finished on that +date, and it will be listed then. In addition, the compilation for +@emph{today} will carry a warning about the approaching or missed +deadline, starting @code{org-deadline-warning-days} before the due date, +and continuing until the entry is marked DONE. An example: @example -* TODO Replace batteries in smoke detector REPEAT(+18m) - SCHEDULED: <2007-01-01 Mon> - -* TODO Get dentist appointment REPEAT(+6m) - SCHEDULED: <2006-12-19 Tue> - -* TODO Tax report to IRS REPEAT(+1y) - DEADLINE: <2007-04-01 Sun> +*** TODO write article about the Earth for the Guide + The editor in charge is [[bbdb:Ford Prefect]] + DEADLINE: <2004-02-29 Sun> @end example -Each time you try to mark one of these entries DONE using @kbd{C-c C-t}, -they will automatically switch back to the state TODO, and the -deadline/scheduling will be shifted accordingly. The time units -recognized by org-mode are year (y), month (m), week (w), and day (d). -Org-mode will also prompt you for a note and record the fact that you -have closed this item in a note under the headline. +@item SCHEDULED +@cindex SCHEDULED keyword +You are planning to start working on that task on the given date. The +headline will be listed under the given date@footnote{It will still be +listed on that date after it has been marked DONE. If you don't like +this, set the variable @code{org-agenda-skip-scheduled-if-done}.}. In +addition, a reminder that the scheduled date has passed will be present +in the compilation for @emph{today}, until the entry is marked DONE. +I.e., the task will automatically be forwarded until completed. -One unusual property of these repeating items is that only one instance -of each exist at any given time. So if you look back or ahead in the -agenda, you will not find past and future instances, only the current -one will show up. Use a cyclic diary entry if you need all past and -future instances to be visible in the agenda. +@example +*** TODO Call Trillian for a date on New Years Eve. + SCHEDULED: <2004-12-25 Sat> +@end example +@end table -@c FIXME: Document that a note is always being taken. +@menu +* Inserting deadline/schedule:: +* Repeated tasks:: +@end menu -@node Progress logging, , Repeating items, Timestamps +@node Inserting deadline/schedule, Repeated tasks, Deadlines and scheduling, Deadlines and scheduling +@subsection Inserting deadline/schedule + +The following commands allow to quickly insert a deadline or to schedule +an item: + +@table @kbd +@c +@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. +@c FIXME Any CLOSED timestamp will be removed.???????? +@c +@kindex C-c C-w +@cindex sparse tree, for deadlines +@item C-c C-w +Create a sparse tree with all deadlines that are either past-due, or +which will become due within @code{org-deadline-warning-days}. +With @kbd{C-u} prefix, show all deadlines in the file. With a numeric +prefix, check that many days. For example, @kbd{C-1 C-c C-w} shows +all deadlines due tomorrow. +@c +@kindex C-c C-s +@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. +@end table + +@node Repeated tasks, , Inserting deadline/schedule, Deadlines and scheduling +@subsection Repeated Tasks + +Some tasks need to be repeated again and again, and Org-mode therefore +allows to use a repeater in a DEADLINE or SCHEDULED time stamp, for +example: +@example +** TODO Pay the rent + DEADLINE: <2005-10-01 Sat +1m> +@end example + +Deadlines and scheduled items produce entries in the agenda when they +are over-due, so it is important to be able to mark such an entry as +completed once you have done so. When you mark a DEADLINE or a SCHEDULE +with the todo keyword DONE, it will no longer produce entries in the +agenda. The problem with this is, however, that then also the +@emph{next} instance of the repeated entry will not be active. Org-mode +deals with this in the following way: When you try to mark such an entry +DONE (using @kbd{C-c C-t}), it will shift the base date of the repeating +time stamp by the repeater interval, and immediately set the entry state +back to TODO. In the example above, setting the state to DONE would +actually switch the date like this: + +@example +** TODO Pay the rent + 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. + +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 +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. + +@node Progress logging, , Deadlines and scheduling, Timestamps @section Progress Logging @cindex progress logging @cindex logging, of progress @@ -3335,6 +3378,7 @@ these into a separate file that starts with: #+STARTUP: lognotestate @end example + @node Clocking work time, , Tracking TODO state changes, Progress logging @subsection Clocking work time @@ -3879,6 +3923,23 @@ Sunrise/Sunset times, show lunar phases and to convert to other calendars, respectively. @kbd{c} can be used to switch back and forth between calendar and agenda. +If you are using the diary only for sexp entries and holidays, it is +faster to not use the above setting, but instead to copy or even move +the entries into an Org-mode file. Org-mode evaluates diary-style sexp +entries, and does it faster because there is no overhead for first +creating the diary display. Note that the sexp entries must start at +the left margin, no white space is allowed before them. For example, +the following segment of an Org-mode file will be processed and entries +will be made in the agenda: + +@example +* Birthdays and similar stuff +#+CATEGORY: Holiday +%%(org-calendar-holiday) ; special function for holiday names +#+CATEGORY: Ann +%%(diary-anniversary 14 5 1956) Artur Dent %d is years old +%%(diary-anniversary 2 10 1869) Mahatma Gandhi would be %d years old +@end example @node Global TODO list, Matching headline tags, Weekly/Daily agenda, Built-in agenda views @subsection The global TODO list @@ -5151,13 +5212,24 @@ Export as HTML file and open it with a browser. @kindex C-c C-e H @item C-c C-e H Export to a temporary buffer, do not create a file. +@kindex C-c C-e R +@item C-c C-e H +Export the active region to a temporary buffer. With prefix arg, do not +produce file header and foot, but just the plain HTML section for the +region. This is good for cut-and-paste operations. @kindex C-c C-e v h @kindex C-c C-e v b @kindex C-c C-e v H +@kindex C-c C-e v R @item C-c C-e v h @item C-c C-e v b @item C-c C-e v H +@item C-c C-e v R Export only the visible part of the document. +@item M-x org-export-region-as-html +Convert the region to HTML under the assumption that it was org-mode +syntax before. This is a global command that can be invoked in any +buffer. @end table @cindex headline levels, for exporting @@ -6048,6 +6120,10 @@ This line sets the archive location for the agenda file. It applies for all subsequent lines until the next @samp{#+CATEGORY} line, or the end of the file. The first such line also applies to any entries before it. The corresponding variable is @code{org-archive-location}. +@item #+PRIORITIES: highest lowest default +This line sets the limits and the default for the priorities. All three +must be either letters A-Z or numbers 0-9. The highest priority must +have a lower ASCII number that the lowest priority. @item #+TBLFM: This line contains the formulas for the table directly above the line. @item #+TITLE:, #+AUTHOR:, #+EMAIL:, #+LANGUAGE:, #+TEXT:, #+OPTIONS: @@ -6893,6 +6969,9 @@ asked for a way to narrow wide table columns. @i{Christian Egli} converted the documentation into TeXInfo format, patched CSS formatting into the HTML exporter, and inspired the agenda. @item +@i{David Emery} provided a patch for custom CSS support in exported +HTML agendas. +@item @i{Nic Ferrier} contributed mailcap and XOXO support. @item @i{John Foerch} figured out how to make incremental search show context @@ -6908,6 +6987,11 @@ translated David O'Toole's tutorial into French. @i{Shidai Liu} ("Leo") asked for embedded LaTeX and tested it. He also provided frequent feedback and some patches. @item +@i{Jason F. McBrayer} suggested agenda export to CSV format. +@item +@i{Dmitri Minaev} sent a patch to set priority limits on a per-file +basis. +@item @i{Stefan Monnier} provided a patch to keep the Emacs-Lisp compiler happy. @item diff --git a/orgcard.pdf b/orgcard.pdf index 8f07685b5..71fcca41f 100644 Binary files a/orgcard.pdf and b/orgcard.pdf differ diff --git a/orgcard.tex b/orgcard.tex index 4e11c7892..64107b413 100644 --- a/orgcard.tex +++ b/orgcard.tex @@ -1,5 +1,5 @@ % Reference Card for Org Mode -\def\orgversionnumber{4.74} +\def\orgversionnumber{4.75} \def\versionyear{2007} % latest update \def\year{2007} % latest copyright year %