aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Dominik2008-10-25 21:35:48 +0000
committerCarsten Dominik2008-10-25 21:35:48 +0000
commit71d35b2418ec19b79c09f15f88e7a46acae9f8c4 (patch)
tree630786d48294e2357994c128b6d8cf10170602c5
parent7f5cd5548e0183470b7127d45911f98d7a9bb5a2 (diff)
downloademacs-71d35b2418ec19b79c09f15f88e7a46acae9f8c4.tar.gz
emacs-71d35b2418ec19b79c09f15f88e7a46acae9f8c4.zip
2008-10-26 Carsten Dominik <dominik@science.uva.nl>
* org-agenda.el (org-format-agenda-item) (org-agenda-filter-make-matcher): Make sure tags are stored and compared donwcased. 2008-10-26 Carsten Dominik <dominik@science.uva.nl> * org.el (org-insert-todo-heading): Fix bug with force-heading argument. 2008-10-26 Carsten Dominik <dominik@science.uva.nl> * org-exp.el (org-export-as-ascii): Handle the case that we are bulishing from an indirect buffer. * org-table.el (org-table-copy-down): Fix bug with time stamp increment. * org-mouse.el (org-mouse-features): New option. (org-mode-hook): Turn on features depending on `org-mouse-features'. * org.el (org-insert-heading-respect-content): Force heading creation. (org-insert-heading): keep the folding state of the heading before the inserted one. 2008-10-26 Carsten Dominik <dominik@science.uva.nl> * org-archive.el (org-archive-to-archive-sibling): Handle top level headlines better. 2008-10-26 Bastien Guerry <bzg@altern.org> * org-export-latex.el (org-export-latex-classes): Added \usepackage{graphicx} to the default list of packages. 2008-10-26 Carsten Dominik <dominik@science.uva.nl> * org-agenda.el (org-agenda-filter): Renamed from `org-agenda-filter-tags'. 2008-10-26 Carsten Dominik <dominik@science.uva.nl> * org.el (org-entry-properties): Add CATEGORY property, iven if it is not defined as a property in this entry. (org-add-log-note): Mask prefix argument when immediately storing the note. * org-agenda.el (org-agenda-filter-effort-default-operator): New option. 2008-10-26 James TD Smith <ahktenzero@mohorovi.cc> * org.el (org-add-log-setup): Bugfix; code to find insertion point after drawers was skipping ahead one line too many, so notes were inserted after the first note instead of before it. 2008-10-26 Carsten Dominik <dominik@science.uva.nl> * org-agenda.el (org-agenda-filter-tags,org-agenda-filter-form): New variables. (org-prepare-agenda): Reset the filter tags. (org-agenda-filter-by-tag, org-agenda-filter-by-tag-show-all): Show filter tags in mode line. * org-table.el (orgtbl-to-html): Bind `html-table-tag' for the formatter. * org-export-latex.el (org-latex-entities-regexp): New constant. (org-export-as-pdf): Use two calls to `shell-command'. 2008-10-26 Carsten Dominik <dominik@science.uva.nl> * org-export-latex.el (org-export-latex-treat-sub-super-char): Honor the {} value of the subsuperscript setting. Make sure that longer subsuperscripts are typeset in a roman font. * org.el (org-clock-update-time-maybe): Compute negative clock intervals correctly. 2008-10-26 Carsten Dominik <dominik@science.uva.nl> * org.el (org-add-log-setup): Respect `org-log-state-notes-insert-after-drawers'. (org-log-state-notes-insert-after-drawers): New option. (org-todo-trigger-tag-changes): New function. (org-todo): Call `org-todo-trigger-tag-changes'. 2008-10-26 James TD Smith <ahktenzero@mohorovi.cc> * org.el (org-add-log-setup): Only skip drawers if the are immediately after the scheduling keywords. * org-clock.el (org-clock-in-switch-to-state): Allow this to be a function (org-clock-in): If `org-clock-in-switch-to-state' is a function, call it with the current todo state to get the state to switch to when clocking in. (org-clock-in): Use org-indent-line-function to indent clock lines. (org-clock-find-position): Fix indentation of empty clock drawers. 2008-10-26 Carsten Dominik <dominik@science.uva.nl> * org-publish.el (org-publish-org-to): Handle case when org-export-to-pdf does return a file name, not a buffer. (org-publish-org-to-pdf): New function. * org-export-latex.el (org-export-as-pdf) (org-export-as-pdf-and-open): New commands. * org-table.el (org-table-eval-formula): Avoid parsing Calc's HMS forms as ranges. * org-export-latex.el (org-export-latex-lists): Ignore lists-like things in protexted regions. 2008-10-26 Carsten Dominik <dominik@science.uva.nl> * org-export-latex.el (org-export-latex-preprocess): Improve quoting of LaTeX environments.
-rw-r--r--doc/misc/org.texi174
-rw-r--r--etc/refcards/orgcard.tex8
-rw-r--r--lisp/org/ChangeLog123
-rw-r--r--lisp/org/org-agenda.el203
-rw-r--r--lisp/org/org-archive.el13
-rw-r--r--lisp/org/org-attach.el2
-rw-r--r--lisp/org/org-bbdb.el2
-rw-r--r--lisp/org/org-bibtex.el2
-rw-r--r--lisp/org/org-clock.el37
-rw-r--r--lisp/org/org-colview.el2
-rw-r--r--lisp/org/org-compat.el96
-rw-r--r--lisp/org/org-exp.el22
-rw-r--r--lisp/org/org-export-latex.el160
-rw-r--r--lisp/org/org-faces.el2
-rw-r--r--lisp/org/org-gnus.el2
-rw-r--r--lisp/org/org-id.el5
-rw-r--r--lisp/org/org-info.el2
-rw-r--r--lisp/org/org-irc.el2
-rw-r--r--lisp/org/org-jsinfo.el2
-rw-r--r--lisp/org/org-list.el2
-rw-r--r--lisp/org/org-mac-message.el2
-rw-r--r--lisp/org/org-macs.el2
-rw-r--r--lisp/org/org-mew.el2
-rw-r--r--lisp/org/org-mhe.el2
-rw-r--r--lisp/org/org-mouse.el64
-rw-r--r--lisp/org/org-plot.el2
-rw-r--r--lisp/org/org-publish.el69
-rw-r--r--lisp/org/org-remember.el2
-rw-r--r--lisp/org/org-rmail.el2
-rw-r--r--lisp/org/org-table.el10
-rw-r--r--lisp/org/org-vm.el2
-rw-r--r--lisp/org/org-wl.el2
-rw-r--r--lisp/org/org.el116
33 files changed, 828 insertions, 310 deletions
diff --git a/doc/misc/org.texi b/doc/misc/org.texi
index 019d9578e13..5e1246ba5c9 100644
--- a/doc/misc/org.texi
+++ b/doc/misc/org.texi
@@ -3,7 +3,7 @@
3@setfilename ../../info/org 3@setfilename ../../info/org
4@settitle The Org Manual 4@settitle The Org Manual
5 5
6@set VERSION 6.09a 6@set VERSION 6.10c
7@set DATE October 2008 7@set DATE October 2008
8 8
9@dircategory Emacs 9@dircategory Emacs
@@ -291,7 +291,7 @@ Exporting
291* The export dispatcher:: How to access exporter commands 291* The export dispatcher:: How to access exporter commands
292* ASCII export:: Exporting to plain ASCII 292* ASCII export:: Exporting to plain ASCII
293* HTML export:: Exporting to HTML 293* HTML export:: Exporting to HTML
294* LaTeX export:: Exporting to LaTeX 294* LaTeX and PDF export:: Exporting to LaTeX, and processing to PDF
295* XOXO export:: Exporting to XOXO 295* XOXO export:: Exporting to XOXO
296* iCalendar export:: Exporting in iCalendar format 296* iCalendar export:: Exporting in iCalendar format
297 297
@@ -321,9 +321,9 @@ HTML export
321* CSS support:: Changing the appearance of the output 321* CSS support:: Changing the appearance of the output
322* Javascript support:: Info and Folding in a web browser 322* Javascript support:: Info and Folding in a web browser
323 323
324LaTeX export 324LaTeX and PDF export
325 325
326* LaTeX export commands:: How to invoke LaTeX export 326* LaTeX/PDF export commands::
327* Quoting LaTeX code:: Incorporating literal LaTeX code 327* Quoting LaTeX code:: Incorporating literal LaTeX code
328* Sectioning structure:: Changing sectioning in LaTeX output 328* Sectioning structure:: Changing sectioning in LaTeX output
329 329
@@ -541,7 +541,7 @@ You need to fix the single quotes by hand, or copy from Info
541documentation.} 541documentation.}
542@end iftex 542@end iftex
543 543
544Add the following lines to your @file{.emacs} file. The last two lines 544Add the following lines to your @file{.emacs} file. The last three lines
545define @emph{global} keys for the commands @command{org-store-link}, 545define @emph{global} keys for the commands @command{org-store-link},
546@command{org-agenda}, and @command{org-iswitchb} - please choose suitable 546@command{org-agenda}, and @command{org-iswitchb} - please choose suitable
547keys yourself. 547keys yourself.
@@ -859,11 +859,14 @@ you can use the following keys to find your destination:
859@example 859@example
860@key{TAB} @r{Cycle visibility.} 860@key{TAB} @r{Cycle visibility.}
861@key{down} / @key{up} @r{Next/previous visible headline.} 861@key{down} / @key{up} @r{Next/previous visible headline.}
862@key{RET} @r{Select this location.}
863@kbd{/} @r{Do a Sparse-tree search}
864@r{The following keys work if you turn off @code{org-goto-auto-isearch}}
862n / p @r{Next/previous visible headline.} 865n / p @r{Next/previous visible headline.}
863f / b @r{Next/previous headline same level.} 866f / b @r{Next/previous headline same level.}
864u @r{One level up.} 867u @r{One level up.}
8650-9 @r{Digit argument.} 8680-9 @r{Digit argument.}
866@key{RET} @r{Select this location.} 869q @r{Quit}
867@end example 870@end example
868@end table 871@end table
869 872
@@ -897,8 +900,9 @@ of a headline), then a headline like the current one will be inserted
897after the end of the subtree. 900after the end of the subtree.
898@kindex C-@key{RET} 901@kindex C-@key{RET}
899@item C-@key{RET} 902@item C-@key{RET}
900Just like @kbd{M-@key{RET}}, but if the heading is inserted after the current, 903Just like @kbd{M-@key{RET}}, except when adding a new heading below the
901insert it actually after the entire subtree. 904current heading, the new heading is placed after the body instead of before
905it. This command works from anywhere in the entry.
902@kindex M-S-@key{RET} 906@kindex M-S-@key{RET}
903@item M-S-@key{RET} 907@item M-S-@key{RET}
904Insert new TODO entry with same level as current heading. 908Insert new TODO entry with same level as current heading.
@@ -927,9 +931,7 @@ level).
927@item M-S-@key{down} 931@item M-S-@key{down}
928Move subtree down (swap with next subtree of same level). 932Move subtree down (swap with next subtree of same level).
929@kindex C-c C-x C-w 933@kindex C-c C-x C-w
930@kindex C-c C-x C-k
931@item C-c C-x C-w 934@item C-c C-x C-w
932@itemx C-c C-x C-k
933Kill subtree, i.e. remove it from buffer but save in kill ring. 935Kill subtree, i.e. remove it from buffer but save in kill ring.
934With a numeric prefix argument N, kill N sequential subtrees. 936With a numeric prefix argument N, kill N sequential subtrees.
935@kindex C-c C-x M-w 937@kindex C-c C-x M-w
@@ -2272,12 +2274,10 @@ functions.
2272@cindex plot tables using gnuplot 2274@cindex plot tables using gnuplot
2273 2275
2274Org Plot can produce 2D and 3D graphs of information stored in org tables 2276Org Plot can produce 2D and 3D graphs of information stored in org tables
2275using @file{Gnuplot} (see @uref{http://www.gnuplot.info/, the Gnuplot 2277using @file{Gnuplot} @uref{http://www.gnuplot.info/} and @file{gnuplot-mode}
2276website}) and @file{gnuplot-mode} (see 2278@uref{http://cars9.uchicago.edu/~ravel/software/gnuplot-mode.html}. To see
2277@uref{http://cars9.uchicago.edu/~ravel/software/gnuplot-mode.html, the 2279this in action ensure that you have both Gnuplot and Gnuplot-mode installed
2278gnuplot-mode website}). To see this in action ensure that you have both 2280on your system, then call @code{org-plot/gnuplot} on the following table.
2279Gnuplot and Gnuplot-mode installed on your system, then call
2280@code{org-plot/gnuplot} on the following table.
2281 2281
2282@example 2282@example
2283@group 2283@group
@@ -2296,8 +2296,8 @@ Notice that Org Plot is smart enough to apply the tables headers as labels.
2296Further control over the labels, type, content, and appearance of plots can 2296Further control over the labels, type, content, and appearance of plots can
2297be exercised through the @code{#+Plot:} lines preceding a table. See below 2297be exercised through the @code{#+Plot:} lines preceding a table. See below
2298for a complete list of Org plot options. For more information and examples 2298for a complete list of Org plot options. For more information and examples
2299@uref{http://orgmode.org/worg/org-tutorials/org-plot.php, the org-plot 2299see the org-plot tutorial at
2300tutorial}. 2300@uref{http://legito.org/worg/org-tutorials/org-plot.php}.
2301 2301
2302@subsubheading Plot Options 2302@subsubheading Plot Options
2303 2303
@@ -2312,8 +2312,10 @@ Specify the title of the plot.
2312Specify which column of the table to use as the @code{x} axis. 2312Specify which column of the table to use as the @code{x} axis.
2313 2313
2314@item deps 2314@item deps
2315Specify (as a comma seperated list with no spaces) which columns of the table 2315Specify the columns to graph as a lisp style list, surrounded by parenthesis
2316to graph against the ind (defaults to all other columns). 2316and separated by spaces for example @code{dep:(3 4)} to graph the third and
2317fourth columns (defaults to graphing all other columns aside from the ind
2318column).
2317 2319
2318@item type 2320@item type
2319Specify whether the plot will be @code{2d}, @code{3d}, or @code{grid}. 2321Specify whether the plot will be @code{2d}, @code{3d}, or @code{grid}.
@@ -2895,6 +2897,10 @@ commands}). @xref{Global TODO list}, for more information.
2895Insert a new TODO entry below the current one. 2897Insert a new TODO entry below the current one.
2896@end table 2898@end table
2897 2899
2900@noindent
2901Changing a TODO state can also trigger tag changes. See the docstring of the
2902option @code{org-todo-state-tags-triggers} for details.
2903
2898@node TODO extensions, Progress logging, TODO basics, TODO Items 2904@node TODO extensions, Progress logging, TODO basics, TODO Items
2899@section Extended use of TODO keywords 2905@section Extended use of TODO keywords
2900@cindex extended TODO keywords 2906@cindex extended TODO keywords
@@ -3225,7 +3231,6 @@ settings like @code{TODO(!)}. For example
3225 :END: 3231 :END:
3226@end example 3232@end example
3227 3233
3228
3229@node Priorities, Breaking down tasks, Progress logging, TODO Items 3234@node Priorities, Breaking down tasks, Progress logging, TODO Items
3230@section Priorities 3235@section Priorities
3231@cindex priorities 3236@cindex priorities
@@ -3471,8 +3476,8 @@ After a colon, @kbd{M-@key{TAB}} offers completion on tags. There is
3471also a special command for inserting tags: 3476also a special command for inserting tags:
3472 3477
3473@table @kbd 3478@table @kbd
3474@kindex C-c C-c 3479@kindex C-c C-q
3475@item C-c C-c 3480@item C-c C-q
3476@cindex completion, of tags 3481@cindex completion, of tags
3477Enter new tags for the current headline. Org mode will either offer 3482Enter new tags for the current headline. Org mode will either offer
3478completion or a special single-key interface for setting tags, see 3483completion or a special single-key interface for setting tags, see
@@ -3481,6 +3486,9 @@ to @code{org-tags-column}. When called with a @kbd{C-u} prefix, all
3481tags in the current buffer will be aligned to that column, just to make 3486tags in the current buffer will be aligned to that column, just to make
3482things look nice. TAGS are automatically realigned after promotion, 3487things look nice. TAGS are automatically realigned after promotion,
3483demotion, and TODO state changes (@pxref{TODO basics}). 3488demotion, and TODO state changes (@pxref{TODO basics}).
3489@kindex C-c C-c
3490@item C-c C-c
3491When the cursor is in a headline, this does the same as @kbd{C-c C-q}.
3484@end table 3492@end table
3485 3493
3486Org will support tag insertion based on a @emph{list of tags}. By 3494Org will support tag insertion based on a @emph{list of tags}. By
@@ -4857,10 +4865,10 @@ you want to clock your time). For a specific buffer you can use
4857@end example 4865@end example
4858 4866
4859@noindent 4867@noindent
4860or you can set up these values globally by customizing the variables 4868or, even better, you can set up these values globally by customizing the
4861@code{org-global-properties} and @code{org-columns-default-format}. In 4869variables @code{org-global-properties} and @code{org-columns-default-format}.
4862particular if you want to use this setup also in the agenda, a global setup 4870In particular if you want to use this setup also in the agenda, a global
4863may be advised. 4871setup may be advised.
4864 4872
4865The way to assign estimates to individual items is then to switch to column 4873The way to assign estimates to individual items is then to switch to column
4866mode, and to use @kbd{S-@key{right}} and @kbd{S-@key{left}} to change the 4874mode, and to use @kbd{S-@key{right}} and @kbd{S-@key{left}} to change the
@@ -4876,6 +4884,10 @@ option @code{org-agenda-columns-add-appointments-to-effort-sum}. The
4876appointments on a day that take place over a specified time interval will 4884appointments on a day that take place over a specified time interval will
4877then also be added to the load estimate of the day. 4885then also be added to the load estimate of the day.
4878 4886
4887Effort estimates can be used in secondary agenda filtering that is triggered
4888with the @kbd{/} key in the agenda (@pxref{Agenda commands}). If you have
4889these estimates defined consistently, two or three key presses will narrow
4890down the list to stuff that fits into an available time slot.
4879 4891
4880@node Capture, Agenda Views, Dates and Times, Top 4892@node Capture, Agenda Views, Dates and Times, Top
4881@chapter Capture 4893@chapter Capture
@@ -5829,9 +5841,7 @@ sequence in which they are found in the agenda files.
5829 5841
5830Sorting can be customized using the variable 5842Sorting can be customized using the variable
5831@code{org-agenda-sorting-strategy}, and may also include criteria based on 5843@code{org-agenda-sorting-strategy}, and may also include criteria based on
5832the estimated effort of an entry. 5844the estimated effort of an entry (@pxref{Effort estimates}).
5833@c FIXME: link!!!!!!!!
5834
5835 5845
5836@node Agenda commands, Custom agenda views, Presentation and sorting, Agenda Views 5846@node Agenda commands, Custom agenda views, Presentation and sorting, Agenda Views
5837@section Commands in the agenda buffer 5847@section Commands in the agenda buffer
@@ -5988,17 +5998,48 @@ that entry would be in the original buffer (taken from a property, from a
5988@code{org-columns-default-format}), will be used in the agenda. 5998@code{org-columns-default-format}), will be used in the agenda.
5989 5999
5990@tsubheading{Secondary filtering and query editing} 6000@tsubheading{Secondary filtering and query editing}
6001@cindex filtering, by tag and effort, in agenda
6002@cindex tag filtering, in agenda
6003@cindex effort filtering, in agenda
5991@cindex query editing, in agenda 6004@cindex query editing, in agenda
5992 6005
5993@kindex / 6006@kindex /
5994@item / 6007@item /
5995Filter the current agenda view with respect to a tag. You will be prompted 6008Filter the current agenda view with respect to a tag and/or effort estimates.
5996for a tag selection letter. Pressing @key{TAB} at that prompt will offer use 6009The difference between this and a custom agenda commands is that filtering is
5997completion to select a tag (including any tags that do not have a selection 6010very fast, so that you can switch quickly between different filters without
5998character). The command then hides all entries that do not contain or 6011having to recreate the agenda.
5999inherit this tag. When called with prefix arg, remove the entries that 6012
6000@emph{do} have the tag. A second @kbd{/} at the prompt will unhide any 6013You will be prompted for a tag selection letter. Pressing @key{TAB} at that
6001hidden entries. 6014prompt will offer use completion to select a tag (including any tags that do
6015not have a selection character). The command then hides all entries that do
6016not contain or inherit this tag. When called with prefix arg, remove the
6017entries that @emph{do} have the tag. A second @kbd{/} at the prompt will
6018turn off the filter and unhide any hidden entries. If the first key you
6019press is either @kbd{+} or @kbd{-}, the previous filter will be narrowed by
6020requiring or forbidding the selected additional tag. Instead of pressing
6021@kbd{+} or @kbd{-}, you can also use the @kbd{\} command.
6022
6023In order to filter for effort estimates, you should set-up allowed
6024efforts globally, for example
6025@lisp
6026(setq org-global-properties
6027 '(("Effort_ALL". "0 0:10 0:30 1:00 2:00 3:00 4:00")))
6028@end lisp
6029You can then filter for an effort by first typing an operator, one of @kbd{<},
6030@kbd{>}, and @kbd{=}, and then the one-digit index of an effort estimate in
6031your array of allowed values, where @kbd{0} means the 10th value. The filter
6032will then restrict to entries with effort smaller-or-equal, equal, or
6033larger-or-equal than the selected value. If the digits 0-9 are not used as
6034fast access keys to tags, you can also simply press the index digit directly
6035without an operator. In this case, @kbd{<} will be assumed.
6036
6037@kindex \
6038@item \
6039Narrow the current agenda filter by an additional condition. When called with
6040prefix arg, remove the entries that @emph{do} have the tag, or that do match
6041the effort criterion. You can achieve the same effect by pressing @kbd{+} or
6042@kbd{-} as the first key after the @kbd{/} command.
6002 6043
6003@kindex [ 6044@kindex [
6004@kindex ] 6045@kindex ]
@@ -6520,7 +6561,8 @@ From the command line you may also use
6520emacs -f org-batch-store-agenda-views -kill 6561emacs -f org-batch-store-agenda-views -kill
6521@end example 6562@end example
6522@noindent 6563@noindent
6523or, if you need to modify some parameters 6564or, if you need to modify some parameters@footnote{Quoting may depend on the
6565system you use, please check th FAQ for examples.}
6524@example 6566@example
6525emacs -eval '(org-batch-store-agenda-views \ 6567emacs -eval '(org-batch-store-agenda-views \
6526 org-agenda-ndays 30 \ 6568 org-agenda-ndays 30 \
@@ -6930,7 +6972,7 @@ Org mode only supports export, not import of these different formats.
6930* The export dispatcher:: How to access exporter commands 6972* The export dispatcher:: How to access exporter commands
6931* ASCII export:: Exporting to plain ASCII 6973* ASCII export:: Exporting to plain ASCII
6932* HTML export:: Exporting to HTML 6974* HTML export:: Exporting to HTML
6933* LaTeX export:: Exporting to LaTeX 6975* LaTeX and PDF export:: Exporting to LaTeX, and processing to PDF
6934* XOXO export:: Exporting to XOXO 6976* XOXO export:: Exporting to XOXO
6935* iCalendar export:: Exporting in iCalendar format 6977* iCalendar export:: Exporting in iCalendar format
6936@end menu 6978@end menu
@@ -7454,7 +7496,7 @@ the body text. Any indentation larger than this is adjusted to preserve
7454the layout relative to the first line. Should there be lines with less 7496the layout relative to the first line. Should there be lines with less
7455indentation than the first, these are left alone. 7497indentation than the first, these are left alone.
7456 7498
7457@node HTML export, LaTeX export, ASCII export, Exporting 7499@node HTML export, LaTeX and PDF export, ASCII export, Exporting
7458@section HTML export 7500@section HTML export
7459@cindex HTML export 7501@cindex HTML export
7460 7502
@@ -7698,19 +7740,23 @@ You can choose default values for these options by customizing the variable
7698@code{org-infojs-options}. If you always want to apply the script to your 7740@code{org-infojs-options}. If you always want to apply the script to your
7699pages, configure the variable @code{org-export-html-use-infojs}. 7741pages, configure the variable @code{org-export-html-use-infojs}.
7700 7742
7701@node LaTeX export, XOXO export, HTML export, Exporting 7743@node LaTeX and PDF export, XOXO export, HTML export, Exporting
7702@section LaTeX export 7744@section LaTeX and PDF export
7703@cindex LaTeX export 7745@cindex LaTeX export
7746@cindex PDF export
7704 7747
7705Org mode contains a La@TeX{} exporter written by Bastien Guerry. 7748Org mode contains a La@TeX{} exporter written by Bastien Guerry. With
7749further processing, this backend is also used to produce PDF output. Since
7750the LaTeX output uses @file{hyperref} to implement links and cross
7751references, the PDF output file will be fully linked.
7706 7752
7707@menu 7753@menu
7708* LaTeX export commands:: How to invoke LaTeX export 7754* LaTeX/PDF export commands::
7709* Quoting LaTeX code:: Incorporating literal LaTeX code 7755* Quoting LaTeX code:: Incorporating literal LaTeX code
7710* Sectioning structure:: Changing sectioning in LaTeX output 7756* Sectioning structure:: Changing sectioning in LaTeX output
7711@end menu 7757@end menu
7712 7758
7713@node LaTeX export commands, Quoting LaTeX code, LaTeX export, LaTeX export 7759@node LaTeX/PDF export commands, Quoting LaTeX code, LaTeX and PDF export, LaTeX and PDF export
7714@subsection LaTeX export commands 7760@subsection LaTeX export commands
7715 7761
7716@table @kbd 7762@table @kbd
@@ -7738,6 +7784,12 @@ buffer.
7738@item M-x org-replace-region-by-latex 7784@item M-x org-replace-region-by-latex
7739Replace the active region (assumed to be in Org mode syntax) by La@TeX{} 7785Replace the active region (assumed to be in Org mode syntax) by La@TeX{}
7740code. 7786code.
7787@kindex C-c C-e p
7788@item C-c C-e p
7789Export as LaTeX and then process to PDF.
7790@kindex C-c C-e d
7791@item C-c C-e d
7792Export as LaTeX and then process to PDF, then open the resulting PDF file.
7741@end table 7793@end table
7742 7794
7743@cindex headline levels, for exporting 7795@cindex headline levels, for exporting
@@ -7757,7 +7809,7 @@ with a numeric prefix argument. For example,
7757@noindent 7809@noindent
7758creates two levels of headings and does the rest as items. 7810creates two levels of headings and does the rest as items.
7759 7811
7760@node Quoting LaTeX code, Sectioning structure, LaTeX export commands, LaTeX export 7812@node Quoting LaTeX code, Sectioning structure, LaTeX/PDF export commands, LaTeX and PDF export
7761@subsection Quoting LaTeX code 7813@subsection Quoting LaTeX code
7762 7814
7763Embedded La@TeX{} as described in @ref{Embedded LaTeX} will be correctly 7815Embedded La@TeX{} as described in @ref{Embedded LaTeX} will be correctly
@@ -7778,7 +7830,7 @@ All lines between these markers are exported literally
7778#+END_LaTeX 7830#+END_LaTeX
7779@end example 7831@end example
7780 7832
7781@node Sectioning structure, , Quoting LaTeX code, LaTeX export 7833@node Sectioning structure, , Quoting LaTeX code, LaTeX and PDF export
7782@subsection Sectioning structure 7834@subsection Sectioning structure
7783@cindex LaTeX class 7835@cindex LaTeX class
7784@cindex LaTeX sectioning structure 7836@cindex LaTeX sectioning structure
@@ -7786,13 +7838,13 @@ All lines between these markers are exported literally
7786By default, the La@TeX{} output uses the class @code{article}. 7838By default, the La@TeX{} output uses the class @code{article}.
7787 7839
7788You can change this globally by setting a different value for 7840You can change this globally by setting a different value for
7789@code{org-export-latex-default-class} or locally by adding an option 7841@code{org-export-latex-default-class} or locally by adding an option like
7790like @code{#+LaTeX_CLASS: myclass} in your file. The class should be 7842@code{#+LaTeX_CLASS: myclass} in your file. The class should be listed in
7791listed in @code{org-export-latex-classes}, where you can also define the 7843@code{org-export-latex-classes}, where you can also define the sectioning
7792sectioning structure for each class. 7844structure for each class, as well as defining additonal classes.
7793 7845
7794 7846
7795@node XOXO export, iCalendar export, LaTeX export, Exporting 7847@node XOXO export, iCalendar export, LaTeX and PDF export, Exporting
7796@section XOXO export 7848@section XOXO export
7797@cindex XOXO export 7849@cindex XOXO export
7798 7850
@@ -7984,14 +8036,14 @@ and @code{:exclude}.
7984@cindex action, for publishing 8036@cindex action, for publishing
7985 8037
7986Publishing means that a file is copied to the destination directory and 8038Publishing means that a file is copied to the destination directory and
7987possibly transformed in the process. The default transformation is to 8039possibly transformed in the process. The default transformation is to export
7988export Org files as HTML files, and this is done by the function 8040Org files as HTML files, and this is done by the function
7989@code{org-publish-org-to-html} which calls the HTML exporter 8041@code{org-publish-org-to-html} which calls the HTML exporter (@pxref{HTML
7990(@pxref{HTML export}). But you also can publish your files in La@TeX{} by 8042export}). But you also can publish your files in La@TeX{} by using the
7991using the function @code{org-publish-org-to-latex} instead. Other files 8043function @code{org-publish-org-to-latex} instead, or as PDF files using
7992like images only need to be copied to the publishing destination. For 8044@code{org-publish-org-to-pdf}. Other files like images only need to be
7993non-Org files, you need to specify the publishing function. 8045copied to the publishing destination. For non-Org files, you need to provide
7994 8046your own publishing function:
7995 8047
7996@multitable @columnfractions 0.3 0.7 8048@multitable @columnfractions 0.3 0.7
7997@item @code{:publishing-function} 8049@item @code{:publishing-function}
@@ -8633,7 +8685,7 @@ tty you would rather use @kbd{C-c .} to re-insert the timestamp.
8633@item @kbd{S-@key{TAB}} @tab @kbd{C-u @key{TAB}} @tab 8685@item @kbd{S-@key{TAB}} @tab @kbd{C-u @key{TAB}} @tab
8634@item @kbd{M-@key{left}} @tab @kbd{C-c C-x l} @tab @kbd{@key{Esc} @key{left}} 8686@item @kbd{M-@key{left}} @tab @kbd{C-c C-x l} @tab @kbd{@key{Esc} @key{left}}
8635@item @kbd{M-S-@key{left}} @tab @kbd{C-c C-x L} @tab 8687@item @kbd{M-S-@key{left}} @tab @kbd{C-c C-x L} @tab
8636@item @kbd{M-@key{right}} @tab @kbd{C-c C-x r} @tab @kbd{@key{Esc} @key{right}} 8688@item @kbd{M-@key{right}} @tab @kbd{C-c C-x i} @tab @kbd{@key{Esc} @key{right}}
8637@item @kbd{M-S-@key{right}} @tab @kbd{C-c C-x R} @tab 8689@item @kbd{M-S-@key{right}} @tab @kbd{C-c C-x R} @tab
8638@item @kbd{M-@key{up}} @tab @kbd{C-c C-x u} @tab @kbd{@key{Esc} @key{up}} 8690@item @kbd{M-@key{up}} @tab @kbd{C-c C-x u} @tab @kbd{@key{Esc} @key{up}}
8639@item @kbd{M-S-@key{up}} @tab @kbd{C-c C-x U} @tab 8691@item @kbd{M-S-@key{up}} @tab @kbd{C-c C-x U} @tab
diff --git a/etc/refcards/orgcard.tex b/etc/refcards/orgcard.tex
index 4b1f2b38cc1..f745556f0ea 100644
--- a/etc/refcards/orgcard.tex
+++ b/etc/refcards/orgcard.tex
@@ -1,5 +1,5 @@
1% Reference Card for Org Mode 1% Reference Card for Org Mode
2\def\orgversionnumber{6.09a} 2\def\orgversionnumber{6.10c}
3\def\versionyear{2008} % latest update 3\def\versionyear{2008} % latest update
4\def\year{2008} % latest copyright year 4\def\year{2008} % latest copyright year
5 5
@@ -539,8 +539,8 @@ after ``{\tt :}'', and dictionary words elsewhere.
539 539
540\section{Tags} 540\section{Tags}
541 541
542\key{set tags for current heading}{C-c C-c} 542\key{set tags for current heading}{C-c C-q}
543\key{realign tags in all headings}{C-u C-c C-c} 543\key{realign tags in all headings}{C-u C-c C-q}
544\key{create sparse tree with matching tags}{C-c \\} 544\key{create sparse tree with matching tags}{C-c \\}
545\key{globally (agenda) match tags at cursor}{C-c C-o} 545\key{globally (agenda) match tags at cursor}{C-c C-o}
546 546
@@ -607,7 +607,7 @@ after ``{\tt :}'', and dictionary words elsewhere.
607\key{compile agenda for the current week}{C-c a a$^1$} 607\key{compile agenda for the current week}{C-c a a$^1$}
608\key{compile global TODO list}{C-c a t$^1$} 608\key{compile global TODO list}{C-c a t$^1$}
609\key{compile TODO list for specific keyword}{C-c a T$^1$} 609\key{compile TODO list for specific keyword}{C-c a T$^1$}
610\key{match tags, ODO kwds, properties}{C-c a m$^1$} 610\key{match tags, TODO kwds, properties}{C-c a m$^1$}
611\key{match only in TODO entries}{C-c a M$^1$} 611\key{match only in TODO entries}{C-c a M$^1$}
612\key{find stuck projects}{C-c a \#$^1$} 612\key{find stuck projects}{C-c a \#$^1$}
613\key{show timeline of current org file}{C-c a L$^1$} 613\key{show timeline of current org file}{C-c a L$^1$}
diff --git a/lisp/org/ChangeLog b/lisp/org/ChangeLog
index f7c3c58c9c8..40a8ee75f35 100644
--- a/lisp/org/ChangeLog
+++ b/lisp/org/ChangeLog
@@ -1,3 +1,126 @@
12008-10-26 Carsten Dominik <dominik@science.uva.nl>
2
3 * org-agenda.el (org-format-agenda-item)
4 (org-agenda-filter-make-matcher): Make sure tags are stored and
5 compared donwcased.
6
72008-10-26 Carsten Dominik <dominik@science.uva.nl>
8
9 * org.el (org-insert-todo-heading): Fix bug with force-heading
10 argument.
11
122008-10-26 Carsten Dominik <dominik@science.uva.nl>
13
14 * org-exp.el (org-export-as-ascii): Handle the case that we are
15 bulishing from an indirect buffer.
16
17 * org-table.el (org-table-copy-down): Fix bug with time stamp
18 increment.
19
20 * org-mouse.el (org-mouse-features): New option.
21 (org-mode-hook): Turn on features depending on
22 `org-mouse-features'.
23
24 * org.el (org-insert-heading-respect-content): Force heading
25 creation.
26 (org-insert-heading): keep the folding state of the heading before
27 the inserted one.
28
292008-10-26 Carsten Dominik <dominik@science.uva.nl>
30
31 * org-archive.el (org-archive-to-archive-sibling): Handle top
32 level headlines better.
33
342008-10-26 Bastien Guerry <bzg@altern.org>
35
36 * org-export-latex.el (org-export-latex-classes): Added
37 \usepackage{graphicx} to the default list of packages.
38
392008-10-26 Carsten Dominik <dominik@science.uva.nl>
40
41 * org-agenda.el (org-agenda-filter): Renamed from
42 `org-agenda-filter-tags'.
43
442008-10-26 Carsten Dominik <dominik@science.uva.nl>
45
46 * org.el (org-entry-properties): Add CATEGORY property, iven if it
47 is not defined as a property in this entry.
48 (org-add-log-note): Mask prefix argument when immediately storing
49 the note.
50
51 * org-agenda.el (org-agenda-filter-effort-default-operator): New
52 option.
53
542008-10-26 James TD Smith <ahktenzero@mohorovi.cc>
55
56 * org.el (org-add-log-setup): Bugfix; code to find insertion point
57 after drawers was skipping ahead one line too many, so notes were
58 inserted after the first note instead of before it.
59
602008-10-26 Carsten Dominik <dominik@science.uva.nl>
61
62 * org-agenda.el (org-agenda-filter-tags,org-agenda-filter-form):
63 New variables.
64 (org-prepare-agenda): Reset the filter tags.
65 (org-agenda-filter-by-tag, org-agenda-filter-by-tag-show-all):
66 Show filter tags in mode line.
67
68 * org-table.el (orgtbl-to-html): Bind `html-table-tag' for the
69 formatter.
70
71 * org-export-latex.el (org-latex-entities-regexp): New constant.
72 (org-export-as-pdf): Use two calls to `shell-command'.
73
742008-10-26 Carsten Dominik <dominik@science.uva.nl>
75
76 * org-export-latex.el (org-export-latex-treat-sub-super-char):
77 Honor the {} value of the subsuperscript setting. Make sure that
78 longer subsuperscripts are typeset in a roman font.
79
80 * org.el (org-clock-update-time-maybe): Compute negative clock
81 intervals correctly.
82
832008-10-26 Carsten Dominik <dominik@science.uva.nl>
84
85 * org.el (org-add-log-setup): Respect
86 `org-log-state-notes-insert-after-drawers'.
87 (org-log-state-notes-insert-after-drawers): New option.
88 (org-todo-trigger-tag-changes): New function.
89 (org-todo): Call `org-todo-trigger-tag-changes'.
90
912008-10-26 James TD Smith <ahktenzero@mohorovi.cc>
92
93 * org.el (org-add-log-setup): Only skip drawers if the are
94 immediately after the scheduling keywords.
95
96 * org-clock.el (org-clock-in-switch-to-state): Allow this to be a
97 function
98 (org-clock-in): If `org-clock-in-switch-to-state' is a function,
99 call it with the current todo state to get the state to switch to
100 when clocking in.
101 (org-clock-in): Use org-indent-line-function to indent clock lines.
102 (org-clock-find-position): Fix indentation of empty clock drawers.
103
1042008-10-26 Carsten Dominik <dominik@science.uva.nl>
105
106 * org-publish.el (org-publish-org-to): Handle case when
107 org-export-to-pdf does return a file name, not a buffer.
108 (org-publish-org-to-pdf): New function.
109
110 * org-export-latex.el (org-export-as-pdf)
111 (org-export-as-pdf-and-open): New commands.
112
113 * org-table.el (org-table-eval-formula): Avoid parsing Calc's HMS
114 forms as ranges.
115
116 * org-export-latex.el (org-export-latex-lists): Ignore lists-like
117 things in protexted regions.
118
1192008-10-26 Carsten Dominik <dominik@science.uva.nl>
120
121 * org-export-latex.el (org-export-latex-preprocess): Improve
122 quoting of LaTeX environments.
123
12008-10-19 Eli Zaretskii <eliz@gnu.org> 1242008-10-19 Eli Zaretskii <eliz@gnu.org>
2 125
3 * org.el (org-default-notes-file): 126 * org.el (org-default-notes-file):
diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el
index 3a244302e93..8dd31c8e481 100644
--- a/lisp/org/org-agenda.el
+++ b/lisp/org/org-agenda.el
@@ -6,7 +6,7 @@
6;; Author: Carsten Dominik <carsten at orgmode dot org> 6;; Author: Carsten Dominik <carsten at orgmode dot org>
7;; Keywords: outlines, hypermedia, calendar, wp 7;; Keywords: outlines, hypermedia, calendar, wp
8;; Homepage: http://orgmode.org 8;; Homepage: http://orgmode.org
9;; Version: 6.09a 9;; Version: 6.10c
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
@@ -32,6 +32,7 @@
32 32
33(require 'org) 33(require 'org)
34(eval-when-compile 34(eval-when-compile
35 (require 'cl)
35 (require 'calendar)) 36 (require 'calendar))
36 37
37(declare-function diary-add-to-list "diary-lib" 38(declare-function diary-add-to-list "diary-lib"
@@ -386,6 +387,14 @@ or `C-c a #' to produce the list."
386 (repeat :tag "Projects are *not* stuck if they have an entry with TAG being any of" (string)) 387 (repeat :tag "Projects are *not* stuck if they have an entry with TAG being any of" (string))
387 (regexp :tag "Projects are *not* stuck if this regexp matches\ninside the subtree"))) 388 (regexp :tag "Projects are *not* stuck if this regexp matches\ninside the subtree")))
388 389
390(defcustom org-agenda-filter-effort-default-operator "<"
391 "The default operator for effort estimate filtering.
392If you select an effort estimate limit with first pressing an operator,
393this one will be used."
394 :group 'org-agenda-custom-commands
395 :type '(choice (const :tag "less or equal" "<")
396 (const :tag "greater or equal"">")
397 (const :tag "equal" "=")))
389 398
390(defgroup org-agenda-skip nil 399(defgroup org-agenda-skip nil
391 "Options concerning skipping parts of agenda files." 400 "Options concerning skipping parts of agenda files."
@@ -1092,6 +1101,7 @@ The following commands are available:
1092(org-defkey org-agenda-mode-map "t" 'org-agenda-todo) 1101(org-defkey org-agenda-mode-map "t" 'org-agenda-todo)
1093(org-defkey org-agenda-mode-map "a" 'org-agenda-toggle-archive-tag) 1102(org-defkey org-agenda-mode-map "a" 'org-agenda-toggle-archive-tag)
1094(org-defkey org-agenda-mode-map ":" 'org-agenda-set-tags) 1103(org-defkey org-agenda-mode-map ":" 'org-agenda-set-tags)
1104(org-defkey org-agenda-mode-map "\C-c\C-q" 'org-agenda-set-tags)
1095(org-defkey org-agenda-mode-map "." 'org-agenda-goto-today) 1105(org-defkey org-agenda-mode-map "." 'org-agenda-goto-today)
1096(org-defkey org-agenda-mode-map "j" 'org-agenda-goto-date) 1106(org-defkey org-agenda-mode-map "j" 'org-agenda-goto-date)
1097(org-defkey org-agenda-mode-map "d" 'org-agenda-day-view) 1107(org-defkey org-agenda-mode-map "d" 'org-agenda-day-view)
@@ -1167,6 +1177,7 @@ The following commands are available:
1167(org-defkey org-agenda-mode-map "{" 'org-agenda-manipulate-query-add-re) 1177(org-defkey org-agenda-mode-map "{" 'org-agenda-manipulate-query-add-re)
1168(org-defkey org-agenda-mode-map "}" 'org-agenda-manipulate-query-subtract-re) 1178(org-defkey org-agenda-mode-map "}" 'org-agenda-manipulate-query-subtract-re)
1169(org-defkey org-agenda-mode-map "/" 'org-agenda-filter-by-tag) 1179(org-defkey org-agenda-mode-map "/" 'org-agenda-filter-by-tag)
1180(org-defkey org-agenda-mode-map "\\" 'org-agenda-filter-by-tag-refine)
1170 1181
1171(defvar org-agenda-keymap (copy-keymap org-agenda-mode-map) 1182(defvar org-agenda-keymap (copy-keymap org-agenda-mode-map)
1172 "Local keymap for agenda entries from Org-mode.") 1183 "Local keymap for agenda entries from Org-mode.")
@@ -1953,9 +1964,11 @@ higher priority settings."
1953(defvar org-pre-agenda-window-conf nil) 1964(defvar org-pre-agenda-window-conf nil)
1954(defvar org-agenda-columns-active nil) 1965(defvar org-agenda-columns-active nil)
1955(defvar org-agenda-name nil) 1966(defvar org-agenda-name nil)
1967(defvar org-agenda-filter nil)
1956(defun org-prepare-agenda (&optional name) 1968(defun org-prepare-agenda (&optional name)
1957 (setq org-todo-keywords-for-agenda nil) 1969 (setq org-todo-keywords-for-agenda nil)
1958 (setq org-done-keywords-for-agenda nil) 1970 (setq org-done-keywords-for-agenda nil)
1971 (setq org-agenda-filter nil)
1959 (if org-agenda-multi 1972 (if org-agenda-multi
1960 (progn 1973 (progn
1961 (setq buffer-read-only nil) 1974 (setq buffer-read-only nil)
@@ -3737,7 +3750,7 @@ Any match of REMOVE-RE will be removed from TXT."
3737 3750
3738 ;; And finally add the text properties 3751 ;; And finally add the text properties
3739 (org-add-props rtn nil 3752 (org-add-props rtn nil
3740 'org-category (downcase category) 'tags tags 3753 'org-category (downcase category) 'tags (mapcar 'downcase tags)
3741 'org-highest-priority org-highest-priority 3754 'org-highest-priority org-highest-priority
3742 'org-lowest-priority org-lowest-priority 3755 'org-lowest-priority org-lowest-priority
3743 'prefix-length (- (length rtn) (length txt)) 3756 'prefix-length (- (length rtn) (length txt))
@@ -3934,7 +3947,7 @@ HH:MM."
3934 (t nil)))) 3947 (t nil))))
3935 3948
3936(defsubst org-cmp-tag (a b) 3949(defsubst org-cmp-tag (a b)
3937 "Compare the string values of categories of strings A and B." 3950 "Compare the string values of the first tags of A and B."
3938 (let ((ta (car (last (get-text-property 1 'tags a)))) 3951 (let ((ta (car (last (get-text-property 1 'tags a))))
3939 (tb (car (last (get-text-property 1 'tags b))))) 3952 (tb (car (last (get-text-property 1 'tags b)))))
3940 (cond ((not ta) +1) 3953 (cond ((not ta) +1)
@@ -4101,6 +4114,7 @@ So this is just a shortcut for `\\[org-agenda]', available in the agenda."
4101When this is the global TODO list, a prefix argument will be interpreted." 4114When this is the global TODO list, a prefix argument will be interpreted."
4102 (interactive) 4115 (interactive)
4103 (let* ((org-agenda-keep-modes t) 4116 (let* ((org-agenda-keep-modes t)
4117 (filter org-agenda-filter)
4104 (cols org-agenda-columns-active) 4118 (cols org-agenda-columns-active)
4105 (line (org-current-line)) 4119 (line (org-current-line))
4106 (window-line (- line (org-current-line (window-start)))) 4120 (window-line (- line (org-current-line (window-start))))
@@ -4111,52 +4125,138 @@ When this is the global TODO list, a prefix argument will be interpreted."
4111 (setq org-agenda-undo-list nil 4125 (setq org-agenda-undo-list nil
4112 org-agenda-pending-undo-list nil) 4126 org-agenda-pending-undo-list nil)
4113 (message "Rebuilding agenda buffer...done") 4127 (message "Rebuilding agenda buffer...done")
4128 (and filter (org-agenda-filter-apply filter))
4114 (and cols (interactive-p) (org-agenda-columns)) 4129 (and cols (interactive-p) (org-agenda-columns))
4115 (goto-line line) 4130 (goto-line line)
4116 (recenter window-line))) 4131 (recenter window-line)))
4117 4132
4133
4118(defvar org-global-tags-completion-table nil) 4134(defvar org-global-tags-completion-table nil)
4119(defun org-agenda-filter-by-tag (strip &optional char) 4135(defvar org-agenda-filter-form nil)
4136(defun org-agenda-filter-by-tag (strip &optional char narrow)
4120 "Keep only those lines in the agenda buffer that have a specific tag. 4137 "Keep only those lines in the agenda buffer that have a specific tag.
4121The tag is selected with its fast selection letter, as configured. 4138The tag is selected with its fast selection letter, as configured.
4122With prefix argument STRIP, remove all lines that do have the tag." 4139With prefix argument STRIP, remove all lines that do have the tag.
4140A lisp caller can specify CHAR. NARROW means that the new tag should be
4141used to narrow the search - the interactive user can also press `-' or `+'
4142to switch to narrowing."
4123 (interactive "P") 4143 (interactive "P")
4124 (let (char a tag tags (inhibit-read-only t)) 4144 (let* ((alist org-tag-alist-for-agenda)
4125 (message "Select tag [%s] or no tag [ ], [TAB] to complete, [/] to restore: " 4145 (tag-chars (mapconcat
4126 (mapconcat 4146 (lambda (x) (if (cdr x) (char-to-string (cdr x)) ""))
4127 (lambda (x) (if (cdr x) (char-to-string (cdr x)) "")) 4147 alist ""))
4128 org-tag-alist-for-agenda "")) 4148 (efforts (org-split-string
4149 (or (cdr (assoc (concat org-effort-property "_ALL")
4150 org-global-properties))
4151 "0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00 8:00" "")))
4152 (effort-op org-agenda-filter-effort-default-operator)
4153 (effort-prompt "")
4154 (inhibit-read-only t)
4155 (current org-agenda-filter)
4156 char a n tag tags)
4157 (unless char
4158 (message
4159 "%s by tag [%s ], [TAB], [/]:off, [+-]:narrow, [>=<]:effort: "
4160 (if narrow "Narrow" "Filter") tag-chars)
4161 (setq char (read-char)))
4162 (when (member char '(?+ ?-))
4163 ;; Narrowing down
4164 (cond ((equal char ?-) (setq strip t narrow t))
4165 ((equal char ?+) (setq strip nil narrow t)))
4166 (message
4167 "Narrow by tag [%s ], [TAB], [/]:off, [>=<]:effort: " tag-chars)
4168 (setq char (read-char)))
4169 (when (member char '(?< ?> ?=))
4170 ;; An effort operator
4171 (setq effort-op (char-to-string char))
4172 (loop for i from 0 to 9 do
4173 (setq effort-prompt
4174 (concat
4175 effort-prompt " ["
4176 (if (= i 9) "0" (int-to-string (1+ i)))
4177 "]" (nth i efforts))))
4178 (setq alist nil) ; to make sure it will be interpreted as effort.
4179 (message "Effort%s: %s " effort-op effort-prompt)
4129 (setq char (read-char)) 4180 (setq char (read-char))
4130 (when (equal char ?\t) 4181 (when (or (< char ?0) (> char ?9))
4131 (unless (local-variable-p 'org-global-tags-completion-table) 4182 (error "Need 1-9,0 to select effort" )))
4132 (org-set-local 'org-global-tags-completion-table 4183 (when (equal char ?\t)
4133 (org-global-tags-completion-table))) 4184 (unless (local-variable-p 'org-global-tags-completion-table (current-buffer))
4134 (let ((completion-ignore-case t)) 4185 (org-set-local 'org-global-tags-completion-table
4135 (setq tag (completing-read 4186 (org-global-tags-completion-table)))
4136 "Tag: " org-global-tags-completion-table)))) 4187 (let ((completion-ignore-case t))
4137 (cond 4188 (setq tag (completing-read
4138 ((equal char ?/) (org-agenda-filter-by-tag-show-all)) 4189 "Tag: " org-global-tags-completion-table))))
4139 ((or (equal char ?\ ) 4190 (cond
4140 (setq a (rassoc char org-tag-alist-for-agenda)) 4191 ((equal char ?/) (org-agenda-filter-by-tag-show-all))
4141 (and tag (setq a (cons tag nil)))) 4192 ((or (equal char ?\ )
4142 (org-agenda-filter-by-tag-show-all) 4193 (setq a (rassoc char alist))
4143 (setq tag (car a)) 4194 (and (>= char ?0) (<= char ?9)
4144 (save-excursion 4195 (setq n (if (= char ?0) 9 (- char ?0 1))
4145 (goto-char (point-min)) 4196 tag (concat effort-op (nth n efforts))
4146 (while (not (eobp)) 4197 a (cons tag nil)))
4147 (if (get-text-property (point) 'org-marker) 4198 (and tag (setq a (cons tag nil))))
4148 (progn 4199 (org-agenda-filter-by-tag-show-all)
4149 (setq tags (get-text-property (point) 'tags)) 4200 (setq tag (car a))
4150 (if (not tag) 4201 (setq org-agenda-filter
4151 (if (or (and strip (not tags)) 4202 (cons (concat (if strip "-" "+") tag)
4152 (and (not strip) tags)) 4203 (if narrow current nil)))
4153 (org-agenda-filter-by-tag-hide-line)) 4204 (org-agenda-filter-apply org-agenda-filter))
4154 (if (or (and (member tag tags) strip) 4205 (t (error "Invalid tag selection character %c" char)))))
4155 (and (not (member tag tags)) (not strip))) 4206
4156 (org-agenda-filter-by-tag-hide-line))) 4207(defun org-agenda-filter-by-tag-refine (strip &optional char)
4157 (beginning-of-line 2)) 4208 "Refine the current filter. See `org-agenda-filter-by-tag."
4158 (beginning-of-line 2))))) 4209 (interactive "P")
4159 (t (error "Invalid tag selection character %c" char))))) 4210 (org-agenda-filter-by-tag strip char 'refine))
4211
4212(defun org-agenda-filter-make-matcher ()
4213 "Create the form that tests a line for the agenda filter."
4214 (let (f f1)
4215 (dolist (x org-agenda-filter)
4216 (if (member x '("-" "+"))
4217 (setq f1 '(not tags))
4218 (if (string-match "[<=>]" x)
4219 (setq f1 (org-agenda-filter-effort-form x))
4220 (setq f1 (list 'member (downcase (substring x 1)) 'tags)))
4221 (if (equal (string-to-char x) ?-)
4222 (setq f1 (list 'not f1))))
4223 (push f1 f))
4224 (cons 'and (nreverse f))))
4225
4226(defun org-agenda-filter-effort-form (e)
4227 "Return the form to compare the effort of the current line with what E says.
4228E looks line \"+<2:25\"."
4229 (let (op)
4230 (setq e (substring e 1))
4231 (setq op (string-to-char e) e (substring e 1))
4232 (setq op (if (equal op ?<) '<= (if (equal op ?>) '>= '=)))
4233 (list 'org-agenda-compare-effort (list 'quote op)
4234 (org-hh:mm-string-to-minutes e))))
4235
4236(defun org-agenda-compare-effort (op value)
4237 "Compare the effort of the current line with VALUE, using OP.
4238If the line does not have an effort defined, return nil."
4239 (let ((eff (get-text-property (point) 'effort-minutes)))
4240 (if (not eff)
4241 nil ; we don't have an effort defined
4242 (funcall op eff value))))
4243
4244(defun org-agenda-filter-apply (filter)
4245 "Set FILTER as the new agenda filter and apply it."
4246 (let (tags)
4247 (setq org-agenda-filter filter
4248 org-agenda-filter-form (org-agenda-filter-make-matcher))
4249 (org-agenda-set-mode-name)
4250 (save-excursion
4251 (goto-char (point-min))
4252 (while (not (eobp))
4253 (if (get-text-property (point) 'org-marker)
4254 (progn
4255 (setq tags (get-text-property (point) 'tags))
4256 (if (not (eval org-agenda-filter-form))
4257 (org-agenda-filter-by-tag-hide-line))
4258 (beginning-of-line 2))
4259 (beginning-of-line 2))))))
4160 4260
4161(defvar org-agenda-filter-overlays nil) 4261(defvar org-agenda-filter-overlays nil)
4162 4262
@@ -4168,9 +4268,23 @@ With prefix argument STRIP, remove all lines that do have the tag."
4168 (org-overlay-put ov 'type 'tags-filter) 4268 (org-overlay-put ov 'type 'tags-filter)
4169 (push ov org-agenda-filter-overlays))) 4269 (push ov org-agenda-filter-overlays)))
4170 4270
4271(defun org-agenda-fix-tags-filter-overlays-at (&optional pos)
4272 (setq pos (or pos (point)))
4273 (save-excursion
4274 (dolist (ov (org-overlays-at pos))
4275 (when (and (org-overlay-get ov 'invisible)
4276 (eq (org-overlay-get ov 'type) 'tags-filter))
4277 (goto-char pos)
4278 (if (< (org-overlay-start ov) (point-at-eol))
4279 (org-move-overlay ov (point-at-eol)
4280 (org-overlay-end ov)))))))
4281
4171(defun org-agenda-filter-by-tag-show-all () 4282(defun org-agenda-filter-by-tag-show-all ()
4172 (mapc 'org-delete-overlay org-agenda-filter-overlays) 4283 (mapc 'org-delete-overlay org-agenda-filter-overlays)
4173 (setq org-agenda-filter-overlays nil)) 4284 (setq org-agenda-filter-overlays nil)
4285 (setq org-agenda-filter nil)
4286 (setq org-agenda-filter-form nil)
4287 (org-agenda-set-mode-name))
4174 4288
4175(defun org-agenda-manipulate-query-add () 4289(defun org-agenda-manipulate-query-add ()
4176 "Manipulate the query by adding a search term with positive selection. 4290 "Manipulate the query by adding a search term with positive selection.
@@ -4509,6 +4623,9 @@ so that the date SD will be in that range."
4509 (if org-agenda-include-diary " Diary" "") 4623 (if org-agenda-include-diary " Diary" "")
4510 (if org-agenda-use-time-grid " Grid" "") 4624 (if org-agenda-use-time-grid " Grid" "")
4511 (if org-agenda-show-log " Log" "") 4625 (if org-agenda-show-log " Log" "")
4626 (if org-agenda-filter
4627 (concat " {" (mapconcat 'identity org-agenda-filter "") "}")
4628 "")
4512 (if org-agenda-archives-mode 4629 (if org-agenda-archives-mode
4513 (if (eq org-agenda-archives-mode t) 4630 (if (eq org-agenda-archives-mode t)
4514 " Archives" 4631 " Archives"
@@ -5002,13 +5119,15 @@ the same tree node, and the headline of the tree node in the Org-mode file."
5002(defun org-agenda-show-new-time (marker stamp &optional prefix) 5119(defun org-agenda-show-new-time (marker stamp &optional prefix)
5003 "Show new date stamp via text properties." 5120 "Show new date stamp via text properties."
5004 ;; We use text properties to make this undoable 5121 ;; We use text properties to make this undoable
5005 (let ((inhibit-read-only t)) 5122 (let ((inhibit-read-only t)
5123 (buffer-invisibility-spec))
5006 (setq stamp (concat " " prefix " => " stamp)) 5124 (setq stamp (concat " " prefix " => " stamp))
5007 (save-excursion 5125 (save-excursion
5008 (goto-char (point-max)) 5126 (goto-char (point-max))
5009 (while (not (bobp)) 5127 (while (not (bobp))
5010 (when (equal marker (get-text-property (point) 'org-marker)) 5128 (when (equal marker (get-text-property (point) 'org-marker))
5011 (org-move-to-column (- (window-width) (length stamp)) t) 5129 (org-move-to-column (- (window-width) (length stamp)) t)
5130 (org-agenda-fix-tags-filter-overlays-at (point))
5012 (if (featurep 'xemacs) 5131 (if (featurep 'xemacs)
5013 ;; Use `duplicable' property to trigger undo recording 5132 ;; Use `duplicable' property to trigger undo recording
5014 (let ((ex (make-extent nil nil)) 5133 (let ((ex (make-extent nil nil))
diff --git a/lisp/org/org-archive.el b/lisp/org/org-archive.el
index 91705775e00..75acc8e89ec 100644
--- a/lisp/org/org-archive.el
+++ b/lisp/org/org-archive.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.09a 8;; Version: 6.10c
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
@@ -322,12 +322,13 @@ sibling does not exist, it will be created at the end of the subtree."
322 (setq pos (point)) 322 (setq pos (point))
323 (condition-case nil 323 (condition-case nil
324 (outline-up-heading 1 t) 324 (outline-up-heading 1 t)
325 (error (goto-char (point-min)))) 325 (error (setq e (point-max)) (goto-char (point-min))))
326 (setq b (point)) 326 (setq b (point))
327 (condition-case nil 327 (unless e
328 (org-end-of-subtree t t) 328 (condition-case nil
329 (error (goto-char (point-max)))) 329 (org-end-of-subtree t t)
330 (setq e (point)) 330 (error (goto-char (point-max))))
331 (setq e (point)))
331 (goto-char b) 332 (goto-char b)
332 (unless (re-search-forward 333 (unless (re-search-forward
333 (concat "^" (regexp-quote leader) 334 (concat "^" (regexp-quote leader)
diff --git a/lisp/org/org-attach.el b/lisp/org/org-attach.el
index a43ec7e41f7..08b4a5997e6 100644
--- a/lisp/org/org-attach.el
+++ b/lisp/org/org-attach.el
@@ -4,7 +4,7 @@
4 4
5;; Author: John Wiegley <johnw@newartisans.com> 5;; Author: John Wiegley <johnw@newartisans.com>
6;; Keywords: org data task 6;; Keywords: org data task
7;; Version: 6.09a 7;; Version: 6.10c
8 8
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
10;; 10;;
diff --git a/lisp/org/org-bbdb.el b/lisp/org/org-bbdb.el
index fa72ba57086..ca68a20f684 100644
--- a/lisp/org/org-bbdb.el
+++ b/lisp/org/org-bbdb.el
@@ -6,7 +6,7 @@
6;; Thomas Baumann <thomas dot baumann at ch dot tum dot de> 6;; Thomas Baumann <thomas dot baumann at ch dot tum dot de>
7;; Keywords: outlines, hypermedia, calendar, wp 7;; Keywords: outlines, hypermedia, calendar, wp
8;; Homepage: http://orgmode.org 8;; Homepage: http://orgmode.org
9;; Version: 6.09a 9;; Version: 6.10c
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
diff --git a/lisp/org/org-bibtex.el b/lisp/org/org-bibtex.el
index 3b92b9c3430..94224afb100 100644
--- a/lisp/org/org-bibtex.el
+++ b/lisp/org/org-bibtex.el
@@ -5,7 +5,7 @@
5;; Author: Bastien Guerry <bzg at altern dot org> 5;; Author: Bastien Guerry <bzg at altern dot org>
6;; Carsten Dominik <carsten dot dominik at gmail dot com> 6;; Carsten Dominik <carsten dot dominik at gmail dot com>
7;; Keywords: org, wp, remember 7;; Keywords: org, wp, remember
8;; Version: 6.09a 8;; Version: 6.10c
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el
index 4a14100e2bf..d5bfbf46906 100644
--- a/lisp/org/org-clock.el
+++ b/lisp/org/org-clock.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.09a 8;; Version: 6.10c
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
@@ -67,12 +67,16 @@ A nil value means, clock will keep running until stopped explicitly with
67 67
68(defcustom org-clock-in-switch-to-state nil 68(defcustom org-clock-in-switch-to-state nil
69 "Set task to a special todo state while clocking it. 69 "Set task to a special todo state while clocking it.
70The value should be the state to which the entry should be switched." 70The value should be the state to which the entry should be
71switched. If the value is a function, it must take one
72parameter (the current TODO state of the item) and return the
73state to switch it to."
71 :group 'org-clock 74 :group 'org-clock
72 :group 'org-todo 75 :group 'org-todo
73 :type '(choice 76 :type '(choice
74 (const :tag "Don't force a state" nil) 77 (const :tag "Don't force a state" nil)
75 (string :tag "State"))) 78 (string :tag "State")
79 (symbol :tag "Function")))
76 80
77(defcustom org-clock-history-length 5 81(defcustom org-clock-history-length 5
78 "Number of clock tasks to remember in history." 82 "Number of clock tasks to remember in history."
@@ -265,12 +269,16 @@ the clocking selection, associated with the letter `d'."
265 (org-back-to-heading t) 269 (org-back-to-heading t)
266 (or interrupting (move-marker org-clock-interrupted-task nil)) 270 (or interrupting (move-marker org-clock-interrupted-task nil))
267 (org-clock-history-push) 271 (org-clock-history-push)
268 (when (and org-clock-in-switch-to-state 272 (cond ((functionp org-clock-in-switch-to-state)
269 (not (looking-at (concat outline-regexp "[ \t]*" 273 (looking-at org-complex-heading-regexp)
270 org-clock-in-switch-to-state 274 (let ((newstate (funcall org-clock-in-switch-to-state (match-string 2))))
271 "\\>")))) 275 (if newstate (org-todo newstate))))
272 (org-todo org-clock-in-switch-to-state)) 276 ((and org-clock-in-switch-to-state
273 (setq org-clock-heading-for-remember 277 (not (looking-at (concat outline-regexp "[ \t]*"
278 org-clock-in-switch-to-state
279 "\\>"))))
280 (org-todo org-clock-in-switch-to-state)))
281 (setq org-clock-heading-for-remember
274 (and (looking-at org-complex-heading-regexp) 282 (and (looking-at org-complex-heading-regexp)
275 (match-end 4) 283 (match-end 4)
276 (org-trim (buffer-substring (match-end 1) (match-end 4))))) 284 (org-trim (buffer-substring (match-end 1) (match-end 4)))))
@@ -283,9 +291,9 @@ the clocking selection, associated with the letter `d'."
283 (t "???"))) 291 (t "???")))
284 (setq org-clock-heading (org-propertize org-clock-heading 'face nil)) 292 (setq org-clock-heading (org-propertize org-clock-heading 'face nil))
285 (org-clock-find-position) 293 (org-clock-find-position)
286 294
287 (insert "\n") (backward-char 1) 295 (insert "\n") (backward-char 1)
288 (indent-relative) 296 (org-indent-line-function)
289 (insert org-clock-string " ") 297 (insert org-clock-string " ")
290 (setq org-clock-start-time (current-time)) 298 (setq org-clock-start-time (current-time))
291 (setq ts (org-insert-time-stamp (current-time) 'with-hm 'inactive)) 299 (setq ts (org-insert-time-stamp (current-time) 'with-hm 'inactive))
@@ -348,11 +356,12 @@ the clocking selection, associated with the letter `d'."
348 (or (bolp) (newline))) 356 (or (bolp) (newline)))
349 (when (eq t org-clock-into-drawer) 357 (when (eq t org-clock-into-drawer)
350 (insert ":CLOCK:\n:END:\n") 358 (insert ":CLOCK:\n:END:\n")
351 (beginning-of-line -1) 359 (beginning-of-line 0)
352 (org-indent-line-function) 360 (org-indent-line-function)
361 (beginning-of-line 0)
353 (org-flag-drawer t) 362 (org-flag-drawer t)
354 (beginning-of-line 2) 363 (org-indent-line-function)
355 (org-indent-line-function))))) 364 (beginning-of-line 2)))))
356 365
357(defun org-clock-out (&optional fail-quietly) 366(defun org-clock-out (&optional fail-quietly)
358 "Stop the currently running clock. 367 "Stop the currently running clock.
diff --git a/lisp/org/org-colview.el b/lisp/org/org-colview.el
index 18c14ccaeb7..6580def46e2 100644
--- a/lisp/org/org-colview.el
+++ b/lisp/org/org-colview.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.09a 8;; Version: 6.10c
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el
index 22348e5f19d..075fbac46e9 100644
--- a/lisp/org/org-compat.el
+++ b/lisp/org/org-compat.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.09a 8;; Version: 6.10c
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
@@ -176,7 +176,7 @@ that can be added."
176 ((fboundp 'add-to-invisibility-spec) 176 ((fboundp 'add-to-invisibility-spec)
177 (add-to-invisibility-spec arg)) 177 (add-to-invisibility-spec arg))
178 ((or (null buffer-invisibility-spec) (eq buffer-invisibility-spec t)) 178 ((or (null buffer-invisibility-spec) (eq buffer-invisibility-spec t))
179 (setq buffer-invisibility-spec (list arg))) 179 (setq buffer-invisibility-spec (list arg)))
180 (t 180 (t
181 (setq buffer-invisibility-spec 181 (setq buffer-invisibility-spec
182 (cons arg buffer-invisibility-spec))))) 182 (cons arg buffer-invisibility-spec)))))
@@ -197,56 +197,56 @@ that can be added."
197 197
198(defun org-indent-to-column (column &optional minimum buffer) 198(defun org-indent-to-column (column &optional minimum buffer)
199 "Work around a bug with extents with invisibility in XEmacs." 199 "Work around a bug with extents with invisibility in XEmacs."
200 (if (featurep 'xemacs) 200 (if (featurep 'xemacs)
201 (let ((ext-inv (extent-list 201 (let ((ext-inv (extent-list
202 nil (point-at-bol) (point-at-eol) 202 nil (point-at-bol) (point-at-eol)
203 'all-extents-closed-open 'invisible)) 203 'all-extents-closed-open 'invisible))
204 ext-inv-specs) 204 ext-inv-specs)
205 (dolist (ext ext-inv) 205 (dolist (ext ext-inv)
206 (when (extent-property ext 'invisible) 206 (when (extent-property ext 'invisible)
207 (add-to-list 'ext-inv-specs (list ext (extent-property 207 (add-to-list 'ext-inv-specs (list ext (extent-property
208 ext 'invisible))) 208 ext 'invisible)))
209 (set-extent-property ext 'invisible nil))) 209 (set-extent-property ext 'invisible nil)))
210 (indent-to-column column minimum buffer) 210 (indent-to-column column minimum buffer)
211 (dolist (ext-inv-spec ext-inv-specs) 211 (dolist (ext-inv-spec ext-inv-specs)
212 (set-extent-property (car ext-inv-spec) 'invisible 212 (set-extent-property (car ext-inv-spec) 'invisible
213 (cadr ext-inv-spec)))) 213 (cadr ext-inv-spec))))
214 (indent-to-column column minimum))) 214 (indent-to-column column minimum)))
215 215
216(defun org-indent-line-to (column) 216(defun org-indent-line-to (column)
217 "Work around a bug with extents with invisibility in XEmacs." 217 "Work around a bug with extents with invisibility in XEmacs."
218 (if (featurep 'xemacs) 218 (if (featurep 'xemacs)
219 (let ((ext-inv (extent-list 219 (let ((ext-inv (extent-list
220 nil (point-at-bol) (point-at-eol) 220 nil (point-at-bol) (point-at-eol)
221 'all-extents-closed-open 'invisible)) 221 'all-extents-closed-open 'invisible))
222 ext-inv-specs) 222 ext-inv-specs)
223 (dolist (ext ext-inv) 223 (dolist (ext ext-inv)
224 (when (extent-property ext 'invisible) 224 (when (extent-property ext 'invisible)
225 (add-to-list 'ext-inv-specs (list ext (extent-property 225 (add-to-list 'ext-inv-specs (list ext (extent-property
226 ext 'invisible))) 226 ext 'invisible)))
227 (set-extent-property ext 'invisible nil))) 227 (set-extent-property ext 'invisible nil)))
228 (indent-line-to column) 228 (indent-line-to column)
229 (dolist (ext-inv-spec ext-inv-specs) 229 (dolist (ext-inv-spec ext-inv-specs)
230 (set-extent-property (car ext-inv-spec) 'invisible 230 (set-extent-property (car ext-inv-spec) 'invisible
231 (cadr ext-inv-spec)))) 231 (cadr ext-inv-spec))))
232 (indent-line-to column))) 232 (indent-line-to column)))
233 233
234(defun org-move-to-column (column &optional force buffer) 234(defun org-move-to-column (column &optional force buffer)
235 (if (featurep 'xemacs) 235 (if (featurep 'xemacs)
236 (let ((ext-inv (extent-list 236 (let ((ext-inv (extent-list
237 nil (point-at-bol) (point-at-eol) 237 nil (point-at-bol) (point-at-eol)
238 'all-extents-closed-open 'invisible)) 238 'all-extents-closed-open 'invisible))
239 ext-inv-specs) 239 ext-inv-specs)
240 (dolist (ext ext-inv) 240 (dolist (ext ext-inv)
241 (when (extent-property ext 'invisible) 241 (when (extent-property ext 'invisible)
242 (add-to-list 'ext-inv-specs (list ext (extent-property ext 242 (add-to-list 'ext-inv-specs (list ext (extent-property ext
243 'invisible))) 243 'invisible)))
244 (set-extent-property ext 'invisible nil))) 244 (set-extent-property ext 'invisible nil)))
245 (move-to-column column force buffer) 245 (move-to-column column force buffer)
246 (dolist (ext-inv-spec ext-inv-specs) 246 (dolist (ext-inv-spec ext-inv-specs)
247 (set-extent-property (car ext-inv-spec) 'invisible 247 (set-extent-property (car ext-inv-spec) 'invisible
248 (cadr ext-inv-spec)))) 248 (cadr ext-inv-spec))))
249 (move-to-column column force))) 249 (move-to-column column force)))
250 250
251(defun org-get-x-clipboard-compat (value) 251(defun org-get-x-clipboard-compat (value)
252 "Get the clipboard value on XEmacs or Emacs 21" 252 "Get the clipboard value on XEmacs or Emacs 21"
@@ -263,7 +263,7 @@ that can be added."
263 (if (featurep 'xemacs) 263 (if (featurep 'xemacs)
264 (add-text-properties 0 (length string) properties string) 264 (add-text-properties 0 (length string) properties string)
265 (apply 'propertize string properties))) 265 (apply 'propertize string properties)))
266 266
267(provide 'org-compat) 267(provide 'org-compat)
268 268
269;; arch-tag: a0a0579f-e68c-4bdf-9e55-93768b846bbe 269;; arch-tag: a0a0579f-e68c-4bdf-9e55-93768b846bbe
diff --git a/lisp/org/org-exp.el b/lisp/org/org-exp.el
index 081b33309ea..c5c0bb30d47 100644
--- a/lisp/org/org-exp.el
+++ b/lisp/org/org-exp.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.09a 8;; Version: 6.10c
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
@@ -856,6 +856,7 @@ in this hook gets a chance to modify this property list. Each function
856must accept the property list as an argument, and must return the (possibly 856must accept the property list as an argument, and must return the (possibly
857modified) list.") 857modified) list.")
858 858
859;; FIXME: should we fold case here?
859(defun org-infile-export-plist () 860(defun org-infile-export-plist ()
860 "Return the property list with file-local settings for export." 861 "Return the property list with file-local settings for export."
861 (save-excursion 862 (save-excursion
@@ -1008,6 +1009,8 @@ value of `org-export-run-in-background'."
1008\[x] export as XOXO 1009\[x] export as XOXO
1009 1010
1010\[l] export as LaTeX 1011\[l] export as LaTeX
1012\[p] export as LaTeX and process to PDF
1013\[d] export as LaTeX, process to PDF, and open the resulting PDF document
1011\[L] export as LaTeX to temporary buffer 1014\[L] export as LaTeX to temporary buffer
1012 1015
1013\[i] export current file as iCalendar file 1016\[i] export current file as iCalendar file
@@ -1028,6 +1031,8 @@ value of `org-export-run-in-background'."
1028 (?R org-export-region-as-html nil) 1031 (?R org-export-region-as-html nil)
1029 (?x org-export-as-xoxo t) 1032 (?x org-export-as-xoxo t)
1030 (?l org-export-as-latex t) 1033 (?l org-export-as-latex t)
1034 (?p org-export-as-pdf t)
1035 (?d org-export-as-pdf-and-open t)
1031 (?L org-export-as-latex-to-buffer nil) 1036 (?L org-export-as-latex-to-buffer nil)
1032 (?i org-export-icalendar-this-file t) 1037 (?i org-export-icalendar-this-file t)
1033 (?I org-export-icalendar-all-agenda-files t) 1038 (?I org-export-icalendar-all-agenda-files t)
@@ -1041,12 +1046,17 @@ value of `org-export-run-in-background'."
1041 (delete-other-windows) 1046 (delete-other-windows)
1042 (with-output-to-temp-buffer "*Org Export/Publishing Help*" 1047 (with-output-to-temp-buffer "*Org Export/Publishing Help*"
1043 (princ help)) 1048 (princ help))
1049 (if (fboundp 'fit-window-to-buffer)
1050 (fit-window-to-buffer (get-buffer-window
1051 "*Org Export/Publishing Help*")))
1044 (message "Select command: ") 1052 (message "Select command: ")
1045 (setq r1 (read-char-exclusive))) 1053 (setq r1 (read-char-exclusive)))
1046 (setq r2 (if (< r1 27) (+ r1 96) r1)) 1054 (setq r2 (if (< r1 27) (+ r1 96) r1))
1047 (unless (setq ass (assq r2 cmds)) 1055 (unless (setq ass (assq r2 cmds))
1048 (error "No command associated with key %c" r1)) 1056 (error "No command associated with key %c" r1))
1049 (if (and bg (nth 2 ass)) 1057 (if (and bg (nth 2 ass)
1058 (not (buffer-base-buffer))
1059 (not (org-region-active-p)))
1050 ;; execute in background 1060 ;; execute in background
1051 (let ((p (start-process 1061 (let ((p (start-process
1052 (concat "Exporting " (file-name-nondirectory (buffer-file-name))) 1062 (concat "Exporting " (file-name-nondirectory (buffer-file-name)))
@@ -1496,7 +1506,6 @@ on this string to produce the exported version."
1496 ;; Remove or replace comments 1506 ;; Remove or replace comments
1497 (org-export-handle-comments (plist-get parameters :comments)) 1507 (org-export-handle-comments (plist-get parameters :comments))
1498 1508
1499
1500 (setq rtn (buffer-string))) 1509 (setq rtn (buffer-string)))
1501 (kill-buffer " org-mode-tmp") 1510 (kill-buffer " org-mode-tmp")
1502 rtn)) 1511 rtn))
@@ -2181,16 +2190,17 @@ underlined headlines. The default is 3."
2181 (umax nil) 2190 (umax nil)
2182 (umax-toc nil) 2191 (umax-toc nil)
2183 (case-fold-search nil) 2192 (case-fold-search nil)
2193 (bfname (buffer-file-name (or (buffer-base-buffer) (current-buffer))))
2184 (filename (concat (file-name-as-directory 2194 (filename (concat (file-name-as-directory
2185 (org-export-directory :ascii opt-plist)) 2195 (org-export-directory :ascii opt-plist))
2186 (file-name-sans-extension 2196 (file-name-sans-extension
2187 (or (and subtree-p 2197 (or (and subtree-p
2188 (org-entry-get (region-beginning) 2198 (org-entry-get (region-beginning)
2189 "EXPORT_FILE_NAME" t)) 2199 "EXPORT_FILE_NAME" t))
2190 (file-name-nondirectory buffer-file-name))) 2200 (file-name-nondirectory bfname)))
2191 ".txt")) 2201 ".txt"))
2192 (filename (if (equal (file-truename filename) 2202 (filename (if (equal (file-truename filename)
2193 (file-truename buffer-file-name)) 2203 (file-truename bfname))
2194 (concat filename ".txt") 2204 (concat filename ".txt")
2195 filename)) 2205 filename))
2196 (buffer (find-file-noselect filename)) 2206 (buffer (find-file-noselect filename))
@@ -2204,7 +2214,7 @@ underlined headlines. The default is 3."
2204 (plist-get opt-plist :skip-before-1st-heading)) 2214 (plist-get opt-plist :skip-before-1st-heading))
2205 (org-export-grab-title-from-buffer)) 2215 (org-export-grab-title-from-buffer))
2206 (file-name-sans-extension 2216 (file-name-sans-extension
2207 (file-name-nondirectory buffer-file-name)))) 2217 (file-name-nondirectory bfname))))
2208 (email (plist-get opt-plist :email)) 2218 (email (plist-get opt-plist :email))
2209 (language (plist-get opt-plist :language)) 2219 (language (plist-get opt-plist :language))
2210 (quote-re0 (concat "^[ \t]*" org-quote-string "\\>")) 2220 (quote-re0 (concat "^[ \t]*" org-quote-string "\\>"))
diff --git a/lisp/org/org-export-latex.el b/lisp/org/org-export-latex.el
index 09ddd9ada34..7a6cc8e3c98 100644
--- a/lisp/org/org-export-latex.el
+++ b/lisp/org/org-export-latex.el
@@ -4,7 +4,7 @@
4;; 4;;
5;; Emacs Lisp Archive Entry 5;; Emacs Lisp Archive Entry
6;; Filename: org-export-latex.el 6;; Filename: org-export-latex.el
7;; Version: 6.09a 7;; Version: 6.10c
8;; Author: Bastien Guerry <bzg AT altern DOT org> 8;; Author: Bastien Guerry <bzg AT altern DOT org>
9;; Maintainer: Bastien Guerry <bzg AT altern DOT org> 9;; Maintainer: Bastien Guerry <bzg AT altern DOT org>
10;; Keywords: org, wp, tex 10;; Keywords: org, wp, tex
@@ -36,6 +36,8 @@
36;; The interactive functions are similar to those of the HTML exporter: 36;; The interactive functions are similar to those of the HTML exporter:
37;; 37;;
38;; M-x `org-export-as-latex' 38;; M-x `org-export-as-latex'
39;; M-x `org-export-as-pdf'
40;; M-x `org-export-as-pdf-and-open'
39;; M-x `org-export-as-latex-batch' 41;; M-x `org-export-as-latex-batch'
40;; M-x `org-export-as-latex-to-buffer' 42;; M-x `org-export-as-latex-to-buffer'
41;; M-x `org-export-region-as-latex' 43;; M-x `org-export-region-as-latex'
@@ -88,6 +90,7 @@
88 "\\documentclass[11pt,a4paper]{article} 90 "\\documentclass[11pt,a4paper]{article}
89\\usepackage[utf8]{inputenc} 91\\usepackage[utf8]{inputenc}
90\\usepackage[T1]{fontenc} 92\\usepackage[T1]{fontenc}
93\\usepackage{graphicx}
91\\usepackage{hyperref}" 94\\usepackage{hyperref}"
92 ("\\section{%s}" . "\\section*{%s}") 95 ("\\section{%s}" . "\\section*{%s}")
93 ("\\subsection{%s}" . "\\subsection*{%s}") 96 ("\\subsection{%s}" . "\\subsection*{%s}")
@@ -98,6 +101,7 @@
98 "\\documentclass[11pt,a4paper]{report} 101 "\\documentclass[11pt,a4paper]{report}
99\\usepackage[utf8]{inputenc} 102\\usepackage[utf8]{inputenc}
100\\usepackage[T1]{fontenc} 103\\usepackage[T1]{fontenc}
104\\usepackage{graphicx}
101\\usepackage{hyperref}" 105\\usepackage{hyperref}"
102 ("\\part{%s}" . "\\part*{%s}") 106 ("\\part{%s}" . "\\part*{%s}")
103 ("\\chapter{%s}" . "\\chapter*{%s}") 107 ("\\chapter{%s}" . "\\chapter*{%s}")
@@ -108,6 +112,7 @@
108 "\\documentclass[11pt,a4paper]{book} 112 "\\documentclass[11pt,a4paper]{book}
109\\usepackage[utf8]{inputenc} 113\\usepackage[utf8]{inputenc}
110\\usepackage[T1]{fontenc} 114\\usepackage[T1]{fontenc}
115\\usepackage{graphicx}
111\\usepackage{hyperref}" 116\\usepackage{hyperref}"
112 ("\\part{%s}" . "\\part*{%s}") 117 ("\\part{%s}" . "\\part*{%s}")
113 ("\\chapter{%s}" . "\\chapter*{%s}") 118 ("\\chapter{%s}" . "\\chapter*{%s}")
@@ -120,30 +125,38 @@ associated information. Here is the structure of each cell:
120 125
121 \(class-name 126 \(class-name
122 header-string 127 header-string
123 (unnumbered-section numbered-section\) 128 (numbered-section . unnumbered-section\)
124 ...\) 129 ...\)
125 130
126A %s formatter is mandatory in each section string and will be 131A %s formatter is mandatory in each section string and will be
127replaced by the title of the section." 132replaced by the title of the section.
133
134Instead of a cons cell (numbered . unnumbered), you can also provide a list
135of 2-4 elements,
136
137 (numbered-open numbered-close)
138
139or
140
141 (numbered-open numbered-close unnumbered-open unnumbered-close)
142
143providing opening and closing strings for an environment that should
144represent the document section. The opening clause should have a %s
145to represent the section title."
128 :group 'org-export-latex 146 :group 'org-export-latex
129 :type '(repeat 147 :type '(repeat
130 (list (string :tag "LaTeX class") 148 (list (string :tag "LaTeX class")
131 (string :tag "LaTeX header") 149 (string :tag "LaTeX header")
132 (cons :tag "Level 1" 150 (repeat :tag "Levels" :inline t
133 (string :tag "Numbered") 151 (choice
134 (string :tag "Unnumbered")) 152 (cons :tag "Heading"
135 (cons :tag "Level 2" 153 (string :tag "numbered")
136 (string :tag "Numbered") 154 (string :tag "unnumbered)"))
137 (string :tag "Unnumbered")) 155 (list :tag "Environment"
138 (cons :tag "Level 3" 156 (string :tag "Opening (numbered) ")
139 (string :tag "Numbered") 157 (string :tag "Closing (numbered) ")
140 (string :tag "Unnumbered")) 158 (string :tag "Opening (unnumbered)")
141 (cons :tag "Level 4" 159 (string :tag "Closing (unnumbered)")))))))
142 (string :tag "Numbered")
143 (string :tag "Unnumbered"))
144 (cons :tag "Level 5"
145 (string :tag "Numbered")
146 (string :tag "Unnumbered")))))
147 160
148(defcustom org-export-latex-emphasis-alist 161(defcustom org-export-latex-emphasis-alist
149 '(("*" "\\textbf{%s}" nil) 162 '(("*" "\\textbf{%s}" nil)
@@ -224,6 +237,18 @@ Don't remove the keys, just change their values."
224 :group 'org-export-latex 237 :group 'org-export-latex
225 :type 'coding-system) 238 :type 'coding-system)
226 239
240(defgroup org-export-pdf nil
241 "Options for exporting Org-mode files to PDF, via LaTeX."
242 :tag "Org Export LaTeX"
243 :group 'org-export-latex
244 :group 'org-export)
245
246(defcustom org-export-pdf-remove-logfiles t
247 "Non-nil means, remove the logfiles produced by PDF production.
248These are the .aux, .log, .out, and .toc files."
249 :group 'org-export-latex
250 :type 'boolean)
251
227;;; Autoload functions: 252;;; Autoload functions:
228 253
229;;;###autoload 254;;;###autoload
@@ -454,6 +479,44 @@ when PUB-DIR is set, use this as the publishing directory."
454 (current-buffer)) 479 (current-buffer))
455 (set-window-configuration wcf)))) 480 (set-window-configuration wcf))))
456 481
482;;;###autoload
483(defun org-export-as-pdf (arg &optional hidden ext-plist
484 to-buffer body-only pub-dir)
485 "Export as LaTeX, then process through to PDF."
486 (interactive "P")
487 (message "Exporting to PDF...")
488 (let* ((wconfig (current-window-configuration))
489 (lbuf (org-export-as-latex arg hidden ext-plist
490 to-buffer body-only pub-dir))
491 (file (buffer-file-name lbuf))
492 (base (file-name-sans-extension (buffer-file-name lbuf)))
493 (pdffile (concat base ".pdf")))
494 (and (file-exists-p pdffile) (delete-file pdffile))
495 (message "Processing LaTeX file...")
496 (shell-command (format "pdflatex -interaction nonstopmode %s"
497 (shell-quote-argument file)))
498 (shell-command (format "pdflatex -interaction nonstopmode %s"
499 (shell-quote-argument file)))
500 (message "Processing LaTeX file...done")
501 (if (not (file-exists-p pdffile))
502 (error "PDF file was not produced")
503 (set-window-configuration wconfig)
504 (when org-export-pdf-remove-logfiles
505 (dolist (ext '("aux" "log" "out" "toc"))
506 (setq file (concat base "." ext))
507 (and (file-exists-p file) (delete-file file))))
508 (message "Exporting to PDF...done")
509 pdffile)))
510
511;;;###autoload
512(defun org-export-as-pdf-and-open (arg)
513 "Export as LaTeX, then process through to PDF, and open."
514 (interactive "P")
515 (let ((pdffile (org-export-as-pdf arg)))
516 (if pdffile
517 (org-open-file pdffile)
518 (error "PDF file was not produced"))))
519
457;;; Parsing functions: 520;;; Parsing functions:
458 521
459(defun org-export-latex-parse-global (level odd) 522(defun org-export-latex-parse-global (level odd)
@@ -554,12 +617,18 @@ If NUM, export sections as numerical sections."
554 (cond 617 (cond
555 ;; Normal conversion 618 ;; Normal conversion
556 ((<= level org-export-latex-sectioning-depth) 619 ((<= level org-export-latex-sectioning-depth)
557 (let ((sec (nth (1- level) org-export-latex-sectioning))) 620 (let* ((sec (nth (1- level) org-export-latex-sectioning))
558 (insert (format (if num (car sec) (cdr sec)) heading) "\n")) 621 start end)
559 (when label (insert (format "\\label{%s}\n" label))) 622 (if (consp (cdr sec))
560 (insert (org-export-latex-content content)) 623 (setq start (nth (if num 0 2) sec)
561 (cond ((stringp subcontent) (insert subcontent)) 624 end (nth (if num 1 3) sec))
562 ((listp subcontent) (org-export-latex-sub subcontent)))) 625 (setq start (if num (car sec) (cdr sec))))
626 (insert (format start heading) "\n")
627 (when label (insert (format "\\label{%s}\n" label)))
628 (insert (org-export-latex-content content))
629 (cond ((stringp subcontent) (insert subcontent))
630 ((listp subcontent) (org-export-latex-sub subcontent)))
631 (if end (insert end "\n"))))
563 ;; At a level under the hl option: we can drop this subsection 632 ;; At a level under the hl option: we can drop this subsection
564 ((> level org-export-latex-sectioning-depth) 633 ((> level org-export-latex-sectioning-depth)
565 (cond ((eq org-export-latex-low-levels 'description) 634 (cond ((eq org-export-latex-low-levels 'description)
@@ -877,12 +946,15 @@ Convert CHAR depending on STRING-BEFORE and STRING-AFTER."
877 ((string-match "[({]?\\([^)}]+\\)[)}]?" string-after) 946 ((string-match "[({]?\\([^)}]+\\)[)}]?" string-after)
878 (format "%s%s{%s}" string-before char 947 (format "%s%s{%s}" string-before char
879 (match-string 1 string-after)))))) 948 (match-string 1 string-after))))))
880 ((and subsup 949 ((and (> (length string-after) 1)
881 (> (length string-after) 1) 950 (or (eq subsup t)
951 (and (equal subsup '{}) (eq (string-to-char string-after) ?\{)))
882 (string-match "[({]?\\([^)}]+\\)[)}]?" string-after)) 952 (string-match "[({]?\\([^)}]+\\)[)}]?" string-after))
883 (format "$%s%s{%s}$" string-before char 953 (format "%s$%s{%s}$" string-before char
884 (match-string 1 string-after))) 954 (if (> (match-end 1) (1+ (match-beginning 1)))
885 (subsup (concat "$" string-before char string-after "$")) 955 (concat "\\mathrm{" (match-string 1 string-after) "}")
956 (match-string 1 string-after))))
957 ((eq subsup t) (concat string-before "$" char string-after "$"))
886 (t (org-export-latex-protect-string 958 (t (org-export-latex-protect-string
887 (concat string-before "\\" char "{}" string-after))))) 959 (concat string-before "\\" char "{}" string-after)))))
888 (t (org-export-latex-protect-string 960 (t (org-export-latex-protect-string
@@ -1084,6 +1156,7 @@ If TIMESTAMPS, convert timestamps, otherwise delete them."
1084 (t (insert "\\texttt{" desc "}"))))))) 1156 (t (insert "\\texttt{" desc "}")))))))
1085 1157
1086(defvar org-latex-entities) ; defined below 1158(defvar org-latex-entities) ; defined below
1159(defvar org-latex-entities-regexp) ; defined below
1087 1160
1088(defun org-export-latex-preprocess () 1161(defun org-export-latex-preprocess ()
1089 "Clean stuff in the LaTeX export." 1162 "Clean stuff in the LaTeX export."
@@ -1096,11 +1169,12 @@ If TIMESTAMPS, convert timestamps, otherwise delete them."
1096 1169
1097 ;; Preserve latex environments 1170 ;; Preserve latex environments
1098 (goto-char (point-min)) 1171 (goto-char (point-min))
1099 (while (search-forward "\\begin{" nil t) 1172 (while (re-search-forward "^[ \t]*\\begin{\\([a-zA-Z]+\\)}" nil t)
1100 (let ((start (progn (beginning-of-line) (point))) 1173 (let* ((start (progn (beginning-of-line) (point)))
1101 (end (or (and (search-forward "\\end{" nil t) 1174 (end (or (and (re-search-forward
1102 (end-of-line) (point)) 1175 (concat "^[ \t]*\\end{" (match-string 1) "}" nil t)
1103 (point-max)))) 1176 (point-at-eol)))
1177 (point-max))))
1104 (add-text-properties start end '(org-protected t)))) 1178 (add-text-properties start end '(org-protected t))))
1105 1179
1106 ;; Convert LaTeX to \LaTeX{} 1180 ;; Convert LaTeX to \LaTeX{}
@@ -1139,7 +1213,7 @@ If TIMESTAMPS, convert timestamps, otherwise delete them."
1139 1213
1140 ;; Protect LaTeX entities 1214 ;; Protect LaTeX entities
1141 (goto-char (point-min)) 1215 (goto-char (point-min))
1142 (while (re-search-forward (regexp-opt org-latex-entities) nil t) 1216 (while (re-search-forward org-latex-entities-regexp nil t)
1143 (add-text-properties (match-beginning 0) (match-end 0) 1217 (add-text-properties (match-beginning 0) (match-end 0)
1144 '(org-protected t))) 1218 '(org-protected t)))
1145 1219
@@ -1204,8 +1278,9 @@ If TIMESTAMPS, convert timestamps, otherwise delete them."
1204 "Convert lists to LaTeX." 1278 "Convert lists to LaTeX."
1205 (goto-char (point-min)) 1279 (goto-char (point-min))
1206 (while (re-search-forward org-list-beginning-re nil t) 1280 (while (re-search-forward org-list-beginning-re nil t)
1207 (beginning-of-line) 1281 (org-if-unprotected
1208 (insert (org-list-to-latex (org-list-parse-list t)) "\n"))) 1282 (beginning-of-line)
1283 (insert (org-list-to-latex (org-list-parse-list t)) "\n"))))
1209 1284
1210(defconst org-latex-entities 1285(defconst org-latex-entities
1211 '("\\!" 1286 '("\\!"
@@ -1383,6 +1458,15 @@ If TIMESTAMPS, convert timestamps, otherwise delete them."
1383 "\\vspace") 1458 "\\vspace")
1384 "A list of LaTeX commands to be protected when performing conversion.") 1459 "A list of LaTeX commands to be protected when performing conversion.")
1385 1460
1461(defconst org-latex-entities-regexp
1462 (let (names rest)
1463 (dolist (x org-latex-entities)
1464 (if (string-match "[a-z][A-Z]$" x)
1465 (push x names)
1466 (push x rest)))
1467 (concat "\\(" (regexp-opt (nreverse names)) "\\>\\)"
1468 "\\|\\(" (regexp-opt (nreverse rest)) "\\)")))
1469
1386(provide 'org-export-latex) 1470(provide 'org-export-latex)
1387 1471
1388;; arch-tag: 23c2b87d-da04-4c2d-ad2d-1eb6487bc3ad 1472;; arch-tag: 23c2b87d-da04-4c2d-ad2d-1eb6487bc3ad
diff --git a/lisp/org/org-faces.el b/lisp/org/org-faces.el
index 6094ea077dd..8244283be49 100644
--- a/lisp/org/org-faces.el
+++ b/lisp/org/org-faces.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.09a 8;; Version: 6.10c
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
diff --git a/lisp/org/org-gnus.el b/lisp/org/org-gnus.el
index 61a3334d313..d31f9a7826c 100644
--- a/lisp/org/org-gnus.el
+++ b/lisp/org/org-gnus.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.09a 8;; Version: 6.10c
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
diff --git a/lisp/org/org-id.el b/lisp/org/org-id.el
index e4ba7b0e741..5ba0c419a8a 100644
--- a/lisp/org/org-id.el
+++ b/lisp/org/org-id.el
@@ -4,7 +4,7 @@
4;; Author: Carsten Dominik <carsten at orgmode dot org> 4;; Author: Carsten Dominik <carsten at orgmode dot org>
5;; Keywords: outlines, hypermedia, calendar, wp 5;; Keywords: outlines, hypermedia, calendar, wp
6;; Homepage: http://orgmode.org 6;; Homepage: http://orgmode.org
7;; Version: 6.09a 7;; Version: 6.10c
8;; 8;;
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
10;; 10;;
@@ -116,7 +116,8 @@ be added."
116 :group 'org-id 116 :group 'org-id
117 :type 'boolean) 117 :type 'boolean)
118 118
119(defcustom org-id-locations-file (convert-standard-filename "~/.org-id-locations") 119(defcustom org-id-locations-file (convert-standard-filename
120 "~/.org-id-locations")
120 "The file for remembering the last ID number generated." 121 "The file for remembering the last ID number generated."
121 :group 'org-id 122 :group 'org-id
122 :type 'file) 123 :type 'file)
diff --git a/lisp/org/org-info.el b/lisp/org/org-info.el
index c523caf538f..b664d61f6e7 100644
--- a/lisp/org/org-info.el
+++ b/lisp/org/org-info.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.09a 8;; Version: 6.10c
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
diff --git a/lisp/org/org-irc.el b/lisp/org/org-irc.el
index 275034a02e2..ed8e2fa68d2 100644
--- a/lisp/org/org-irc.el
+++ b/lisp/org/org-irc.el
@@ -4,7 +4,7 @@
4;; 4;;
5;; Author: Philip Jackson <emacs@shellarchive.co.uk> 5;; Author: Philip Jackson <emacs@shellarchive.co.uk>
6;; Keywords: erc, irc, link, org 6;; Keywords: erc, irc, link, org
7;; Version: 6.09a 7;; Version: 6.10c
8;; 8;;
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
10;; 10;;
diff --git a/lisp/org/org-jsinfo.el b/lisp/org/org-jsinfo.el
index 903e1dbec97..17a029dfc93 100644
--- a/lisp/org/org-jsinfo.el
+++ b/lisp/org/org-jsinfo.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.09a 8;; Version: 6.10c
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
diff --git a/lisp/org/org-list.el b/lisp/org/org-list.el
index e7c460f4bc5..004b56e684e 100644
--- a/lisp/org/org-list.el
+++ b/lisp/org/org-list.el
@@ -6,7 +6,7 @@
6;; Bastien Guerry <bzg AT altern DOT org> 6;; Bastien Guerry <bzg AT altern DOT org>
7;; Keywords: outlines, hypermedia, calendar, wp 7;; Keywords: outlines, hypermedia, calendar, wp
8;; Homepage: http://orgmode.org 8;; Homepage: http://orgmode.org
9;; Version: 6.09a 9;; Version: 6.10c
10;; 10;;
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12;; 12;;
diff --git a/lisp/org/org-mac-message.el b/lisp/org/org-mac-message.el
index d2b21460f90..bd8e5d308b0 100644
--- a/lisp/org/org-mac-message.el
+++ b/lisp/org/org-mac-message.el
@@ -3,7 +3,7 @@
3;; Copyright (C) 2008 Free Software Foundation, Inc. 3;; Copyright (C) 2008 Free Software Foundation, Inc.
4 4
5;; Author: John Wiegley <johnw@gnu.org> 5;; Author: John Wiegley <johnw@gnu.org>
6;; Version: 6.09a 6;; Version: 6.10c
7;; Keywords: outlines, hypermedia, calendar, wp 7;; Keywords: outlines, hypermedia, calendar, wp
8 8
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
diff --git a/lisp/org/org-macs.el b/lisp/org/org-macs.el
index c2870126b24..7cb39b76cf7 100644
--- a/lisp/org/org-macs.el
+++ b/lisp/org/org-macs.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.09a 8;; Version: 6.10c
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
diff --git a/lisp/org/org-mew.el b/lisp/org/org-mew.el
index e4c7be398c0..f056d27a9a5 100644
--- a/lisp/org/org-mew.el
+++ b/lisp/org/org-mew.el
@@ -5,7 +5,7 @@
5;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp> 5;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.09a 8;; Version: 6.10c
9 9
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11 11
diff --git a/lisp/org/org-mhe.el b/lisp/org/org-mhe.el
index 3a580f09b0c..9fa6c6c54a2 100644
--- a/lisp/org/org-mhe.el
+++ b/lisp/org/org-mhe.el
@@ -5,7 +5,7 @@
5;; Author: Thomas Baumann <thomas dot baumann at ch dot tum dot de> 5;; Author: Thomas Baumann <thomas dot baumann at ch dot tum dot de>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.09a 8;; Version: 6.10c
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
diff --git a/lisp/org/org-mouse.el b/lisp/org/org-mouse.el
index d09e4eb0434..07d12091796 100644
--- a/lisp/org/org-mouse.el
+++ b/lisp/org/org-mouse.el
@@ -4,7 +4,7 @@
4;; 4;;
5;; Author: Piotr Zielinski <piotr dot zielinski at gmail dot com> 5;; Author: Piotr Zielinski <piotr dot zielinski at gmail dot com>
6;; Maintainer: Carsten Dominik <carsten at orgmode dot org> 6;; Maintainer: Carsten Dominik <carsten at orgmode dot org>
7;; Version: 6.09a 7;; Version: 6.10c
8;; 8;;
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
10;; 10;;
@@ -166,6 +166,18 @@ indirectly, for example, through the agenda buffer.")
166 :group 'org-mouse 166 :group 'org-mouse
167 :type 'string) 167 :type 'string)
168 168
169(defcustom org-mouse-features
170 '(context-menu yank-link activate-stars activate-bullets activate-checkboxes)
171 "The features of org-mouse that should be activated.
172Changing this variable requires a restart of Emacs to get activated."
173 :group 'org-mouse
174 :type '(set :greedy t
175 (const :tag "Mouse-3 shows context menu" context-menu)
176 (const :tag "C-mouse-1 and mouse-3 move trees" move-tree)
177 (const :tag "S-mouse-2 and drag-mouse-3 yank link" yank-link)
178 (const :tag "Activate headline stars" activate-stars)
179 (const :tag "Activate item bullets" activate-bullets)
180 (const :tag "Activate checkboxes" activate-checkboxes)))
169 181
170(defun org-mouse-re-search-line (regexp) 182(defun org-mouse-re-search-line (regexp)
171 "Search the current line for a given regular expression." 183 "Search the current line for a given regular expression."
@@ -410,7 +422,7 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:"
410 422
411(defun org-mouse-tag-menu () ;todo 423(defun org-mouse-tag-menu () ;todo
412 (append 424 (append
413 (let ((tags (org-split-string (org-get-tags) ":"))) 425 (let ((tags (org-get-tags)))
414 (org-mouse-keyword-menu 426 (org-mouse-keyword-menu
415 (sort (mapcar 'car (org-get-buffer-tags)) 'string-lessp) 427 (sort (mapcar 'car (org-get-buffer-tags)) 'string-lessp)
416 `(lambda (tag) 428 `(lambda (tag)
@@ -890,26 +902,42 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:"
890 '(lambda () 902 '(lambda ()
891 (setq org-mouse-context-menu-function 'org-mouse-context-menu) 903 (setq org-mouse-context-menu-function 'org-mouse-context-menu)
892 904
893; (define-key org-mouse-map [follow-link] 'mouse-face) 905 (when (memq 'context-menu org-mouse-features)
894 (define-key org-mouse-map (if (featurep 'xemacs) [button3] [mouse-3]) nil) 906 (define-key org-mouse-map (if (featurep 'xemacs) [button3] [mouse-3]) nil)
895 (define-key org-mode-map [mouse-3] 'org-mouse-show-context-menu) 907 (define-key org-mode-map [mouse-3] 'org-mouse-show-context-menu))
896 (define-key org-mode-map [down-mouse-1] 'org-mouse-down-mouse) 908 (define-key org-mode-map [down-mouse-1] 'org-mouse-down-mouse)
897 (define-key org-mouse-map [C-drag-mouse-1] 'org-mouse-move-tree) 909 (when (memq 'context-menu org-mouse-features)
898 (define-key org-mouse-map [C-down-mouse-1] 'org-mouse-move-tree-start) 910 (define-key org-mouse-map [C-drag-mouse-1] 'org-mouse-move-tree)
899 (define-key org-mode-map [S-mouse-2] 'org-mouse-yank-link) 911 (define-key org-mouse-map [C-down-mouse-1] 'org-mouse-move-tree-start))
900 (define-key org-mode-map [drag-mouse-3] 'org-mouse-yank-link) 912 (when (memq 'yank-link org-mouse-features)
901 (define-key org-mouse-map [drag-mouse-3] 'org-mouse-move-tree) 913 (define-key org-mode-map [S-mouse-2] 'org-mouse-yank-link)
902 (define-key org-mouse-map [down-mouse-3] 'org-mouse-move-tree-start) 914 (define-key org-mode-map [drag-mouse-3] 'org-mouse-yank-link))
903 915 (when (memq 'move-tree org-mouse-features)
904 (font-lock-add-keywords nil 916 (define-key org-mouse-map [drag-mouse-3] 'org-mouse-move-tree)
917 (define-key org-mouse-map [down-mouse-3] 'org-mouse-move-tree-start))
918
919 (when (memq 'activate-stars org-mouse-features)
920 (font-lock-add-keywords
921 nil
905 `((,outline-regexp 922 `((,outline-regexp
906 0 `(face org-link mouse-face highlight keymap ,org-mouse-map) 923 0 `(face org-link mouse-face highlight keymap ,org-mouse-map)
907 'prepend) 924 'prepend))
908 ("^[ \t]*\\([-+*]\\|[0-9]+[.)]\\) +" 925 t))
909 (1 `(face org-link keymap ,org-mouse-map mouse-face highlight) 'prepend)) 926
910 ("^[ \t]*\\([-+*]\\|[0-9]+[.)]\\) +\\(\\[[ X]\\]\\)" 927 (when (memq 'activate-bullets org-mouse-features)
928 (font-lock-add-keywords
929 nil
930 `(("^[ \t]*\\([-+*]\\|[0-9]+[.)]\\) +"
931 (1 `(face org-link keymap ,org-mouse-map mouse-face highlight)
932 'prepend)))
933 t))
934
935 (when (memq 'activate-checkboxes org-mouse-features)
936 (font-lock-add-keywords
937 nil
938 `(("^[ \t]*\\([-+*]\\|[0-9]+[.)]\\) +\\(\\[[ X]\\]\\)"
911 (2 `(face bold keymap ,org-mouse-map mouse-face highlight) t))) 939 (2 `(face bold keymap ,org-mouse-map mouse-face highlight) t)))
912 t) 940 t))
913 941
914 (defadvice org-open-at-point (around org-mouse-open-at-point activate) 942 (defadvice org-open-at-point (around org-mouse-open-at-point activate)
915 (let ((context (org-context))) 943 (let ((context (org-context)))
diff --git a/lisp/org/org-plot.el b/lisp/org/org-plot.el
index e743c762dbd..db67257e513 100644
--- a/lisp/org/org-plot.el
+++ b/lisp/org/org-plot.el
@@ -5,7 +5,7 @@
5;; Author: Eric Schulte <schulte dot eric at gmail dot com> 5;; Author: Eric Schulte <schulte dot eric at gmail dot com>
6;; Keywords: tables, plotting 6;; Keywords: tables, plotting
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.06b 8;; Version: 6.10c
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
diff --git a/lisp/org/org-publish.el b/lisp/org/org-publish.el
index 406da0c484e..2af71d3c0b2 100644
--- a/lisp/org/org-publish.el
+++ b/lisp/org/org-publish.el
@@ -4,7 +4,7 @@
4;; Author: David O'Toole <dto@gnu.org> 4;; Author: David O'Toole <dto@gnu.org>
5;; Maintainer: Bastien Guerry <bzg AT altern DOT org> 5;; Maintainer: Bastien Guerry <bzg AT altern DOT org>
6;; Keywords: hypermedia, outlines, wp 6;; Keywords: hypermedia, outlines, wp
7;; Version: 6.09a 7;; Version: 6.10c
8 8
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
10;; 10;;
@@ -276,8 +276,8 @@ When nil, do no timestamp checking and always publish all files."
276 :group 'org-publish 276 :group 'org-publish
277 :type 'boolean) 277 :type 'boolean)
278 278
279(defcustom org-publish-timestamp-directory 279(defcustom org-publish-timestamp-directory (convert-standard-filename
280 (convert-standard-filename "~/.org-timestamps/") 280 "~/.org-timestamps/")
281 "Name of directory in which to store publishing timestamps." 281 "Name of directory in which to store publishing timestamps."
282 :group 'org-publish 282 :group 'org-publish
283 :type 'directory) 283 :type 'directory)
@@ -479,38 +479,48 @@ PUB-DIR is the publishing directory."
479 (require 'org) 479 (require 'org)
480 (unless (file-exists-p pub-dir) 480 (unless (file-exists-p pub-dir)
481 (make-directory pub-dir t)) 481 (make-directory pub-dir t))
482 (let* ((visiting (find-buffer-visiting filename)) 482 (let ((visiting (find-buffer-visiting filename)))
483 (plist (cons :buffer-will-be-killed (cons t plist))) 483 (save-excursion
484 (init-buf (or visiting (find-file filename))) 484 (switch-to-buffer (or visiting (find-file filename)))
485 (init-point (point)) 485 (let* ((plist (cons :buffer-will-be-killed (cons t plist)))
486 (init-buf-string (buffer-string)) export-buf) 486 (init-buf (current-buffer))
487 ;; run hooks before exporting 487 (init-point (point))
488 (run-hooks 'org-publish-before-export-hook) 488 (init-buf-string (buffer-string))
489 ;; export the possibly modified buffer 489 export-buf-or-file)
490 (setq export-buf 490 ;; run hooks before exporting
491 (funcall (intern (concat "org-export-as-" format)) 491 (run-hooks 'org-publish-before-export-hook)
492 (plist-get plist :headline-levels) 492 ;; export the possibly modified buffer
493 nil plist nil nil pub-dir)) 493 (setq export-buf-or-file
494 (set-buffer export-buf) 494 (funcall (intern (concat "org-export-as-" format))
495 ;; run hooks after export and save export 495 (plist-get plist :headline-levels)
496 (and (run-hooks 'org-publish-after-export-hook) 496 nil plist nil nil pub-dir))
497 (if (buffer-modified-p) (save-buffer))) 497 (when (and (bufferp export-buf-or-file)
498 (kill-buffer export-buf) 498 (buffer-live-p export-buf-or-file))
499 ;; maybe restore buffer's content 499 (set-buffer export-buf-or-file)
500 (set-buffer init-buf) 500 ;; run hooks after export and save export
501 (when (buffer-modified-p init-buf) 501 (and (run-hooks 'org-publish-after-export-hook)
502 (erase-buffer) 502 (if (buffer-modified-p) (save-buffer)))
503 (insert init-buf-string) 503 (kill-buffer export-buf-or-file))
504 (save-buffer) 504 ;; maybe restore buffer's content
505 (goto-char init-point)) 505 (set-buffer init-buf)
506 (unless visiting 506 (when (buffer-modified-p init-buf)
507 (kill-buffer init-buf)))) 507 (erase-buffer)
508 (insert init-buf-string)
509 (save-buffer)
510 (goto-char init-point))
511 (unless visiting
512 (kill-buffer init-buf))))))
508 513
509(defun org-publish-org-to-latex (plist filename pub-dir) 514(defun org-publish-org-to-latex (plist filename pub-dir)
510 "Publish an org file to LaTeX. 515 "Publish an org file to LaTeX.
511See `org-publish-org-to' to the list of arguments." 516See `org-publish-org-to' to the list of arguments."
512 (org-publish-org-to "latex" plist filename pub-dir)) 517 (org-publish-org-to "latex" plist filename pub-dir))
513 518
519(defun org-publish-org-to-pdf (plist filename pub-dir)
520 "Publish an org file to PDF (via LaTeX).
521See `org-publish-org-to' to the list of arguments."
522 (org-publish-org-to "pdf" plist filename pub-dir))
523
514(defun org-publish-org-to-html (plist filename pub-dir) 524(defun org-publish-org-to-html (plist filename pub-dir)
515 "Publish an org file to HTML. 525 "Publish an org file to HTML.
516See `org-publish-org-to' to the list of arguments." 526See `org-publish-org-to' to the list of arguments."
@@ -667,6 +677,7 @@ Default for INDEX-FILENAME is 'index.org'."
667;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 677;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
668;;; Interactive publishing functions 678;;; Interactive publishing functions
669 679
680;;;###autoload
670(defalias 'org-publish-project 'org-publish) 681(defalias 'org-publish-project 'org-publish)
671 682
672;;;###autoload 683;;;###autoload
diff --git a/lisp/org/org-remember.el b/lisp/org/org-remember.el
index 2bd08833def..5424e007d8c 100644
--- a/lisp/org/org-remember.el
+++ b/lisp/org/org-remember.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.09a 8;; Version: 6.10c
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
diff --git a/lisp/org/org-rmail.el b/lisp/org/org-rmail.el
index 240ed3ed59b..5d59cce887b 100644
--- a/lisp/org/org-rmail.el
+++ b/lisp/org/org-rmail.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.09a 8;; Version: 6.10c
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el
index 339c01cf27a..e57b83d95de 100644
--- a/lisp/org/org-table.el
+++ b/lisp/org/org-table.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.09a 8;; Version: 6.10c
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
@@ -43,7 +43,7 @@
43(declare-function org-format-org-table-html "org-exp" (lines &optional splice)) 43(declare-function org-format-org-table-html "org-exp" (lines &optional splice))
44(defvar orgtbl-mode) ; defined below 44(defvar orgtbl-mode) ; defined below
45(defvar orgtbl-mode-menu) ; defined when orgtbl mode get initialized 45(defvar orgtbl-mode-menu) ; defined when orgtbl mode get initialized
46 46(defvar org-export-html-table-tag) ; defined in org-exp.el
47(defvar constants-unit-system) 47(defvar constants-unit-system)
48 48
49(defcustom orgtbl-optimized (eq org-enable-table-editor 'optimized) 49(defcustom orgtbl-optimized (eq org-enable-table-editor 'optimized)
@@ -894,7 +894,7 @@ in order to easily repeat the interval."
894 (insert txt) 894 (insert txt)
895 (org-move-to-column col) 895 (org-move-to-column col)
896 (if (and org-table-copy-increment (org-at-timestamp-p t)) 896 (if (and org-table-copy-increment (org-at-timestamp-p t))
897 (org-timestamp-up 1) 897 (org-timestamp-up-day)
898 (org-table-maybe-recalculate-line)) 898 (org-table-maybe-recalculate-line))
899 (org-table-align) 899 (org-table-align)
900 (org-move-to-column col)) 900 (org-move-to-column col))
@@ -2116,7 +2116,8 @@ not overwrite the stored one."
2116 ;; Check for old vertical references 2116 ;; Check for old vertical references
2117 (setq form (org-rewrite-old-row-references form)) 2117 (setq form (org-rewrite-old-row-references form))
2118 ;; Insert complex ranges 2118 ;; Insert complex ranges
2119 (while (string-match org-table-range-regexp form) 2119 (while (and (string-match org-table-range-regexp form)
2120 (> (length (match-string 0 form)) 1))
2120 (setq form 2121 (setq form
2121 (replace-match 2122 (replace-match
2122 (save-match-data 2123 (save-match-data
@@ -3926,6 +3927,7 @@ The general parameters :skip and :skipcols have already been applied when
3926this function is called. The function does *not* use `orgtbl-to-generic', 3927this function is called. The function does *not* use `orgtbl-to-generic',
3927so you cannot specify parameters for it." 3928so you cannot specify parameters for it."
3928 (let* ((splicep (plist-get params :splice)) 3929 (let* ((splicep (plist-get params :splice))
3930 (html-table-tag org-export-html-table-tag)
3929 html) 3931 html)
3930 ;; Just call the formatter we already have 3932 ;; Just call the formatter we already have
3931 ;; We need to make text lines for it, so put the fields back together. 3933 ;; We need to make text lines for it, so put the fields back together.
diff --git a/lisp/org/org-vm.el b/lisp/org/org-vm.el
index 5bccc49ee93..053fcb5146c 100644
--- a/lisp/org/org-vm.el
+++ b/lisp/org/org-vm.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.09a 8;; Version: 6.10c
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
diff --git a/lisp/org/org-wl.el b/lisp/org/org-wl.el
index a82afdbed77..354f21f381c 100644
--- a/lisp/org/org-wl.el
+++ b/lisp/org/org-wl.el
@@ -5,7 +5,7 @@
5;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp> 5;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.09a 8;; Version: 6.10c
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
diff --git a/lisp/org/org.el b/lisp/org/org.el
index fcf16a37ad0..89695968e38 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <carsten at orgmode dot org> 5;; Author: Carsten Dominik <carsten at orgmode dot org>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://orgmode.org 7;; Homepage: http://orgmode.org
8;; Version: 6.09a 8;; Version: 6.10c
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
@@ -92,7 +92,7 @@
92 92
93;;; Version 93;;; Version
94 94
95(defconst org-version "6.09a" 95(defconst org-version "6.10c"
96 "The version number of the file org.el.") 96 "The version number of the file org.el.")
97 97
98(defun org-version (&optional here) 98(defun org-version (&optional here)
@@ -1140,6 +1140,7 @@ See `org-file-apps'.")
1140 '( 1140 '(
1141 (auto-mode . emacs) 1141 (auto-mode . emacs)
1142 ("\\.x?html?\\'" . default) 1142 ("\\.x?html?\\'" . default)
1143 ("\\.pdf\\'" . default)
1143 ) 1144 )
1144 "External applications for opening `file:path' items in a document. 1145 "External applications for opening `file:path' items in a document.
1145Org-mode uses system defaults for different file types, but 1146Org-mode uses system defaults for different file types, but
@@ -1426,6 +1427,27 @@ Lisp variable `state'."
1426 :group 'org-todo 1427 :group 'org-todo
1427 :type 'hook) 1428 :type 'hook)
1428 1429
1430(defcustom org-todo-state-tags-triggers nil
1431 "Tag changes that should be triggered by TODO state changes.
1432This is a list. Each entry is
1433
1434 (state-change (tag . flag) .......)
1435
1436State-change can be a string with a state, and empty string to indicate the
1437state that has no TODO keyword, or it can be one of the symbols `todo'
1438or `done', meaning any not-done or done state, respectively."
1439 :group 'org-todo
1440 :group 'org-tags
1441 :type '(repeat
1442 (cons (choice :tag "When changing to"
1443 (const :tag "Not-done state" todo)
1444 (const :tag "Done state" done)
1445 (string :tag "State"))
1446 (repeat
1447 (cons :tag "Tag action"
1448 (string :tag "Tag")
1449 (choice (const :tag "Add" t) (const :tag "Remove" nil)))))))
1450
1429(defcustom org-log-done nil 1451(defcustom org-log-done nil
1430 "Non-nil means, record a CLOSED timestamp when moving an entry to DONE. 1452 "Non-nil means, record a CLOSED timestamp when moving an entry to DONE.
1431When equal to the list (done), also prompt for a closing note. 1453When equal to the list (done), also prompt for a closing note.
@@ -1491,6 +1513,16 @@ empty string.
1491(unless (assq 'note org-log-note-headings) 1513(unless (assq 'note org-log-note-headings)
1492 (push '(note . "%t") org-log-note-headings)) 1514 (push '(note . "%t") org-log-note-headings))
1493 1515
1516(defcustom org-log-state-notes-insert-after-drawers nil
1517 "Non-nil means, insert state change notes after any drawers in entry.
1518Only the drawers that *immediately* follow the headline and the
1519deadline/scheduled line are skipped.
1520When nil, insert notes right after the heading and perhaps the line
1521with deadline/scheduling if present."
1522 :group 'org-todo
1523 :group 'org-progress
1524 :type 'boolean)
1525
1494(defcustom org-log-states-order-reversed t 1526(defcustom org-log-states-order-reversed t
1495 "Non-nil means, the latest state change note will be directly after heading. 1527 "Non-nil means, the latest state change note will be directly after heading.
1496When nil, the notes will be orderer according to time." 1528When nil, the notes will be orderer according to time."
@@ -1690,7 +1722,7 @@ This has influence for the following applications:
1690 1722
1691IMPORTANT: This is a feature whose implementation is and likely will 1723IMPORTANT: This is a feature whose implementation is and likely will
1692remain incomplete. Really, it is only here because past midnight seems to 1724remain incomplete. Really, it is only here because past midnight seems to
1693ne the favorite working time of John Wiegley :-)" 1725be the favorite working time of John Wiegley :-)"
1694 :group 'org-time 1726 :group 'org-time
1695 :type 'number) 1727 :type 'number)
1696 1728
@@ -2490,7 +2522,7 @@ Otherwise, return nil."
2490 (let ((re (concat "[ \t]*" org-clock-string 2522 (let ((re (concat "[ \t]*" org-clock-string
2491 " *[[<]\\([^]>]+\\)[]>]\\(-+[[<]\\([^]>]+\\)[]>]" 2523 " *[[<]\\([^]>]+\\)[]>]\\(-+[[<]\\([^]>]+\\)[]>]"
2492 "\\([ \t]*=>.*\\)?\\)?")) 2524 "\\([ \t]*=>.*\\)?\\)?"))
2493 ts te h m s) 2525 ts te h m s neg)
2494 (cond 2526 (cond
2495 ((not (looking-at re)) 2527 ((not (looking-at re))
2496 nil) 2528 nil)
@@ -2512,11 +2544,13 @@ Otherwise, return nil."
2512 (apply 'encode-time (org-parse-time-string te))) 2544 (apply 'encode-time (org-parse-time-string te)))
2513 (time-to-seconds 2545 (time-to-seconds
2514 (apply 'encode-time (org-parse-time-string ts)))) 2546 (apply 'encode-time (org-parse-time-string ts))))
2547 neg (< s 0)
2548 s (abs s)
2515 h (floor (/ s 3600)) 2549 h (floor (/ s 3600))
2516 s (- s (* 3600 h)) 2550 s (- s (* 3600 h))
2517 m (floor (/ s 60)) 2551 m (floor (/ s 60))
2518 s (- s (* 60 s))) 2552 s (- s (* 60 s)))
2519 (insert " => " (format "%2d:%02d" h m)) 2553 (insert " => " (format (if neg "-%d:%02d" "%2d:%02d") h m))
2520 t)))))) 2554 t))))))
2521 2555
2522(defun org-check-running-clock () 2556(defun org-check-running-clock ()
@@ -4573,7 +4607,7 @@ but create the new hedline after the current line."
4573 (match-string 0)) 4607 (match-string 0))
4574 (error "*")))) 4608 (error "*"))))
4575 (blank (cdr (assq 'heading org-blank-before-new-entry))) 4609 (blank (cdr (assq 'heading org-blank-before-new-entry)))
4576 pos) 4610 pos hide-previous)
4577 (cond 4611 (cond
4578 ((and (org-on-heading-p) (bolp) 4612 ((and (org-on-heading-p) (bolp)
4579 (or (bobp) 4613 (or (bobp)
@@ -4588,6 +4622,9 @@ but create the new hedline after the current line."
4588 nil) 4622 nil)
4589 (t 4623 (t
4590 ;; in the middle of the line 4624 ;; in the middle of the line
4625 (save-excursion
4626 (end-of-line)
4627 (setq hide-previous (org-invisible-p)))
4591 (org-show-entry) 4628 (org-show-entry)
4592 (let ((split 4629 (let ((split
4593 (org-get-alist-option org-M-RET-may-split-line 'headline)) 4630 (org-get-alist-option org-M-RET-may-split-line 'headline))
@@ -4618,6 +4655,10 @@ but create the new hedline after the current line."
4618 (setq pos (point)) 4655 (setq pos (point))
4619 (end-of-line 1) 4656 (end-of-line 1)
4620 (unless (= (point) pos) (just-one-space) (backward-delete-char 1)) 4657 (unless (= (point) pos) (just-one-space) (backward-delete-char 1))
4658 (when (and org-insert-heading-respect-content hide-previous)
4659 (save-excursion
4660 (outline-previous-visible-heading 1)
4661 (hide-entry)))
4621 (run-hooks 'org-insert-heading-hook))))) 4662 (run-hooks 'org-insert-heading-hook)))))
4622 4663
4623(defun org-get-heading (&optional no-tags) 4664(defun org-get-heading (&optional no-tags)
@@ -4641,20 +4682,20 @@ but create the new hedline after the current line."
4641(defun org-insert-heading-respect-content () 4682(defun org-insert-heading-respect-content ()
4642 (interactive) 4683 (interactive)
4643 (let ((org-insert-heading-respect-content t)) 4684 (let ((org-insert-heading-respect-content t))
4644 (call-interactively 'org-insert-heading))) 4685 (org-insert-heading t)))
4645 4686
4646(defun org-insert-todo-heading-respect-content () 4687(defun org-insert-todo-heading-respect-content (&optional force-state)
4647 (interactive) 4688 (interactive "P")
4648 (let ((org-insert-heading-respect-content t)) 4689 (let ((org-insert-heading-respect-content t))
4649 (call-interactively 'org-insert-todo-todo-heading))) 4690 (org-insert-todo-heading force-state t)))
4650 4691
4651(defun org-insert-todo-heading (arg) 4692(defun org-insert-todo-heading (arg &optional force-heading)
4652 "Insert a new heading with the same level and TODO state as current heading. 4693 "Insert a new heading with the same level and TODO state as current heading.
4653If the heading has no TODO state, or if the state is DONE, use the first 4694If the heading has no TODO state, or if the state is DONE, use the first
4654state (TODO by default). Also with prefix arg, force first state." 4695state (TODO by default). Also with prefix arg, force first state."
4655 (interactive "P") 4696 (interactive "P")
4656 (when (not (org-insert-item 'checkbox)) 4697 (when (or force-heading (not (org-insert-item 'checkbox)))
4657 (org-insert-heading) 4698 (org-insert-heading force-heading)
4658 (save-excursion 4699 (save-excursion
4659 (org-back-to-heading) 4700 (org-back-to-heading)
4660 (outline-previous-heading) 4701 (outline-previous-heading)
@@ -7209,7 +7250,7 @@ and will therefore always be up-to-date.
7209 7250
7210At the target location, the entry is filed as a subitem of the target heading. 7251At the target location, the entry is filed as a subitem of the target heading.
7211Depending on `org-reverse-note-order', the new subitem will either be the 7252Depending on `org-reverse-note-order', the new subitem will either be the
7212first of the last subitem. 7253first or the last subitem.
7213 7254
7214With prefix arg GOTO, the command will only visit the target location, 7255With prefix arg GOTO, the command will only visit the target location,
7215not actually move anything. 7256not actually move anything.
@@ -7876,6 +7917,7 @@ For calling through lisp, arg is also interpreted in the following way:
7876 ;; This is a non-nil state, and we need to log it 7917 ;; This is a non-nil state, and we need to log it
7877 (org-add-log-setup 'state state 'findpos dolog))) 7918 (org-add-log-setup 'state state 'findpos dolog)))
7878 ;; Fixup tag positioning 7919 ;; Fixup tag positioning
7920 (org-todo-trigger-tag-changes state)
7879 (and org-auto-align-tags (not org-setting-tags) (org-set-tags nil t)) 7921 (and org-auto-align-tags (not org-setting-tags) (org-set-tags nil t))
7880 (when org-provide-todo-statistics 7922 (when org-provide-todo-statistics
7881 (org-update-parent-todo-statistics)) 7923 (org-update-parent-todo-statistics))
@@ -7942,6 +7984,21 @@ when there is a statistics cookie in the headline!
7942 (let (org-log-done org-log-states) ; turn off logging 7984 (let (org-log-done org-log-states) ; turn off logging
7943 (org-todo (if (= n-not-done 0) \"DONE\" \"TODO\")))) 7985 (org-todo (if (= n-not-done 0) \"DONE\" \"TODO\"))))
7944") 7986")
7987
7988(defun org-todo-trigger-tag-changes (state)
7989 "Apply the changes defined in `org-todo-state-tags-triggers'."
7990 (let ((l org-todo-state-tags-triggers)
7991 changes)
7992 (when (or (not state) (equal state ""))
7993 (setq changes (append changes (cdr (assoc "" l)))))
7994 (when (and (stringp state) (> (length state) 0))
7995 (setq changes (append changes (cdr (assoc state l)))))
7996 (when (member state org-not-done-keywords)
7997 (setq changes (append changes (cdr (assoc 'todo l)))))
7998 (when (member state org-done-keywords)
7999 (setq changes (append changes (cdr (assoc 'done l)))))
8000 (dolist (c changes)
8001 (org-toggle-tag (car c) (if (cdr c) 'on 'off)))))
7945 8002
7946(defun org-local-logging (value) 8003(defun org-local-logging (value)
7947 "Get logging settings from a property VALUE." 8004 "Get logging settings from a property VALUE."
@@ -8346,13 +8403,19 @@ EXTRA is additional text that will be inserted into the notes buffer."
8346 (org-back-to-heading t) 8403 (org-back-to-heading t)
8347 (narrow-to-region (point) (save-excursion 8404 (narrow-to-region (point) (save-excursion
8348 (outline-next-heading) (point))) 8405 (outline-next-heading) (point)))
8349 (while (re-search-forward
8350 (concat "\\(" org-drawer-regexp "\\|" org-property-end-re "\\)")
8351 (point-max) t) (forward-line))
8352 (looking-at (concat outline-regexp "\\( *\\)[^\r\n]*" 8406 (looking-at (concat outline-regexp "\\( *\\)[^\r\n]*"
8353 "\\(\n[^\r\n]*?" org-keyword-time-not-clock-regexp 8407 "\\(\n[^\r\n]*?" org-keyword-time-not-clock-regexp
8354 "[^\r\n]*\\)?")) 8408 "[^\r\n]*\\)?"))
8355 (goto-char (match-end 0)) 8409 (goto-char (match-end 0))
8410 (when (and org-log-state-notes-insert-after-drawers
8411 (save-excursion
8412 (forward-line) (looking-at org-drawer-regexp)))
8413 (progn (forward-line)
8414 (while (looking-at org-drawer-regexp)
8415 (goto-char (match-end 0))
8416 (re-search-forward org-property-end-re (point-max) t)
8417 (forward-line))
8418 (forward-line -1)))
8356 (unless org-log-states-order-reversed 8419 (unless org-log-states-order-reversed
8357 (and (= (char-after) ?\n) (forward-char 1)) 8420 (and (= (char-after) ?\n) (forward-char 1))
8358 (org-skip-over-state-notes) 8421 (org-skip-over-state-notes)
@@ -8383,7 +8446,7 @@ EXTRA is additional text that will be inserted into the notes buffer."
8383 (org-switch-to-buffer-other-window "*Org Note*") 8446 (org-switch-to-buffer-other-window "*Org Note*")
8384 (erase-buffer) 8447 (erase-buffer)
8385 (if (memq org-log-note-how '(time state)) 8448 (if (memq org-log-note-how '(time state))
8386 (org-store-log-note) 8449 (let (current-prefix-arg) (org-store-log-note))
8387 (let ((org-inhibit-startup t)) (org-mode)) 8450 (let ((org-inhibit-startup t)) (org-mode))
8388 (insert (format "# Insert note for %s. 8451 (insert (format "# Insert note for %s.
8389# Finish with C-c C-c, or cancel with C-c C-k.\n\n" 8452# Finish with C-c C-c, or cancel with C-c C-k.\n\n"
@@ -9127,6 +9190,15 @@ If ONOFF is `on' or `off', don't toggle but set to this state."
9127 (org-move-to-column (min ncol col) t)) 9190 (org-move-to-column (min ncol col) t))
9128 (goto-char pos)))) 9191 (goto-char pos))))
9129 9192
9193(defun org-set-tags-command (&optional arg just-align)
9194 "Call the set-tags command for the current entry."
9195 (interactive "P")
9196 (if (org-on-heading-p)
9197 (org-set-tags arg just-align)
9198 (save-excursion
9199 (org-back-to-heading t)
9200 (org-set-tags arg just-align))))
9201
9130(defun org-set-tags (&optional arg just-align) 9202(defun org-set-tags (&optional arg just-align)
9131 "Set the tags for the current headline. 9203 "Set the tags for the current headline.
9132With prefix ARG, realign all tags in headings in the current buffer." 9204With prefix ARG, realign all tags in headings in the current buffer."
@@ -9756,6 +9828,11 @@ If WHICH is nil or `all', get all properties. If WHICH is
9756 (org-columns-number-to-string (/ (float clocksum) 60.) 9828 (org-columns-number-to-string (/ (float clocksum) 60.)
9757 'add_times)) 9829 'add_times))
9758 props)) 9830 props))
9831 (unless (assoc "CATEGORY" props)
9832 (setq value (or (org-get-category)
9833 (progn (org-refresh-category-properties)
9834 (org-get-category))))
9835 (push (cons "CATEGORY" value) props))
9759 (append sum-props (nreverse props))))))) 9836 (append sum-props (nreverse props)))))))
9760 9837
9761(defun org-entry-get (pom property &optional inherit) 9838(defun org-entry-get (pom property &optional inherit)
@@ -12042,6 +12119,7 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]."
12042(org-defkey org-mode-map "\C-c\C-xb" 'org-tree-to-indirect-buffer) 12119(org-defkey org-mode-map "\C-c\C-xb" 'org-tree-to-indirect-buffer)
12043(org-defkey org-mode-map "\C-c\C-j" 'org-goto) 12120(org-defkey org-mode-map "\C-c\C-j" 'org-goto)
12044(org-defkey org-mode-map "\C-c\C-t" 'org-todo) 12121(org-defkey org-mode-map "\C-c\C-t" 'org-todo)
12122(org-defkey org-mode-map "\C-c\C-q" 'org-set-tags-command)
12045(org-defkey org-mode-map "\C-c\C-s" 'org-schedule) 12123(org-defkey org-mode-map "\C-c\C-s" 'org-schedule)
12046(org-defkey org-mode-map "\C-c\C-d" 'org-deadline) 12124(org-defkey org-mode-map "\C-c\C-d" 'org-deadline)
12047(org-defkey org-mode-map "\C-c;" 'org-toggle-comment) 12125(org-defkey org-mode-map "\C-c;" 'org-toggle-comment)
@@ -12850,7 +12928,7 @@ See the individual commands for more information."
12850 ["Priority Up" org-shiftup t] 12928 ["Priority Up" org-shiftup t]
12851 ["Priority Down" org-shiftdown t]) 12929 ["Priority Down" org-shiftdown t])
12852 ("TAGS and Properties" 12930 ("TAGS and Properties"
12853 ["Set Tags" 'org-ctrl-c-ctrl-c (org-at-heading-p)] 12931 ["Set Tags" 'org-set-tags-command t]
12854 ["Change tag in region" 'org-change-tag-in-region (org-region-active-p)] 12932 ["Change tag in region" 'org-change-tag-in-region (org-region-active-p)]
12855 "--" 12933 "--"
12856 ["Set property" 'org-set-property t] 12934 ["Set property" 'org-set-property t]