1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 18:40:39 -08:00

Sync with Org 8.2.8.

This commit is contained in:
Bastien Guerry 2014-10-03 10:13:51 +02:00
parent e197284d47
commit a81e5de3a3
44 changed files with 2586 additions and 1811 deletions

View file

@ -1,3 +1,25 @@
2014-10-02 Bastien Guerry <bzg@gnu.org>
* org.texi (Key bindings and useful functions): Fix typo. Use the
correct function's name.
2014-10-02 Michael Brand <michael.ch.brand@gmail.com>
* org.texi (Formula syntax for Calc): Add `f-1' to TBLFM example
about `nan'.
2014-10-02 Nicolas Goaziou <mail@nicolasgoaziou.fr>
* org.texi (Export settings): Be more explicit about how output
file name is built.
* org.texi (Headings and sectioning structure): Document menus.
2014-10-02 Nicolas Goaziou <n.goaziou@gmail.com>
* org.texi (Include files, Publishing options): Remove reference
to inexistent variable.
2014-07-25 Stephen Berman <stephen.berman@gmx.net> 2014-07-25 Stephen Berman <stephen.berman@gmx.net>
* todo-mode.texi (Marked Items): Correct omission of item deletion * todo-mode.texi (Marked Items): Correct omission of item deletion

View file

@ -2,7 +2,7 @@
@c %**start of header @c %**start of header
@setfilename ../../info/org @setfilename ../../info/org
@settitle The Org Manual @settitle The Org Manual
@set VERSION 8.2.6 @set VERSION 8.2.8
@c Version and Contact Info @c Version and Contact Info
@set MAINTAINERSITE @uref{http://orgmode.org,maintainers web page} @set MAINTAINERSITE @uref{http://orgmode.org,maintainers web page}
@ -584,8 +584,9 @@ Exporting
* Markdown export:: Exporting to Markdown * Markdown export:: Exporting to Markdown
* OpenDocument Text export:: Exporting to OpenDocument Text * OpenDocument Text export:: Exporting to OpenDocument Text
* Org export:: Exporting to Org * Org export:: Exporting to Org
* Texinfo export:: Exporting to Texinfo
* iCalendar export:: Exporting to iCalendar * iCalendar export:: Exporting to iCalendar
* Other built-in back-ends:: Exporting to @code{Texinfo} or a man page * Other built-in back-ends:: Exporting to a man page
* Export in foreign buffers:: Author tables and lists in Org syntax * Export in foreign buffers:: Author tables and lists in Org syntax
* Advanced configuration:: Fine-tuning the export output * Advanced configuration:: Fine-tuning the export output
@ -637,6 +638,16 @@ Advanced topics in ODT export
* Customizing tables in ODT export:: How to define and use Table templates * Customizing tables in ODT export:: How to define and use Table templates
* Validating OpenDocument XML:: How to debug corrupt OpenDocument files * Validating OpenDocument XML:: How to debug corrupt OpenDocument files
Texinfo export
* Texinfo export commands:: How to invoke Texinfo export
* Document preamble:: File header, title and copyright page
* Headings and sectioning structure:: Building document structure
* Indices:: Creating indices
* Quoting Texinfo code:: Incorporating literal Texinfo code
* Texinfo specific attributes:: Controlling Texinfo output
* An example::
Publishing Publishing
* Configuration:: Defining projects * Configuration:: Defining projects
@ -2725,9 +2736,11 @@ Operations, , Logical Operations, calc, GNU Emacs Calc Manual}). For example
@item if($1 < 20, teen, string("")) @item if($1 < 20, teen, string(""))
"teen" if age $1 is less than 20, else the Org table result field is set to "teen" if age $1 is less than 20, else the Org table result field is set to
empty with the empty string. empty with the empty string.
@item if("$1" == "nan" || "$2" == "nan", string(""), $1 + $2); E @item if("$1" == "nan" || "$2" == "nan", string(""), $1 + $2); E f-1
Sum of the first two columns. When at least one of the input fields is empty Sum of the first two columns. When at least one of the input fields is empty
the Org table result field is set to empty. the Org table result field is set to empty. @samp{E} is required to not
convert empty fields to 0. @samp{f-1} is an optional Calc format string
similar to @samp{%.1f} but leaves empty results empty.
@item if(typeof(vmean($1..$7)) == 12, string(""), vmean($1..$7); E @item if(typeof(vmean($1..$7)) == 12, string(""), vmean($1..$7); E
Mean value of a range unless there is any empty field. Every field in the Mean value of a range unless there is any empty field. Every field in the
range that is empty is replaced by @samp{nan} which lets @samp{vmean} result range that is empty is replaced by @samp{nan} which lets @samp{vmean} result
@ -4410,7 +4423,7 @@ To record a timestamp without a note for TODO keywords configured with
@noindent @noindent
@vindex org-log-done @vindex org-log-done
you not only define global TODO keywords and fast access keys, but also You not only define global TODO keywords and fast access keys, but also
request that a time is recorded when the entry is set to request that a time is recorded when the entry is set to
DONE@footnote{It is possible that Org mode will record two timestamps DONE@footnote{It is possible that Org mode will record two timestamps
when you are using both @code{org-log-done} and state change logging. when you are using both @code{org-log-done} and state change logging.
@ -9951,11 +9964,10 @@ include your @file{.emacs} file, you could use:
@end example @end example
@noindent @noindent
The optional second and third parameter are the markup (e.g., @samp{quote}, The optional second and third parameter are the markup (i.e., @samp{example}
@samp{example}, or @samp{src}), and, if the markup is @samp{src}, the or @samp{src}), and, if the markup is @samp{src}, the language for formatting
language for formatting the contents. The markup is optional; if it is not the contents. The markup is optional; if it is not given, the text will be
given, the text will be assumed to be in Org mode format and will be assumed to be in Org mode format and will be processed normally.
processed normally.
Contents of the included file will belong to the same structure (headline, Contents of the included file will belong to the same structure (headline,
item) containing the @code{INCLUDE} keyword. In particular, headlines within item) containing the @code{INCLUDE} keyword. In particular, headlines within
@ -10364,8 +10376,9 @@ in the iCalendar format.
* Markdown export:: Exporting to Markdown * Markdown export:: Exporting to Markdown
* OpenDocument Text export:: Exporting to OpenDocument Text * OpenDocument Text export:: Exporting to OpenDocument Text
* Org export:: Exporting to Org * Org export:: Exporting to Org
* Texinfo export:: Exporting to Texinfo
* iCalendar export:: Exporting to iCalendar * iCalendar export:: Exporting to iCalendar
* Other built-in back-ends:: Exporting to @code{Texinfo} or a man page * Other built-in back-ends:: Exporting to a man page
* Export in foreign buffers:: Author tables and lists in Org syntax * Export in foreign buffers:: Author tables and lists in Org syntax
* Advanced configuration:: Fine-tuning the export output * Advanced configuration:: Fine-tuning the export output
@end menu @end menu
@ -10690,16 +10703,12 @@ Toggle inclusion of TODO keywords into exported text
Toggle inclusion of tables (@code{org-export-with-tables}). Toggle inclusion of tables (@code{org-export-with-tables}).
@end table @end table
@cindex property, EXPORT_FILE_NAME
When exporting only a subtree, each of the previous keywords@footnote{With When exporting only a subtree, each of the previous keywords@footnote{With
the exception of @samp{SETUPFILE}.} can be overridden locally by special node the exception of @samp{SETUPFILE}.} can be overridden locally by special node
properties. These begin with @samp{EXPORT_}, followed by the name of the properties. These begin with @samp{EXPORT_}, followed by the name of the
keyword they supplant. For example, @samp{DATE} and @samp{OPTIONS} keywords keyword they supplant. For example, @samp{DATE} and @samp{OPTIONS} keywords
become, respectively, @samp{EXPORT_DATE} and @samp{EXPORT_OPTIONS} become, respectively, @samp{EXPORT_DATE} and @samp{EXPORT_OPTIONS}
properties. Subtree export also supports the self-explicit properties.
@samp{EXPORT_FILE_NAME} property@footnote{There is no buffer-wide equivalent
for this property. The file name in this case is derived from the file
associated to the buffer, if possible, or asked to the user otherwise.}.
@cindex #+BIND @cindex #+BIND
@vindex org-export-allow-bind-keywords @vindex org-export-allow-bind-keywords
@ -10708,6 +10717,13 @@ can become buffer-local during export by using the BIND keyword. Its syntax
is @samp{#+BIND: variable value}. This is particularly useful for in-buffer is @samp{#+BIND: variable value}. This is particularly useful for in-buffer
settings that cannot be changed using specific keywords. settings that cannot be changed using specific keywords.
@cindex property, EXPORT_FILE_NAME
The name of the output file to be generated is taken from the file associated
to the buffer, when possible, or asked to you otherwise. For subtree export,
you can also set @samp{EXPORT_FILE_NAME} property. In all cases, only the
base name of the file is retained, and a back-end specific extension is
added.
@node ASCII/Latin-1/UTF-8 export, Beamer export, Export settings, Exporting @node ASCII/Latin-1/UTF-8 export, Beamer export, Export settings, Exporting
@section ASCII/Latin-1/UTF-8 export @section ASCII/Latin-1/UTF-8 export
@cindex ASCII export @cindex ASCII export
@ -12228,7 +12244,7 @@ height:width ratio, do the following
@cindex #+ATTR_ODT @cindex #+ATTR_ODT
You can control the manner in which an image is anchored by setting the You can control the manner in which an image is anchored by setting the
@code{:anchor} property of it's @code{#+ATTR_ODT} line. You can specify one @code{:anchor} property of it's @code{#+ATTR_ODT} line. You can specify one
of the the following three values for the @code{:anchor} property: of the following three values for the @code{:anchor} property:
@samp{"as-char"}, @samp{"paragraph"} and @samp{"page"}. @samp{"as-char"}, @samp{"paragraph"} and @samp{"page"}.
To create an image that is anchored to a page, do the following: To create an image that is anchored to a page, do the following:
@ -12834,7 +12850,324 @@ Export to a temporary buffer. Do not create a file.
Export to an Org file, then open it. Export to an Org file, then open it.
@end table @end table
@node iCalendar export, Other built-in back-ends, Org export, Exporting @node Texinfo export, iCalendar export, Org export, Exporting
@section Texinfo export
@cindex Texinfo export
@samp{texinfo} export back-end generates Texinfo code and can compile it into
an Info file.
@menu
* Texinfo export commands:: How to invoke Texinfo export
* Document preamble:: File header, title and copyright page
* Headings and sectioning structure:: Building document structure
* Indices:: Creating indices
* Quoting Texinfo code:: Incorporating literal Texinfo code
* Texinfo specific attributes:: Controlling Texinfo output
* An example::
@end menu
@node Texinfo export commands, Document preamble, Texinfo export, Texinfo export
@subsection Texinfo export commands
@vindex org-texinfo-info-process
@table @kbd
@orgcmd{C-c C-e i t,org-texinfo-export-to-texinfo}
Export as a Texinfo file. For an Org file, @file{myfile.org}, the resulting
file will be @file{myfile.texi}. The file will be overwritten without
warning.
@orgcmd{C-c C-e i i,org-texinfo-export-to-info}
Export to Texinfo and then process to an Info file@footnote{By setting
@code{org-texinfo-info-process}, it is possible to generate other formats,
including DocBook.}.
@end table
@node Document preamble, Headings and sectioning structure, Texinfo export commands, Texinfo export
@subsection Document preamble
When processing a document, @samp{texinfo} back-end generates a minimal file
header along with a title page, a copyright page, and a menu. You control
the latter through the structure of the document (@pxref{Headings and
sectioning structure}). Various keywords allow to tweak the other parts. It
is also possible to give directions to install the document in the @samp{Top}
node.
@subsubheading File header
@cindex #+TEXINFO_FILENAME
Upon creating the header of a Texinfo file, the back-end guesses a name for
the Info file to be compiled. This may not be a sensible choice, e.g., if
you want to produce the final document in a different directory. Specify an
alternate path with @code{#+TEXINFO_FILENAME} keyword to override the default
destination.
@vindex org-texinfo-coding-system
@vindex org-texinfo-classes
@cindex #+TEXINFO_HEADER
@cindex #+TEXINFO_CLASS
Along with the output file name, the header contains information about the
language (@pxref{Export settings}) and current encoding used@footnote{See
@code{org-texinfo-coding-system} for more information.}. Insert
a @code{#+TEXINFO_HEADER} keyword for each additional command needed, e.g.,
@@code@{@@synindex@}.
If you happen to regularly install the same set of commands, it may be easier
to define your own class in @code{org-texinfo-classes}, which see. Set
@code{#+TEXINFO_CLASS} keyword accordingly in your document to activate it.
@subsubheading Title and copyright page
@cindex #+TEXINFO_PRINTED_TITLE
@cindex #+SUBTITLE
The default template includes a title page for hard copy output. The title
and author displayed on this page are extracted from, respectively,
@code{#+TITLE} and @code{#+AUTHOR} keywords (@pxref{Export settings}). It is
also possible to print a different, more specific, title with
@code{#+TEXINFO_PRINTED_TITLE} keyword, and add subtitles with
@code{#+SUBTITLE} keyword. Both expect raw Texinfo code in their value.
@cindex #+SUBAUTHOR
Likewise, information brought by @code{#+AUTHOR} may not be enough. You can
include other authors with several @code{#+SUBAUTHOR} keywords. Values are
also expected to be written in Texinfo code.
@example
#+AUTHOR: Jane Smith
#+SUBAUTHOR: John Doe
#+TEXINFO_PRINTED_TITLE: This Long Title@@inlinefmt@{tex,@@*@} Is Broken in @@TeX@{@}
@end example
@cindex property, COPYING
Copying material is defined in a dedicated headline with a non-nil
@code{:COPYING:} property. The contents are inserted within
a @code{@@copying} command at the beginning of the document whereas the
heading itself does not appear in the structure of the document.
Copyright information is printed on the back of the title page.
@example
* Copying
:PROPERTIES:
:COPYING: t
:END:
This is a short example of a complete Texinfo file, version 1.0.
Copyright \copy 2014 Free Software Foundation, Inc.
@end example
@subsubheading The Top node
@cindex #+TEXINFO_DIR_CATEGORY
@cindex #+TEXINFO_DIR_TITLE
@cindex #+TEXINFO_DIR_DESC
You may ultimately want to install your new Info file to your system. You
can write an appropriate entry in the top level directory specifying its
category and title with, respectively, @code{#+TEXINFO_DIR_CATEGORY} and
@code{#+TEXINFO_DIR_TITLE}. Optionally, you can add a short description
using @code{#+TEXINFO_DIR_DESC}. The following example would write an entry
similar to Org's in the @samp{Top} node.
@example
#+TEXINFO_DIR_CATEGORY: Emacs
#+TEXINFO_DIR_TITLE: Org Mode: (org)
#+TEXINFO_DIR_DESC: Outline-based notes management and organizer
@end example
@node Headings and sectioning structure, Indices, Document preamble, Texinfo export
@subsection Headings and sectioning structure
@vindex org-texinfo-classes
@vindex org-texinfo-default-class
@cindex #+TEXINFO_CLASS
@samp{texinfo} uses a pre-defined scheme, or class, to convert headlines into
Texinfo structuring commands. For example, a top level headline appears as
@code{@@chapter} if it should be numbered or as @code{@@unnumbered}
otherwise. If you need to use a different set of commands, e.g., to start
with @code{@@part} instead of @code{@@chapter}, install a new class in
@code{org-texinfo-classes}, then activate it with @code{#+TEXINFO_CLASS}
keyword. Export process defaults to @code{org-texinfo-default-class} when
there is no such keyword in the document.
If a headline's level has no associated structuring command, or is below
a certain threshold @pxref{Export settings}, that headline becomes a list in
Texinfo output.
@cindex property, APPENDIX
As an exception, a headline with a non-nil @code{:APPENDIX:} property becomes
an appendix, independently on its level and the class used.
@cindex property, DESCRIPTION
Each regular sectioning structure creates a menu entry, named after the
heading. You can provide a different, e.g., shorter, title in
@code{:ALT_TITLE:} property (@pxref{Table of contents}). Optionally, you can
specify a description for the item in @code{:DESCRIPTION:} property. E.g.,
@example
* Controlling Screen Display
:PROPERTIES:
:ALT_TITLE: Display
:DESCRIPTION: Controlling Screen Display
:END:
@end example
@node Indices, Quoting Texinfo code, Headings and sectioning structure, Texinfo export
@subsection Indices
@cindex #+CINDEX
@cindex #+FINDEX
@cindex #+KINDEX
@cindex #+PINDEX
@cindex #+TINDEX
@cindex #+VINDEX
Index entries are created using dedicated keywords. @samp{texinfo} back-end
provides one for each predefined type: @code{#+CINDEX}, @code{#+FINDEX},
@code{#+KINDEX}, @code{#+PINDEX}, @code{#+TINDEX} and @code{#+VINDEX}. For
custom indices, you can write raw Texinfo code (@pxref{Quoting Texinfo
code}).
@example
#+CINDEX: Defining indexing entries
@end example
@cindex property, INDEX
To generate an index, you need to set the @code{:INDEX:} property of
a headline to an appropriate abbreviation (e.g., @samp{cp} or @samp{vr}).
The headline is then exported as an unnumbered chapter or section command and
the index is inserted after its contents.
@example
* Concept Index
:PROPERTIES:
:INDEX: cp
:END:
@end example
@node Quoting Texinfo code, Texinfo specific attributes, Indices, Texinfo export
@subsection Quoting Texinfo code
It is possible to insert raw Texinfo code using any of the following
constructs
@cindex #+TEXINFO
@cindex #+BEGIN_TEXINFO
@example
Richard @@@@texinfo:@@sc@{@@@@Stallman@@@@texinfo:@}@@@@ commence' GNU.
#+TEXINFO: @@need800
This paragraph is preceded by...
#+BEGIN_TEXINFO
@@auindex Johnson, Mark
@@auindex Lakoff, George
#+END_TEXINFO
@end example
@node Texinfo specific attributes, An example, Quoting Texinfo code, Texinfo export
@subsection Texinfo specific attributes
@cindex #+ATTR_TEXINFO
@samp{texinfo} back-end understands several attributes in plain lists and
tables. They must be specified using an @code{#+ATTR_TEXINFO} keyword,
written just above the list or table.
@subsubheading Plain lists
In Texinfo output, description lists appear as two-column tables, using the
default command @code{@@table}. You can use @code{@@ftable} or
@code{@@vtable}@footnote{For more information, @inforef{Two-column
Tables,,texinfo}.} instead with @code{:table-type} attribute.
@vindex org-texinfo-def-table-markup
In any case, these constructs require a highlighting command for entries in
the list. You can provide one with @code{:indic} attribute. If you do not,
it defaults to the value stored in @code{org-texinfo-def-table-markup}, which
see.
@example
#+ATTR_TEXINFO: :indic @@asis
- foo :: This is the text for /foo/, with no highlighting.
@end example
@subsubheading Tables
When exporting a table, column widths are deduced from the longest cell in
each column. You can also define them explicitly as fractions of the line
length, using @code{:columns} attribute.
@example
#+ATTR_TEXINFO: :columns .5 .5
| a cell | another cell |
@end example
@node An example, , Texinfo specific attributes, Texinfo export
@subsection An example
Here is a thorough example, taken from @inforef{GNU Sample Texts,,texinfo}.
@smallexample
#+MACRO: version 2.0
#+MACRO: updated last updated 4 March 2014
#+OPTIONS: ':t toc:t author:t email:t
#+TITLE: GNU Sample @{@{@{version@}@}@}
#+AUTHOR: A.U. Thor
#+EMAIL: bug-sample@@gnu.org
#+LANGUAGE: en
#+TEXINFO_FILENAME: sample.info
#+TEXINFO_HEADER: @@syncodeindex pg cp
#+TEXINFO_DIR_CATEGORY: Texinfo documentation system
#+TEXINFO_DIR_TITLE: sample: (sample)
#+TEXINFO_DIR_DESC: Invoking sample
#+TEXINFO_PRINTED_TITLE: GNU Sample
#+SUBTITLE: for version 2.0, last updated 4 March 2014
* Copying
:PROPERTIES:
:COPYING: t
:END:
This manual is for GNU Sample (version @{@{@{version@}@}@},
@{@{@{updated@}@}@}), which is an example in the Texinfo documentation.
Copyright @@@@texinfo:@@copyright@{@}@@@@ 2013 Free Software Foundation,
Inc.
#+BEGIN_QUOTE
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License,
Version 1.3 or any later version published by the Free Software
Foundation; with no Invariant Sections, with no Front-Cover Texts,
and with no Back-Cover Texts. A copy of the license is included in
the section entitled "GNU Free Documentation License".
#+END_QUOTE
* Invoking sample
#+PINDEX: sample
#+CINDEX: invoking @@command@{sample@}
This is a sample manual. There is no sample program to invoke, but
if there were, you could see its basic usage and command line
options here.
* GNU Free Documentation License
:PROPERTIES:
:APPENDIX: t
:END:
#+TEXINFO: @@include fdl.texi
* Index
:PROPERTIES:
:INDEX: cp
:END:
@end smallexample
@node iCalendar export, Other built-in back-ends, Texinfo export, Exporting
@section iCalendar export @section iCalendar export
@cindex iCalendar export @cindex iCalendar export
@ -12912,12 +13245,11 @@ On top of the aforementioned back-ends, Org comes with other built-in ones:
@itemize @itemize
@item @file{ox-man.el}: export to a man page. @item @file{ox-man.el}: export to a man page.
@item @file{ox-texinfo.el}: export to @code{Texinfo} format.
@end itemize @end itemize
To activate these export back-end, customize @code{org-export-backends} or To activate these export back-end, customize @code{org-export-backends} or
load them directly with e.g., @code{(require 'ox-texinfo)}. This will add load them directly with e.g., @code{(require 'ox-man)}. This will add new
new keys in the export dispatcher (@pxref{The Export Dispatcher}). keys in the export dispatcher (@pxref{The Export Dispatcher}).
See the comment section of these files for more information on how to use See the comment section of these files for more information on how to use
them. them.
@ -13334,7 +13666,6 @@ string of these options for details.
@item @code{:headline-levels} @tab @code{org-export-headline-levels} @item @code{:headline-levels} @tab @code{org-export-headline-levels}
@item @code{:language} @tab @code{org-export-default-language} @item @code{:language} @tab @code{org-export-default-language}
@item @code{:preserve-breaks} @tab @code{org-export-preserve-breaks} @item @code{:preserve-breaks} @tab @code{org-export-preserve-breaks}
@item @code{:publishing-directory} @tab @code{org-export-publishing-directory}
@item @code{:section-numbers} @tab @code{org-export-with-section-numbers} @item @code{:section-numbers} @tab @code{org-export-with-section-numbers}
@item @code{:select-tags} @tab @code{org-export-select-tags} @item @code{:select-tags} @tab @code{org-export-select-tags}
@item @code{:with-author} @tab @code{org-export-with-author} @item @code{:with-author} @tab @code{org-export-with-author}
@ -15473,10 +15804,10 @@ are active:
@item @kbd{C-c C-c} @tab @code{org-babel-execute-src-block} @item @kbd{C-c C-c} @tab @code{org-babel-execute-src-block}
@kindex C-c C-o @kindex C-c C-o
@item @kbd{C-c C-o} @tab @code{org-babel-open-src-block-result} @item @kbd{C-c C-o} @tab @code{org-babel-open-src-block-result}
@kindex C-up @kindex M-up
@item @kbd{C-@key{up}} @tab @code{org-babel-load-in-session} @item @kbd{M-@key{up}} @tab @code{org-babel-load-in-session}
@kindex M-down @kindex M-down
@item @kbd{M-@key{down}} @tab @code{org-babel-pop-to-session} @item @kbd{M-@key{down}} @tab @code{org-babel-switch-to-session}
@end multitable @end multitable
In an Org mode buffer, the following key bindings are active: In an Org mode buffer, the following key bindings are active:
@ -18208,7 +18539,6 @@ org-customize @key{RET}} and then click yourself through the tree.
@bye @bye
@c Local variables: @c Local variables:
@c coding: utf-8
@c fill-column: 77 @c fill-column: 77
@c indent-tabs-mode: nil @c indent-tabs-mode: nil
@c paragraph-start: "\\|^@[a-zA-Z]*[ \n]\\|^@x?org\\(key\\|cmd\\)\\|\f\\|[ ]*$" @c paragraph-start: "\\|^@[a-zA-Z]*[ \n]\\|^@x?org\\(key\\|cmd\\)\\|\f\\|[ ]*$"

View file

@ -46,7 +46,19 @@
<!-- automatic styles --> <!-- automatic styles -->
<office:automatic-styles> <office:automatic-styles>
<!-- Section styles --> <!-- Section styles -->
<!-- Section styles for Table Of Contents and Other Indices -->
<style:style style:name="OrgIndexSection" style:family="section">
<style:section-properties fo:background-color="#c0c0c0" style:editable="false">
<style:columns fo:column-count="1" fo:column-gap="0cm"/>
<style:background-image/>
</style:section-properties>
</style:style>
<!-- Indented sections, used as container for tables that occur
within list items -->
<style:style style:name="OrgIndentedSection-Level-1" style:family="section"> <style:style style:name="OrgIndentedSection-Level-1" style:family="section">
<style:section-properties text:dont-balance-text-columns="false" fo:margin-left="1.281cm" fo:margin-right="0cm" style:editable="false"> <style:section-properties text:dont-balance-text-columns="false" fo:margin-left="1.281cm" fo:margin-right="0cm" style:editable="false">
<style:columns fo:column-count="1" fo:column-gap="0cm"/> <style:columns fo:column-count="1" fo:column-gap="0cm"/>

View file

@ -86,7 +86,11 @@
<style:style style:name="Standard" style:family="paragraph" style:class="text"/> <style:style style:name="Standard" style:family="paragraph" style:class="text"/>
<style:style style:name="Heading" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Text_20_body" style:class="text"> <style:style style:name="Heading" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Text_20_body" style:class="text">
<style:paragraph-properties fo:margin-top="0.423cm" fo:margin-bottom="0.212cm" fo:keep-with-next="always"/> <style:paragraph-properties fo:margin-top="0.423cm" fo:margin-bottom="0.212cm" fo:keep-with-next="always">
<style:tab-stops>
<style:tab-stop style:position="17cm" style:type="right"/>
</style:tab-stops>
</style:paragraph-properties>
<style:text-properties style:font-name="Arial" fo:font-size="14pt" style:font-name-asian="SimSun" style:font-size-asian="14pt" style:font-name-complex="Tahoma" style:font-size-complex="14pt"/> <style:text-properties style:font-name="Arial" fo:font-size="14pt" style:font-name-asian="SimSun" style:font-size-asian="14pt" style:font-name-complex="Tahoma" style:font-size-complex="14pt"/>
</style:style> </style:style>
<style:style style:name="Text_20_body" style:display-name="Text body" style:family="paragraph" style:parent-style-name="Standard" style:class="text"> <style:style style:name="Text_20_body" style:display-name="Text body" style:family="paragraph" style:parent-style-name="Standard" style:class="text">
@ -252,26 +256,44 @@
<style:style style:name="Quotations" style:family="paragraph" style:parent-style-name="Standard" style:class="html"> <style:style style:name="Quotations" style:family="paragraph" style:parent-style-name="Standard" style:class="html">
<style:paragraph-properties fo:margin-left="1cm" fo:margin-right="1cm" fo:margin-top="0cm" fo:margin-bottom="0.499cm" fo:text-indent="0cm" style:auto-text-indent="false"/> <style:paragraph-properties fo:margin-left="1cm" fo:margin-right="1cm" fo:margin-top="0cm" fo:margin-bottom="0.499cm" fo:text-indent="0cm" style:auto-text-indent="false"/>
</style:style> </style:style>
<style:style style:name="OrgFootnoteQuotations" style:family="paragraph" style:parent-style-name="Footnote" style:class="html">
<style:paragraph-properties fo:margin-left="1cm" fo:margin-right="1cm" fo:margin-top="0cm" fo:margin-bottom="0.499cm" fo:text-indent="0cm" style:auto-text-indent="false"/>
</style:style>
<style:style style:name="Preformatted_20_Text" style:display-name="Preformatted Text" style:family="paragraph" style:parent-style-name="Standard" style:class="html"> <style:style style:name="Preformatted_20_Text" style:display-name="Preformatted Text" style:family="paragraph" style:parent-style-name="Standard" style:class="html">
<style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0cm"/> <style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0cm"/>
<style:text-properties style:font-name="Courier New" fo:font-size="10pt" style:font-name-asian="NSimSun" style:font-size-asian="10pt" style:font-name-complex="Courier New" style:font-size-complex="10pt"/> <style:text-properties style:font-name="Courier New" fo:font-size="10pt" style:font-name-asian="NSimSun" style:font-size-asian="10pt" style:font-name-complex="Courier New" style:font-size-complex="10pt"/>
</style:style> </style:style>
<style:style style:name="OrgVerse" style:family="paragraph" style:parent-style-name="Preformatted_20_Text"> <style:style style:name="OrgVerse" style:family="paragraph" style:parent-style-name="Preformatted_20_Text">
<style:paragraph-properties fo:background-color="#c0c0c0" fo:padding="0.049cm" fo:border="0.018cm solid #000000" style:shadow="none"> <style:paragraph-properties fo:background-color="transparent" fo:padding="0cm" fo:border="none" style:shadow="none">
<style:background-image/> <style:background-image/>
</style:paragraph-properties> </style:paragraph-properties>
</style:style> </style:style>
<style:style style:name="OrgClock" style:family="paragraph" style:parent-style-name="Text_20_body">
<style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0cm"/>
</style:style>
<style:style style:name="OrgClockLastLine" style:family="paragraph" style:parent-style-name="OrgClock"/>
<style:style style:name="OrgPlanning" style:family="paragraph" style:parent-style-name="Text_20_body"/>
<!-- Fixed width block -->
<style:style style:name="OrgFixedWidthBlock" style:family="paragraph" style:parent-style-name="Preformatted_20_Text"> <style:style style:name="OrgFixedWidthBlock" style:family="paragraph" style:parent-style-name="Preformatted_20_Text">
<style:paragraph-properties fo:background-color="#c0c0c0" fo:padding="0.049cm" fo:border="0.018cm solid #000000" style:shadow="none"> <style:paragraph-properties fo:background-color="#c0c0c0" fo:padding="0.049cm" fo:border="0.06pt solid #000000" style:shadow="none">
<style:background-image/> <style:background-image/>
</style:paragraph-properties> </style:paragraph-properties>
</style:style> </style:style>
<style:style style:name="OrgFixedWidthBlockLastLine" style:family="paragraph" style:parent-style-name="OrgFixedWidthBlock"> <style:style style:name="OrgFixedWidthBlockLastLine" style:family="paragraph" style:parent-style-name="OrgFixedWidthBlock">
<style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0.21cm"/> <style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0.21cm"/>
</style:style> </style:style>
<style:style style:name="OrgFormula" style:family="paragraph" style:parent-style-name="Text_20_body">
<style:paragraph-properties>
<style:tab-stops>
<style:tab-stop style:position="17cm" style:type="right"/>
</style:tab-stops>
</style:paragraph-properties>
</style:style>
<style:style style:name="OrgSrcBlockLastLine" style:family="paragraph" style:parent-style-name="OrgSrcBlock"> <style:style style:name="OrgSrcBlockLastLine" style:family="paragraph" style:parent-style-name="OrgSrcBlock">
<style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0.21cm"/> <style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0.21cm"/>
</style:style> </style:style>
@ -279,6 +301,9 @@
<style:style style:name="OrgCenter" style:family="paragraph" style:parent-style-name="Text_20_body"> <style:style style:name="OrgCenter" style:family="paragraph" style:parent-style-name="Text_20_body">
<style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/> <style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/>
</style:style> </style:style>
<style:style style:name="OrgFootnoteCenter" style:family="paragraph" style:parent-style-name="Footnote">
<style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/>
</style:style>
<style:style style:name="OrgTableContents" style:family="paragraph" style:parent-style-name="Text_20_body"/> <style:style style:name="OrgTableContents" style:family="paragraph" style:parent-style-name="Text_20_body"/>
<style:style style:name="OrgTableHeading" style:family="paragraph" style:parent-style-name="OrgTableContents" style:class="extra"> <style:style style:name="OrgTableHeading" style:family="paragraph" style:parent-style-name="OrgTableContents" style:class="extra">
<style:paragraph-properties fo:text-align="center" style:justify-single-word="false" text:number-lines="false" text:line-number="0"/> <style:paragraph-properties fo:text-align="center" style:justify-single-word="false" text:number-lines="false" text:line-number="0"/>
@ -325,9 +350,10 @@
</style:paragraph-properties> </style:paragraph-properties>
</style:style> </style:style>
<style:style style:name="Horizontal_20_Line" style:display-name="Horizontal Line" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Text_20_body" style:class="html"> <style:style style:name="Horizontal_20_Line" style:display-name="Horizontal Line" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Text_20_body" style:class="html">
<style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0.499cm" style:border-line-width-bottom="0.002cm 0.035cm 0.002cm" fo:padding="0cm" fo:border-left="none" fo:border-right="none" fo:border-top="none" fo:border-bottom="0.039cm double #808080" text:number-lines="false" text:line-number="0" style:join-border="false"/> <style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0.21cm" style:page-number="auto" fo:padding="0cm" fo:border-left="none" fo:border-right="none" fo:border-top="none" fo:border-bottom="0.06pt solid #000000" style:shadow="none" text:number-lines="false" text:line-number="0" style:join-border="false"/>
<style:text-properties fo:font-size="6pt" style:font-size-asian="6pt" style:font-size-complex="6pt"/> <style:text-properties fo:font-size="6pt" style:font-size-asian="6pt" style:font-size-complex="6pt"/>
</style:style> </style:style>
<style:style style:name="Emphasis" style:family="text"> <style:style style:name="Emphasis" style:family="text">
<style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic"/> <style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic"/>
</style:style> </style:style>
@ -349,23 +375,41 @@
<style:style style:name="OrgCode" style:family="text" style:parent-style-name="Source_20_Text"/> <style:style style:name="OrgCode" style:family="text" style:parent-style-name="Source_20_Text"/>
<!-- BEGIN: Org Agenda Styles --> <!-- BEGIN: Org Agenda Styles -->
<style:style style:name="OrgTodo" style:family="text"> <style:style style:name="OrgTodo" style:family="text"/>
<style:text-properties fo:color="#ff0000"/> <style:style style:name="OrgDone" style:family="text"/>
</style:style>
<style:style style:name="OrgDone" style:family="text">
<style:text-properties fo:color="#008000"/>
</style:style>
<style:style style:name="OrgTag" style:family="text"> <style:style style:name="OrgTag" style:family="text">
<style:text-properties fo:background-color="#add8e6"/> <style:text-properties fo:font-variant="small-caps" fo:background-color="transparent"/>
</style:style> </style:style>
<style:style style:name="OrgTimestamp" style:family="text"> <style:style style:name="OrgTags" style:family="text"/>
<style:text-properties fo:color="#bebebe"/>
<style:style style:name="OrgPriority" style:family="text"/>
<style:style style:name="OrgPriority-A" style:family="text" style:parent-style-name="OrgPriority"/>
<style:style style:name="OrgPriority-B" style:family="text" style:parent-style-name="OrgPriority"/>
<style:style style:name="OrgPriority-C" style:family="text" style:parent-style-name="OrgPriority"/>
<style:style style:name="OrgTimestamp" style:display-name="OrgTimestamp" style:family="text">
<style:text-properties style:font-name="Courier New" fo:background-color="transparent" style:font-name-asian="NSimSun" style:font-name-complex="Courier New"/>
</style:style> </style:style>
<style:style style:name="OrgActiveTimestamp" style:family="text" style:parent-style-name="OrgTimestamp"/>
<style:style style:name="OrgInactiveTimestamp" style:family="text" style:parent-style-name="OrgTimestamp"/>
<style:style style:name="OrgTimestampKeyword" style:family="text"> <style:style style:name="OrgTimestampKeyword" style:family="text">
<style:text-properties fo:color="#5f9ea0"/> <style:text-properties style:use-window-font-color="true" fo:font-weight="bold"/>
</style:style> </style:style>
<style:style style:name="OrgScheduledKeyword" style:family="text" style:parent-style-name="OrgTimestampKeyword"/>
<style:style style:name="OrgDeadlineKeyword" style:family="text" style:parent-style-name="OrgTimestampKeyword"/>
<style:style style:name="OrgClockKeyword" style:family="text" style:parent-style-name="OrgTimestampKeyword"/>
<style:style style:name="OrgClosedKeyword" style:family="text" style:parent-style-name="OrgTimestampKeyword"/>
<style:style style:name="OrgTimestampWrapper" style:family="text"/> <style:style style:name="OrgTimestampWrapper" style:family="text"/>
<style:style style:name="OrgTarget" style:family="text"/> <style:style style:name="OrgTarget" style:family="text"/>
<number:date-style style:name="OrgDate" number:automatic-order="true">
<number:day number:style="long"/>
<number:text>/</number:text>
<number:month number:style="long"/>
<number:text>/</number:text>
<number:year number:style="long"/>
</number:date-style>
<!-- END: Org Agenda Styles --> <!-- END: Org Agenda Styles -->
<style:style style:name="Bold" style:family="text"> <style:style style:name="Bold" style:family="text">
@ -441,7 +485,7 @@
</style:style> </style:style>
<style:style style:name="OrgFormulaCaptionFrame" style:family="graphic" style:parent-style-name="Frame"> <style:style style:name="OrgFormulaCaptionFrame" style:family="graphic" style:parent-style-name="Frame">
<style:graphic-properties fo:margin-top="0cm" fo:margin-bottom="0cm" style:vertical-pos="middle" style:vertical-rel="text" style:horizontal-pos="from-left" style:horizontal-rel="paragraph-content" fo:padding="0cm" fo:border="none"/> <style:graphic-properties text:anchor-type="paragraph" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-top="0cm" fo:margin-bottom="0cm" style:wrap="right" style:number-wrapped-paragraphs="1" style:wrap-contour="false" style:vertical-pos="top" style:vertical-rel="paragraph" style:horizontal-pos="center" style:horizontal-rel="paragraph" fo:padding="0cm" fo:border="none"/>
</style:style> </style:style>
<style:style style:name="OrgCaptionedFormula" style:family="graphic" style:parent-style-name="OrgFormula"> <style:style style:name="OrgCaptionedFormula" style:family="graphic" style:parent-style-name="OrgFormula">

View file

@ -1,3 +1,598 @@
2014-10-02 Achim Gratz <Stromeko@Stromeko.DE>
* ob-sh.el (org-babel-sh-initiate-session): After initiating a
session, initialize the marker `comint-last-output-start' since it
is going to be used by the ANSI color filter without further
checks in Emacs 23 and throws an error.
* ob-lilypond.el, testing/lisp/test-ob-lilypond.el: Change prefix
from `ly-' to `org-babel-lilypond-' throughout.
* org-footnote.el: Forward declare `org-element-context',
`org-element-property' and `org-element-type'.
* org.el: Add forward declarations for a number of functions that
the compiler otherwise warns about as potentially undefined at
runtime.
* ob-core.el: Add comment to forward declaration of
'org-src-preserve-indentations'.
* ob-exp.el: Require org-src to import
'org-src-preserve-indentations'.
* ob-haskell.el, lisp/ob-python.el: Remove superfluous forward
declaration of 'org-src-preserve-indentations', since it gets
imported by other requires.
* ob-core.el (org-every): Forward declare 'org-every'.
* ob-C.el: Require cl during compilation so that lexical-let is
known.
* org-entities.el: Remove superfluous require of org-macs.
Forward declare 'org-toggle-pretty-entities' and
'org-pretty-entities'.
* ox.el (org-export-get-parent): Move definition of
'org-export-get-parent' before first use. Leave comment at original
place of definition.
* org.el (org-uniquify): Move definition of 'org-uniquify' before
first use. Leave comment at original place of definition.
* ob-tangle.el (org-babel-tangle): When `file-name-directory'
returns nil, do not run make-directory. Remove superfluous when
clauses by using short-circuiting `and' instead.
2014-10-02 Alex Kosorukoff <alex@3form.com> (tiny change)
* org-capture.el (org-capture-fill-template): Set `mark-active' to
nil.
2014-10-02 Bastien Guerry <bzg@gnu.org>
* org-agenda.el (org-agenda-prepare): Reset preset filters when
using sticky agendas.
* org-agenda.el (org-agenda-get-sexps): Don't add tags as text
properties.
* org-capture.el (org-capture-fill-template): Take
`org-extend-today-until' into account when setting the format time
string.
* org.el (org-paste-subtree): Fix match subexpression.
* org.el (org-fix-ellipsis-at-bol): Delete.
(org-mode, org-show-context, org-isearch-end): Don't use
`org-fix-ellipsis-at-bol'.
* org-agenda.el (org-agenda-filter-apply): Fix setting of
`org-agenda-filtered-by-category'.
* org.el (org-fontify-meta-lines-and-blocks-1): Fix handling
of `org-hidden-keywords'.
* org-agenda.el (org-cmp-ts): Fix agenda entry type checking.
* org-agenda.el (org-entries-lessp): Fix inactive timestamp
comparison.
* org-agenda.el (org-agenda-mode): Let `org-agenda-redo' DTRT
when agenda are sticky.
(org-agenda-tag-filter-while-redo): Delete.
(org-agenda-list, org-agenda-redo, org-agenda-filter-by-tag):
Remove unused code.
(org-agenda-clockreport-mode, org-agenda-set-mode-name): Don't
consider tag filters.
* org.el (org-fix-ellipsis-at-bol)
(org-first-headline-recenter): Use `set-window-start' instead
of `recenter'.
* org-agenda.el (org-recenter-heading): Delete.
* org.el (org-insert-heading): With one universal prefix argument
or `org-insert-heading-respect-content' set to `t', always respect
the content, i.e. don't insert a list item and don't convert
normal lines into headings. Update docstring.
(org-insert-heading-respect-content): Remove unused arg.
(org-insert-todo-heading-respect-content): Don't use
`org-insert-todo-heading-respect-content', use the second argument
of `org-insert-todo-heading' instead.
* org-mobile.el (org-mobile-edit): Use only one arg.
* org.el (org-overview): Don't call `recenter'.
* org-agenda.el (org-agenda-custom-commands-local-options): Fix
misquoted values.
* org.el (org-property-re): Also match null properties by default.
(org-entry-delete): Also delete null properties.
(org-read-property-value): Allow the empty string as a new value.
(org-delete-property): Throw a message when there is not property
to delete.
* org-agenda.el (org-agenda-insert-diary-make-new-entry): Fix
docstring.
* org.el (org-re-property): New parameter `allow-null' to match
property with a null value.
(org-entry-put): Correctly update a property with a null
value.
* ox-md.el (org-md-headline): When exporting with a HTML table of
contents, add HTML anchors to Markdown headlines.
* org.el (org-insert-heading): Don't insert an item when called
with two universal prefix arguments.
* org-agenda.el (org-agenda-finalize): Remove duplicate check for
'org-hd-marker.
* org-agenda.el (org-agenda-prepare-window): New parameter
`filter-alist' to set the filters correctly when
`org-agenda-persistent-filter' is on.
(org-agenda-prepare): Use the new parameter for
`org-agenda-prepare-window'.
* org-compat.el (org-in-invisibility-spec-p): Tiny code cleanup.
(org-move-to-column): Only remove '(org-filtered) from
`buffer-invisibility-spec'.
* org-agenda.el (org-agenda-mode): Add buffer invisibility specs.
(org-agenda-filter-hide-line, org-agenda-remove-filter): Set
the 'invisible text property to 'org-filtered.
(org-agenda-show-new-time): Add the default face to avoid the
foreground of the last character on the line to leak into the
timestamp notification.
* org-agenda.el (org-get-time-of-day): Don't return time string
from within links.
* org-timer.el (org-timer-value-string): Always return a positive
value. Add docstring.
* org-capture.el (org-capture-steal-local-variables): Don't steal
`mark-active', which should be nil in the target buffer.
* org-agenda.el (org-agenda-remove-filter): Use `save-excursion'.
* org.el (org-move-subtree-down): Use `org-end-of-subtree' instead
of `outline-end-of-subtree'.
(outline-end-of-subtree): Remove advice.
* org-mouse.el (org-mouse-move-tree, org-mouse-do-remotely): Use
`org-end-of-subtree' instead of `outline-end-of-subtree'.
* org-agenda.el (org-cmp-ts): Argument `type' is not optional.
Don't quote it.
* org-habit.el (org-habit-insert-consistency-graphs): Don't remove
filter overlays as we don't use overlays for filters anymore.
* org-agenda.el (org-agenda-local-vars): Add
`org-agenda-top-headline-filter'.
(org-agenda-filter-by-category): Fix syntax.
(org-agenda-filter-show-all-top-filter): New function.
(org-agenda-filter-by-top-headline)
(org-agenda-filter-remove-all): Use the new function.
(org-agenda-filter-top-headline-apply): Use a dedicated symbol
`top-headline'.
* org.el (org-entry-properties): Ensure the special property is
not commented out when matched.
* org-agenda.el (org-agenda-write): Code cleanup.
(org-agenda-mark-filtered-text)
(org-agenda-unmark-filtered-text)
(org-agenda-fix-tags-filter-overlays-at): Delete.
(org-agenda-remove-marked-text): Use the `property' argument
instead of hard-coding 'org-filtered.
(org-agenda-filter-remove-all): Use `org-agenda-finalize'.
(org-agenda-filter-hide-line): Rewrite using text properties
instead of overlays.
(org-agenda-remove-filter): New function.
(org-agenda-filter-show-all-tag)
(org-agenda-filter-show-all-cat)
(org-agenda-filter-show-all-re): Rewrite using
`org-agenda-remove-filter'.
* org-attach.el (org-attach-dir): When the property is "inherited"
from a variable outside of the file, do not use
`org-entry-property-inherited-from' to find the attachment
position, assume we need to go back to the current headline.
* ob-R.el (org-babel-R-assign-elisp): Fix parsing of a
one-dimensional value.
* org.el (org-insert-heading): Fix bug when trying to insert a
heading when point is before the first headline and not at the
beginning of a line.
* org-table.el (org-table-eval-formula): Fix conversion of
inactive timestamps to active ones.
* org.el (org-set-regexps-and-options): Allow
`org-complex-heading-regexp-format' to match [/] and [%] cookies
when they are both before and after the heading.
* org-agenda.el (org-agenda-max-todos, org-agenda-max-tags)
(org-agenda-max-effort): Fix type strings.
* org-capture.el (org-capture-fill-template): Deactivate region
while trying to align tags on the current headline.
* org-agenda.el (org-agenda-finalize): Filter by top headline if
`org-agenda-top-headline-filter' is set.
2014-10-02 Bernt Hansen <bernt@norang.ca>
* org-macs.el: Remove restriction when locating markers.
2014-10-02 Dmitry Gorbik <dgorbik@me.com> (tiny change)
* org.el (org-fast-tag-selection): Fix window splitting.
2014-10-02 Eric Schulte <schulte.eric@gmail.com>
* ob-screen.el (org-babel-screen-test): Use unpredictable name for
temporary file.
* ob-screen.el (org-babel-screen-session-write-temp-file): Use
unpredictable temp file name, fixes bug#17416.
2014-10-02 Ian Kelling <ian@iankelling.org>
* ob-core.el (org-babel-insert-result): Test all list elements
against listp and (eq element 'hline) instead of checking just the
first.
2014-10-02 Konstantin Kliakhandler <kosta@slumpy.org> (tiny change)
* org-agenda.el (org-agenda-redo): Reapply the filters correctly.
2014-10-02 Kyle Meyer <kyle@kyleam.com> (tiny change)
* ox.el (org-export-show-temporary-export-buffer): Fix typo.
2014-10-02 Matt Lundin <mdl@imapmail.org>
* ox-publish.el (org-publish-find-title, org-publish-find-date):
Make sure to call org-export-get-environment in copy of buffer if
emacs is already visiting. Otherwise, #+bind variables meant for
export can be set in live buffers.
* org.el (org-agenda-inhibit-startup): fix docstring to reflect
default value
* ox-publish.el (org-publish-find-title, org-publish-find-date):
Fix unnecessary invocations of org-mode with org-inhibit-startup.
2014-10-02 Nick Dokos <ndokos@gmail.com>
* org-table.el (org-table-clean-before-export): The regexes match
spaces in addition to the special characters that might be used in
the first column as special marking characters. Remove the space
from the character class.
* ox-ascii.el (org-ascii-superscript): Change _ to ^ in the
output.
2014-10-02 Nick Dokos <ndokos@redhat.com>
* org-table.el (org-table-show-reference): Call `set-window-start'
with the calculated values `min' and `max', not with
(point-min) and (point-max).
2014-10-02 Nicolas Goaziou <n.goaziou@gmail.com>
* ox-latex.el (org-latex-link): Improve test for unnumbered
headlines.
* ox-ascii.el (org-ascii--fill-string): Allow filling even when
`org-export-preserve-breaks' is non-nil.
* org.el (org-N-empty-lines-before-current): Make sure to delete
only empty lines, not trailing whitespaces.
* ox-html.el (org-html-headline): Make sure even listified
headlines have proper anchors so internal links can refer to them.
Small refactoring.
* org-src.el (org-edit-src-code): Fix regexp.
(org-edit-src-exit): Do not remove auto-save timer. This is
handled by the timer itself.
* org.el (org-re-property): Fix regexp. Improve docstring.
* org-element.el (org-element-property-drawer-parser)
(org-element-node-property-parser): Ignore lines that are not node
properties.
(org-element-node-property-interpreter): Allow nil properties.
* org.el (org-re-property): Fix regexp to match properties with
empty values.
* org-element.el (org-element-headline-interpreter): Take into
consideration `org-odd-levels-only' value. Small refactoring.
* ox-texinfo.el (org-texinfo--get-node): Return a node or anchor
name.
(org-texinfo--sanitize-content): Fix regexp.
(org-texinfo-link): Fix various bugs in link export.
* ox-beamer.el (org-beamer-link):
* ox-html.el (org-html-link):
* ox-latex.el (org-latex-link):
* ox-odt.el (org-odt-link): When radio link has no valid
target (e.g., this is a subtree export and the radio target is not
in the exported subtree), simply return contents.
* org.el (org-called-with-limited-levels): Initialize variable.
* org-agenda.el (org-agenda-write): Write headings in proper
order.
* org-element.el (org-element-table-interpreter): Enhance
docstring.
* ox-md.el (org-md-link): Allow custom link type export function.
* ox-texinfo.el (org-texinfo-template): Fix language and encoding
case.
* ox-md.el (org-md-separate-elements): Outside of lists, preserve
blank lines between paragraphs and plain lists.
* org-element.el (org-element-normalize-contents): Fix indentation
removal when there is an empty line within a verse block.
* ox-texinfo.el (org-texinfo--normalize-headlines): Properly add a
section to the contents.
* ox-texinfo.el (org-texinfo--normalize-headlines): Do not set pre
blanks since the value is now hard-coded.
(org-texinfo-headline): Force one blank line before contents, when non
empty. Refactoring.
(org-texinfo-src-block): Refactor code. Comply to predicate naming.
* ox-texinfo.el (org-texinfo--sanitize-node): Handle
" (not)allowed" case.
* ox-texinfo.el (org-texinfo-headline): Remove wrong code
comments.
* ox-texinfo.el (org-texinfo-headline): Remove `not-in-toc'
special case for tags.
* ox-texinfo.el (org-texinfo-headline): Remove LaTeXism (optional
arguments within square brackets).
* ox-texinfo.el (org-texinfo-info-process): Fix docstring.
(org-texinfo-compile): Do not check for impossible cases (e.g., if the
previous variable contains a function).
* ox-texinfo.el (org-texinfo-max-toc-depth): Fix docstring.
* ox-texinfo.el (org-texinfo--make-option-string,
org-texinfo--sanitize-headline,
org-texinfo--sanitize-headline-contents): Remove.
* ox-texinfo.el (org-texinfo--sanitize-node): "@", "{" and "}"
characters are allowed in a node name. So are "(" and ")" unless
"(" starts the name and there is ")" somewhere in the name. Also
trim and collapse whitespace characters. Renamed from
`org-texinfo--sanitize-menu'.
(org-texinfo--get-node): Do not sanitize node names over zealously.
Ensure returned node names are unique.
(org-texinfo-headline): Only add @node command where it makes sense.
* ox-texinfo.el (org-texinfo--sanitize-menu)
(org-texinfo--sanitize-content): Fix docstrings.
* ox-texinfo.el (org-texinfo--normalize-headlines): Make sure a
blank line always follows nodes.
* ox-texinfo.el (org-texinfo-make-menu): Change signature. Remove
some intermediate functions. Generate the full master menu when
asked.
(org-texinfo--build-menu): Use a simpler algorithm.
(org-texinfo--format-entries): Fix entries when both node and title
are different.
(org-texinfo--menu-entries): Renamed from `org-texinfo--generate-menu-list'.
(org-texinfo-headline): Move menu handling to next function.
(org-texinfo-section): Handle menu for current parent.
(org-texinfo--menu-headlines, org-texinfo--generate-detailed): Remove
functions.
(org-texinfo--normalize-headlines): New function.
* ox-texinfo.el (org-texinfo-headline): Fix @appendix command.
* ox-texinfo.el (org-texinfo-headline): Do not sanitize heading
text for sectioning command.
* ox-texinfo.el (org-texinfo--generate-menu-list): ":COPYING: nil"
is expected to be equivalent to no COPYING property at all.
* ox-texinfo.el (org-texinfo-item): Fix blank lines between items.
* ox-texinfo.el (org-texinfo-plain-list): Fix format string.
Small refactoring.
* ox-texinfo.el (texinfo): Provide new export property.
(org-texinfo-template): Use dedicated title for hard copy, when
available.
* ox-texinfo.el (org-texinfo-headline): Always obey to a non-nil
:APPENDIX: property. Small refactoring.
* ox-texinfo.el (org-texinfo-verse-block): Generate somewhat
meaningful Texinfo code instead of LaTeX.
* ox-texinfo.el (org-texinfo-table): Remove reference to
"verbatim" attribute. Handle table.el tables. Tiny refactoring.
(org-texinfo-table--org-table, org-texinfo-table--table.el-table):
Remove functions.
(org-texinfo-table-column-widths): Indent code correctly. Ignore
special column, if any. Add a comment about the limitation on the
width computation.
(org-texinfo-table-row): Small refactoring.
* ox-texinfo.el (texinfo): Do not provide a default value for
@setfilename value.
(org-texinfo-filename): Remove variable.
(org-texinfo-template): Correctly find value for @setfilename command.
If none is possible, do not provide the command at all.
* ox.el (org-export-to-file): Provide output file name in
communication channel, through :output-file property.
* ox-texinfo.el (org-texinfo-template): Do not hardcode "Manual"
in top node.
* ox-texinfo.el (org-texinfo-classes): Change default value.
Update docstring.
(org-texinfo-template): Insert header string from current class after
"@settitle" command. Always provide "\input texinfo" at the beginning
of the output.
* ox-texinfo.el (org-texinfo-template): Remove spurious blank
lines in output. Refactor code.
* ox-texinfo.el (org-texinfo-template): Fix multi-line subtitles.
* ox-texinfo.el (org-texinfo-template): Make sure table of
contents are allowed before inserting them.
* ox-texinfo.el (org-texinfo-template): Check if copying data is
not nil before using it.
* ox-texinfo.el (org-texinfo-template): Fix multi-line subauthors.
Correctly add email, when provided. Check if author info is
wanted first.
* ox-texinfo.el (org-texinfo-node-description-column)
(org-texinfo-format-drawer-function): Fix docstrings.
* ox-texinfo.el (texinfo): Make sure comments are ignored.
(org-texinfo-comment, org-texinfo-comment-block): Remove functions.
* ox-texinfo.el (org-texinfo-template): Properly pad @direntry
description.
* org-element.el (org-element-headline-parser): Add missing
`:post-blank' property in docstring.
* ox-latex.el (org-latex-table-scientific-notation): Set
appropriate value.
(org-latex-listings-options): Fix docstring.
* ox.el (org-export-raw-special-block-p): New function.
* org-element.el (org-element-link-parser): Properly handle
multi-line links according to RFC 3986 when enclosed within square
brackets.
* org-element.el (org-element-parse-secondary-string): Clone all
local variables from current buffer before parsing a secondary
string. Small refactoring.
(org-element-object-variables): Remove variable.
* ox-odt.el (org-odt--format-paragraph): Change signature to
include info.
(org-odt-footnote-reference, org-odt-paragraph): Apply signature
change.
* org-clock.el (org-clocktable-indent-string): Use "\emsp" instead
of "\__", which is not supported anymore since Org 8.0.
* ox-odt.el (org-odt--paragraph-style): New function.
(org-odt--format-paragraph): Use new function to get proper style
to apply.
* org-element.el (org-element--current-element): Fix regexp.
* org-element.el (org-element--current-element): Fix regexp
matching latex environments. Discrepancy with regexp used in
`org-element-latex-environment-parser' introduced matching errors.
* ox-ascii.el (org-ascii--table-cell-width): Correctly export
tables with width cookies.
* org.el (org-insert-heading): Fix error when inserting a headline
before first headline, with point not at bol. Remove source block
check for consistency with behavior after first headline. Tiny
fix to docstring.
* org.el (org-scan-tags): Fix typo in docstring.
* ox.el (org-export--get-inbuffer-options): Return the empty
string instead of nil when TITLE keywords has no value.
(org-export--get-buffer-attributes): Do not set :title property
early.
(org-export--get-global-options): Do not ignore anymore nil values.
Small refactoring.
(org-export-as): Correctly set :title here.
* org-list.el (org-list-repair): Fix typo in docstring.
* ox-ascii.el (org-ascii--current-text-width): Tiny fix.
* ox-org.el (org-org-section): Tiny refactoring. Use appropriate
property.
* ox-org.el (org-org-headline): Ignore footnote sections.
(org-org-section): New function.
* ox-beamer.el (org-beamer-select-environment): Ignore persistent
tags when displaying environments.
* ox-ascii.el (org-ascii-indented-line-width): Update docstring.
(org-ascii-paragraph): Do not apply indentation to the very first line
of a section.
* ox-latex.el (org-latex-inlinetask): Skip body if contents are
empty.
* ox-html.el (org-html-standalone-image-p): Ensure paragraph
contains at least a link before return a non-nil value. Clarify
docstring.
* ox.el (org-export-data): Always return a string, as specified
by the docstring.
* ox-ascii.el (org-ascii--indent-string): Fix regexp to avoid
stack overflow in regexp matcher on very long lines.
* org-element.el (org-element-timestamp-parser): Fix docstring.
* ox-icalendar.el (org-icalendar-include-sexps,
org-icalendar-blocked-headline-p): Fix docstrings.
(org-icalendar-clear-blank-lines): Fix docstring and regexp.
* ox-icalendar.el (org-icalendar-entry): Use
`org-icalendar-with-timestamps'.
2014-10-02 Nicolas Richard <theonewiththeevillook@yahoo.fr>
* org.el (org-cycle-internal-local): Don't show a trailing
character when cycling a subtree that ends with a non-newline
character at the end of the buffer or the narrowed region.
2014-10-02 Sebastien Vauban <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
* ox-ascii.el (org-ascii--box-string): Choose more universal
Unicode characters for boxquote corners.
2014-10-02 marcowahlsoft@gmail.com <marcowahlsoft@gmail.com> (tiny change)
* org-agenda.el (org-agenda-bulk-mark)
(org-agenda-bulk-mark-regexp, org-agenda-bulk-toggle-all): Fix
org-agenda-bulk-mark-all when time-grid is shown.
2014-05-12 Eric Schulte <eric.schulte@gmx.com> 2014-05-12 Eric Schulte <eric.schulte@gmx.com>
* ob-screen.el (org-babel-screen-session-write-temp-file) * ob-screen.el (org-babel-screen-session-write-temp-file)

View file

@ -30,6 +30,8 @@
;; - not much in the way of error feedback ;; - not much in the way of error feedback
;;; Code: ;;; Code:
(eval-when-compile
(require 'cl))
(require 'ob) (require 'ob)
(require 'cc-mode) (require 'cc-mode)

View file

@ -173,12 +173,11 @@ This function is called by `org-babel-execute-src-block'."
(defun org-babel-R-assign-elisp (name value colnames-p rownames-p) (defun org-babel-R-assign-elisp (name value colnames-p rownames-p)
"Construct R code assigning the elisp VALUE to a variable named NAME." "Construct R code assigning the elisp VALUE to a variable named NAME."
(if (listp value) (if (listp value)
(let ((max (apply #'max (mapcar #'length (org-remove-if-not (let* ((lengths (mapcar 'length (org-remove-if-not 'sequencep value)))
#'sequencep value)))) (max (if lengths (apply 'max lengths) 0))
(min (apply #'min (mapcar #'length (org-remove-if-not (min (if lengths (apply 'min lengths) 0))
#'sequencep value)))) (transition-file (org-babel-temp-file "R-import-")))
(transition-file (org-babel-temp-file "R-import-"))) ;; Ensure VALUE has an orgtbl structure (depth of at least 2).
;; ensure VALUE has an orgtbl structure (depth of at least 2)
(unless (listp (car value)) (setq value (list value))) (unless (listp (car value)) (setq value (list value)))
(with-temp-file transition-file (with-temp-file transition-file
(insert (insert

View file

@ -38,6 +38,7 @@
(defvar org-src-lang-modes) (defvar org-src-lang-modes)
(defvar org-babel-library-of-babel) (defvar org-babel-library-of-babel)
(declare-function show-all "outline" ()) (declare-function show-all "outline" ())
(declare-function org-every "org" (pred seq))
(declare-function org-reduce "org" (CL-FUNC CL-SEQ &rest CL-KEYS)) (declare-function org-reduce "org" (CL-FUNC CL-SEQ &rest CL-KEYS))
(declare-function org-mark-ring-push "org" (&optional pos buffer)) (declare-function org-mark-ring-push "org" (&optional pos buffer))
(declare-function tramp-compat-make-temp-file "tramp-compat" (declare-function tramp-compat-make-temp-file "tramp-compat"
@ -1348,7 +1349,7 @@ specified in the properties of the current outline entry."
(org-entry-get org-babel-current-src-block-location (org-entry-get org-babel-current-src-block-location
(concat "header-args:" lang) 'inherit)))))) (concat "header-args:" lang) 'inherit))))))
(defvar org-src-preserve-indentation) (defvar org-src-preserve-indentation) ;; declare defcustom from org-src
(defun org-babel-parse-src-block-match () (defun org-babel-parse-src-block-match ()
"Parse the results from a match of the `org-babel-src-block-regexp'." "Parse the results from a match of the `org-babel-src-block-regexp'."
(let* ((block-indentation (length (match-string 1))) (let* ((block-indentation (length (match-string 1)))
@ -2100,9 +2101,9 @@ code ---- the results are extracted in the syntax of the source
((funcall proper-list-p result) ((funcall proper-list-p result)
(goto-char beg) (goto-char beg)
(insert (concat (orgtbl-to-orgtbl (insert (concat (orgtbl-to-orgtbl
(if (or (eq 'hline (car result)) (if (org-every
(and (listp (car result)) (lambda (el) (or (listp el) (eq el 'hline)))
(listp (cdr (car result))))) result)
result (list result)) result (list result))
'(:fmt (lambda (cell) (format "%s" cell)))) "\n")) '(:fmt (lambda (cell) (format "%s" cell)))) "\n"))
(goto-char beg) (when (org-at-table-p) (org-table-align))) (goto-char beg) (when (org-at-table-p) (org-table-align)))

View file

@ -24,6 +24,7 @@
;;; Code: ;;; Code:
(require 'ob-core) (require 'ob-core)
(require 'org-src)
(eval-when-compile (eval-when-compile
(require 'cl)) (require 'cl))

View file

@ -147,7 +147,6 @@ specifying a variable of the same value."
(concat "[" (mapconcat #'org-babel-haskell-var-to-haskell var ", ") "]") (concat "[" (mapconcat #'org-babel-haskell-var-to-haskell var ", ") "]")
(format "%S" var))) (format "%S" var)))
(defvar org-src-preserve-indentation)
(defvar org-export-copy-to-kill-ring) (defvar org-export-copy-to-kill-ring)
(declare-function org-export-to-file "ox" (declare-function org-export-to-file "ox"
(backend file (backend file

View file

@ -39,62 +39,62 @@
(defvar org-babel-default-header-args:lilypond '() (defvar org-babel-default-header-args:lilypond '()
"Default header arguments for lilypond code blocks. "Default header arguments for lilypond code blocks.
NOTE: The arguments are determined at lilypond compile time. NOTE: The arguments are determined at lilypond compile time.
See (ly-set-header-args)") See (org-babel-lilypond-set-header-args)")
(defvar ly-compile-post-tangle t (defvar org-babel-lilypond-compile-post-tangle t
"Following the org-babel-tangle (C-c C-v t) command, "Following the org-babel-tangle (C-c C-v t) command,
ly-compile-post-tangle determines whether ob-lilypond should org-babel-lilypond-compile-post-tangle determines whether ob-lilypond should
automatically attempt to compile the resultant tangled file. automatically attempt to compile the resultant tangled file.
If the value is nil, no automated compilation takes place. If the value is nil, no automated compilation takes place.
Default value is t") Default value is t")
(defvar ly-display-pdf-post-tangle t (defvar org-babel-lilypond-display-pdf-post-tangle t
"Following a successful LilyPond compilation "Following a successful LilyPond compilation
ly-display-pdf-post-tangle determines whether to automate the org-babel-lilypond-display-pdf-post-tangle determines whether to automate the
drawing / redrawing of the resultant pdf. If the value is nil, drawing / redrawing of the resultant pdf. If the value is nil,
the pdf is not automatically redrawn. Default value is t") the pdf is not automatically redrawn. Default value is t")
(defvar ly-play-midi-post-tangle t (defvar org-babel-lilypond-play-midi-post-tangle t
"Following a successful LilyPond compilation "Following a successful LilyPond compilation
ly-play-midi-post-tangle determines whether to automate the org-babel-lilypond-play-midi-post-tangle determines whether to automate the
playing of the resultant midi file. If the value is nil, playing of the resultant midi file. If the value is nil,
the midi file is not automatically played. Default value is t") the midi file is not automatically played. Default value is t")
(defvar ly-OSX-ly-path (defvar org-babel-lilypond-OSX-ly-path
"/Applications/lilypond.app/Contents/Resources/bin/lilypond") "/Applications/lilypond.app/Contents/Resources/bin/lilypond")
(defvar ly-OSX-pdf-path "open") (defvar org-babel-lilypond-OSX-pdf-path "open")
(defvar ly-OSX-midi-path "open") (defvar org-babel-lilypond-OSX-midi-path "open")
(defvar ly-nix-ly-path "/usr/bin/lilypond") (defvar org-babel-lilypond-nix-ly-path "/usr/bin/lilypond")
(defvar ly-nix-pdf-path "evince") (defvar org-babel-lilypond-nix-pdf-path "evince")
(defvar ly-nix-midi-path "timidity") (defvar org-babel-lilypond-nix-midi-path "timidity")
(defvar ly-w32-ly-path "lilypond") (defvar org-babel-lilypond-w32-ly-path "lilypond")
(defvar ly-w32-pdf-path "") (defvar org-babel-lilypond-w32-pdf-path "")
(defvar ly-w32-midi-path "") (defvar org-babel-lilypond-w32-midi-path "")
(defvar ly-gen-png nil (defvar org-babel-lilypond-gen-png nil
"Image generation (png) can be turned on by default by setting "Image generation (png) can be turned on by default by setting
LY-GEN-PNG to t") ORG-BABEL-LILYPOND-GEN-PNG to t")
(defvar ly-gen-svg nil (defvar org-babel-lilypond-gen-svg nil
"Image generation (SVG) can be turned on by default by setting "Image generation (SVG) can be turned on by default by setting
LY-GEN-SVG to t") ORG-BABEL-LILYPOND-GEN-SVG to t")
(defvar ly-gen-html nil (defvar org-babel-lilypond-gen-html nil
"HTML generation can be turned on by default by setting "HTML generation can be turned on by default by setting
LY-GEN-HTML to t") ORG-BABEL-LILYPOND-GEN-HTML to t")
(defvar ly-gen-pdf nil (defvar org-babel-lilypond-gen-pdf nil
"PDF generation can be turned on by default by setting "PDF generation can be turned on by default by setting
LY-GEN-PDF to t") ORG-BABEL-LILYPOND-GEN-PDF to t")
(defvar ly-use-eps nil (defvar org-babel-lilypond-use-eps nil
"You can force the compiler to use the EPS backend by setting "You can force the compiler to use the EPS backend by setting
LY-USE-EPS to t") ORG-BABEL-LILYPOND-USE-EPS to t")
(defvar ly-arrange-mode nil (defvar org-babel-lilypond-arrange-mode nil
"Arrange mode is turned on by setting LY-ARRANGE-MODE "Arrange mode is turned on by setting ORG-BABEL-LILYPOND-ARRANGE-MODE
to t. In Arrange mode the following settings are altered to t. In Arrange mode the following settings are altered
from default... from default...
:tangle yes, :noweb yes :tangle yes, :noweb yes
@ -123,20 +123,20 @@ Depending on whether we are in arrange mode either:
1. Attempt to execute lilypond block according to header settings 1. Attempt to execute lilypond block according to header settings
(This is the default basic mode) (This is the default basic mode)
2. Tangle all lilypond blocks and process the result (arrange mode)" 2. Tangle all lilypond blocks and process the result (arrange mode)"
(ly-set-header-args ly-arrange-mode) (org-babel-lilypond-set-header-args org-babel-lilypond-arrange-mode)
(if ly-arrange-mode (if org-babel-lilypond-arrange-mode
(ly-tangle) (org-babel-lilypond-tangle)
(ly-process-basic body params))) (org-babel-lilypond-process-basic body params)))
(defun ly-tangle () (defun org-babel-lilypond-tangle ()
"ob-lilypond specific tangle, attempts to invoke "ob-lilypond specific tangle, attempts to invoke
=ly-execute-tangled-ly= if tangle is successful. Also passes =ly-execute-tangled-ly= if tangle is successful. Also passes
specific arguments to =org-babel-tangle=" specific arguments to =org-babel-tangle="
(interactive) (interactive)
(if (org-babel-tangle nil "yes" "lilypond") (if (org-babel-tangle nil "yes" "lilypond")
(ly-execute-tangled-ly) nil)) (org-babel-lilypond-execute-tangled-ly) nil))
(defun ly-process-basic (body params) (defun org-babel-lilypond-process-basic (body params)
"Execute a lilypond block in basic mode." "Execute a lilypond block in basic mode."
(let* ((result-params (cdr (assoc :result-params params))) (let* ((result-params (cdr (assoc :result-params params)))
(out-file (cdr (assoc :file params))) (out-file (cdr (assoc :file params)))
@ -148,7 +148,7 @@ specific arguments to =org-babel-tangle="
(insert (org-babel-expand-body:generic body params))) (insert (org-babel-expand-body:generic body params)))
(org-babel-eval (org-babel-eval
(concat (concat
(ly-determine-ly-path) (org-babel-lilypond-determine-ly-path)
" -dbackend=eps " " -dbackend=eps "
"-dno-gs-load-fonts " "-dno-gs-load-fonts "
"-dinclude-eps-fonts " "-dinclude-eps-fonts "
@ -167,45 +167,45 @@ specific arguments to =org-babel-tangle="
"Return an error because LilyPond exporter does not support sessions." "Return an error because LilyPond exporter does not support sessions."
(error "Sorry, LilyPond does not currently support sessions!")) (error "Sorry, LilyPond does not currently support sessions!"))
(defun ly-execute-tangled-ly () (defun org-babel-lilypond-execute-tangled-ly ()
"Compile result of block tangle with lilypond. "Compile result of block tangle with lilypond.
If error in compilation, attempt to mark the error in lilypond org file" If error in compilation, attempt to mark the error in lilypond org file"
(when ly-compile-post-tangle (when org-babel-lilypond-compile-post-tangle
(let ((ly-tangled-file (ly-switch-extension (let ((org-babel-lilypond-tangled-file (org-babel-lilypond-switch-extension
(buffer-file-name) ".lilypond")) (buffer-file-name) ".lilypond"))
(ly-temp-file (ly-switch-extension (org-babel-lilypond-temp-file (org-babel-lilypond-switch-extension
(buffer-file-name) ".ly"))) (buffer-file-name) ".ly")))
(if (file-exists-p ly-tangled-file) (if (file-exists-p org-babel-lilypond-tangled-file)
(progn (progn
(when (file-exists-p ly-temp-file) (when (file-exists-p org-babel-lilypond-temp-file)
(delete-file ly-temp-file)) (delete-file org-babel-lilypond-temp-file))
(rename-file ly-tangled-file (rename-file org-babel-lilypond-tangled-file
ly-temp-file)) org-babel-lilypond-temp-file))
(error "Error: Tangle Failed!") t) (error "Error: Tangle Failed!") t)
(switch-to-buffer-other-window "*lilypond*") (switch-to-buffer-other-window "*lilypond*")
(erase-buffer) (erase-buffer)
(ly-compile-lilyfile ly-temp-file) (org-babel-lilypond-compile-lilyfile org-babel-lilypond-temp-file)
(goto-char (point-min)) (goto-char (point-min))
(if (not (ly-check-for-compile-error ly-temp-file)) (if (not (org-babel-lilypond-check-for-compile-error org-babel-lilypond-temp-file))
(progn (progn
(other-window -1) (other-window -1)
(ly-attempt-to-open-pdf ly-temp-file) (org-babel-lilypond-attempt-to-open-pdf org-babel-lilypond-temp-file)
(ly-attempt-to-play-midi ly-temp-file)) (org-babel-lilypond-attempt-to-play-midi org-babel-lilypond-temp-file))
(error "Error in Compilation!")))) nil) (error "Error in Compilation!")))) nil)
(defun ly-compile-lilyfile (file-name &optional test) (defun org-babel-lilypond-compile-lilyfile (file-name &optional test)
"Compile lilypond file and check for compile errors "Compile lilypond file and check for compile errors
FILE-NAME is full path to lilypond (.ly) file" FILE-NAME is full path to lilypond (.ly) file"
(message "Compiling LilyPond...") (message "Compiling LilyPond...")
(let ((arg-1 (ly-determine-ly-path)) ;program (let ((arg-1 (org-babel-lilypond-determine-ly-path)) ;program
(arg-2 nil) ;infile (arg-2 nil) ;infile
(arg-3 "*lilypond*") ;buffer (arg-3 "*lilypond*") ;buffer
(arg-4 t) ;display (arg-4 t) ;display
(arg-5 (if ly-gen-png "--png" "")) ;&rest... (arg-5 (if org-babel-lilypond-gen-png "--png" "")) ;&rest...
(arg-6 (if ly-gen-html "--html" "")) (arg-6 (if org-babel-lilypond-gen-html "--html" ""))
(arg-7 (if ly-gen-pdf "--pdf" "")) (arg-7 (if org-babel-lilypond-gen-pdf "--pdf" ""))
(arg-8 (if ly-use-eps "-dbackend=eps" "")) (arg-8 (if org-babel-lilypond-use-eps "-dbackend=eps" ""))
(arg-9 (if ly-gen-svg "-dbackend=svg" "")) (arg-9 (if org-babel-lilypond-gen-svg "-dbackend=svg" ""))
(arg-10 (concat "--output=" (file-name-sans-extension file-name))) (arg-10 (concat "--output=" (file-name-sans-extension file-name)))
(arg-11 file-name)) (arg-11 file-name))
(if test (if test
@ -215,7 +215,7 @@ FILE-NAME is full path to lilypond (.ly) file"
arg-1 arg-2 arg-3 arg-4 arg-5 arg-6 arg-1 arg-2 arg-3 arg-4 arg-5 arg-6
arg-7 arg-8 arg-9 arg-10 arg-11)))) arg-7 arg-8 arg-9 arg-10 arg-11))))
(defun ly-check-for-compile-error (file-name &optional test) (defun org-babel-lilypond-check-for-compile-error (file-name &optional test)
"Check for compile error. "Check for compile error.
This is performed by parsing the *lilypond* buffer This is performed by parsing the *lilypond* buffer
containing the output message from the compilation. containing the output message from the compilation.
@ -226,24 +226,24 @@ nil as file-name since it is unused in this context"
(if (not test) (if (not test)
(if (not is-error) (if (not is-error)
nil nil
(ly-process-compile-error file-name)) (org-babel-lilypond-process-compile-error file-name))
is-error))) is-error)))
(defun ly-process-compile-error (file-name) (defun org-babel-lilypond-process-compile-error (file-name)
"Process the compilation error that has occurred. "Process the compilation error that has occurred.
FILE-NAME is full path to lilypond file" FILE-NAME is full path to lilypond file"
(let ((line-num (ly-parse-line-num))) (let ((line-num (org-babel-lilypond-parse-line-num)))
(let ((error-lines (ly-parse-error-line file-name line-num))) (let ((error-lines (org-babel-lilypond-parse-error-line file-name line-num)))
(ly-mark-error-line file-name error-lines) (org-babel-lilypond-mark-error-line file-name error-lines)
(error "Error: Compilation Failed!")))) (error "Error: Compilation Failed!"))))
(defun ly-mark-error-line (file-name line) (defun org-babel-lilypond-mark-error-line (file-name line)
"Mark the erroneous lines in the lilypond org buffer. "Mark the erroneous lines in the lilypond org buffer.
FILE-NAME is full path to lilypond file. FILE-NAME is full path to lilypond file.
LINE is the erroneous line" LINE is the erroneous line"
(switch-to-buffer-other-window (switch-to-buffer-other-window
(concat (file-name-nondirectory (concat (file-name-nondirectory
(ly-switch-extension file-name ".org")))) (org-babel-lilypond-switch-extension file-name ".org"))))
(let ((temp (point))) (let ((temp (point)))
(goto-char (point-min)) (goto-char (point-min))
(setq case-fold-search nil) (setq case-fold-search nil)
@ -254,7 +254,7 @@ LINE is the erroneous line"
(goto-char (- (point) (length line)))) (goto-char (- (point) (length line))))
(goto-char temp)))) (goto-char temp))))
(defun ly-parse-line-num (&optional buffer) (defun org-babel-lilypond-parse-line-num (&optional buffer)
"Extract error line number." "Extract error line number."
(when buffer (when buffer
(set-buffer buffer)) (set-buffer buffer))
@ -276,12 +276,12 @@ LINE is the erroneous line"
nil))) nil)))
nil))) nil)))
(defun ly-parse-error-line (file-name lineNo) (defun org-babel-lilypond-parse-error-line (file-name lineNo)
"Extract the erroneous line from the tangled .ly file "Extract the erroneous line from the tangled .ly file
FILE-NAME is full path to lilypond file. FILE-NAME is full path to lilypond file.
LINENO is the number of the erroneous line" LINENO is the number of the erroneous line"
(with-temp-buffer (with-temp-buffer
(insert-file-contents (ly-switch-extension file-name ".ly") (insert-file-contents (org-babel-lilypond-switch-extension file-name ".ly")
nil nil nil t) nil nil nil t)
(if (> lineNo 0) (if (> lineNo 0)
(progn (progn
@ -290,128 +290,128 @@ LINENO is the number of the erroneous line"
(buffer-substring (point) (point-at-eol))) (buffer-substring (point) (point-at-eol)))
nil))) nil)))
(defun ly-attempt-to-open-pdf (file-name &optional test) (defun org-babel-lilypond-attempt-to-open-pdf (file-name &optional test)
"Attempt to display the generated pdf file "Attempt to display the generated pdf file
FILE-NAME is full path to lilypond file FILE-NAME is full path to lilypond file
If TEST is non-nil, the shell command is returned and is not run" If TEST is non-nil, the shell command is returned and is not run"
(when ly-display-pdf-post-tangle (when org-babel-lilypond-display-pdf-post-tangle
(let ((pdf-file (ly-switch-extension file-name ".pdf"))) (let ((pdf-file (org-babel-lilypond-switch-extension file-name ".pdf")))
(if (file-exists-p pdf-file) (if (file-exists-p pdf-file)
(let ((cmd-string (let ((cmd-string
(concat (ly-determine-pdf-path) " " pdf-file))) (concat (org-babel-lilypond-determine-pdf-path) " " pdf-file)))
(if test (if test
cmd-string cmd-string
(start-process (start-process
"\"Audition pdf\"" "\"Audition pdf\""
"*lilypond*" "*lilypond*"
(ly-determine-pdf-path) (org-babel-lilypond-determine-pdf-path)
pdf-file))) pdf-file)))
(message "No pdf file generated so can't display!"))))) (message "No pdf file generated so can't display!")))))
(defun ly-attempt-to-play-midi (file-name &optional test) (defun org-babel-lilypond-attempt-to-play-midi (file-name &optional test)
"Attempt to play the generated MIDI file "Attempt to play the generated MIDI file
FILE-NAME is full path to lilypond file FILE-NAME is full path to lilypond file
If TEST is non-nil, the shell command is returned and is not run" If TEST is non-nil, the shell command is returned and is not run"
(when ly-play-midi-post-tangle (when org-babel-lilypond-play-midi-post-tangle
(let ((midi-file (ly-switch-extension file-name ".midi"))) (let ((midi-file (org-babel-lilypond-switch-extension file-name ".midi")))
(if (file-exists-p midi-file) (if (file-exists-p midi-file)
(let ((cmd-string (let ((cmd-string
(concat (ly-determine-midi-path) " " midi-file))) (concat (org-babel-lilypond-determine-midi-path) " " midi-file)))
(if test (if test
cmd-string cmd-string
(start-process (start-process
"\"Audition midi\"" "\"Audition midi\""
"*lilypond*" "*lilypond*"
(ly-determine-midi-path) (org-babel-lilypond-determine-midi-path)
midi-file))) midi-file)))
(message "No midi file generated so can't play!"))))) (message "No midi file generated so can't play!")))))
(defun ly-determine-ly-path (&optional test) (defun org-babel-lilypond-determine-ly-path (&optional test)
"Return correct path to ly binary depending on OS "Return correct path to ly binary depending on OS
If TEST is non-nil, it contains a simulation of the OS for test purposes" If TEST is non-nil, it contains a simulation of the OS for test purposes"
(let ((sys-type (let ((sys-type
(or test system-type))) (or test system-type)))
(cond ((string= sys-type "darwin") (cond ((string= sys-type "darwin")
ly-OSX-ly-path) org-babel-lilypond-OSX-ly-path)
((string= sys-type "windows-nt") ((string= sys-type "windows-nt")
ly-w32-ly-path) org-babel-lilypond-w32-ly-path)
(t ly-nix-ly-path)))) (t org-babel-lilypond-nix-ly-path))))
(defun ly-determine-pdf-path (&optional test) (defun org-babel-lilypond-determine-pdf-path (&optional test)
"Return correct path to pdf viewer depending on OS "Return correct path to pdf viewer depending on OS
If TEST is non-nil, it contains a simulation of the OS for test purposes" If TEST is non-nil, it contains a simulation of the OS for test purposes"
(let ((sys-type (let ((sys-type
(or test system-type))) (or test system-type)))
(cond ((string= sys-type "darwin") (cond ((string= sys-type "darwin")
ly-OSX-pdf-path) org-babel-lilypond-OSX-pdf-path)
((string= sys-type "windows-nt") ((string= sys-type "windows-nt")
ly-w32-pdf-path) org-babel-lilypond-w32-pdf-path)
(t ly-nix-pdf-path)))) (t org-babel-lilypond-nix-pdf-path))))
(defun ly-determine-midi-path (&optional test) (defun org-babel-lilypond-determine-midi-path (&optional test)
"Return correct path to midi player depending on OS "Return correct path to midi player depending on OS
If TEST is non-nil, it contains a simulation of the OS for test purposes" If TEST is non-nil, it contains a simulation of the OS for test purposes"
(let ((sys-type (let ((sys-type
(or test test system-type))) (or test test system-type)))
(cond ((string= sys-type "darwin") (cond ((string= sys-type "darwin")
ly-OSX-midi-path) org-babel-lilypond-OSX-midi-path)
((string= sys-type "windows-nt") ((string= sys-type "windows-nt")
ly-w32-midi-path) org-babel-lilypond-w32-midi-path)
(t ly-nix-midi-path)))) (t org-babel-lilypond-nix-midi-path))))
(defun ly-toggle-midi-play () (defun org-babel-lilypond-toggle-midi-play ()
"Toggle whether midi will be played following a successful compilation." "Toggle whether midi will be played following a successful compilation."
(interactive) (interactive)
(setq ly-play-midi-post-tangle (setq org-babel-lilypond-play-midi-post-tangle
(not ly-play-midi-post-tangle)) (not org-babel-lilypond-play-midi-post-tangle))
(message (concat "Post-Tangle MIDI play has been " (message (concat "Post-Tangle MIDI play has been "
(if ly-play-midi-post-tangle (if org-babel-lilypond-play-midi-post-tangle
"ENABLED." "DISABLED.")))) "ENABLED." "DISABLED."))))
(defun ly-toggle-pdf-display () (defun org-babel-lilypond-toggle-pdf-display ()
"Toggle whether pdf will be displayed following a successful compilation." "Toggle whether pdf will be displayed following a successful compilation."
(interactive) (interactive)
(setq ly-display-pdf-post-tangle (setq org-babel-lilypond-display-pdf-post-tangle
(not ly-display-pdf-post-tangle)) (not org-babel-lilypond-display-pdf-post-tangle))
(message (concat "Post-Tangle PDF display has been " (message (concat "Post-Tangle PDF display has been "
(if ly-display-pdf-post-tangle (if org-babel-lilypond-display-pdf-post-tangle
"ENABLED." "DISABLED.")))) "ENABLED." "DISABLED."))))
(defun ly-toggle-png-generation () (defun org-babel-lilypond-toggle-png-generation ()
"Toggle whether png image will be generated by compilation." "Toggle whether png image will be generated by compilation."
(interactive) (interactive)
(setq ly-gen-png (not ly-gen-png)) (setq org-babel-lilypond-gen-png (not org-babel-lilypond-gen-png))
(message (concat "PNG image generation has been " (message (concat "PNG image generation has been "
(if ly-gen-png "ENABLED." "DISABLED.")))) (if org-babel-lilypond-gen-png "ENABLED." "DISABLED."))))
(defun ly-toggle-html-generation () (defun org-babel-lilypond-toggle-html-generation ()
"Toggle whether html will be generated by compilation." "Toggle whether html will be generated by compilation."
(interactive) (interactive)
(setq ly-gen-html (not ly-gen-html)) (setq org-babel-lilypond-gen-html (not org-babel-lilypond-gen-html))
(message (concat "HTML generation has been " (message (concat "HTML generation has been "
(if ly-gen-html "ENABLED." "DISABLED.")))) (if org-babel-lilypond-gen-html "ENABLED." "DISABLED."))))
(defun ly-toggle-pdf-generation () (defun org-babel-lilypond-toggle-pdf-generation ()
"Toggle whether pdf will be generated by compilation." "Toggle whether pdf will be generated by compilation."
(interactive) (interactive)
(setq ly-gen-pdf (not ly-gen-pdf)) (setq org-babel-lilypond-gen-pdf (not org-babel-lilypond-gen-pdf))
(message (concat "PDF generation has been " (message (concat "PDF generation has been "
(if ly-gen-pdf "ENABLED." "DISABLED.")))) (if org-babel-lilypond-gen-pdf "ENABLED." "DISABLED."))))
(defun ly-toggle-arrange-mode () (defun org-babel-lilypond-toggle-arrange-mode ()
"Toggle whether in Arrange mode or Basic mode." "Toggle whether in Arrange mode or Basic mode."
(interactive) (interactive)
(setq ly-arrange-mode (setq org-babel-lilypond-arrange-mode
(not ly-arrange-mode)) (not org-babel-lilypond-arrange-mode))
(message (concat "Arrange mode has been " (message (concat "Arrange mode has been "
(if ly-arrange-mode "ENABLED." "DISABLED.")))) (if org-babel-lilypond-arrange-mode "ENABLED." "DISABLED."))))
(defun ly-switch-extension (file-name ext) (defun org-babel-lilypond-switch-extension (file-name ext)
"Utility command to swap current FILE-NAME extension with EXT" "Utility command to swap current FILE-NAME extension with EXT"
(concat (file-name-sans-extension (concat (file-name-sans-extension
file-name) ext)) file-name) ext))
(defun ly-get-header-args (mode) (defun org-babel-lilypond-get-header-args (mode)
"Default arguments to use when evaluating a lilypond "Default arguments to use when evaluating a lilypond
source block. These depend upon whether we are in arrange source block. These depend upon whether we are in arrange
mode i.e. ARRANGE-MODE is t" mode i.e. ARRANGE-MODE is t"
@ -425,11 +425,11 @@ mode i.e. ARRANGE-MODE is t"
'((:results . "file") '((:results . "file")
(:exports . "results"))))) (:exports . "results")))))
(defun ly-set-header-args (mode) (defun org-babel-lilypond-set-header-args (mode)
"Set org-babel-default-header-args:lilypond "Set org-babel-default-header-args:lilypond
dependent on LY-ARRANGE-MODE" dependent on ORG-BABEL-LILYPOND-ARRANGE-MODE"
(setq org-babel-default-header-args:lilypond (setq org-babel-default-header-args:lilypond
(ly-get-header-args mode))) (org-babel-lilypond-get-header-args mode)))
(provide 'ob-lilypond) (provide 'ob-lilypond)

View file

@ -56,8 +56,6 @@ This will typically be either 'python or 'python-mode."
:package-version '(Org . "8.0") :package-version '(Org . "8.0")
:type 'symbol) :type 'symbol)
(defvar org-src-preserve-indentation)
(defcustom org-babel-python-hline-to "None" (defcustom org-babel-python-hline-to "None"
"Replace hlines in incoming tables with this when translating to python." "Replace hlines in incoming tables with this when translating to python."
:group 'org-babel :group 'org-babel

View file

@ -123,7 +123,13 @@ Emacs-lisp table, otherwise return the results as a string."
(when (and session (not (string= session "none"))) (when (and session (not (string= session "none")))
(save-window-excursion (save-window-excursion
(or (org-babel-comint-buffer-livep session) (or (org-babel-comint-buffer-livep session)
(progn (shell session) (get-buffer (current-buffer))))))) (progn
(shell session)
;; Needed for Emacs 23 since the marker is initially
;; undefined and the filter functions try to use it without
;; checking.
(set-marker comint-last-output-start (point))
(get-buffer (current-buffer)))))))
(defvar org-babel-sh-eoe-indicator "echo 'org_babel_sh_eoe'" (defvar org-babel-sh-eoe-indicator "echo 'org_babel_sh_eoe'"
"String to indicate that evaluation has completed.") "String to indicate that evaluation has completed.")

View file

@ -225,13 +225,14 @@ used to limit the exported source code blocks by language."
(concat base-name "." ext) base-name)))) (concat base-name "." ext) base-name))))
(when file-name (when file-name
;; Possibly create the parent directories for file. ;; Possibly create the parent directories for file.
(when (let ((m (funcall get-spec :mkdirp))) (let ((m (funcall get-spec :mkdirp))
(and m (not (string= m "no")))) (fnd (file-name-directory file-name)))
(make-directory (file-name-directory file-name) 'parents)) (and m fnd (not (string= m "no"))
(make-directory fnd 'parents)))
;; delete any old versions of file ;; delete any old versions of file
(when (and (file-exists-p file-name) (and (file-exists-p file-name)
(not (member file-name (mapcar #'car path-collector)))) (not (member file-name (mapcar #'car path-collector)))
(delete-file file-name)) (delete-file file-name))
;; drop source-block to file ;; drop source-block to file
(with-temp-buffer (with-temp-buffer
(when (fboundp lang-f) (ignore-errors (funcall lang-f))) (when (fboundp lang-f) (ignore-errors (funcall lang-f)))

View file

@ -390,32 +390,36 @@ the daily/weekly agenda, see `org-agenda-skip-function'.")
(repeat :inline t :tag "Conditions for skipping" (repeat :inline t :tag "Conditions for skipping"
(choice (choice
:tag "Condition type" :tag "Condition type"
(list :tag "Regexp matches" :inline t (const :format "" regexp) (regexp)) (list :tag "Regexp matches" :inline t
(list :tag "Regexp does not match" :inline t (const :format "" notregexp) (regexp)) (const :format "" 'regexp)
(regexp))
(list :tag "Regexp does not match" :inline t
(const :format "" 'notregexp)
(regexp))
(list :tag "TODO state is" :inline t (list :tag "TODO state is" :inline t
(const todo) (const 'todo)
(choice (choice
(const :tag "any not-done state" todo) (const :tag "Any not-done state" 'todo)
(const :tag "any done state" done) (const :tag "Any done state" 'done)
(const :tag "any state" any) (const :tag "Any state" 'any)
(list :tag "Keyword list" (list :tag "Keyword list"
(const :format "" quote) (const :format "" quote)
(repeat (string :tag "Keyword"))))) (repeat (string :tag "Keyword")))))
(list :tag "TODO state is not" :inline t (list :tag "TODO state is not" :inline t
(const nottodo) (const 'nottodo)
(choice (choice
(const :tag "any not-done state" todo) (const :tag "Any not-done state" 'todo)
(const :tag "any done state" done) (const :tag "Any done state" 'done)
(const :tag "any state" any) (const :tag "Any state" 'any)
(list :tag "Keyword list" (list :tag "Keyword list"
(const :format "" quote) (const :format "" quote)
(repeat (string :tag "Keyword"))))) (repeat (string :tag "Keyword")))))
(const :tag "scheduled" scheduled) (const :tag "scheduled" 'scheduled)
(const :tag "not scheduled" notscheduled) (const :tag "not scheduled" 'notscheduled)
(const :tag "deadline" deadline) (const :tag "deadline" 'deadline)
(const :tag "no deadline" notdeadline) (const :tag "no deadline" 'notdeadline)
(const :tag "timestamp" timestamp) (const :tag "timestamp" 'timestamp)
(const :tag "no timestamp" nottimestamp)))))) (const :tag "no timestamp" 'nottimestamp))))))
(list :tag "Non-standard skipping condition" (list :tag "Non-standard skipping condition"
:value (org-agenda-skip-function) :value (org-agenda-skip-function)
(const org-agenda-skip-function) (const org-agenda-skip-function)
@ -2092,11 +2096,9 @@ When nil, `q' will kill the single agenda buffer."
org-agenda-info org-agenda-info
org-agenda-pre-window-conf org-agenda-pre-window-conf
org-agenda-columns-active org-agenda-columns-active
org-agenda-tag-filter-overlays
org-agenda-tag-filter org-agenda-tag-filter
org-agenda-cat-filter-overlays
org-agenda-category-filter org-agenda-category-filter
org-agenda-re-filter-overlays org-agenda-top-headline-filter
org-agenda-regexp-filter org-agenda-regexp-filter
org-agenda-markers org-agenda-markers
org-agenda-last-search-view-search-was-boolean org-agenda-last-search-view-search-was-boolean
@ -2158,10 +2160,11 @@ The following commands are available:
nil t) nil t)
(unless org-agenda-keep-modes (unless org-agenda-keep-modes
(setq org-agenda-follow-mode org-agenda-start-with-follow-mode (setq org-agenda-follow-mode org-agenda-start-with-follow-mode
org-agenda-entry-text-mode org-agenda-start-with-entry-text-mode org-agenda-entry-text-mode org-agenda-start-with-entry-text-mode))
org-agenda-clockreport-mode org-agenda-start-with-clockreport-mode (setq org-agenda-show-log org-agenda-start-with-log-mode)
org-agenda-show-log org-agenda-start-with-log-mode)) (setq org-agenda-clockreport-mode org-agenda-start-with-clockreport-mode)
(add-to-invisibility-spec '(org-filtered))
(add-to-invisibility-spec '(org-link))
(easy-menu-change (easy-menu-change
'("Agenda") "Agenda Files" '("Agenda") "Agenda Files"
(append (append
@ -2604,7 +2607,7 @@ type."
:package-version '(Org . "8.0") :package-version '(Org . "8.0")
:group 'org-agenda-custom-commands :group 'org-agenda-custom-commands
:type '(choice (symbol :tag "No limit" nil) :type '(choice (symbol :tag "No limit" nil)
(integer :tag "Max number of entries") (integer :tag "Max number of TODOs")
(repeat (repeat
(cons (choice :tag "Agenda type" (cons (choice :tag "Agenda type"
(const agenda) (const agenda)
@ -2612,7 +2615,7 @@ type."
(const tags) (const tags)
(const search) (const search)
(const timeline)) (const timeline))
(integer :tag "Max number of entries"))))) (integer :tag "Max number of TODOs")))))
(defcustom org-agenda-max-tags nil (defcustom org-agenda-max-tags nil
"Maximum number of tagged entries to display in an agenda. "Maximum number of tagged entries to display in an agenda.
@ -2623,7 +2626,7 @@ type."
:package-version '(Org . "8.0") :package-version '(Org . "8.0")
:group 'org-agenda-custom-commands :group 'org-agenda-custom-commands
:type '(choice (symbol :tag "No limit" nil) :type '(choice (symbol :tag "No limit" nil)
(integer :tag "Max number of entries") (integer :tag "Max number of tagged entries")
(repeat (repeat
(cons (choice :tag "Agenda type" (cons (choice :tag "Agenda type"
(const agenda) (const agenda)
@ -2631,7 +2634,7 @@ type."
(const tags) (const tags)
(const search) (const search)
(const timeline)) (const timeline))
(integer :tag "Max number of entries"))))) (integer :tag "Max number of tagged entries")))))
(defcustom org-agenda-max-effort nil (defcustom org-agenda-max-effort nil
"Maximum cumulated effort duration for the agenda. "Maximum cumulated effort duration for the agenda.
@ -2642,7 +2645,7 @@ to limit entries to in this type."
:package-version '(Org . "8.0") :package-version '(Org . "8.0")
:group 'org-agenda-custom-commands :group 'org-agenda-custom-commands
:type '(choice (symbol :tag "No limit" nil) :type '(choice (symbol :tag "No limit" nil)
(integer :tag "Max number of entries") (integer :tag "Max number of minutes")
(repeat (repeat
(cons (choice :tag "Agenda type" (cons (choice :tag "Agenda type"
(const agenda) (const agenda)
@ -2650,7 +2653,7 @@ to limit entries to in this type."
(const tags) (const tags)
(const search) (const search)
(const timeline)) (const timeline))
(integer :tag "Max number of entries"))))) (integer :tag "Max number of minutes")))))
(defvar org-keys nil) (defvar org-keys nil)
(defvar org-match nil) (defvar org-match nil)
@ -3324,19 +3327,12 @@ If AGENDA-BUFFER-NAME, use this as the buffer name for the agenda to write."
(org-let (if nosettings nil org-agenda-exporter-settings) (org-let (if nosettings nil org-agenda-exporter-settings)
'(save-excursion '(save-excursion
(save-window-excursion (save-window-excursion
(org-agenda-mark-filtered-text)
(let ((bs (copy-sequence (buffer-string))) beg content) (let ((bs (copy-sequence (buffer-string))) beg content)
(org-agenda-unmark-filtered-text)
(with-temp-buffer (with-temp-buffer
(rename-buffer org-agenda-write-buffer-name t) (rename-buffer org-agenda-write-buffer-name t)
(set-buffer-modified-p nil) (set-buffer-modified-p nil)
(insert bs) (insert bs)
(org-agenda-remove-marked-text 'org-filtered) (org-agenda-remove-marked-text 'org-filtered)
(while (setq beg (text-property-any (point-min) (point-max)
'org-filtered t))
(delete-region
beg (or (next-single-property-change beg 'org-filtered)
(point-max))))
(run-hooks 'org-agenda-before-write-hook) (run-hooks 'org-agenda-before-write-hook)
(cond (cond
((org-bound-and-true-p org-mobile-creating-agendas) ((org-bound-and-true-p org-mobile-creating-agendas)
@ -3356,7 +3352,7 @@ If AGENDA-BUFFER-NAME, use this as the buffer name for the agenda to write."
content))) content)))
(find-file file) (find-file file)
(erase-buffer) (erase-buffer)
(mapcar (lambda (s) (org-paste-subtree 1 s)) (reverse content)) (dolist (s content) (org-paste-subtree 1 s))
(write-file file) (write-file file)
(kill-buffer (current-buffer)) (kill-buffer (current-buffer))
(message "Org file written to %s" file))) (message "Org file written to %s" file)))
@ -3402,28 +3398,6 @@ If AGENDA-BUFFER-NAME, use this as the buffer name for the agenda to write."
org-agenda-buffer-name))) org-agenda-buffer-name)))
(when open (org-open-file file))) (when open (org-open-file file)))
(defvar org-agenda-tag-filter-overlays nil)
(defvar org-agenda-cat-filter-overlays nil)
(defvar org-agenda-re-filter-overlays nil)
(defun org-agenda-mark-filtered-text ()
"Mark all text hidden by filtering with a text property."
(let ((inhibit-read-only t))
(mapc
(lambda (o)
(when (equal (overlay-buffer o) (current-buffer))
(put-text-property
(overlay-start o) (overlay-end o)
'org-filtered t)))
(append org-agenda-tag-filter-overlays
org-agenda-cat-filter-overlays
org-agenda-re-filter-overlays))))
(defun org-agenda-unmark-filtered-text ()
"Remove the filtering text property."
(let ((inhibit-read-only t))
(remove-text-properties (point-min) (point-max) '(org-filtered t))))
(defun org-agenda-remove-marked-text (property &optional value) (defun org-agenda-remove-marked-text (property &optional value)
"Delete all text marked with VALUE of PROPERTY. "Delete all text marked with VALUE of PROPERTY.
VALUE defaults to t." VALUE defaults to t."
@ -3432,7 +3406,7 @@ VALUE defaults to t."
(while (setq beg (text-property-any (point-min) (point-max) (while (setq beg (text-property-any (point-min) (point-max)
property value)) property value))
(delete-region (delete-region
beg (or (next-single-property-change beg 'org-filtered) beg (or (next-single-property-change beg property)
(point-max)))))) (point-max))))))
(defun org-agenda-add-entry-text () (defun org-agenda-add-entry-text ()
@ -3557,7 +3531,6 @@ removed from the entry content. Currently only `planning' is allowed here."
(defvar org-agenda-category-filter nil) (defvar org-agenda-category-filter nil)
(defvar org-agenda-regexp-filter nil) (defvar org-agenda-regexp-filter nil)
(defvar org-agenda-top-headline-filter nil) (defvar org-agenda-top-headline-filter nil)
(defvar org-agenda-tag-filter-while-redo nil)
(defvar org-agenda-tag-filter-preset nil (defvar org-agenda-tag-filter-preset nil
"A preset of the tags filter used for secondary agenda filtering. "A preset of the tags filter used for secondary agenda filtering.
This must be a list of strings, each string must be a single tag preceded This must be a list of strings, each string must be a single tag preceded
@ -3609,10 +3582,12 @@ generating a new one."
;; does not have org variables local ;; does not have org variables local
org-agenda-this-buffer-is-sticky)))) org-agenda-this-buffer-is-sticky))))
(defun org-agenda-prepare-window (abuf) (defun org-agenda-prepare-window (abuf filter-alist)
"Setup agenda buffer in the window." "Setup agenda buffer in the window.
(let* ((awin (get-buffer-window abuf)) ABUF is the buffer for the agenda window.
wconf) FILTER-ALIST is an alist of filters we need to apply when
`org-agenda-persistent-filter' is non-nil."
(let* ((awin (get-buffer-window abuf)) wconf)
(cond (cond
((equal (current-buffer) abuf) nil) ((equal (current-buffer) abuf) nil)
(awin (select-window awin)) (awin (select-window awin))
@ -3626,68 +3601,76 @@ generating a new one."
((equal org-agenda-window-setup 'reorganize-frame) ((equal org-agenda-window-setup 'reorganize-frame)
(delete-other-windows) (delete-other-windows)
(org-switch-to-buffer-other-window abuf))) (org-switch-to-buffer-other-window abuf)))
;; additional test in case agenda is invoked from within agenda (setq org-agenda-tag-filter (cdr (assoc 'tag filter-alist)))
;; buffer via elisp link (setq org-agenda-category-filter (cdr (assoc 'cat filter-alist)))
(setq org-agenda-regexp-filter (cdr (assoc 're filter-alist)))
;; Additional test in case agenda is invoked from within agenda
;; buffer via elisp link.
(unless (equal (current-buffer) abuf) (unless (equal (current-buffer) abuf)
(org-pop-to-buffer-same-window abuf)) (org-pop-to-buffer-same-window abuf))
(setq org-agenda-pre-window-conf (setq org-agenda-pre-window-conf
(or org-agenda-pre-window-conf wconf)))) (or org-agenda-pre-window-conf wconf))))
(defun org-agenda-prepare (&optional name) (defun org-agenda-prepare (&optional name)
(if (org-agenda-use-sticky-p) (let ((filter-alist (if org-agenda-persistent-filter
(progn (list `(tag . ,org-agenda-tag-filter)
;; Popup existing buffer `(re . ,org-agenda-regexp-filter)
(org-agenda-prepare-window (get-buffer org-agenda-buffer-name)) `(car . ,org-agenda-category-filter)))))
(message "Sticky Agenda buffer, use `r' to refresh") (if (org-agenda-use-sticky-p)
(or org-agenda-multi (org-agenda-fit-window-to-buffer))
(throw 'exit "Sticky Agenda buffer, use `r' to refresh"))
(setq org-todo-keywords-for-agenda nil)
(setq org-drawers-for-agenda nil)
(unless org-agenda-persistent-filter
(setq org-agenda-tag-filter nil
org-agenda-category-filter nil
org-agenda-regexp-filter nil))
(put 'org-agenda-tag-filter :preset-filter
org-agenda-tag-filter-preset)
(put 'org-agenda-category-filter :preset-filter
org-agenda-category-filter-preset)
(put 'org-agenda-regexp-filter :preset-filter
org-agenda-regexp-filter-preset)
(if org-agenda-multi
(progn (progn
(setq buffer-read-only nil) (put 'org-agenda-tag-filter :preset-filter nil)
(goto-char (point-max)) (put 'org-agenda-category-filter :preset-filter nil)
(unless (or (bobp) org-agenda-compact-blocks (put 'org-agenda-regexp-filter :preset-filter nil)
(not org-agenda-block-separator)) ;; Popup existing buffer
(insert "\n" (org-agenda-prepare-window (get-buffer org-agenda-buffer-name)
(if (stringp org-agenda-block-separator) filter-alist)
org-agenda-block-separator (message "Sticky Agenda buffer, use `r' to refresh")
(make-string (window-width) org-agenda-block-separator)) (or org-agenda-multi (org-agenda-fit-window-to-buffer))
"\n")) (throw 'exit "Sticky Agenda buffer, use `r' to refresh"))
(narrow-to-region (point) (point-max))) (setq org-todo-keywords-for-agenda nil)
(setq org-done-keywords-for-agenda nil) (setq org-drawers-for-agenda nil)
(put 'org-agenda-tag-filter :preset-filter
org-agenda-tag-filter-preset)
(put 'org-agenda-category-filter :preset-filter
org-agenda-category-filter-preset)
(put 'org-agenda-regexp-filter :preset-filter
org-agenda-regexp-filter-preset)
(if org-agenda-multi
(progn
(setq buffer-read-only nil)
(goto-char (point-max))
(unless (or (bobp) org-agenda-compact-blocks
(not org-agenda-block-separator))
(insert "\n"
(if (stringp org-agenda-block-separator)
org-agenda-block-separator
(make-string (window-width) org-agenda-block-separator))
"\n"))
(narrow-to-region (point) (point-max)))
(setq org-done-keywords-for-agenda nil)
;; Setting any org variables that are in org-agenda-local-vars ;; Setting any org variables that are in org-agenda-local-vars
;; list need to be done after the prepare call ;; list need to be done after the prepare call
(org-agenda-prepare-window (get-buffer-create org-agenda-buffer-name)) (org-agenda-prepare-window
(setq buffer-read-only nil) (get-buffer-create org-agenda-buffer-name) filter-alist)
(org-agenda-reset-markers) (setq buffer-read-only nil)
(let ((inhibit-read-only t)) (erase-buffer)) (org-agenda-reset-markers)
(org-agenda-mode) (let ((inhibit-read-only t)) (erase-buffer))
(setq org-agenda-buffer (current-buffer)) (org-agenda-mode)
(setq org-agenda-contributing-files nil) (setq org-agenda-buffer (current-buffer))
(setq org-agenda-columns-active nil) (setq org-agenda-contributing-files nil)
(org-agenda-prepare-buffers (org-agenda-files nil 'ifmode)) (setq org-agenda-columns-active nil)
(setq org-todo-keywords-for-agenda (org-agenda-prepare-buffers (org-agenda-files nil 'ifmode))
(org-uniquify org-todo-keywords-for-agenda)) (setq org-todo-keywords-for-agenda
(setq org-done-keywords-for-agenda (org-uniquify org-todo-keywords-for-agenda))
(org-uniquify org-done-keywords-for-agenda)) (setq org-done-keywords-for-agenda
(setq org-drawers-for-agenda (org-uniquify org-drawers-for-agenda)) (org-uniquify org-done-keywords-for-agenda))
(setq org-agenda-last-prefix-arg current-prefix-arg) (setq org-drawers-for-agenda (org-uniquify org-drawers-for-agenda))
(setq org-agenda-this-buffer-name org-agenda-buffer-name) (setq org-agenda-last-prefix-arg current-prefix-arg)
(and name (not org-agenda-name) (setq org-agenda-this-buffer-name org-agenda-buffer-name)
(org-set-local 'org-agenda-name name))) (and name (not org-agenda-name)
(setq buffer-read-only nil))) (org-set-local 'org-agenda-name name)))
(setq buffer-read-only nil))))
(defvar org-agenda-overriding-columns-format) ; From org-colview.el (defvar org-agenda-overriding-columns-format) ; From org-colview.el
(defun org-agenda-finalize () (defun org-agenda-finalize ()
@ -3739,13 +3722,15 @@ generating a new one."
(save-excursion (save-excursion
(goto-char (point-min)) (goto-char (point-min))
(while (equal (forward-line) 0) (while (equal (forward-line) 0)
(when (setq mrk (or (get-text-property (point) 'org-hd-marker) (when (setq mrk (get-text-property (point) 'org-hd-marker))
(get-text-property (point) 'org-hd-marker)))
(put-text-property (point-at-bol) (point-at-eol) (put-text-property (point-at-bol) (point-at-eol)
'tags (org-with-point-at mrk 'tags (org-with-point-at mrk
(delete-dups (delete-dups
(mapcar 'downcase (org-get-tags-at)))))))))) (mapcar 'downcase (org-get-tags-at))))))))))
(run-hooks 'org-agenda-finalize-hook) (run-hooks 'org-agenda-finalize-hook)
(when org-agenda-top-headline-filter
(org-agenda-filter-top-headline-apply
org-agenda-top-headline-filter))
(when org-agenda-tag-filter (when org-agenda-tag-filter
(org-agenda-filter-apply org-agenda-tag-filter 'tag)) (org-agenda-filter-apply org-agenda-tag-filter 'tag))
(when (get 'org-agenda-tag-filter :preset-filter) (when (get 'org-agenda-tag-filter :preset-filter)
@ -4326,14 +4311,6 @@ items if they have an hour specification like [h]h:mm."
(setq p (plist-put p :tstart clocktable-start)) (setq p (plist-put p :tstart clocktable-start))
(setq p (plist-put p :tend clocktable-end)) (setq p (plist-put p :tend clocktable-end))
(setq p (plist-put p :scope 'agenda)) (setq p (plist-put p :scope 'agenda))
(when (and (eq org-agenda-clockreport-mode 'with-filter)
(setq filter (or org-agenda-tag-filter-while-redo
(get 'org-agenda-tag-filter :preset-filter))))
(setq p (plist-put p :tags (mapconcat (lambda (x)
(if (string-match "[<>=]" x)
""
x))
filter ""))))
(setq tbl (apply 'org-clock-get-clocktable p)) (setq tbl (apply 'org-clock-get-clocktable p))
(insert tbl))) (insert tbl)))
(goto-char (point-min)) (goto-char (point-min))
@ -5703,7 +5680,7 @@ This function is invoked if `org-agenda-todo-ignore-deadlines',
(setq txt (org-agenda-format-item extra txt level category tags 'time)) (setq txt (org-agenda-format-item extra txt level category tags 'time))
(org-add-props txt props 'org-marker marker (org-add-props txt props 'org-marker marker
'org-category category 'date date 'todo-state todo-state 'org-category category 'date date 'todo-state todo-state
'org-category-position category-pos 'tags tags 'org-category-position category-pos
'level level 'level level
'type "sexp" 'warntime warntime) 'type "sexp" 'warntime warntime)
(push txt ee))))) (push txt ee)))))
@ -6781,8 +6758,10 @@ The optional STRING argument forces conversion into a 5 character wide string
HH:MM." HH:MM."
(save-match-data (save-match-data
(when (when
(or (string-match "\\<\\([012]?[0-9]\\)\\(:\\([0-5][0-9]\\)\\)\\([AaPp][Mm]\\)?\\> *" s) (and
(string-match "\\<\\([012]?[0-9]\\)\\(:\\([0-5][0-9]\\)\\)?\\([AaPp][Mm]\\)\\> *" s)) (or (string-match "\\<\\([012]?[0-9]\\)\\(:\\([0-5][0-9]\\)\\)\\([AaPp][Mm]\\)?\\> *" s)
(string-match "\\<\\([012]?[0-9]\\)\\(:\\([0-5][0-9]\\)\\)?\\([AaPp][Mm]\\)\\> *" s))
(not (eq (get-text-property 1 'face s) 'org-link)))
(let* ((h (string-to-number (match-string 1 s))) (let* ((h (string-to-number (match-string 1 s)))
(m (if (match-end 3) (string-to-number (match-string 3 s)) 0)) (m (if (match-end 3) (string-to-number (match-string 3 s)) 0))
(ampm (if (match-end 4) (downcase (match-string 4 s)))) (ampm (if (match-end 4) (downcase (match-string 4 s))))
@ -7010,7 +6989,7 @@ The optional argument TYPE tells the agenda type."
(cond ((< ta tb) -1) (cond ((< ta tb) -1)
((< tb ta) +1)))) ((< tb ta) +1))))
(defsubst org-cmp-ts (a b &optional type) (defsubst org-cmp-ts (a b type)
"Compare the timestamps values of entries A and B. "Compare the timestamps values of entries A and B.
When TYPE is \"scheduled\", \"deadline\", \"timestamp\" or When TYPE is \"scheduled\", \"deadline\", \"timestamp\" or
\"timestamp_ia\", compare within each of these type. When TYPE \"timestamp_ia\", compare within each of these type. When TYPE
@ -7018,9 +6997,11 @@ is the empty string, compare all timestamps without respect of
their type." their type."
(let* ((def (if org-sort-agenda-notime-is-late most-positive-fixnum -1)) (let* ((def (if org-sort-agenda-notime-is-late most-positive-fixnum -1))
(ta (or (and (string-match type (or (get-text-property 1 'type a) "")) (ta (or (and (string-match type (or (get-text-property 1 'type a) ""))
(get-text-property 1 'ts-date a)) def)) (get-text-property 1 'ts-date a))
def))
(tb (or (and (string-match type (or (get-text-property 1 'type b) "")) (tb (or (and (string-match type (or (get-text-property 1 'type b) ""))
(get-text-property 1 'ts-date b)) def))) (get-text-property 1 'ts-date b))
def)))
(cond ((< ta tb) -1) (cond ((< ta tb) -1)
((< tb ta) +1)))) ((< tb ta) +1))))
@ -7046,7 +7027,7 @@ their type."
(org-cmp-ts a b "deadline"))) (org-cmp-ts a b "deadline")))
(deadline-down (if deadline-up (- deadline-up) nil)) (deadline-down (if deadline-up (- deadline-up) nil))
(tsia-up (and (org-em 'tsia-up 'tsia-down ss) (tsia-up (and (org-em 'tsia-up 'tsia-down ss)
(org-cmp-ts a b "iatimestamp_ia"))) (org-cmp-ts a b "timestamp_ia")))
(tsia-down (if tsia-up (- tsia-up) nil)) (tsia-down (if tsia-up (- tsia-up) nil))
(ts-up (and (org-em 'ts-up 'ts-down ss) (ts-up (and (org-em 'ts-up 'ts-down ss)
(org-cmp-ts a b "timestamp"))) (org-cmp-ts a b "timestamp")))
@ -7283,7 +7264,6 @@ in the agenda."
(cat-preset (get 'org-agenda-category-filter :preset-filter)) (cat-preset (get 'org-agenda-category-filter :preset-filter))
(re-filter org-agenda-regexp-filter) (re-filter org-agenda-regexp-filter)
(re-preset (get 'org-agenda-regexp-filter :preset-filter)) (re-preset (get 'org-agenda-regexp-filter :preset-filter))
(org-agenda-tag-filter-while-redo (or tag-filter tag-preset))
(cols org-agenda-columns-active) (cols org-agenda-columns-active)
(line (org-current-line)) (line (org-current-line))
(window-line (- line (org-current-line (window-start)))) (window-line (- line (org-current-line (window-start))))
@ -7316,9 +7296,12 @@ in the agenda."
(put 'org-agenda-tag-filter :preset-filter tag-preset) (put 'org-agenda-tag-filter :preset-filter tag-preset)
(put 'org-agenda-category-filter :preset-filter cat-preset) (put 'org-agenda-category-filter :preset-filter cat-preset)
(put 'org-agenda-regexp-filter :preset-filter re-preset) (put 'org-agenda-regexp-filter :preset-filter re-preset)
(and (or tag-filter tag-preset) (org-agenda-filter-apply tag-filter 'tag)) (let ((tag (or tag-filter tag-preset))
(and (or cat-filter cat-preset) (org-agenda-filter-apply cat-filter 'category)) (cat (or cat-filter cat-preset))
(and (or re-filter re-preset) (org-agenda-filter-apply re-filter 'regexp)) (re (or re-filter re-preset)))
(when tag (org-agenda-filter-apply tag 'tag))
(when cat (org-agenda-filter-apply cat 'category))
(when re (org-agenda-filter-apply re 'regexp)))
(and top-hl-filter (org-agenda-filter-top-headline-apply top-hl-filter)) (and top-hl-filter (org-agenda-filter-top-headline-apply top-hl-filter))
(and cols (org-called-interactively-p 'any) (org-agenda-columns)) (and cols (org-called-interactively-p 'any) (org-agenda-columns))
(org-goto-line line) (org-goto-line line)
@ -7344,7 +7327,7 @@ The category is that of the current line."
(org-agenda-filter-apply (org-agenda-filter-apply
(setq org-agenda-category-filter (setq org-agenda-category-filter
(list (concat "+" cat))) 'category)) (list (concat "+" cat))) 'category))
((error "No category at point")))))) (t (error "No category at point"))))))
(defun org-find-top-headline (&optional pos) (defun org-find-top-headline (&optional pos)
"Find the topmost parent headline and return it." "Find the topmost parent headline and return it."
@ -7365,10 +7348,10 @@ The top headline is that of the current line."
(progn (progn
(setq org-agenda-filtered-by-top-headline nil (setq org-agenda-filtered-by-top-headline nil
org-agenda-top-headline-filter nil) org-agenda-top-headline-filter nil)
(org-agenda-filter-show-all-cat)) (org-agenda-filter-show-all-top-filter))
(let ((cat (org-find-top-headline (org-get-at-bol 'org-hd-marker)))) (let ((toph (org-find-top-headline (org-get-at-bol 'org-hd-marker))))
(if cat (org-agenda-filter-top-headline-apply cat strip) (if toph (org-agenda-filter-top-headline-apply toph strip)
(error "No top-level category at point"))))) (error "No top-level headline at point")))))
(defvar org-agenda-regexp-filter nil) (defvar org-agenda-regexp-filter nil)
(defun org-agenda-filter-by-regexp (strip) (defun org-agenda-filter-by-regexp (strip)
@ -7397,7 +7380,10 @@ With two prefix arguments, remove the regexp filters."
(when org-agenda-category-filter (when org-agenda-category-filter
(org-agenda-filter-show-all-cat)) (org-agenda-filter-show-all-cat))
(when org-agenda-regexp-filter (when org-agenda-regexp-filter
(org-agenda-filter-show-all-re))) (org-agenda-filter-show-all-re))
(when org-agenda-top-headline-filter
(org-agenda-filter-show-all-top-filter))
(org-agenda-finalize))
(defun org-agenda-filter-by-tag (strip &optional char narrow) (defun org-agenda-filter-by-tag (strip &optional char narrow)
"Keep only those lines in the agenda buffer that have a specific tag. "Keep only those lines in the agenda buffer that have a specific tag.
@ -7500,8 +7486,7 @@ to switch to narrowing."
(org-agenda-filter-apply org-agenda-tag-filter 'tag) (org-agenda-filter-apply org-agenda-tag-filter 'tag)
(setq maybe-refresh t)) (setq maybe-refresh t))
(t (error "Invalid tag selection character %c" char))) (t (error "Invalid tag selection character %c" char)))
(when (and maybe-refresh (when maybe-refresh
(eq org-agenda-clockreport-mode 'with-filter))
(org-agenda-redo)))) (org-agenda-redo))))
(defun org-agenda-get-represented-tags () (defun org-agenda-get-represented-tags ()
@ -7622,13 +7607,12 @@ When NO-OPERATOR is non-nil, do not add the + operator to returned tags."
;; Deactivate `org-agenda-entry-text-mode' when filtering ;; Deactivate `org-agenda-entry-text-mode' when filtering
(if org-agenda-entry-text-mode (org-agenda-entry-text-mode)) (if org-agenda-entry-text-mode (org-agenda-entry-text-mode))
(let (tags cat txt) (let (tags cat txt)
(setq org-agenda-filter-form (setq org-agenda-filter-form (org-agenda-filter-make-matcher filter type))
(org-agenda-filter-make-matcher filter type)) ;; Only set `org-agenda-filtered-by-category' to t when a unique
(if (and (eq type 'category) ;; category is used as the filter:
(not (equal (substring (car filter) 0 1) "-"))) (setq org-agenda-filtered-by-category
;; Only set `org-agenda-filtered-by-category' to t (and (eq type 'category)
;; when a unique category is used as the filter (not (equal (substring (car filter) 0 1) "-"))))
(setq org-agenda-filtered-by-category t))
(org-agenda-set-mode-name) (org-agenda-set-mode-name)
(save-excursion (save-excursion
(goto-char (point-min)) (goto-char (point-min))
@ -7659,7 +7643,7 @@ When NO-OPERATOR is non-nil, do not add the + operator to returned tags."
(tophl (and pos (org-find-top-headline pos)))) (tophl (and pos (org-find-top-headline pos))))
(if (and tophl (funcall (if negative 'identity 'not) (if (and tophl (funcall (if negative 'identity 'not)
(string= hl tophl))) (string= hl tophl)))
(org-agenda-filter-hide-line 'category))) (org-agenda-filter-hide-line 'top-headline)))
(beginning-of-line 2))) (beginning-of-line 2)))
(if (get-char-property (point) 'invisible) (if (get-char-property (point) 'invisible)
(org-agenda-previous-line)) (org-agenda-previous-line))
@ -7669,50 +7653,35 @@ When NO-OPERATOR is non-nil, do not add the + operator to returned tags."
(defun org-agenda-filter-hide-line (type) (defun org-agenda-filter-hide-line (type)
"Hide lines with TYPE in the agenda buffer." "Hide lines with TYPE in the agenda buffer."
(let* ((b (max (point-min) (1- (point-at-bol)))) (let* ((b (max (point-min) (1- (point-at-bol))))
(e (point-at-eol)) (e (point-at-eol)))
(ov (make-overlay b e))) (let ((inhibit-read-only t))
(overlay-put ov 'invisible t) (add-text-properties
(overlay-put ov 'intangible t) b e `(invisible org-filtered org-filter-type ,type)))))
(overlay-put ov 'type type)
(cond ((eq type 'tag) (push ov org-agenda-tag-filter-overlays))
((eq type 'category) (push ov org-agenda-cat-filter-overlays))
((eq type 'regexp) (push ov org-agenda-re-filter-overlays)))))
(defun org-agenda-fix-tags-filter-overlays-at (&optional pos) (defun org-agenda-remove-filter (type)
(setq pos (or pos (point))) (interactive)
"Remove filter of type TYPE from the agenda buffer."
(save-excursion (save-excursion
(dolist (ov (overlays-at pos)) (goto-char (point-min))
(when (and (overlay-get ov 'invisible) (let ((inhibit-read-only t) pos)
(eq (overlay-get ov 'type) 'tag)) (while (setq pos (text-property-any (point) (point-max) 'org-filter-type type))
(goto-char pos) (goto-char pos)
(if (< (overlay-start ov) (point-at-eol)) (remove-text-properties
(move-overlay ov (point-at-eol) (point) (next-single-property-change (point) 'org-filter-type)
(overlay-end ov))))))) `(invisible org-filtered org-filter-type ,type))))
(set (intern (format "org-agenda-%s-filter" (intern-soft type))) nil)
(setq org-agenda-filter-form nil)
(org-agenda-set-mode-name)
(org-agenda-finalize)))
(defun org-agenda-filter-show-all-tag nil (defun org-agenda-filter-show-all-tag nil
"Remove tag filter overlays from the agenda buffer." (org-agenda-remove-filter 'tag))
(mapc 'delete-overlay org-agenda-tag-filter-overlays)
(setq org-agenda-tag-filter-overlays nil
org-agenda-tag-filter nil
org-agenda-filter-form nil)
(org-agenda-set-mode-name))
(defun org-agenda-filter-show-all-re nil (defun org-agenda-filter-show-all-re nil
"Remove regexp filter overlays from the agenda buffer." (org-agenda-remove-filter 'regexp))
(mapc 'delete-overlay org-agenda-re-filter-overlays)
(setq org-agenda-re-filter-overlays nil
org-agenda-regexp-filter nil
org-agenda-filter-form nil)
(org-agenda-set-mode-name))
(defun org-agenda-filter-show-all-cat nil (defun org-agenda-filter-show-all-cat nil
"Remove category filter overlays from the agenda buffer." (org-agenda-remove-filter 'category))
(mapc 'delete-overlay org-agenda-cat-filter-overlays) (defun org-agenda-filter-show-all-top-filter nil
(setq org-agenda-cat-filter-overlays nil (org-agenda-remove-filter 'top-headline))
org-agenda-filtered-by-category nil
org-agenda-category-filter nil
org-agenda-filter-form nil)
(org-agenda-set-mode-name))
(defun org-agenda-manipulate-query-add () (defun org-agenda-manipulate-query-add ()
"Manipulate the query by adding a search term with positive selection. "Manipulate the query by adding a search term with positive selection.
@ -8106,15 +8075,12 @@ so that the date SD will be in that range."
(format " (maximum number of lines is %d)" (format " (maximum number of lines is %d)"
(if (integerp arg) arg org-agenda-entry-text-maxlines)))))) (if (integerp arg) arg org-agenda-entry-text-maxlines))))))
(defun org-agenda-clockreport-mode (&optional with-filter) (defun org-agenda-clockreport-mode ()
"Toggle clocktable mode in an agenda buffer. "Toggle clocktable mode in an agenda buffer."
With prefix arg WITH-FILTER, make the clocktable respect the current (interactive)
agenda filter."
(interactive "P")
(org-agenda-check-type t 'agenda) (org-agenda-check-type t 'agenda)
(if with-filter (setq org-agenda-clockreport-mode (not org-agenda-clockreport-mode))
(setq org-agenda-clockreport-mode 'with-filter) (setq org-agenda-start-with-clockreport-mode org-agenda-clockreport-mode)
(setq org-agenda-clockreport-mode (not org-agenda-clockreport-mode)))
(org-agenda-set-mode-name) (org-agenda-set-mode-name)
(org-agenda-redo) (org-agenda-redo)
(message "Clocktable mode is %s" (message "Clocktable mode is %s"
@ -8135,6 +8101,7 @@ With a double `C-u' prefix arg, show *only* log items, nothing else."
nil 'clockcheck)) nil 'clockcheck))
(special '(closed clock state)) (special '(closed clock state))
(t (not org-agenda-show-log)))) (t (not org-agenda-show-log))))
(setq org-agenda-start-with-log-mode org-agenda-show-log)
(org-agenda-set-mode-name) (org-agenda-set-mode-name)
(org-agenda-redo) (org-agenda-redo)
(message "Log mode is %s" (message "Log mode is %s"
@ -8252,10 +8219,7 @@ When called with a prefix argument, include all archive files as well."
" Archives" " Archives"
(format " :%s:" org-archive-tag)) (format " :%s:" org-archive-tag))
"") "")
(if org-agenda-clockreport-mode (if org-agenda-clockreport-mode " Clock" "")))
(if (eq org-agenda-clockreport-mode 'with-filter)
" Clock{}" " Clock")
"")))
(force-mode-line-update)) (force-mode-line-update))
(define-obsolete-function-alias (define-obsolete-function-alias
@ -8623,7 +8587,8 @@ if it was hidden in the outline."
(interactive "p") (interactive "p")
(let ((win (selected-window))) (let ((win (selected-window)))
(org-agenda-goto t) (org-agenda-goto t)
(org-recenter-heading 1) (org-back-to-heading)
(set-window-start (selected-window) (point-at-bol))
(cond (cond
((= more 0) ((= more 0)
(hide-subtree) (hide-subtree)
@ -8662,11 +8627,6 @@ if it was hidden in the outline."
(message "Remote: SUBTREE AND ALL DRAWERS"))) (message "Remote: SUBTREE AND ALL DRAWERS")))
(select-window win))) (select-window win)))
(defun org-recenter-heading (n)
(save-excursion
(org-back-to-heading)
(recenter n)))
(defvar org-agenda-cycle-counter nil) (defvar org-agenda-cycle-counter nil)
(defun org-agenda-cycle-show (&optional n) (defun org-agenda-cycle-show (&optional n)
"Show the current entry in another window, with default settings. "Show the current entry in another window, with default settings.
@ -9177,8 +9137,6 @@ Called with a universal prefix arg, show the priority instead of setting it."
(when (equal marker (org-get-at-bol 'org-marker)) (when (equal marker (org-get-at-bol 'org-marker))
(remove-text-properties (point-at-bol) (point-at-eol) '(display)) (remove-text-properties (point-at-bol) (point-at-eol) '(display))
(org-move-to-column (- (window-width) (length stamp)) t) (org-move-to-column (- (window-width) (length stamp)) t)
(org-agenda-fix-tags-filter-overlays-at (point))
(if (featurep 'xemacs) (if (featurep 'xemacs)
;; Use `duplicable' property to trigger undo recording ;; Use `duplicable' property to trigger undo recording
(let ((ex (make-extent nil nil)) (let ((ex (make-extent nil nil))
@ -9190,7 +9148,7 @@ Called with a universal prefix arg, show the priority instead of setting it."
(add-text-properties (add-text-properties
(1- (point)) (point-at-eol) (1- (point)) (point-at-eol)
(list 'display (org-add-props stamp nil (list 'display (org-add-props stamp nil
'face 'secondary-selection)))) 'face '(secondary-selection default)))))
(beginning-of-line 1)) (beginning-of-line 1))
(beginning-of-line 0))))) (beginning-of-line 0)))))
@ -9478,9 +9436,9 @@ a timestamp can be added there."
(if org-adapt-indentation (org-indent-to-column 2))) (if org-adapt-indentation (org-indent-to-column 2)))
(defun org-agenda-insert-diary-make-new-entry (text) (defun org-agenda-insert-diary-make-new-entry (text)
"Make new entry as last child of current entry. "Make a new entry with TEXT as the first child of the current subtree.
Add TEXT as headline, and position the cursor in the second line so that Position the point in the line right after the new heading so
a timestamp can be added there." that a timestamp can be added there."
(let ((org-show-following-heading t) (let ((org-show-following-heading t)
(org-show-siblings t) (org-show-siblings t)
(org-show-hierarchy-above t) (org-show-hierarchy-above t)
@ -9669,7 +9627,7 @@ This is a command that has to be installed in `calendar-mode-map'."
(overlay-put ov 'type 'org-marked-entry-overlay)) (overlay-put ov 'type 'org-marked-entry-overlay))
(end-of-line 1) (end-of-line 1)
(or (ignore-errors (or (ignore-errors
(goto-char (next-single-property-change (point) 'txt))) (goto-char (next-single-property-change (point) 'org-hd-marker)))
(beginning-of-line 2)) (beginning-of-line 2))
(while (and (get-char-property (point) 'invisible) (not (eobp))) (while (and (get-char-property (point) 'invisible) (not (eobp)))
(beginning-of-line 2)) (beginning-of-line 2))
@ -9687,7 +9645,7 @@ This is a command that has to be installed in `calendar-mode-map'."
(let ((entries-marked 0) txt-at-point) (let ((entries-marked 0) txt-at-point)
(save-excursion (save-excursion
(goto-char (point-min)) (goto-char (point-min))
(goto-char (next-single-property-change (point) 'txt)) (goto-char (next-single-property-change (point) 'org-hd-marker))
(while (and (re-search-forward regexp nil t) (while (and (re-search-forward regexp nil t)
(setq txt-at-point (get-text-property (point) 'txt))) (setq txt-at-point (get-text-property (point) 'txt)))
(when (string-match regexp txt-at-point) (when (string-match regexp txt-at-point)
@ -9723,7 +9681,7 @@ This is a command that has to be installed in `calendar-mode-map'."
(save-excursion (save-excursion
(goto-char (point-min)) (goto-char (point-min))
(while (ignore-errors (while (ignore-errors
(goto-char (next-single-property-change (point) 'txt))) (goto-char (next-single-property-change (point) 'org-hd-marker)))
(org-agenda-bulk-toggle)))) (org-agenda-bulk-toggle))))
(defun org-agenda-bulk-toggle () (defun org-agenda-bulk-toggle ()

View file

@ -208,7 +208,9 @@ the directory and (if necessary) the corresponding ID will be created."
(save-excursion (save-excursion
(save-restriction (save-restriction
(widen) (widen)
(goto-char org-entry-property-inherited-from) (if (marker-position org-entry-property-inherited-from)
(goto-char org-entry-property-inherited-from)
(org-back-to-heading t))
(let (org-attach-allow-inheritance) (let (org-attach-allow-inheritance)
(org-attach-dir create-if-not-exists-p))))) (org-attach-dir create-if-not-exists-p)))))
(org-attach-check-absolute-path attach-dir) (org-attach-check-absolute-path attach-dir)

View file

@ -400,8 +400,11 @@ This is used by Org to re-create the anniversary hash table."
(defun org-bbdb-complete-link () (defun org-bbdb-complete-link ()
"Read a bbdb link with name completion." "Read a bbdb link with name completion."
(require 'bbdb-com) (require 'bbdb-com)
(concat "bbdb:" (let ((rec (bbdb-completing-read-record "Name: ")))
(bbdb-record-name (car (bbdb-completing-read-record "Name: "))))) (concat "bbdb:"
(bbdb-record-name (if (listp rec)
(car rec)
rec)))))
(defun org-bbdb-anniv-export-ical () (defun org-bbdb-anniv-export-ical ()
"Extract anniversaries from BBDB and convert them to icalendar format." "Extract anniversaries from BBDB and convert them to icalendar format."

View file

@ -203,7 +203,7 @@
(:pages . "One or more page numbers or range of numbers, such as 42-111 or 7,41,73-97 or 43+ (the + in this last example indicates pages following that dont form simple range). BibTEX requires double dashes for page ranges (--).") (:pages . "One or more page numbers or range of numbers, such as 42-111 or 7,41,73-97 or 43+ (the + in this last example indicates pages following that dont form simple range). BibTEX requires double dashes for page ranges (--).")
(:publisher . "The publishers name.") (:publisher . "The publishers name.")
(:school . "The name of the school where a thesis was written.") (:school . "The name of the school where a thesis was written.")
(:series . "The name of a series or set of books. When citing an entire book, the the title field gives its title and an optional series field gives the name of a series or multi-volume set in which the book is published.") (:series . "The name of a series or set of books. When citing an entire book, the title field gives its title and an optional series field gives the name of a series or multi-volume set in which the book is published.")
(:title . "The works title, typed as explained in the LaTeX book.") (:title . "The works title, typed as explained in the LaTeX book.")
(:type . "The type of a technical report for example, 'Research Note'.") (:type . "The type of a technical report for example, 'Research Note'.")
(:volume . "The volume of a journal or multi-volume book.") (:volume . "The volume of a journal or multi-volume book.")

View file

@ -1529,8 +1529,8 @@ The template may still contain \"%?\" for cursor positioning."
(v-x (or (org-get-x-clipboard 'PRIMARY) (v-x (or (org-get-x-clipboard 'PRIMARY)
(org-get-x-clipboard 'CLIPBOARD) (org-get-x-clipboard 'CLIPBOARD)
(org-get-x-clipboard 'SECONDARY))) (org-get-x-clipboard 'SECONDARY)))
(v-t (format-time-string (car org-time-stamp-formats) ct)) (v-t (format-time-string (car org-time-stamp-formats) ct1))
(v-T (format-time-string (cdr org-time-stamp-formats) ct)) (v-T (format-time-string (cdr org-time-stamp-formats) ct1))
(v-u (concat "[" (substring v-t 1 -1) "]")) (v-u (concat "[" (substring v-t 1 -1) "]"))
(v-U (concat "[" (substring v-T 1 -1) "]")) (v-U (concat "[" (substring v-T 1 -1) "]"))
;; `initial' and `annotation' might habe been passed. ;; `initial' and `annotation' might habe been passed.
@ -1587,7 +1587,7 @@ The template may still contain \"%?\" for cursor positioning."
(insert template) (insert template)
(goto-char (point-min)) (goto-char (point-min))
(org-capture-steal-local-variables buffer) (org-capture-steal-local-variables buffer)
(setq buffer-file-name nil) (setq buffer-file-name nil mark-active nil)
;; %[] Insert contents of a file. ;; %[] Insert contents of a file.
(goto-char (point-min)) (goto-char (point-min))
@ -1674,7 +1674,9 @@ The template may still contain \"%?\" for cursor positioning."
(or (equal (char-before) ?:) (insert ":")) (or (equal (char-before) ?:) (insert ":"))
(insert ins) (insert ins)
(or (equal (char-after) ?:) (insert ":")) (or (equal (char-after) ?:) (insert ":"))
(and (org-at-heading-p) (org-set-tags nil 'align))))) (and (org-at-heading-p)
(let ((org-ignore-region t))
(org-set-tags nil 'align))))))
((equal char "C") ((equal char "C")
(cond ((= (length clipboards) 1) (insert (car clipboards))) (cond ((= (length clipboards) 1) (insert (car clipboards)))
((> (length clipboards) 1) ((> (length clipboards) 1)

View file

@ -2556,13 +2556,10 @@ from the dynamic block definition."
total-time)) total-time))
(defun org-clocktable-indent-string (level) (defun org-clocktable-indent-string (level)
(if (= level 1) (if (= level 1) ""
"" (let ((str " "))
(let ((str "\\__")) (dotimes (k (1- level) str)
(while (> level 2) (setq str (concat "\\emsp" str))))))
(setq level (1- level)
str (concat str "___")))
(concat str " "))))
(defun org-clocktable-steps (params) (defun org-clocktable-steps (params)
"Step through the range to make a number of clock tables." "Step through the range to make a number of clock tables."

View file

@ -312,8 +312,7 @@ Works on both Emacs and XEmacs."
(defun org-in-invisibility-spec-p (arg) (defun org-in-invisibility-spec-p (arg)
"Is ARG a member of `buffer-invisibility-spec'?" "Is ARG a member of `buffer-invisibility-spec'?"
(if (consp buffer-invisibility-spec) (if (consp buffer-invisibility-spec)
(member arg buffer-invisibility-spec) (member arg buffer-invisibility-spec)))
nil))
(defmacro org-xemacs-without-invisibility (&rest body) (defmacro org-xemacs-without-invisibility (&rest body)
"Turn off extents with invisibility while executing BODY." "Turn off extents with invisibility while executing BODY."
@ -347,18 +346,8 @@ Works on both Emacs and XEmacs."
"Move to column COLUMN. "Move to column COLUMN.
Pass COLUMN and FORCE to `move-to-column'. Pass COLUMN and FORCE to `move-to-column'.
Pass BUFFER to the XEmacs version of `move-to-column'." Pass BUFFER to the XEmacs version of `move-to-column'."
(let* ((with-bracket-link (let ((buffer-invisibility-spec
(save-excursion (remove '(org-filtered) buffer-invisibility-spec)))
(forward-line 0)
(looking-at (concat "^.*" org-bracket-link-regexp))))
(buffer-invisibility-spec
(cond
((or (not (derived-mode-p 'org-mode))
(and with-bracket-link (org-invisible-p2)))
(remove '(org-link) buffer-invisibility-spec))
(with-bracket-link
(remove t buffer-invisibility-spec))
(t buffer-invisibility-spec))))
(if (featurep 'xemacs) (if (featurep 'xemacs)
(org-xemacs-without-invisibility (org-xemacs-without-invisibility
(move-to-column column force buffer)) (move-to-column column force buffer))

View file

@ -360,11 +360,6 @@ still has an entry since one of its properties (`:title') does.")
(footnote-reference . :inline-definition)) (footnote-reference . :inline-definition))
"Alist between element types and location of secondary value.") "Alist between element types and location of secondary value.")
(defconst org-element-object-variables '(org-link-abbrev-alist-local)
"List of buffer-local variables used when parsing objects.
These variables are copied to the temporary buffer created by
`org-export-secondary-string'.")
;;; Accessors and Setters ;;; Accessors and Setters
@ -732,11 +727,11 @@ CONTENTS is the contents of the footnote-definition."
Return a list whose CAR is `headline' and CDR is a plist Return a list whose CAR is `headline' and CDR is a plist
containing `:raw-value', `:title', `:alt-title', `:begin', containing `:raw-value', `:title', `:alt-title', `:begin',
`:end', `:pre-blank', `:hiddenp', `:contents-begin' and `:end', `:pre-blank', `:hiddenp', `:contents-begin',
`:contents-end', `:level', `:priority', `:tags', `:contents-end', `:level', `:priority', `:tags',
`:todo-keyword',`:todo-type', `:scheduled', `:deadline', `:todo-keyword',`:todo-type', `:scheduled', `:deadline',
`:closed', `:quotedp', `:archivedp', `:commentedp' and `:closed', `:quotedp', `:archivedp', `:commentedp',
`:footnote-section-p' keywords. `:footnote-section-p' and `:post-blank' keywords.
The plist also contains any property set in the property drawer, The plist also contains any property set in the property drawer,
with its name in upper cases and colons added at the with its name in upper cases and colons added at the
@ -875,38 +870,40 @@ CONTENTS is the contents of the element."
(org-element-property :tags headline)) (org-element-property :tags headline))
(org-element-property :tags headline)))) (org-element-property :tags headline))))
(and tag-list (and tag-list
(format ":%s:" (mapconcat 'identity tag-list ":"))))) (format ":%s:" (mapconcat #'identity tag-list ":")))))
(commentedp (org-element-property :commentedp headline)) (commentedp (org-element-property :commentedp headline))
(quotedp (org-element-property :quotedp headline)) (quotedp (org-element-property :quotedp headline))
(pre-blank (or (org-element-property :pre-blank headline) 0)) (pre-blank (or (org-element-property :pre-blank headline) 0))
(heading (concat (make-string (org-reduced-level level) ?*) (heading
(and todo (concat " " todo)) (concat (make-string (if org-odd-levels-only (1- (* level 2)) level)
(and quotedp (concat " " org-quote-string)) ?*)
(and commentedp (concat " " org-comment-string)) (and todo (concat " " todo))
(and priority (and quotedp (concat " " org-quote-string))
(format " [#%s]" (char-to-string priority))) (and commentedp (concat " " org-comment-string))
(cond ((and org-footnote-section (and priority (format " [#%s]" (char-to-string priority)))
(org-element-property " "
:footnote-section-p headline)) (if (and org-footnote-section
(concat " " org-footnote-section)) (org-element-property :footnote-section-p headline))
(title (concat " " title)))))) org-footnote-section
(concat heading title))))
;; Align tags. (concat
(when tags heading
(cond ;; Align tags.
((zerop org-tags-column) (format " %s" tags)) (when tags
((< org-tags-column 0) (cond
(concat ((zerop org-tags-column) (format " %s" tags))
(make-string ((< org-tags-column 0)
(max (- (+ org-tags-column (length heading) (length tags))) 1) (concat
? ) (make-string
tags)) (max (- (+ org-tags-column (length heading) (length tags))) 1)
(t ?\s)
(concat tags))
(make-string (max (- org-tags-column (length heading)) 1) ? ) (t
tags)))) (concat
(make-string (1+ pre-blank) 10) (make-string (max (- org-tags-column (length heading)) 1) ?\s)
contents))) tags))))
(make-string (1+ pre-blank) ?\n)
contents)))
;;;; Inlinetask ;;;; Inlinetask
@ -1315,36 +1312,36 @@ containing `:begin', `:end', `:hiddenp', `:contents-begin',
`:contents-end', `:post-blank' and `:post-affiliated' keywords. `:contents-end', `:post-blank' and `:post-affiliated' keywords.
Assume point is at the beginning of the property drawer." Assume point is at the beginning of the property drawer."
(save-excursion (let ((case-fold-search t))
(let ((case-fold-search t)) (if (not (save-excursion (re-search-forward "^[ \t]*:END:[ \t]*$" limit t)))
(if (not (save-excursion ;; Incomplete drawer: parse it as a paragraph.
(re-search-forward "^[ \t]*:END:[ \t]*$" limit t))) (org-element-paragraph-parser limit affiliated)
;; Incomplete drawer: parse it as a paragraph. (save-excursion
(org-element-paragraph-parser limit affiliated) (let* ((drawer-end-line (match-beginning 0))
(save-excursion (begin (car affiliated))
(let* ((drawer-end-line (match-beginning 0)) (post-affiliated (point))
(begin (car affiliated)) (contents-begin
(post-affiliated (point)) (progn
(contents-begin (progn (forward-line) (forward-line)
(and (< (point) drawer-end-line) (and (re-search-forward org-property-re drawer-end-line t)
(point)))) (line-beginning-position))))
(contents-end (and contents-begin drawer-end-line)) (contents-end (and contents-begin drawer-end-line))
(hidden (org-invisible-p2)) (hidden (org-invisible-p2))
(pos-before-blank (progn (goto-char drawer-end-line) (pos-before-blank (progn (goto-char drawer-end-line)
(forward-line) (forward-line)
(point))) (point)))
(end (progn (skip-chars-forward " \r\t\n" limit) (end (progn (skip-chars-forward " \r\t\n" limit)
(if (eobp) (point) (line-beginning-position))))) (if (eobp) (point) (line-beginning-position)))))
(list 'property-drawer (list 'property-drawer
(nconc (nconc
(list :begin begin (list :begin begin
:end end :end end
:hiddenp hidden :hiddenp hidden
:contents-begin contents-begin :contents-begin contents-begin
:contents-end contents-end :contents-end contents-end
:post-blank (count-lines pos-before-blank end) :post-blank (count-lines pos-before-blank end)
:post-affiliated post-affiliated) :post-affiliated post-affiliated)
(cdr affiliated))))))))) (cdr affiliated))))))))
(defun org-element-property-drawer-interpreter (property-drawer contents) (defun org-element-property-drawer-interpreter (property-drawer contents)
"Interpret PROPERTY-DRAWER element as Org syntax. "Interpret PROPERTY-DRAWER element as Org syntax.
@ -2099,28 +2096,28 @@ LIMIT bounds the search.
Return a list whose CAR is `node-property' and CDR is a plist Return a list whose CAR is `node-property' and CDR is a plist
containing `:key', `:value', `:begin', `:end' and `:post-blank' containing `:key', `:value', `:begin', `:end' and `:post-blank'
keywords." keywords."
(save-excursion (looking-at org-property-re)
(looking-at org-property-re) (let ((begin (point))
(let ((case-fold-search t) (key (org-match-string-no-properties 2))
(begin (point)) (value (org-match-string-no-properties 3))
(key (org-match-string-no-properties 2)) (end (save-excursion
(value (org-match-string-no-properties 3)) (end-of-line)
(pos-before-blank (progn (forward-line) (point))) (if (re-search-forward org-property-re limit t)
(end (progn (skip-chars-forward " \r\t\n" limit) (line-beginning-position)
(if (eobp) (point) (point-at-bol))))) limit))))
(list 'node-property (list 'node-property
(list :key key (list :key key
:value value :value value
:begin begin :begin begin
:end end :end end
:post-blank (count-lines pos-before-blank end)))))) :post-blank 0))))
(defun org-element-node-property-interpreter (node-property contents) (defun org-element-node-property-interpreter (node-property contents)
"Interpret NODE-PROPERTY element as Org syntax. "Interpret NODE-PROPERTY element as Org syntax.
CONTENTS is nil." CONTENTS is nil."
(format org-property-format (format org-property-format
(format ":%s:" (org-element-property :key node-property)) (format ":%s:" (org-element-property :key node-property))
(org-element-property :value node-property))) (or (org-element-property :value node-property) "")))
;;;; Paragraph ;;;; Paragraph
@ -2486,7 +2483,7 @@ Assume point is at the beginning of the table."
(defun org-element-table-interpreter (table contents) (defun org-element-table-interpreter (table contents)
"Interpret TABLE element as Org syntax. "Interpret TABLE element as Org syntax.
CONTENTS is nil." CONTENTS is a string, if table's type is `org', or nil."
(if (eq (org-element-property :type table) 'table.el) (if (eq (org-element-property :type table) 'table.el)
(org-remove-indentation (org-element-property :value table)) (org-remove-indentation (org-element-property :value table))
(concat (with-temp-buffer (insert contents) (concat (with-temp-buffer (insert contents)
@ -3112,16 +3109,20 @@ Assume point is at the beginning of the link."
(cond (cond
;; File type. ;; File type.
((or (file-name-absolute-p raw-link) ((or (file-name-absolute-p raw-link)
(string-match "^\\.\\.?/" raw-link)) (string-match "\\`\\.\\.?/" raw-link))
(setq type "file" path raw-link)) (setq type "file" path raw-link))
;; Explicit type (http, irc, bbdb...). See `org-link-types'. ;; Explicit type (http, irc, bbdb...). See `org-link-types'.
((string-match org-link-re-with-space3 raw-link) ((string-match org-link-types-re raw-link)
(setq type (match-string 1 raw-link) path (match-string 2 raw-link))) (setq type (match-string 1 raw-link)
;; According to RFC 3986, extra whitespace should be
;; ignored when a URI is extracted.
path (replace-regexp-in-string
"[ \t]*\n[ \t]*" "" (substring raw-link (match-end 0)))))
;; Id type: PATH is the id. ;; Id type: PATH is the id.
((string-match "^id:\\([-a-f0-9]+\\)" raw-link) ((string-match "\\`id:\\([-a-f0-9]+\\)" raw-link)
(setq type "id" path (match-string 1 raw-link))) (setq type "id" path (match-string 1 raw-link)))
;; Code-ref type: PATH is the name of the reference. ;; Code-ref type: PATH is the name of the reference.
((string-match "^(\\(.*\\))$" raw-link) ((string-match "\\`(\\(.*\\))\\'" raw-link)
(setq type "coderef" path (match-string 1 raw-link))) (setq type "coderef" path (match-string 1 raw-link)))
;; Custom-id type: PATH is the name of the custom id. ;; Custom-id type: PATH is the name of the custom id.
((= (aref raw-link 0) ?#) ((= (aref raw-link 0) ?#)
@ -3541,7 +3542,7 @@ Return a list whose CAR is `timestamp', and CDR a plist with
`:month-end', `:day-end', `:hour-end', `:minute-end', `:month-end', `:day-end', `:hour-end', `:minute-end',
`:repeater-type', `:repeater-value', `:repeater-unit', `:repeater-type', `:repeater-value', `:repeater-unit',
`:warning-type', `:warning-value', `:warning-unit', `:begin', `:warning-type', `:warning-value', `:warning-unit', `:begin',
`:end', `:value' and `:post-blank' keywords. `:end' and `:post-blank' keywords.
Assume point is at the beginning of the timestamp." Assume point is at the beginning of the timestamp."
(save-excursion (save-excursion
@ -3890,8 +3891,7 @@ element it has to parse."
(goto-char (car affiliated)) (goto-char (car affiliated))
(org-element-keyword-parser limit nil)) (org-element-keyword-parser limit nil))
;; LaTeX Environment. ;; LaTeX Environment.
((looking-at ((looking-at "[ \t]*\\\\begin{\\([A-Za-z0-9]+\\*?\\)}\\(\\[.*?\\]\\|{.*?}\\)*[ \t]*$")
"[ \t]*\\\\begin{[A-Za-z0-9*]+}\\(\\[.*?\\]\\|{.*?}\\)*[ \t]*$")
(org-element-latex-environment-parser limit affiliated)) (org-element-latex-environment-parser limit affiliated))
;; Drawer and Property Drawer. ;; Drawer and Property Drawer.
((looking-at org-drawer-regexp) ((looking-at org-drawer-regexp)
@ -4090,21 +4090,18 @@ looked after.
Optional argument PARENT, when non-nil, is the element or object Optional argument PARENT, when non-nil, is the element or object
containing the secondary string. It is used to set correctly containing the secondary string. It is used to set correctly
`:parent' property within the string." `:parent' property within the string."
;; Copy buffer-local variables listed in (let ((local-variables (buffer-local-variables)))
;; `org-element-object-variables' into temporary buffer. This is
;; required since object parsing is dependent on these variables.
(let ((pairs (delq nil (mapcar (lambda (var)
(when (boundp var)
(cons var (symbol-value var))))
org-element-object-variables))))
(with-temp-buffer (with-temp-buffer
(mapc (lambda (pair) (org-set-local (car pair) (cdr pair))) pairs) (dolist (v local-variables)
(ignore-errors
(if (symbolp v) (makunbound v)
(org-set-local (car v) (cdr v)))))
(insert string) (insert string)
(restore-buffer-modified-p nil)
(let ((secondary (org-element--parse-objects (let ((secondary (org-element--parse-objects
(point-min) (point-max) nil restriction))) (point-min) (point-max) nil restriction)))
(when parent (when parent
(mapc (lambda (obj) (org-element-put-property obj :parent parent)) (dolist (o secondary) (org-element-put-property o :parent parent)))
secondary))
secondary)))) secondary))))
(defun org-element-map (defun org-element-map
@ -4617,29 +4614,29 @@ indentation is not done with TAB characters."
(let* ((min-ind most-positive-fixnum) (let* ((min-ind most-positive-fixnum)
find-min-ind ; For byte-compiler. find-min-ind ; For byte-compiler.
(find-min-ind (find-min-ind
(function ;; Return minimal common indentation within BLOB. This is
;; Return minimal common indentation within BLOB. This is ;; done by walking recursively BLOB and updating MIN-IND
;; done by walking recursively BLOB and updating MIN-IND ;; along the way. FIRST-FLAG is non-nil when the first
;; along the way. FIRST-FLAG is non-nil when the first ;; string hasn't been seen yet. It is required as this
;; string hasn't been seen yet. It is required as this ;; string is the only one whose indentation doesn't happen
;; string is the only one whose indentation doesn't happen ;; after a newline character.
;; after a newline character. (lambda (blob first-flag)
(lambda (blob first-flag) (dolist (object (org-element-contents blob))
(dolist (object (org-element-contents blob)) (when (and first-flag (stringp object))
(when (and first-flag (stringp object)) (setq first-flag nil)
(setq first-flag nil) (string-match "\\` *" object)
(string-match "\\`\\( *\\)" object) (let ((len (match-end 0)))
(let ((len (length (match-string 1 object)))) ;; An indentation of zero means no string will be
;; An indentation of zero means no string will be ;; modified. Quit the process.
;; modified. Quit the process. (if (zerop len) (throw 'zero (setq min-ind 0))
(if (zerop len) (throw 'zero (setq min-ind 0)) (setq min-ind (min len min-ind)))))
(setq min-ind (min len min-ind))))) (cond
(cond ((stringp object)
((stringp object) (dolist (line (cdr (org-split-string object " *\n")))
(dolist (line (delq "" (cdr (org-split-string object " *\n")))) (unless (string= line "")
(setq min-ind (min (org-get-indentation line) min-ind)))) (setq min-ind (min (org-get-indentation line) min-ind)))))
((memq (org-element-type object) org-element-recursive-objects) ((memq (org-element-type object) org-element-recursive-objects)
(funcall find-min-ind object first-flag)))))))) (funcall find-min-ind object first-flag)))))))
;; Find minimal indentation in ELEMENT. ;; Find minimal indentation in ELEMENT.
(catch 'zero (funcall find-min-ind element (not ignore-first))) (catch 'zero (funcall find-min-ind element (not ignore-first)))
(if (or (zerop min-ind) (= min-ind most-positive-fixnum)) element (if (or (zerop min-ind) (= min-ind most-positive-fixnum)) element

View file

@ -27,9 +27,8 @@
;;; Code: ;;; Code:
(require 'org-macs) (declare-function org-toggle-pretty-entities "org" ())
(declare-function org-table-align "org-table" ())
(declare-function org-table-align "org-table" ())
(eval-when-compile (eval-when-compile
(require 'cl)) (require 'cl))
@ -568,6 +567,7 @@ Kind can be any of `latex', `html', `ascii', `latin1', or `utf8'."
(goto-char pos) (goto-char pos)
(org-table-align))) (org-table-align)))
(defvar org-pretty-entities) ;; declare defcustom from org
(defun org-entities-help () (defun org-entities-help ()
"Create a Help buffer with all available entities." "Create a Help buffer with all available entities."
(interactive) (interactive)

View file

@ -351,14 +351,7 @@ current time."
(let ((inhibit-read-only t) l c (let ((inhibit-read-only t) l c
(buffer-invisibility-spec '(org-link)) (buffer-invisibility-spec '(org-link))
(moment (time-subtract (current-time) (moment (time-subtract (current-time)
(list 0 (* 3600 org-extend-today-until) 0))) (list 0 (* 3600 org-extend-today-until) 0))))
disabled-overlays)
;; Disable filters; this helps with alignment if there are links.
(mapc (lambda (ol)
(when (overlay-get ol 'invisible)
(overlay-put ol 'invisible nil)
(setq disabled-overlays (cons ol disabled-overlays))))
(overlays-in (point-min) (point-max)))
(save-excursion (save-excursion
(goto-char (if line (point-at-bol) (point-min))) (goto-char (if line (point-at-bol) (point-min)))
(while (not (eobp)) (while (not (eobp))
@ -374,9 +367,7 @@ current time."
(time-subtract moment (days-to-time org-habit-preceding-days)) (time-subtract moment (days-to-time org-habit-preceding-days))
moment moment
(time-add moment (days-to-time org-habit-following-days)))))) (time-add moment (days-to-time org-habit-following-days))))))
(forward-line))) (forward-line)))))
(mapc (lambda (ol) (overlay-put ol 'invisible t))
disabled-overlays)))
(defun org-habit-toggle-habits () (defun org-habit-toggle-habits ()
"Toggle display of habits in an agenda buffer." "Toggle display of habits in an agenda buffer."

View file

@ -1254,7 +1254,7 @@ some heuristics to guess the result."
If POS is before first character after bullet of the item, the If POS is before first character after bullet of the item, the
new item will be created before the current one. new item will be created before the current one.
STRUCT is the list structure. PREVS is the the alist of previous STRUCT is the list structure. PREVS is the alist of previous
items, as returned by `org-list-prevs-alist'. items, as returned by `org-list-prevs-alist'.
Insert a checkbox if CHECKBOX is non-nil, and string AFTER-BULLET Insert a checkbox if CHECKBOX is non-nil, and string AFTER-BULLET
@ -2237,7 +2237,7 @@ item is invisible."
t))))) t)))))
(defun org-list-repair () (defun org-list-repair ()
"Fix indentation, bullets and checkboxes is the list at point." "Fix indentation, bullets and checkboxes in the list at point."
(interactive) (interactive)
(unless (org-at-item-p) (error "This is not a list")) (unless (org-at-item-p) (error "This is not a list"))
(let* ((struct (org-list-struct)) (let* ((struct (org-list-struct))

View file

@ -154,9 +154,9 @@ We use a macro so that the test can happen at compilation time."
`(let ((,mpom ,pom)) `(let ((,mpom ,pom))
(save-excursion (save-excursion
(if (markerp ,mpom) (set-buffer (marker-buffer ,mpom))) (if (markerp ,mpom) (set-buffer (marker-buffer ,mpom)))
(save-excursion (org-with-wide-buffer
(goto-char (or ,mpom (point))) (goto-char (or ,mpom (point)))
,@body))))) ,@body)))))
(def-edebug-spec org-with-point-at (form body)) (def-edebug-spec org-with-point-at (form body))
(put 'org-with-point-at 'lisp-indent-function 1) (put 'org-with-point-at 'lisp-indent-function 1)

View file

@ -1074,7 +1074,7 @@ be returned that indicates what went wrong."
;; which prevents correct insertion when point is invisible ;; which prevents correct insertion when point is invisible
(org-show-subtree) (org-show-subtree)
(end-of-line 1) (end-of-line 1)
(org-insert-heading-respect-content '(16) t) (org-insert-heading-respect-content t)
(org-demote)) (org-demote))
(beginning-of-line) (beginning-of-line)
(insert "* ")) (insert "* "))

View file

@ -953,20 +953,23 @@ This means, between the beginning of line and the point."
(point) (point)
(save-excursion (goto-char start) (save-excursion (goto-char start)
(org-back-to-heading) (point)))) (org-back-to-heading) (point))))
(outline-end-of-subtree) (progn (org-end-of-subtree nil t)
(unless (eobp) (backward-char)))
(end-of-line) (end-of-line)
(if (eobp) (newline) (forward-char))) (if (eobp) (newline) (forward-char)))
(when (looking-at org-outline-regexp) (when (looking-at org-outline-regexp)
(let ((level (- (match-end 0) (match-beginning 0)))) (let ((level (- (match-end 0) (match-beginning 0))))
(when (> end (match-end 0)) (when (> end (match-end 0))
(outline-end-of-subtree) (progn (org-end-of-subtree nil t)
(unless (eobp) (backward-char)))
(end-of-line) (end-of-line)
(if (eobp) (newline) (forward-char)) (if (eobp) (newline) (forward-char))
(setq level (1+ level))) (setq level (1+ level)))
(org-paste-subtree level) (org-paste-subtree level)
(save-excursion (save-excursion
(outline-end-of-subtree) (progn (org-end-of-subtree nil t)
(unless (eobp) (backward-char)))
(when (bolp) (delete-char -1)))))))))) (when (bolp) (delete-char -1))))))))))
@ -1003,8 +1006,8 @@ This means, between the beginning of line and the point."
(org-mouse-main-buffer (current-buffer))) (org-mouse-main-buffer (current-buffer)))
(when (eq (with-current-buffer buffer major-mode) 'org-mode) (when (eq (with-current-buffer buffer major-mode) 'org-mode)
(let ((endmarker (with-current-buffer buffer (let ((endmarker (with-current-buffer buffer
(outline-end-of-subtree) (org-end-of-subtree nil t)
(forward-char 1) (unless (eobp) (forward-char 1))
(copy-marker (point))))) (copy-marker (point)))))
(org-with-remote-undo buffer (org-with-remote-undo buffer
(with-current-buffer buffer (with-current-buffer buffer

View file

@ -376,23 +376,21 @@ the display of windows containing the Org buffer and the code buffer."
(when (fboundp edit-prep-func) (when (fboundp edit-prep-func)
(funcall edit-prep-func full-info))) (funcall edit-prep-func full-info)))
(or org-edit-src-code-timer (or org-edit-src-code-timer
(zerop org-edit-src-auto-save-idle-delay)
(setq org-edit-src-code-timer (setq org-edit-src-code-timer
(unless (zerop org-edit-src-auto-save-idle-delay) (run-with-idle-timer
(run-with-idle-timer org-edit-src-auto-save-idle-delay t
org-edit-src-auto-save-idle-delay t (lambda ()
(lambda () (cond
(cond ((org-string-match-p "\\`\\*Org Src" (buffer-name))
((and (string-match "\*Org Src" (buffer-name)) (when (buffer-modified-p) (org-edit-src-save)))
(buffer-modified-p)) ((not (org-some (lambda (b)
(org-edit-src-save)) (org-string-match-p "\\`\\*Org Src"
((not (buffer-name b)))
(delq nil (mapcar (buffer-list)))
(lambda (b) (cancel-timer org-edit-src-code-timer)
(string-match "\*Org Src" (buffer-name b))) (setq org-edit-src-code-timer nil))))))))
(buffer-list)))) t)))
(cancel-timer org-edit-src-code-timer)
(setq org-edit-src-code-timer)))))))))
t)))
(defun org-edit-src-continue (e) (defun org-edit-src-continue (e)
"Continue editing source blocks." ;; Fixme: be more accurate "Continue editing source blocks." ;; Fixme: be more accurate
@ -757,8 +755,8 @@ with \",*\", \",#+\", \",,*\" and \",,#+\"."
(delete-region beg (max beg end)) (delete-region beg (max beg end))
(unless (string-match "\\`[ \t]*\\'" code) (unless (string-match "\\`[ \t]*\\'" code)
(insert code)) (insert code))
;; Make sure the overlay stays in place ;; Make sure the overlay stays in place
(when (eq context 'save) (move-overlay ovl beg (point))) (when (eq context 'save) (move-overlay ovl beg (point)))
(goto-char beg) (goto-char beg)
(if single (just-one-space))) (if single (just-one-space)))
(if (memq t (mapcar (lambda (overlay) (if (memq t (mapcar (lambda (overlay)
@ -774,9 +772,6 @@ with \",*\", \",#+\", \",,*\" and \",,#+\"."
(unless (eq context 'save) (unless (eq context 'save)
(move-marker beg nil) (move-marker beg nil)
(move-marker end nil))) (move-marker end nil)))
(when org-edit-src-code-timer
(cancel-timer org-edit-src-code-timer)
(setq org-edit-src-code-timer nil))
(unless (eq context 'save) (unless (eq context 'save)
(when org-edit-src-saved-temp-window-config (when org-edit-src-saved-temp-window-config
(set-window-configuration org-edit-src-saved-temp-window-config) (set-window-configuration org-edit-src-saved-temp-window-config)

View file

@ -2712,7 +2712,8 @@ not overwrite the stored one."
(or (fboundp 'calc-eval) (or (fboundp 'calc-eval)
(user-error "Calc does not seem to be installed, and is needed to evaluate the formula")) (user-error "Calc does not seem to be installed, and is needed to evaluate the formula"))
;; Use <...> time-stamps so that Calc can handle them ;; Use <...> time-stamps so that Calc can handle them
(setq form (replace-regexp-in-string org-ts-regexp3 "<\\1>" form)) (while (string-match (concat "\\[" org-ts-regexp1 "\\]") form)
(setq form (replace-match "<\\1>" nil nil form)))
;; I18n-ize local time-stamps by setting (system-time-locale "C") ;; I18n-ize local time-stamps by setting (system-time-locale "C")
(when (string-match org-ts-regexp2 form) (when (string-match org-ts-regexp2 form)
(let* ((ts (match-string 0 form)) (let* ((ts (match-string 0 form))
@ -3862,9 +3863,10 @@ With prefix ARG, apply the new formulas to the table."
(push org-table-current-begin-pos org-show-positions) (push org-table-current-begin-pos org-show-positions)
(let ((min (apply 'min org-show-positions)) (let ((min (apply 'min org-show-positions))
(max (apply 'max org-show-positions))) (max (apply 'max org-show-positions)))
(goto-char min) (recenter 0) (set-window-start (selected-window) min)
(goto-char max) (goto-char max)
(or (pos-visible-in-window-p max) (recenter -1)))) (or (pos-visible-in-window-p max)
(set-window-start (selected-window) max))))
(select-window win)))) (select-window win))))
(defun org-table-force-dataline () (defun org-table-force-dataline ()

View file

@ -186,7 +186,10 @@ it in the buffer."
(insert (org-timer-value-string)))) (insert (org-timer-value-string))))
(defun org-timer-value-string () (defun org-timer-value-string ()
(format org-timer-format (org-timer-secs-to-hms (floor (org-timer-seconds))))) "Set the timer string."
(format org-timer-format
(org-timer-secs-to-hms
(abs (floor (org-timer-seconds))))))
(defvar org-timer-timer-is-countdown nil) (defvar org-timer-timer-is-countdown nil)
(defun org-timer-seconds () (defun org-timer-seconds ()

View file

@ -5,13 +5,13 @@
(defun org-release () (defun org-release ()
"The release version of org-mode. "The release version of org-mode.
Inserted by installing org-mode or when a release is made." Inserted by installing org-mode or when a release is made."
(let ((org-release "8.2.6")) (let ((org-release "8.2.8"))
org-release)) org-release))
;;;###autoload ;;;###autoload
(defun org-git-version () (defun org-git-version ()
"The Git version of org-mode. "The Git version of org-mode.
Inserted by installing org-mode or when a release is made." Inserted by installing org-mode or when a release is made."
(let ((org-git-version "release_8.2.6-1")) (let ((org-git-version "release_8.2.8"))
org-git-version)) org-git-version))
(provide 'org-version) (provide 'org-version)

View file

@ -111,6 +111,8 @@ Stars are put in group 1 and the trimmed body in group 2.")
(unless (boundp 'diary-fancy-buffer) (unless (boundp 'diary-fancy-buffer)
(org-defvaralias 'diary-fancy-buffer 'fancy-diary-buffer)) (org-defvaralias 'diary-fancy-buffer 'fancy-diary-buffer))
(declare-function org-add-archive-files "org-archive" (files))
(declare-function org-inlinetask-at-task-p "org-inlinetask" ()) (declare-function org-inlinetask-at-task-p "org-inlinetask" ())
(declare-function org-inlinetask-outline-regexp "org-inlinetask" ()) (declare-function org-inlinetask-outline-regexp "org-inlinetask" ())
(declare-function org-inlinetask-toggle-visibility "org-inlinetask" ()) (declare-function org-inlinetask-toggle-visibility "org-inlinetask" ())
@ -118,7 +120,10 @@ Stars are put in group 1 and the trimmed body in group 2.")
(declare-function org-clock-get-last-clock-out-time "org-clock" ()) (declare-function org-clock-get-last-clock-out-time "org-clock" ())
(declare-function org-clock-timestamps-up "org-clock" (&optional n)) (declare-function org-clock-timestamps-up "org-clock" (&optional n))
(declare-function org-clock-timestamps-down "org-clock" (&optional n)) (declare-function org-clock-timestamps-down "org-clock" (&optional n))
(declare-function org-clock-remove-overlays "org-clock" (&optional beg end noremove))
(declare-function org-clock-sum-current-item "org-clock" (&optional tstart)) (declare-function org-clock-sum-current-item "org-clock" (&optional tstart))
(declare-function org-clock-update-time-maybe "org-clock" ())
(declare-function org-clocktable-shift "org-clock" (dir n))
(declare-function orgtbl-mode "org-table" (&optional arg)) (declare-function orgtbl-mode "org-table" (&optional arg))
(declare-function org-clock-out "org-clock" (&optional switch-to-state fail-quietly at-time)) (declare-function org-clock-out "org-clock" (&optional switch-to-state fail-quietly at-time))
@ -133,6 +138,10 @@ Stars are put in group 1 and the trimmed body in group 2.")
(declare-function org-agenda-list "org-agenda" (&optional arg start-day span)) (declare-function org-agenda-list "org-agenda" (&optional arg start-day span))
(declare-function org-agenda-redo "org-agenda" (&optional all)) (declare-function org-agenda-redo "org-agenda" (&optional all))
(declare-function org-table-align "org-table" ()) (declare-function org-table-align "org-table" ())
(declare-function org-table-begin "org-table" (&optional table-type))
(declare-function org-table-blank-field "org-table" ())
(declare-function org-table-end "org-table" (&optional table-type))
(declare-function org-table-insert-row "org-table" (&optional arg))
(declare-function org-table-paste-rectangle "org-table" ()) (declare-function org-table-paste-rectangle "org-table" ())
(declare-function org-table-maybe-eval-formula "org-table" ()) (declare-function org-table-maybe-eval-formula "org-table" ())
(declare-function org-table-maybe-recalculate-line "org-table" ()) (declare-function org-table-maybe-recalculate-line "org-table" ())
@ -179,6 +188,7 @@ Stars are put in group 1 and the trimmed body in group 2.")
(intern (concat "org-babel-expand-body:" lang))))))) (intern (concat "org-babel-expand-body:" lang)))))))
org-babel-load-languages)) org-babel-load-languages))
(declare-function org-babel-tangle-file "ob-tangle" (file &optional target-file lang))
;;;###autoload ;;;###autoload
(defun org-babel-load-file (file &optional compile) (defun org-babel-load-file (file &optional compile)
"Load Emacs Lisp source code blocks in the Org-mode FILE. "Load Emacs Lisp source code blocks in the Org-mode FILE.
@ -5109,9 +5119,9 @@ Support for group tags is controlled by the option
"\\(?: +\\(\\[#.\\]\\)\\)?" "\\(?: +\\(\\[#.\\]\\)\\)?"
"\\(?: +" "\\(?: +"
;; Stats cookies can be stuck to body. ;; Stats cookies can be stuck to body.
"\\(?:\\[[0-9%%/]+\\] *\\)?" "\\(?:\\[[0-9%%/]+\\] *\\)*"
"\\(%s\\)" "\\(%s\\)"
"\\(?: *\\[[0-9%%/]+\\]\\)?" "\\(?: *\\[[0-9%%/]+\\]\\)*"
"\\)" "\\)"
(org-re "\\(?:[ \t]+\\(:[[:alnum:]_@#%%:]+:\\)\\)?") (org-re "\\(?:[ \t]+\\(:[[:alnum:]_@#%%:]+:\\)\\)?")
"[ \t]*$") "[ \t]*$")
@ -5417,8 +5427,7 @@ The following commands are available:
(org-add-hook 'isearch-mode-end-hook 'org-isearch-end 'append 'local) (org-add-hook 'isearch-mode-end-hook 'org-isearch-end 'append 'local)
;; Emacs 22 deals with this through a special variable ;; Emacs 22 deals with this through a special variable
(org-set-local 'outline-isearch-open-invisible-function (org-set-local 'outline-isearch-open-invisible-function
(lambda (&rest ignore) (org-show-context 'isearch))) (lambda (&rest ignore) (org-show-context 'isearch))))
(org-add-hook 'isearch-mode-end-hook 'org-fix-ellipsis-at-bol 'append 'local))
;; Setup the pcomplete hooks ;; Setup the pcomplete hooks
(set (make-local-variable 'pcomplete-command-completion-function) (set (make-local-variable 'pcomplete-command-completion-function)
@ -5473,9 +5482,6 @@ The following commands are available:
(put 'org-mode 'flyspell-mode-predicate 'org-mode-flyspell-verify) (put 'org-mode 'flyspell-mode-predicate 'org-mode-flyspell-verify)
(defsubst org-fix-ellipsis-at-bol ()
(save-excursion (goto-char (window-start)) (recenter 0)))
(defun org-find-invisible-foreground () (defun org-find-invisible-foreground ()
(let ((candidates (remove (let ((candidates (remove
"unspecified-bg" "unspecified-bg"
@ -5881,7 +5887,7 @@ by a #."
((member dc1 '("+title:" "+author:" "+email:" "+date:")) ((member dc1 '("+title:" "+author:" "+email:" "+date:"))
(add-text-properties (add-text-properties
beg (match-end 3) beg (match-end 3)
(if (member (intern (substring dc1 0 -1)) org-hidden-keywords) (if (member (intern (substring dc1 1 -1)) org-hidden-keywords)
'(font-lock-fontified t invisible t) '(font-lock-fontified t invisible t)
'(font-lock-fontified t face org-document-info-keyword))) '(font-lock-fontified t face org-document-info-keyword)))
(add-text-properties (add-text-properties
@ -6145,15 +6151,25 @@ Use `org-reduced-level' to remove the effect of `org-odd-levels'."
(defvar org-font-lock-keywords nil) (defvar org-font-lock-keywords nil)
(defsubst org-re-property (property &optional literal) (defsubst org-re-property (property &optional literal allow-null)
"Return a regexp matching a PROPERTY line. "Return a regexp matching a PROPERTY line.
Match group 3 will be set to the value if it exists."
(concat "^\\(?4:[ \t]*\\)\\(?1::\\(?2:" When optional argument LITERAL is non-nil, do not quote PROPERTY.
(if literal property (regexp-quote property)) This is useful when PROPERTY is a regexp. When ALLOW-NULL is
"\\):\\)[ \t]+\\(?3:[^ \t\r\n].*?\\)\\(?5:[ \t]*\\)$")) non-nil, match properties even without a value.
Match group 3 is set to the value when it exists. If there is no
value and ALLOW-NULL is non-nil, it is set to the empty string."
(concat
"^\\(?4:[ \t]*\\)"
(format "\\(?1::\\(?2:%s\\):\\)"
(if literal property (regexp-quote property)))
(if allow-null
"\\(?:\\(?3:$\\)\\|[ \t]+\\(?3:.*?\\)\\)\\(?5:[ \t]*\\)$"
"[ \t]+\\(?3:[^ \r\t\n]+.*?\\)\\(?5:[ \t]*\\)$")))
(defconst org-property-re (defconst org-property-re
(org-re-property ".*?" 'literal) (org-re-property ".*?" 'literal t)
"Regular expression matching a property line. "Regular expression matching a property line.
There are four matching groups: There are four matching groups:
1: :PROPKEY: including the leading and trailing colon, 1: :PROPKEY: including the leading and trailing colon,
@ -6712,7 +6728,8 @@ in special contexts.
(setq org-cycle-global-status 'overview) (setq org-cycle-global-status 'overview)
(run-hook-with-args 'org-cycle-hook 'overview))))) (run-hook-with-args 'org-cycle-hook 'overview)))))
(defvar org-called-with-limited-levels);Dyn-bound in ̀org-with-limited-levels'. (defvar org-called-with-limited-levels nil
"Non-nil when `org-with-limited-levels' is currently active.")
(defun org-cycle-internal-local () (defun org-cycle-internal-local ()
"Do the local cycling action." "Do the local cycling action."
@ -6729,7 +6746,8 @@ in special contexts.
(setq has-children (org-list-has-child-p (point) struct))) (setq has-children (org-list-has-child-p (point) struct)))
(org-back-to-heading) (org-back-to-heading)
(setq eoh (save-excursion (outline-end-of-heading) (point))) (setq eoh (save-excursion (outline-end-of-heading) (point)))
(setq eos (save-excursion (1- (org-end-of-subtree t t)))) (setq eos (save-excursion (org-end-of-subtree t t)
(when (bolp) (backward-char)) (point)))
(setq has-children (setq has-children
(or (save-excursion (or (save-excursion
(let ((level (funcall outline-level))) (let ((level (funcall outline-level)))
@ -6894,21 +6912,20 @@ With a numeric prefix, show all headlines up to that level."
;; buffers, where outline-regexp is needed. ;; buffers, where outline-regexp is needed.
(defun org-overview () (defun org-overview ()
"Switch to overview mode, showing only top-level headlines. "Switch to overview mode, showing only top-level headlines.
Really, this shows all headlines with level equal or greater than the level This shows all headlines with a level equal or greater than the level
of the first headline in the buffer. This is important, because if the of the first headline in the buffer. This is important, because if the
first headline is not level one, then (hide-sublevels 1) gives confusing first headline is not level one, then (hide-sublevels 1) gives confusing
results." results."
(interactive) (interactive)
(let ((pos (point)) (save-excursion
(level (save-excursion (let ((level
(goto-char (point-min)) (save-excursion
(if (re-search-forward (concat "^" outline-regexp) nil t) (goto-char (point-min))
(progn (if (re-search-forward (concat "^" outline-regexp) nil t)
(goto-char (match-beginning 0)) (progn
(funcall outline-level)))))) (goto-char (match-beginning 0))
(and level (hide-sublevels level)) (funcall outline-level))))))
(recenter '(4)) (and level (hide-sublevels level)))))
(goto-char pos)))
(defun org-content (&optional arg) (defun org-content (&optional arg)
"Show all headlines in the buffer, like a table of contents. "Show all headlines in the buffer, like a table of contents.
@ -7105,13 +7122,11 @@ Otherwise make it visible."
(pos-visible-in-window-p (pos-visible-in-window-p
(save-excursion (org-end-of-subtree t) (point)))) (save-excursion (org-end-of-subtree t) (point))))
(defun org-first-headline-recenter (&optional N) (defun org-first-headline-recenter ()
"Move cursor to the first headline and recenter the headline. "Move cursor to the first headline and recenter the headline."
Optional argument N means put the headline into the Nth line of the window."
(goto-char (point-min)) (goto-char (point-min))
(when (re-search-forward (concat "^\\(" org-outline-regexp "\\)") nil t) (when (re-search-forward (concat "^\\(" org-outline-regexp "\\)") nil t)
(beginning-of-line) (set-window-start (selected-window) (point-at-bol))))
(recenter (prefix-numeric-value N))))
;;; Saving and restoring visibility ;;; Saving and restoring visibility
@ -7545,23 +7560,22 @@ When NEXT is non-nil, check the next line instead."
(looking-at "[ \t]*$"))))) (looking-at "[ \t]*$")))))
(defun org-insert-heading (&optional arg invisible-ok) (defun org-insert-heading (&optional arg invisible-ok)
"Insert a new heading or item with same depth at point. "Insert a new heading or an item with the same depth at point.
If point is at the beginning of a heading or a list item, insert If point is at the beginning of a heading or a list item, insert
a heading or a list item before it. a new heading or a new item above the current one. If point is
at the beginning of a normal line, turn the line into a heading.
If point is at the beginning of a normal line, turn this line
into a heading.
If point is in the middle of a headline or a list item, split the If point is in the middle of a headline or a list item, split the
headline or the item and create a new headline/item with the text headline or the item and create a new headline/item with the text
in the current line after point \(see `org-M-RET-may-split-line' in the current line after point \(see `org-M-RET-may-split-line'
on how to modify this behavior). on how to modify this behavior).
With one universal prefix argument: If point is within a list, With one universal prefirx argument, set the user option
insert a heading instead of a list item. Otherwise, set the `org-insert-heading-respect-content' to t for the duration of
value of `org-insert-heading-respect-content' to `t' for the the command. This modifies the behavior described above in this
duration of the command. ways: on list items and at the beginning of normal lines, force
the insertion of a heading after the current subtree.
With two universal prefix arguments, insert the heading at the With two universal prefix arguments, insert the heading at the
end of the grandparent subtree. For example, if point is within end of the grandparent subtree. For example, if point is within
@ -7589,12 +7603,19 @@ command."
(or arg (not itemp)))) (or arg (not itemp))))
;; At beginning of buffer or so high up that only a heading ;; At beginning of buffer or so high up that only a heading
;; makes sense. ;; makes sense.
(insert (cond ((and (bolp) (not respect-content)) (insert "* "))
(if (or (bobp) (org-previous-line-empty-p)) "" "\n") ((not respect-content)
(if (org-in-src-block-p) ",* " "* ")) (unless may-split (end-of-line))
(insert "\n* "))
((re-search-forward org-outline-regexp-bol nil t)
(beginning-of-line)
(insert "* \n")
(backward-char))
(t (goto-char (point-max))
(insert "\n* ")))
(run-hooks 'org-insert-heading-hook)) (run-hooks 'org-insert-heading-hook))
((and itemp (not (equal arg '(4)))) ((and itemp (not (member arg '((4) (16)))))
;; Insert an item ;; Insert an item
(org-insert-item)) (org-insert-item))
@ -7614,11 +7635,12 @@ command."
nil)) nil))
;; Get a level string to fall back on ;; Get a level string to fall back on
(fix-level (fix-level
(save-excursion (if (org-before-first-heading-p) "*"
(org-back-to-heading t) (save-excursion
(if (org-previous-line-empty-p) (setq empty-line-p t)) (org-back-to-heading t)
(looking-at org-outline-regexp) (if (org-previous-line-empty-p) (setq empty-line-p t))
(make-string (1- (length (match-string 0))) ?*))) (looking-at org-outline-regexp)
(make-string (1- (length (match-string 0))) ?*))))
(stars (stars
(save-excursion (save-excursion
(condition-case nil (condition-case nil
@ -7650,8 +7672,12 @@ command."
pos hide-previous previous-pos) pos hide-previous previous-pos)
;; If we insert after content, move there and clean up whitespace ;; If we insert after content, move there and clean up whitespace
(when (and respect-content (not (org-on-heading-p))) (when (and respect-content
(org-end-of-subtree nil t) (not (org-looking-at-p org-outline-regexp-bol)))
(if (not (org-before-first-heading-p))
(org-end-of-subtree nil t)
(re-search-forward org-outline-regexp-bol)
(beginning-of-line 0))
(skip-chars-backward " \r\n") (skip-chars-backward " \r\n")
(and (not (looking-back "^\*+")) (and (not (looking-back "^\*+"))
(looking-at "[ \t]+") (replace-match "")) (looking-at "[ \t]+") (replace-match ""))
@ -7680,10 +7706,9 @@ command."
(setq initial-content (org-trim initial-content))) (setq initial-content (org-trim initial-content)))
(goto-char pos)) (goto-char pos))
;; a normal line ;; a normal line
(unless (bolp) (setq initial-content
(setq initial-content (buffer-substring (point) (point-at-eol))) (org-trim (buffer-substring (point) (point-at-eol))))
(delete-region (point) (point-at-eol)) (delete-region (point) (point-at-eol))))
(setq initial-content (org-trim initial-content)))))
;; If we are at the beginning of the line, insert before it. Else after ;; If we are at the beginning of the line, insert before it. Else after
(cond (cond
@ -7708,13 +7733,12 @@ command."
"Make the number of empty lines before current exactly N. "Make the number of empty lines before current exactly N.
So this will delete or add empty lines." So this will delete or add empty lines."
(save-excursion (save-excursion
(goto-char (point-at-bol)) (beginning-of-line)
(if (looking-back "\\s-+" nil 'greedy) (let ((p (point)))
(replace-match "")) (skip-chars-backward " \r\t\n")
(or (bobp) (insert "\n")) (unless (bolp) (forward-line))
(while (> N 0) (delete-region (point) p))
(insert "\n") (when (> N 0) (insert (make-string N ?\n)))))
(setq N (1- N)))))
(defun org-get-heading (&optional no-tags no-todo) (defun org-get-heading (&optional no-tags no-todo)
"Return the heading of the current entry, without the stars. "Return the heading of the current entry, without the stars.
@ -7783,17 +7807,15 @@ This is a list with the following elements:
(org-move-subtree-down) (org-move-subtree-down)
(end-of-line 1)) (end-of-line 1))
(defun org-insert-heading-respect-content (&optional arg invisible-ok) (defun org-insert-heading-respect-content (&optional invisible-ok)
"Insert heading with `org-insert-heading-respect-content' set to t." "Insert heading with `org-insert-heading-respect-content' set to t."
(interactive "P") (interactive)
(let ((org-insert-heading-respect-content t)) (org-insert-heading '(4) invisible-ok))
(org-insert-heading '(4) invisible-ok)))
(defun org-insert-todo-heading-respect-content (&optional force-state) (defun org-insert-todo-heading-respect-content (&optional force-state)
"Insert TODO heading with `org-insert-heading-respect-content' set to t." "Insert TODO heading with `org-insert-heading-respect-content' set to t."
(interactive "P") (interactive)
(let ((org-insert-heading-respect-content t)) (org-insert-todo-heading force-state '(4)))
(org-insert-todo-heading force-state '(4))))
(defun org-insert-todo-heading (arg &optional force-heading) (defun org-insert-todo-heading (arg &optional force-heading)
"Insert a new heading with the same level and TODO state as current heading. "Insert a new heading with the same level and TODO state as current heading.
@ -8150,7 +8172,8 @@ case."
(save-match-data (save-match-data
(save-excursion (outline-end-of-heading) (save-excursion (outline-end-of-heading)
(setq folded (outline-invisible-p))) (setq folded (outline-invisible-p)))
(outline-end-of-subtree)) (progn (org-end-of-subtree nil t)
(unless (eobp) (backward-char))))
(outline-next-heading) (outline-next-heading)
(setq ne-end (org-back-over-empty-lines)) (setq ne-end (org-back-over-empty-lines))
(setq end (point)) (setq end (point))
@ -8303,7 +8326,7 @@ the inserted text when done."
(string-match (string-match
"^\\*+$" (buffer-substring "^\\*+$" (buffer-substring
(point-at-bol) (point)))) (point-at-bol) (point))))
(- (match-end 1) (match-beginning 1))) (- (match-end 0) (match-beginning 0)))
((and (bolp) ((and (bolp)
(looking-at org-outline-regexp)) (looking-at org-outline-regexp))
(- (match-end 0) (point) 1)))) (- (match-end 0) (point) 1))))
@ -10592,6 +10615,10 @@ application the system uses for this file type."
(move-marker org-open-link-marker nil) (move-marker org-open-link-marker nil)
(run-hook-with-args 'org-follow-link-hook))) (run-hook-with-args 'org-follow-link-hook)))
(defsubst org-uniquify (list)
"Non-destructively remove duplicate elements from LIST."
(let ((res (copy-sequence list))) (delete-dups res)))
(defun org-offer-links-in-entry (buffer marker &optional nth zero) (defun org-offer-links-in-entry (buffer marker &optional nth zero)
"Offer links in the current entry and return the selected link. "Offer links in the current entry and return the selected link.
If there is only one link, return it. If there is only one link, return it.
@ -13640,8 +13667,7 @@ How much context is shown depends upon the variables
(error nil)) (error nil))
(not (bobp))) (not (bobp)))
(org-flag-heading nil) (org-flag-heading nil)
(when siblings-p (org-show-siblings))))) (when siblings-p (org-show-siblings)))))))
(unless (eq key 'agenda) (org-fix-ellipsis-at-bol))))
(defvar org-reveal-start-hook nil (defvar org-reveal-start-hook nil
"Hook run before revealing a location.") "Hook run before revealing a location.")
@ -13836,7 +13862,7 @@ a file becomes an N^2 operation - but with this variable set, it scales
as N.") as N.")
(defun org-scan-tags (action matcher todo-only &optional start-level) (defun org-scan-tags (action matcher todo-only &optional start-level)
"Sca headline tags with inheritance and produce output ACTION. "Scan headline tags with inheritance and produce output ACTION.
ACTION can be `sparse-tree' to produce a sparse tree in the current buffer, ACTION can be `sparse-tree' to produce a sparse tree in the current buffer,
or `agenda' to produce an entry list for an agenda view. It can also be or `agenda' to produce an entry list for an agenda view. It can also be
@ -14744,8 +14770,8 @@ Returns the new tags string, or nil to not change the current settings."
(if expert (if expert
(set-buffer (get-buffer-create " *Org tags*")) (set-buffer (get-buffer-create " *Org tags*"))
(delete-other-windows) (delete-other-windows)
(split-window-vertically) (set-window-buffer (split-window-vertically) (get-buffer-create " *Org tags*"))
(org-switch-to-buffer-other-window (get-buffer-create " *Org tags*"))) (org-switch-to-buffer-other-window " *Org tags*"))
(erase-buffer) (erase-buffer)
(org-set-local 'org-done-keywords done-keywords) (org-set-local 'org-done-keywords done-keywords)
(org-fast-tag-insert "Inherited" inherited i-face "\n") (org-fast-tag-insert "Inherited" inherited i-face "\n")
@ -15269,7 +15295,10 @@ things up because then unnecessary parsing is avoided."
'("SCHEDULED" "DEADLINE" "CLOCK" "CLOSED" '("SCHEDULED" "DEADLINE" "CLOCK" "CLOSED"
"TIMESTAMP" "TIMESTAMP_IA"))) "TIMESTAMP" "TIMESTAMP_IA")))
(catch 'match (catch 'match
(while (re-search-forward org-maybe-keyword-time-regexp end t) (while (and (re-search-forward org-maybe-keyword-time-regexp end t)
(not (text-property-any 0 (length (match-string 0))
'face 'font-lock-comment-face
(match-string 0))))
(setq key (if (match-end 1) (setq key (if (match-end 1)
(substring (org-match-string-no-properties 1) (substring (org-match-string-no-properties 1)
0 -1)) 0 -1))
@ -15397,7 +15426,7 @@ an empty drawer to delete."
(if (and range (if (and range
(goto-char (car range)) (goto-char (car range))
(re-search-forward (re-search-forward
(org-re-property property) (org-re-property property nil t)
(cdr range) t)) (cdr range) t))
(progn (progn
(delete-region (match-beginning 0) (1+ (point-at-eol))) (delete-region (match-beginning 0) (1+ (point-at-eol)))
@ -15562,7 +15591,7 @@ If it is not a string, an error is raised."
(setq range (org-get-property-block beg end 'force)) (setq range (org-get-property-block beg end 'force))
(goto-char (car range)) (goto-char (car range))
(if (re-search-forward (if (re-search-forward
(org-re-property property) (cdr range) t) (org-re-property property nil t) (cdr range) t)
(progn (progn
(delete-region (match-beginning 0) (match-end 0)) (delete-region (match-beginning 0) (match-end 0))
(goto-char (match-beginning 0))) (goto-char (match-beginning 0)))
@ -15773,9 +15802,7 @@ This is computed according to `org-property-set-functions-alist'."
(funcall set-function prompt (funcall set-function prompt
(mapcar 'list (org-property-values property)) (mapcar 'list (org-property-values property))
nil nil "" nil cur))))) nil nil "" nil cur)))))
(if (equal val "") (org-trim val)))
cur
val)))
(defvar org-last-set-property nil) (defvar org-last-set-property nil)
(defvar org-last-set-property-value nil) (defvar org-last-set-property-value nil)
@ -15853,8 +15880,10 @@ an empty drawer to delete."
(org-icompleting-read "Property: " props nil t) (org-icompleting-read "Property: " props nil t)
(caar props)))) (caar props))))
(list prop))) (list prop)))
(if (org-entry-delete nil property delete-empty-drawer) (if (not property)
(message "Property %s deleted" property))) (message "No property to delete in this entry")
(org-entry-delete nil property delete-empty-drawer)
(message "Property \"%s\" deleted" property)))
(defun org-delete-property-globally (property) (defun org-delete-property-globally (property)
"Remove PROPERTY globally, from all entries." "Remove PROPERTY globally, from all entries."
@ -17743,9 +17772,9 @@ This requires Emacs >= 24.1, build with imagemagick support."
(defcustom org-agenda-inhibit-startup nil (defcustom org-agenda-inhibit-startup nil
"Inhibit startup when preparing agenda buffers. "Inhibit startup when preparing agenda buffers.
When this variable is `t' (the default), the initialization of When this variable is `t', the initialization of the Org agenda
the Org agenda buffers is inhibited: e.g. the visibility state buffers is inhibited: e.g. the visibility state is not set, the
is not set, the tables are not re-aligned, etc." tables are not re-aligned, etc."
:type 'boolean :type 'boolean
:version "24.3" :version "24.3"
:group 'org-agenda) :group 'org-agenda)
@ -21819,9 +21848,7 @@ for the search purpose."
"Return the reverse of STRING." "Return the reverse of STRING."
(apply 'string (reverse (string-to-list string)))) (apply 'string (reverse (string-to-list string))))
(defsubst org-uniquify (list) ;; defsubst org-uniquify must be defined before first use
"Non-destructively remove duplicate elements from LIST."
(let ((res (copy-sequence list))) (delete-dups res)))
(defun org-uniquify-alist (alist) (defun org-uniquify-alist (alist)
"Merge elements of ALIST with the same key. "Merge elements of ALIST with the same key.
@ -23273,14 +23300,6 @@ If there is no such heading, return nil."
(forward-char -1)))))) (forward-char -1))))))
(point)) (point))
(defadvice outline-end-of-subtree (around prefer-org-version activate compile)
"Use Org version in org-mode, for dramatic speed-up."
(if (derived-mode-p 'org-mode)
(progn
(org-end-of-subtree nil t)
(unless (eobp) (backward-char 1)))
ad-do-it))
(defun org-end-of-meta-data-and-drawers () (defun org-end-of-meta-data-and-drawers ()
"Jump to the first text after meta data and drawers in the current entry. "Jump to the first text after meta data and drawers in the current entry.
This will move over empty lines, lines with planning time stamps, This will move over empty lines, lines with planning time stamps,
@ -23777,8 +23796,7 @@ Show the heading too, if it is currently invisible."
isearch-mode-end-hook-quit) isearch-mode-end-hook-quit)
;; Only when the isearch was not quitted. ;; Only when the isearch was not quitted.
(org-add-hook 'post-command-hook 'org-isearch-post-command (org-add-hook 'post-command-hook 'org-isearch-post-command
'append 'local))) 'append 'local)))))
(org-fix-ellipsis-at-bol)))
(defun org-isearch-post-command () (defun org-isearch-post-command ()
"Remove self from hook, and show context." "Remove self from hook, and show context."

View file

@ -192,8 +192,10 @@ original Org buffer at the same place."
(defcustom org-ascii-indented-line-width 'auto (defcustom org-ascii-indented-line-width 'auto
"Additional indentation width for the first line in a paragraph. "Additional indentation width for the first line in a paragraph.
If the value is an integer, indent the first line of each If the value is an integer, indent the first line of each
paragraph by this number. If it is the symbol `auto' preserve paragraph by this width, unless it is located at the beginning of
indentation from original document." a section, in which case indentation is removed from that line.
If it is the symbol `auto' preserve indentation from original
document."
:group 'org-export-ascii :group 'org-export-ascii
:version "24.4" :version "24.4"
:package-version '(Org . "8.0") :package-version '(Org . "8.0")
@ -421,17 +423,17 @@ equivalent to `left'. For a justification that doesn't also fill
string, see `org-ascii--justify-string'. string, see `org-ascii--justify-string'.
Return nil if S isn't a string." Return nil if S isn't a string."
;; Don't fill paragraph when break should be preserved. (when (stringp s)
(cond ((not (stringp s)) nil) (let ((double-space-p sentence-end-double-space))
((plist-get info :preserve-breaks) s) (with-temp-buffer
(t (let ((double-space-p sentence-end-double-space)) (let ((fill-column text-width)
(with-temp-buffer (use-hard-newlines t)
(let ((fill-column text-width) (sentence-end-double-space double-space-p))
(use-hard-newlines t) (insert (if (plist-get info :preserve-breaks)
(sentence-end-double-space double-space-p)) (replace-regexp-in-string "\n" hard-newline s)
(insert s) s))
(fill-region (point-min) (point-max) justify)) (fill-region (point-min) (point-max) justify))
(buffer-string)))))) (buffer-string)))))
(defun org-ascii--justify-string (s text-width how) (defun org-ascii--justify-string (s text-width how)
"Justify string S. "Justify string S.
@ -455,13 +457,13 @@ HOW determines the type of justification: it can be `left',
Empty lines are not indented." Empty lines are not indented."
(when (stringp s) (when (stringp s)
(replace-regexp-in-string (replace-regexp-in-string
"\\(^\\)\\(?:.*\\S-\\)" (make-string width ? ) s nil nil 1))) "\\(^\\)[ \t]*\\S-" (make-string width ?\s) s nil nil 1)))
(defun org-ascii--box-string (s info) (defun org-ascii--box-string (s info)
"Return string S with a partial box to its left. "Return string S with a partial box to its left.
INFO is a plist used as a communication channel." INFO is a plist used as a communication channel."
(let ((utf8p (eq (plist-get info :ascii-charset) 'utf-8))) (let ((utf8p (eq (plist-get info :ascii-charset) 'utf-8)))
(format (if utf8p "╭────\n%s\n────" ",----\n%s\n`----") (format (if utf8p "┌────\n%s\n────" ",----\n%s\n`----")
(replace-regexp-in-string (replace-regexp-in-string
"^" (if utf8p "" "| ") "^" (if utf8p "" "| ")
;; Remove last newline character. ;; Remove last newline character.
@ -473,7 +475,7 @@ INFO is a plist used as a communication channel."
(case (org-element-type element) (case (org-element-type element)
;; Elements with an absolute width: `headline' and `inlinetask'. ;; Elements with an absolute width: `headline' and `inlinetask'.
(inlinetask org-ascii-inlinetask-width) (inlinetask org-ascii-inlinetask-width)
('headline (headline
(- org-ascii-text-width (- org-ascii-text-width
(let ((low-level-rank (org-export-low-level-p element info))) (let ((low-level-rank (org-export-low-level-p element info)))
(if low-level-rank (* low-level-rank 2) org-ascii-global-margin)))) (if low-level-rank (* low-level-rank 2) org-ascii-global-margin))))
@ -1418,12 +1420,16 @@ INFO is a plist holding contextual information."
"Transcode a PARAGRAPH element from Org to ASCII. "Transcode a PARAGRAPH element from Org to ASCII.
CONTENTS is the contents of the paragraph, as a string. INFO is CONTENTS is the contents of the paragraph, as a string. INFO is
the plist used as a communication channel." the plist used as a communication channel."
(let ((contents (if (not (wholenump org-ascii-indented-line-width)) contents (org-ascii--fill-string
(concat (if (not (wholenump org-ascii-indented-line-width)) contents
(make-string org-ascii-indented-line-width ? ) (concat
(replace-regexp-in-string "\\`[ \t]+" "" contents))))) ;; Do not indent first paragraph in a section.
(org-ascii--fill-string (unless (and (not (org-export-get-previous-element paragraph info))
contents (org-ascii--current-text-width paragraph info) info))) (eq (org-element-type (org-export-get-parent paragraph))
'section))
(make-string org-ascii-indented-line-width ?\s))
(replace-regexp-in-string "\\`[ \t]+" "" contents)))
(org-ascii--current-text-width paragraph info) info))
;;;; Plain List ;;;; Plain List
@ -1591,8 +1597,8 @@ contextual information."
CONTENTS is the contents of the object. INFO is a plist holding CONTENTS is the contents of the object. INFO is a plist holding
contextual information." contextual information."
(if (org-element-property :use-brackets-p superscript) (if (org-element-property :use-brackets-p superscript)
(format "_{%s}" contents) (format "^{%s}" contents)
(format "_%s" contents))) (format "^%s" contents)))
;;;; Strike-through ;;;; Strike-through
@ -1659,20 +1665,25 @@ are ignored."
(or (gethash key cache) (or (gethash key cache)
(puthash (puthash
key key
(or (and (not org-ascii-table-widen-columns) (let ((cookie-width (org-export-table-cell-width table-cell info)))
(org-export-table-cell-width table-cell info)) (or (and (not org-ascii-table-widen-columns) cookie-width)
(let* ((max-width 0)) (let ((contents-width
(org-element-map table 'table-row (let ((max-width 0))
(lambda (row) (org-element-map table 'table-row
(setq max-width (lambda (row)
(max (string-width (setq max-width
(org-export-data (max (string-width
(org-element-contents (org-export-data
(elt (org-element-contents row) col)) (org-element-contents
info)) (elt (org-element-contents row) col))
max-width))) info))
info) max-width)))
max-width)) info)
max-width)))
(cond ((not cookie-width) contents-width)
(org-ascii-table-widen-columns
(max cookie-width contents-width))
(t cookie-width)))))
cache)))) cache))))
(defun org-ascii-table-cell (table-cell contents info) (defun org-ascii-table-cell (table-cell contents info)

View file

@ -687,7 +687,7 @@ used as a communication channel."
(cond (cond
((equal type "radio") ((equal type "radio")
(let ((destination (org-export-resolve-radio-link link info))) (let ((destination (org-export-resolve-radio-link link info)))
(when destination (if (not destination) contents
(format "\\hyperlink%s{%s}{%s}" (format "\\hyperlink%s{%s}{%s}"
(or (org-beamer--element-has-overlay-p link) "") (or (org-beamer--element-has-overlay-p link) "")
(org-export-solidify-link-text (org-export-solidify-link-text
@ -1092,6 +1092,7 @@ aid, but the tag does not have any semantic meaning."
envs) envs)
'((:endgroup)) '((:endgroup))
'(("BMCOL" . ?|)))) '(("BMCOL" . ?|))))
(org-tag-persistent-alist nil)
(org-use-fast-tag-selection t) (org-use-fast-tag-selection t)
(org-fast-tag-selection-single-key t)) (org-fast-tag-selection-single-key t))
(org-set-tags) (org-set-tags)

View file

@ -2275,83 +2275,70 @@ holding contextual information."
"Transcode a HEADLINE element from Org to HTML. "Transcode a HEADLINE element from Org to HTML.
CONTENTS holds the contents of the headline. INFO is a plist CONTENTS holds the contents of the headline. INFO is a plist
holding contextual information." holding contextual information."
;; Empty contents? (unless (org-element-property :footnote-section-p headline)
(setq contents (or contents "")) (let* ((contents (or contents ""))
(let* ((numberedp (org-export-numbered-headline-p headline info)) (numberedp (org-export-numbered-headline-p headline info))
(level (org-export-get-relative-level headline info)) (level (org-export-get-relative-level headline info))
(text (org-export-data (org-element-property :title headline) info)) (text (org-export-data (org-element-property :title headline) info))
(todo (and (plist-get info :with-todo-keywords) (todo (and (plist-get info :with-todo-keywords)
(let ((todo (org-element-property :todo-keyword headline))) (let ((todo (org-element-property :todo-keyword headline)))
(and todo (org-export-data todo info))))) (and todo (org-export-data todo info)))))
(todo-type (and todo (org-element-property :todo-type headline))) (todo-type (and todo (org-element-property :todo-type headline)))
(tags (and (plist-get info :with-tags) (tags (and (plist-get info :with-tags)
(org-export-get-tags headline info))) (org-export-get-tags headline info)))
(priority (and (plist-get info :with-priority) (priority (and (plist-get info :with-priority)
(org-element-property :priority headline))) (org-element-property :priority headline)))
(section-number (and (org-export-numbered-headline-p headline info) (section-number (mapconcat #'number-to-string
(mapconcat 'number-to-string (org-export-get-headline-number
(org-export-get-headline-number headline info) "-"))
headline info) "."))) (ids (delq 'nil
;; Create the headline text. (list (org-element-property :CUSTOM_ID headline)
(full-text (org-html-format-headline--wrap headline info))) (concat "sec-" section-number)
(cond (org-element-property :ID headline))))
;; Case 1: This is a footnote section: ignore it. (preferred-id (car ids))
((org-element-property :footnote-section-p headline) nil) (extra-ids (mapconcat
;; Case 2. This is a deep sub-tree: export it as a list item. (lambda (id)
;; Also export as items headlines for which no section (org-html--anchor
;; format has been found. (org-export-solidify-link-text
((org-export-low-level-p headline info) (if (org-uuidgen-p id) (concat "ID-" id) id))))
;; Build the real contents of the sub-tree. (cdr ids) ""))
(let* ((type (if numberedp 'ordered 'unordered)) ;; Create the headline text.
(itemized-body (org-html-format-list-item (full-text (org-html-format-headline--wrap headline info)))
contents type nil info nil full-text))) (if (org-export-low-level-p headline info)
(concat ;; This is a deep sub-tree: export it as a list item.
(and (org-export-first-sibling-p headline info) (let* ((type (if numberedp 'ordered 'unordered))
(org-html-begin-plain-list type)) (itemized-body
itemized-body (org-html-format-list-item
(and (org-export-last-sibling-p headline info) contents type nil info nil
(org-html-end-plain-list type))))) (concat (org-html--anchor preferred-id) extra-ids
;; Case 3. Standard headline. Export it as a section. full-text))))
(t (concat
(let* ((section-number (mapconcat 'number-to-string (and (org-export-first-sibling-p headline info)
(org-export-get-headline-number (org-html-begin-plain-list type))
headline info) "-")) itemized-body
(ids (remove 'nil (and (org-export-last-sibling-p headline info)
(list (org-element-property :CUSTOM_ID headline) (org-html-end-plain-list type))))
(concat "sec-" section-number) ;; Standard headline. Export it as a section.
(org-element-property :ID headline)))) (let ((extra-class (org-element-property :HTML_CONTAINER_CLASS headline))
(preferred-id (car ids)) (level1 (+ level (1- org-html-toplevel-hlevel)))
(extra-ids (cdr ids)) (first-content (car (org-element-contents headline))))
(extra-class (org-element-property :HTML_CONTAINER_CLASS headline)) (format "<%s id=\"%s\" class=\"%s\">%s%s</%s>\n"
(level1 (+ level (1- org-html-toplevel-hlevel))) (org-html--container headline info)
(first-content (car (org-element-contents headline)))) (format "outline-container-%s"
(format "<%s id=\"%s\" class=\"%s\">%s%s</%s>\n" (or (org-element-property :CUSTOM_ID headline)
(org-html--container headline info) (concat "sec-" section-number)))
(format "outline-container-%s" (concat (format "outline-%d" level1) (and extra-class " ")
(or (org-element-property :CUSTOM_ID headline) extra-class)
(concat "sec-" section-number))) (format "\n<h%d id=\"%s\">%s%s</h%d>\n"
(concat (format "outline-%d" level1) (and extra-class " ") level1 preferred-id extra-ids full-text level1)
extra-class) ;; When there is no section, pretend there is an
(format "\n<h%d id=\"%s\">%s%s</h%d>\n" ;; empty one to get the correct <div class="outline-
level1 ;; ...> which is needed by `org-info.js'.
preferred-id (if (not (eq (org-element-type first-content) 'section))
(mapconcat (concat (org-html-section first-content "" info)
(lambda (x) contents)
(let ((id (org-export-solidify-link-text contents)
(if (org-uuidgen-p x) (concat "ID-" x) (org-html--container headline info)))))))
x))))
(org-html--anchor id)))
extra-ids "")
full-text
level1)
;; When there is no section, pretend there is an empty
;; one to get the correct <div class="outline- ...>
;; which is needed by `org-info.js'.
(if (not (eq (org-element-type first-content) 'section))
(concat (org-html-section first-content "" info)
contents)
contents)
(org-html--container headline info)))))))
(defun org-html--container (headline info) (defun org-html--container (headline info)
(or (org-element-property :HTML_CONTAINER headline) (or (org-element-property :HTML_CONTAINER headline)
@ -2596,18 +2583,17 @@ if its description is a single link targeting an image file."
(defvar org-html-standalone-image-predicate) (defvar org-html-standalone-image-predicate)
(defun org-html-standalone-image-p (element info) (defun org-html-standalone-image-p (element info)
"Test if ELEMENT is a standalone image. "Non-nil if ELEMENT is a standalone image.
INFO is a plist holding contextual information. INFO is a plist holding contextual information.
Return non-nil, if ELEMENT is of type paragraph and its sole An element or object is a standalone image when
content, save for white spaces, is a link that qualifies as an
inline image.
Return non-nil, if ELEMENT is of type link and its containing - its type is `paragraph' and its sole content, save for white
paragraph has no other content save white spaces. spaces, is a link that qualifies as an inline image;
Return nil, otherwise. - its type is `link' and its containing paragraph has no other
content save white spaces.
Bind `org-html-standalone-image-predicate' to constrain paragraph Bind `org-html-standalone-image-predicate' to constrain paragraph
further. For example, to check for only captioned standalone further. For example, to check for only captioned standalone
@ -2618,19 +2604,21 @@ images, set it to:
(paragraph element) (paragraph element)
(link (org-export-get-parent element))))) (link (org-export-get-parent element)))))
(and (eq (org-element-type paragraph) 'paragraph) (and (eq (org-element-type paragraph) 'paragraph)
(or (not (and (boundp 'org-html-standalone-image-predicate) (or (not (fboundp 'org-html-standalone-image-predicate))
(functionp org-html-standalone-image-predicate)))
(funcall org-html-standalone-image-predicate paragraph)) (funcall org-html-standalone-image-predicate paragraph))
(not (let ((link-count 0)) (catch 'exit
(org-element-map (org-element-contents paragraph) (let ((link-count 0))
(cons 'plain-text org-element-all-objects) (org-element-map (org-element-contents paragraph)
(lambda (obj) (case (org-element-type obj) (cons 'plain-text org-element-all-objects)
(plain-text (org-string-nw-p obj)) #'(lambda (obj)
(link (when (case (org-element-type obj)
(or (> (incf link-count) 1) (plain-text (org-string-nw-p obj))
(not (org-html-inline-image-p obj info)))) (link (or (> (incf link-count) 1)
(otherwise t))) (not (org-html-inline-image-p obj info))))
info 'first-match 'link)))))) (otherwise t))
(throw 'exit nil)))
info nil 'link)
(= link-count 1))))))
(defun org-html-link (link desc info) (defun org-html-link (link desc info)
"Transcode a LINK object from Org to HTML. "Transcode a LINK object from Org to HTML.
@ -2719,7 +2707,7 @@ INFO is a plist holding contextual information. See
;; link's description. ;; link's description.
((string= type "radio") ((string= type "radio")
(let ((destination (org-export-resolve-radio-link link info))) (let ((destination (org-export-resolve-radio-link link info)))
(when destination (if (not destination) desc
(format "<a href=\"#%s\"%s>%s</a>" (format "<a href=\"#%s\"%s>%s</a>"
(org-export-solidify-link-text (org-export-solidify-link-text
(org-element-property :value destination)) (org-element-property :value destination))

View file

@ -174,8 +174,7 @@ The anniversaries are defined in the BBDB database."
(defcustom org-icalendar-include-sexps t (defcustom org-icalendar-include-sexps t
"Non-nil means export to iCalendar files should also cover sexp entries. "Non-nil means export to iCalendar files should also cover sexp entries.
These are entries like in the diary, but directly in an Org mode These are entries like in the diary, but directly in an Org file."
file."
:group 'org-export-icalendar :group 'org-export-icalendar
:type 'boolean) :type 'boolean)
@ -302,14 +301,14 @@ which will be updated."
INFO is a plist used as a communication channel. INFO is a plist used as a communication channel.
a headline is blocked when either: A headline is blocked when either
- It has children which are not all in a completed state. - it has children which are not all in a completed state;
- It has a parent with the property :ORDERED:, and there are - it has a parent with the property :ORDERED:, and there are
siblings prior to it with incomplete status. siblings prior to it with incomplete status;
- Its parent is blocked because it has siblings that should be - its parent is blocked because it has siblings that should be
done first or is a child of a blocked grandparent entry." done first or is a child of a blocked grandparent entry."
(or (or
;; Check if any child is not done. ;; Check if any child is not done.
@ -478,10 +477,10 @@ or subject for the event."
;;; Filters ;;; Filters
(defun org-icalendar-clear-blank-lines (headline back-end info) (defun org-icalendar-clear-blank-lines (headline back-end info)
"Remove trailing blank lines in HEADLINE export. "Remove blank lines in HEADLINE export.
HEADLINE is a string representing a transcoded headline. HEADLINE is a string representing a transcoded headline.
BACK-END and INFO are ignored." BACK-END and INFO are ignored."
(replace-regexp-in-string "^\\(?:[ \t]*\n\\)*" "" headline)) (replace-regexp-in-string "^\\(?:[ \t]*\n\\)+" "" headline))
@ -570,13 +569,19 @@ inlinetask within the section."
;; happen once ENTRY is one of them. ;; happen once ENTRY is one of them.
(let ((counter 0)) (let ((counter 0))
(mapconcat (mapconcat
'identity #'identity
(org-element-map (cons (org-element-property :title entry) (org-element-map (cons (org-element-property :title entry)
(org-element-contents inside)) (org-element-contents inside))
'timestamp 'timestamp
(lambda (ts) (lambda (ts)
(let ((uid (format "TS%d-%s" (incf counter) uid))) (when (let ((type (org-element-property :type ts)))
(org-icalendar--vevent entry ts uid summary loc desc cat))) (case (plist-get info :with-timestamps)
(active (memq type '(active active-range)))
(inactive (memq type '(inactive inactive-range)))
((t) t)))
(let ((uid (format "TS%d-%s" (incf counter) uid)))
(org-icalendar--vevent
entry ts uid summary loc desc cat))))
info nil (and (eq type 'headline) 'inlinetask)) info nil (and (eq type 'headline) 'inlinetask))
"")) ""))
;; Task: First check if it is appropriate to export it. ;; Task: First check if it is appropriate to export it.
@ -589,7 +594,7 @@ inlinetask within the section."
(and (eq type 'headline) (and (eq type 'headline)
(not (org-icalendar-blocked-headline-p (not (org-icalendar-blocked-headline-p
entry info)))) entry info))))
('t (eq todo-type 'todo)))) ((t) (eq todo-type 'todo))))
(org-icalendar--vtodo entry uid summary loc desc cat)) (org-icalendar--vtodo entry uid summary loc desc cat))
;; Diary-sexp: Collect every diary-sexp element within ;; Diary-sexp: Collect every diary-sexp element within
;; ENTRY and its title, and transcode them. If ENTRY is ;; ENTRY and its title, and transcode them. If ENTRY is
@ -597,7 +602,7 @@ inlinetask within the section."
;; separately. ;; separately.
(when org-icalendar-include-sexps (when org-icalendar-include-sexps
(let ((counter 0)) (let ((counter 0))
(mapconcat 'identity (mapconcat #'identity
(org-element-map (org-element-map
(cons (org-element-property :title entry) (cons (org-element-property :title entry)
(org-element-contents inside)) (org-element-contents inside))
@ -613,7 +618,7 @@ inlinetask within the section."
;; inlinetask within it. In agenda export, this is independent ;; inlinetask within it. In agenda export, this is independent
;; from the mark (or lack thereof) on the entry. ;; from the mark (or lack thereof) on the entry.
(when (eq type 'headline) (when (eq type 'headline)
(mapconcat 'identity (mapconcat #'identity
(org-element-map inside 'inlinetask (org-element-map inside 'inlinetask
(lambda (task) (org-icalendar-entry task nil info)) (lambda (task) (org-icalendar-entry task nil info))
info) "")) info) ""))

View file

@ -524,7 +524,7 @@ When nil, no transformation is made."
:package-version '(Org . "8.0") :package-version '(Org . "8.0")
:type '(choice :type '(choice
(string :tag "Format string") (string :tag "Format string")
(const :tag "No formatting"))) (const :tag "No formatting" nil)))
;;;; Text markup ;;;; Text markup
@ -689,9 +689,9 @@ These options are supplied as a comma-separated list to the
a list containing two strings: the name of the option, and the a list containing two strings: the name of the option, and the
value. For example, value. For example,
(setq org-latex-listings-options \(setq org-latex-listings-options
'((\"basicstyle\" \"\\\\small\") '((\"basicstyle\" \"\\\\small\")
(\"keywordstyle\" \"\\\\color{black}\\\\bfseries\\\\underbar\"))) \(\"keywordstyle\" \"\\\\color{black}\\\\bfseries\\\\underbar\")))
will typeset the code in a small size font with underlined, bold will typeset the code in a small size font with underlined, bold
black keywords. black keywords.
@ -1526,17 +1526,16 @@ holding contextual information."
(when priority (format "\\framebox{\\#%c} " priority)) (when priority (format "\\framebox{\\#%c} " priority))
title title
(when tags (format "\\hfill{}\\textsc{:%s:}" (when tags (format "\\hfill{}\\textsc{:%s:}"
(mapconcat 'identity tags ":")))))) (mapconcat #'identity tags ":"))))))
(format (concat "\\begin{center}\n" (concat "\\begin{center}\n"
"\\fbox{\n" "\\fbox{\n"
"\\begin{minipage}[c]{.6\\textwidth}\n" "\\begin{minipage}[c]{.6\\textwidth}\n"
"%s\n\n" full-title "\n\n"
"\\rule[.8em]{\\textwidth}{2pt}\n\n" (and (org-string-nw-p contents)
"%s" (concat "\\rule[.8em]{\\textwidth}{2pt}\n\n" contents))
"\\end{minipage}\n" "\\end{minipage}\n"
"}\n" "}\n"
"\\end{center}") "\\end{center}"))))))
full-title contents))))))
;;;; Italic ;;;; Italic
@ -1810,7 +1809,7 @@ INFO is a plist holding contextual information. See
;; description. ;; description.
((string= type "radio") ((string= type "radio")
(let ((destination (org-export-resolve-radio-link link info))) (let ((destination (org-export-resolve-radio-link link info)))
(when destination (if (not destination) desc
(format "\\hyperref[%s]{%s}" (format "\\hyperref[%s]{%s}"
(org-export-solidify-link-text (org-export-solidify-link-text
(org-element-property :value destination)) (org-element-property :value destination))
@ -1843,7 +1842,8 @@ INFO is a plist holding contextual information. See
'number-to-string 'number-to-string
(org-export-get-headline-number destination info) (org-export-get-headline-number destination info)
"-")))) "-"))))
(if (and (plist-get info :section-numbers) (not desc)) (if (and (not desc)
(org-export-numbered-headline-p destination info))
(format "\\ref{%s}" label) (format "\\ref{%s}" label)
(format "\\hyperref[%s]{%s}" label (format "\\hyperref[%s]{%s}" label
(or desc (or desc

View file

@ -102,21 +102,28 @@ This variable can be set to either `atx' or `setext'."
TREE is the parse tree being exported. BACKEND is the export TREE is the parse tree being exported. BACKEND is the export
back-end used. INFO is a plist used as a communication channel. back-end used. INFO is a plist used as a communication channel.
Make sure there's no blank line before a plain list, unless it is Enforce a blank line between elements. There are three
located right after a paragraph. Otherwise, add a blank line exceptions to this rule:
between elements. Blank lines between items are preserved.
1. Preserve blank lines between sibling items in a plain list,
2. Outside of plain lists, preserve blank lines between
a paragraph and a plain list,
3. In an item, remove any blank line before the very first
paragraph and the next sub-list.
Assume BACKEND is `md'." Assume BACKEND is `md'."
(org-element-map tree (remq 'item org-element-all-elements) (org-element-map tree (remq 'item org-element-all-elements)
(lambda (elem) (lambda (e)
(org-element-put-property (cond
elem :post-blank ((not (and (eq (org-element-type e) 'paragraph)
(if (and (eq (org-element-type (org-export-get-next-element elem info)) (eq (org-element-type (org-export-get-next-element e info))
'plain-list) 'plain-list)))
(not (and (eq (org-element-type elem) 'paragraph) (org-element-put-property e :post-blank 1))
(org-export-get-previous-element elem info)))) ((not (eq (org-element-type (org-element-property :parent e)) 'item)))
0 (t (org-element-put-property
1)))) e :post-blank (if (org-export-get-previous-element e info) 1 0))))))
;; Return updated tree. ;; Return updated tree.
tree) tree)
@ -182,6 +189,14 @@ a communication channel."
(and (plist-get info :with-priority) (and (plist-get info :with-priority)
(let ((char (org-element-property :priority headline))) (let ((char (org-element-property :priority headline)))
(and char (format "[#%c] " char))))) (and char (format "[#%c] " char)))))
(anchor
(when (plist-get info :with-toc)
(org-html--anchor
(or (org-element-property :CUSTOM_ID headline)
(concat "sec-"
(mapconcat 'number-to-string
(org-export-get-headline-number
headline info) "-"))))))
;; Headline text without tags. ;; Headline text without tags.
(heading (concat todo priority title))) (heading (concat todo priority title)))
(cond (cond
@ -202,12 +217,12 @@ a communication channel."
(replace-regexp-in-string "^" " " contents))))) (replace-regexp-in-string "^" " " contents)))))
;; Use "Setext" style. ;; Use "Setext" style.
((eq org-md-headline-style 'setext) ((eq org-md-headline-style 'setext)
(concat heading tags "\n" (concat heading tags anchor "\n"
(make-string (length heading) (if (= level 1) ?= ?-)) (make-string (length heading) (if (= level 1) ?= ?-))
"\n\n" "\n\n"
contents)) contents))
;; Use "atx" style. ;; Use "atx" style.
(t (concat (make-string level ?#) " " heading tags "\n\n" contents)))))) (t (concat (make-string level ?#) " " heading tags anchor "\n\n" contents))))))
;;;; Horizontal Rule ;;;; Horizontal Rule
@ -279,57 +294,65 @@ a communication channel."
(concat (file-name-sans-extension raw-path) ".md") (concat (file-name-sans-extension raw-path) ".md")
raw-path)))) raw-path))))
(type (org-element-property :type link))) (type (org-element-property :type link)))
(cond ((member type '("custom-id" "id")) (cond
(let ((destination (org-export-resolve-id-link link info))) ((member type '("custom-id" "id"))
(if (stringp destination) ; External file. (let ((destination (org-export-resolve-id-link link info)))
(let ((path (funcall link-org-files-as-md destination))) (if (stringp destination) ; External file.
(if (not contents) (format "<%s>" path) (let ((path (funcall link-org-files-as-md destination)))
(format "[%s](%s)" contents path))) (if (not contents) (format "<%s>" path)
(concat (format "[%s](%s)" contents path)))
(and contents (concat contents " ")) (concat
(format "(%s)" (and contents (concat contents " "))
(format (org-export-translate "See section %s" :html info) (format "(%s)"
(mapconcat 'number-to-string (format (org-export-translate "See section %s" :html info)
(org-export-get-headline-number (mapconcat 'number-to-string
destination info) (org-export-get-headline-number
"."))))))) destination info)
((org-export-inline-image-p link org-html-inline-image-rules) ".")))))))
(let ((path (let ((raw-path (org-element-property :path link))) ((org-export-inline-image-p link org-html-inline-image-rules)
(if (not (file-name-absolute-p raw-path)) raw-path (let ((path (let ((raw-path (org-element-property :path link)))
(expand-file-name raw-path)))) (if (not (file-name-absolute-p raw-path)) raw-path
(caption (org-export-data (expand-file-name raw-path))))
(org-export-get-caption (caption (org-export-data
(org-export-get-parent-element link)) info))) (org-export-get-caption
(format "![img](%s)" (org-export-get-parent-element link)) info)))
(if (not (org-string-nw-p caption)) path (format "![img](%s)"
(format "%s \"%s\"" path caption))))) (if (not (org-string-nw-p caption)) path
((string= type "coderef") (format "%s \"%s\"" path caption)))))
(let ((ref (org-element-property :path link))) ((string= type "coderef")
(format (org-export-get-coderef-format ref contents) (let ((ref (org-element-property :path link)))
(org-export-resolve-coderef ref info)))) (format (org-export-get-coderef-format ref contents)
((equal type "radio") contents) (org-export-resolve-coderef ref info))))
((equal type "fuzzy") ((equal type "radio") contents)
(let ((destination (org-export-resolve-fuzzy-link link info))) ((equal type "fuzzy")
(if (org-string-nw-p contents) contents (let ((destination (org-export-resolve-fuzzy-link link info)))
(when destination (if (org-string-nw-p contents) contents
(let ((number (org-export-get-ordinal destination info))) (when destination
(when number (let ((number (org-export-get-ordinal destination info)))
(if (atom number) (number-to-string number) (when number
(mapconcat 'number-to-string number ".")))))))) (if (atom number) (number-to-string number)
(t (let* ((raw-path (org-element-property :path link)) (mapconcat 'number-to-string number "."))))))))
(path ;; Link type is handled by a special function.
(cond ((let ((protocol (nth 2 (assoc type org-link-protocols))))
((member type '("http" "https" "ftp")) (and (functionp protocol)
(concat type ":" raw-path)) (funcall protocol
((string= type "file") (org-link-unescape (org-element-property :path link))
(let ((path (funcall link-org-files-as-md raw-path))) contents
(if (not (file-name-absolute-p path)) path 'md))))
;; If file path is absolute, prepend it (t (let* ((raw-path (org-element-property :path link))
;; with "file:" component. (path
(concat "file:" path)))) (cond
(t raw-path)))) ((member type '("http" "https" "ftp"))
(if (not contents) (format "<%s>" path) (concat type ":" raw-path))
(format "[%s](%s)" contents path))))))) ((string= type "file")
(let ((path (funcall link-org-files-as-md raw-path)))
(if (not (file-name-absolute-p path)) path
;; If file path is absolute, prepend it
;; with "file:" component.
(concat "file:" path))))
(t raw-path))))
(if (not contents) (format "<%s>" path)
(format "[%s](%s)" contents path)))))))
;;;; Paragraph ;;;; Paragraph

View file

@ -1741,7 +1741,8 @@ CONTENTS is nil. INFO is a plist holding contextual information."
:transcoders :transcoders
'((paragraph . (lambda (p c i) '((paragraph . (lambda (p c i)
(org-odt--format-paragraph (org-odt--format-paragraph
p c "Footnote" p c i
"Footnote"
"OrgFootnoteCenter" "OrgFootnoteCenter"
"OrgFootnoteQuotations"))))) "OrgFootnoteQuotations")))))
info)))) info))))
@ -2732,7 +2733,7 @@ INFO is a plist holding contextual information. See
;; link's description. ;; link's description.
((string= type "radio") ((string= type "radio")
(let ((destination (org-export-resolve-radio-link link info))) (let ((destination (org-export-resolve-radio-link link info)))
(when destination (if (not destination) desc
(format (format
"<text:bookmark-ref text:reference-format=\"text\" text:ref-name=\"OrgXref.%s\">%s</text:bookmark-ref>" "<text:bookmark-ref text:reference-format=\"text\" text:ref-name=\"OrgXref.%s\">%s</text:bookmark-ref>"
(org-export-solidify-link-text (org-export-solidify-link-text
@ -2832,33 +2833,44 @@ INFO is a plist holding contextual information. See
;;;; Paragraph ;;;; Paragraph
(defun org-odt--format-paragraph (paragraph contents default center quote) (defun org-odt--paragraph-style (paragraph)
"Return style of PARAGRAPH.
Style is a symbol among `quoted', `centered' and nil."
(let ((up paragraph))
(while (and (setq up (org-element-property :parent up))
(not (memq (org-element-type up)
'(center-block quote-block section)))))
(case (org-element-type up)
(center-block 'centered)
(quote-block 'quoted))))
(defun org-odt--format-paragraph (paragraph contents info default center quote)
"Format paragraph according to given styles. "Format paragraph according to given styles.
PARAGRAPH is a paragraph type element. CONTENTS is the PARAGRAPH is a paragraph type element. CONTENTS is the
transcoded contents of that paragraph, as a string. DEFAULT, transcoded contents of that paragraph, as a string. INFO is
CENTER and QUOTE are, respectively, style to use when paragraph a plist used as a communication channel. DEFAULT, CENTER and
belongs to no special environment, a center block, or a quote QUOTE are, respectively, style to use when paragraph belongs to
block." no special environment, a center block, or a quote block."
(let* ((parent (org-export-get-parent paragraph)) (format "\n<text:p text:style-name=\"%s\">%s</text:p>"
(parent-type (org-element-type parent)) (case (org-odt--paragraph-style paragraph)
(style (case parent-type (quoted quote)
(quote-block quote) (centered center)
(center-block center) (otherwise default))
(t default)))) ;; If PARAGRAPH is a leading paragraph in an item that has
;; If this paragraph is a leading paragraph in an item and the ;; a checkbox, splice checkbox and paragraph contents
;; item has a checkbox, splice the checkbox and paragraph contents ;; together.
;; together. (concat (let ((parent (org-element-property :parent paragraph)))
(when (and (eq (org-element-type parent) 'item) (and (eq (org-element-type parent) 'item)
(eq paragraph (car (org-element-contents parent)))) (not (org-export-get-previous-element paragraph info))
(setq contents (concat (org-odt--checkbox parent) contents))) (org-odt--checkbox parent)))
(format "\n<text:p text:style-name=\"%s\">%s</text:p>" style contents))) contents)))
(defun org-odt-paragraph (paragraph contents info) (defun org-odt-paragraph (paragraph contents info)
"Transcode a PARAGRAPH element from Org to ODT. "Transcode a PARAGRAPH element from Org to ODT.
CONTENTS is the contents of the paragraph, as a string. INFO is CONTENTS is the contents of the paragraph, as a string. INFO is
the plist used as a communication channel." the plist used as a communication channel."
(org-odt--format-paragraph (org-odt--format-paragraph
paragraph contents paragraph contents info
(or (org-element-property :style paragraph) "Text_20_body") (or (org-element-property :style paragraph) "Text_20_body")
"OrgCenter" "OrgCenter"
"Quotations")) "Quotations"))

View file

@ -65,7 +65,7 @@ setting of `org-html-htmlize-output-type' is 'css."
(entity . org-org-identity) (entity . org-org-identity)
(example-block . org-org-identity) (example-block . org-org-identity)
(fixed-width . org-org-identity) (fixed-width . org-org-identity)
(footnote-definition . org-org-identity) (footnote-definition . ignore)
(footnote-reference . org-org-identity) (footnote-reference . org-org-identity)
(headline . org-org-headline) (headline . org-org-headline)
(horizontal-rule . org-org-identity) (horizontal-rule . org-org-identity)
@ -87,7 +87,7 @@ setting of `org-html-htmlize-output-type' is 'css."
(quote-block . org-org-identity) (quote-block . org-org-identity)
(quote-section . org-org-identity) (quote-section . org-org-identity)
(radio-target . org-org-identity) (radio-target . org-org-identity)
(section . org-org-identity) (section . org-org-section)
(special-block . org-org-identity) (special-block . org-org-identity)
(src-block . org-org-identity) (src-block . org-org-identity)
(statistics-cookie . org-org-identity) (statistics-cookie . org-org-identity)
@ -122,15 +122,16 @@ CONTENTS is its contents, as a string or nil. INFO is ignored."
(defun org-org-headline (headline contents info) (defun org-org-headline (headline contents info)
"Transcode HEADLINE element back into Org syntax. "Transcode HEADLINE element back into Org syntax.
CONTENTS is its contents, as a string or nil. INFO is ignored." CONTENTS is its contents, as a string or nil. INFO is ignored."
(unless (plist-get info :with-todo-keywords) (unless (org-element-property :footnote-section-p headline)
(org-element-put-property headline :todo-keyword nil)) (unless (plist-get info :with-todo-keywords)
(unless (plist-get info :with-tags) (org-element-put-property headline :todo-keyword nil))
(org-element-put-property headline :tags nil)) (unless (plist-get info :with-tags)
(unless (plist-get info :with-priority) (org-element-put-property headline :tags nil))
(org-element-put-property headline :priority nil)) (unless (plist-get info :with-priority)
(org-element-put-property headline :level (org-element-put-property headline :priority nil))
(org-export-get-relative-level headline info)) (org-element-put-property headline :level
(org-element-headline-interpreter headline contents)) (org-export-get-relative-level headline info))
(org-element-headline-interpreter headline contents)))
(defun org-org-keyword (keyword contents info) (defun org-org-keyword (keyword contents info)
"Transcode KEYWORD element back into Org syntax. "Transcode KEYWORD element back into Org syntax.
@ -144,6 +145,33 @@ keywords targeted at other export back-ends."
org-element-block-name-alist)) org-element-block-name-alist))
(org-element-keyword-interpreter keyword nil))) (org-element-keyword-interpreter keyword nil)))
(defun org-org-section (section contents info)
"Transcode SECTION element back into Org syntax.
CONTENTS is the contents of the section. INFO is a plist used as
a communication channel."
(concat
(org-element-normalize-string contents)
;; Insert footnote definitions appearing for the first time in this
;; section. Indeed, some of them may not be available to narrowing
;; so we make sure all of them are included in the result.
(let ((footnotes-alist
(org-element-map section 'footnote-reference
(lambda (fn)
(and (eq (org-element-property :type fn) 'standard)
(org-export-footnote-first-reference-p fn info)
(cons (org-element-property :label fn)
(org-export-get-footnote-definition fn info))))
info)))
(and footnotes-alist
(concat "\n"
(mapconcat
(lambda (d)
(org-element-normalize-string
(concat (format "[%s] "(car d))
(org-export-data (cdr d) info))))
footnotes-alist "\n"))))
(make-string (or (org-element-property :post-blank section) 0) ?\n)))
;;;###autoload ;;;###autoload
(defun org-org-export-as-org (&optional async subtreep visible-only ext-plist) (defun org-org-export-as-org (&optional async subtreep visible-only ext-plist)
"Export current buffer to an Org buffer. "Export current buffer to an Org buffer.

View file

@ -805,9 +805,14 @@ Default for SITEMAP-FILENAME is 'sitemap.org'."
(visiting (find-buffer-visiting file)) (visiting (find-buffer-visiting file))
(buffer (or visiting (find-file-noselect file)))) (buffer (or visiting (find-file-noselect file))))
(with-current-buffer buffer (with-current-buffer buffer
(org-mode)
(let ((title (let ((title
(let ((property (plist-get (org-export-get-environment) :title))) (let ((property
(plist-get
;; protect local variables in open buffers
(if visiting
(org-export-with-buffer-copy (org-export-get-environment))
(org-export-get-environment))
:title)))
(if property (if property
(org-no-properties (org-element-interpret-data property)) (org-no-properties (org-element-interpret-data property))
(file-name-nondirectory (file-name-sans-extension file)))))) (file-name-nondirectory (file-name-sans-extension file))))))
@ -822,12 +827,14 @@ If FILE is an Org file and provides a DATE keyword use it. In
any other case use the file system's modification time. Return any other case use the file system's modification time. Return
time in `current-time' format." time in `current-time' format."
(if (file-directory-p file) (nth 5 (file-attributes file)) (if (file-directory-p file) (nth 5 (file-attributes file))
(let* ((visiting (find-buffer-visiting file)) (let* ((org-inhibit-startup t)
(visiting (find-buffer-visiting file))
(file-buf (or visiting (find-file-noselect file nil))) (file-buf (or visiting (find-file-noselect file nil)))
(date (plist-get (date (plist-get
(with-current-buffer file-buf (with-current-buffer file-buf
(let ((org-inhibit-startup t)) (org-mode)) (if visiting
(org-export-get-environment)) (org-export-with-buffer-copy (org-export-get-environment))
(org-export-get-environment)))
:date))) :date)))
(unless visiting (kill-buffer file-buf)) (unless visiting (kill-buffer file-buf))
;; DATE is either a timestamp object or a secondary string. If it ;; DATE is either a timestamp object or a secondary string. If it

File diff suppressed because it is too large Load diff

View file

@ -814,7 +814,7 @@ This variable can be either set to `buffer' or `subtree'."
(defcustom org-export-show-temporary-export-buffer t (defcustom org-export-show-temporary-export-buffer t
"Non-nil means show buffer after exporting to temp buffer. "Non-nil means show buffer after exporting to temp buffer.
When Org exports to a file, the buffer visiting that file is ever When Org exports to a file, the buffer visiting that file is never
shown, but remains buried. However, when exporting to shown, but remains buried. However, when exporting to
a temporary buffer, that buffer is popped up in a second window. a temporary buffer, that buffer is popped up in a second window.
When this variable is nil, the buffer remains buried also in When this variable is nil, the buffer remains buried also in
@ -1317,6 +1317,10 @@ The back-end could then be called with, for example:
;; - category :: tree ;; - category :: tree
;; - type :: list of elements and objects ;; - type :: list of elements and objects
;; ;;
;; + `:input-buffer' :: Name of input buffer.
;; - category :: option
;; - type :: string
;;
;; + `:input-file' :: Full path to input file, if any. ;; + `:input-file' :: Full path to input file, if any.
;; - category :: option ;; - category :: option
;; - type :: string or nil ;; - type :: string or nil
@ -1329,6 +1333,10 @@ The back-end could then be called with, for example:
;; - category :: option ;; - category :: option
;; - type :: string ;; - type :: string
;; ;;
;; + `:output-file' :: Full path to output file, if any.
;; - category :: option
;; - type :: string or nil
;;
;; + `:parse-tree' :: Whole parse tree, available at any time during ;; + `:parse-tree' :: Whole parse tree, available at any time during
;; transcoding. ;; transcoding.
;; - category :: option ;; - category :: option
@ -1765,17 +1773,19 @@ Assume buffer is in Org mode. Narrowing, if any, is ignored."
(when (stringp value) (when (stringp value)
(setq plist (setq plist
(plist-put plist property (plist-put plist property
(org-element-parse-secondary-string (or (org-element-parse-secondary-string
value (org-element-restriction 'keyword)))))))))) value (org-element-restriction 'keyword))
;; When TITLE keyword sets an empty
;; string, make sure it doesn't
;; appear as nil in the plist.
(and (eq property :title) ""))))))))))
(defun org-export--get-buffer-attributes () (defun org-export--get-buffer-attributes ()
"Return properties related to buffer attributes, as a plist." "Return properties related to buffer attributes, as a plist."
;; Store full path of input file name, or nil. For internal use. ;; Store full path of input file name, or nil. For internal use.
(let ((visited-file (buffer-file-name (buffer-base-buffer)))) (let ((visited-file (buffer-file-name (buffer-base-buffer))))
(list :input-file visited-file (list :input-file visited-file
:title (if (not visited-file) (buffer-name (buffer-base-buffer)) :input-buffer (buffer-name (buffer-base-buffer)))))
(file-name-sans-extension
(file-name-nondirectory visited-file))))))
(defun org-export--get-global-options (&optional backend) (defun org-export--get-global-options (&optional backend)
"Return global export options as a plist. "Return global export options as a plist.
@ -1788,23 +1798,22 @@ process."
(all (append (and backend (org-export-get-all-options backend)) (all (append (and backend (org-export-get-all-options backend))
org-export-options-alist))) org-export-options-alist)))
(dolist (cell all plist) (dolist (cell all plist)
(let ((prop (car cell)) (let ((prop (car cell)))
(default-value (nth 3 cell))) (unless (plist-member plist prop)
(unless (or (not default-value) (plist-member plist prop))
(setq plist (setq plist
(plist-put (plist-put
plist plist
prop prop
;; Eval default value provided. If keyword is ;; Evaluate default value provided. If keyword is
;; a member of `org-element-document-properties', ;; a member of `org-element-document-properties',
;; parse it as a secondary string before storing it. ;; parse it as a secondary string before storing it.
(let ((value (eval (nth 3 cell)))) (let ((value (eval (nth 3 cell))))
(if (not (stringp value)) value (if (and (stringp value)
(let ((keyword (nth 1 cell))) (member (nth 1 cell)
(if (member keyword org-element-document-properties) org-element-document-properties))
(org-element-parse-secondary-string (org-element-parse-secondary-string
value (org-element-restriction 'keyword)) value (org-element-restriction 'keyword))
value))))))))))) value)))))))))
(defun org-export--list-bound-variables () (defun org-export--list-bound-variables ()
"Return variables bound from BIND keywords in current buffer. "Return variables bound from BIND keywords in current buffer.
@ -1843,6 +1852,13 @@ an alist where associations are (VARIABLE-NAME VALUE)."
;; Return value in appropriate order of appearance. ;; Return value in appropriate order of appearance.
(nreverse (funcall collect-bind nil nil))))) (nreverse (funcall collect-bind nil nil)))))
;; defsubst org-export-get-parent must be defined before first use,
;; was originally defined in the topology section
(defsubst org-export-get-parent (blob)
"Return BLOB parent or nil.
BLOB is the element or object considered."
(org-element-property :parent blob))
;;;; Tree Properties ;;;; Tree Properties
;; ;;
@ -2146,9 +2162,8 @@ INFO is a plist containing export directives."
DATA is a parse tree, an element or an object or a secondary DATA is a parse tree, an element or an object or a secondary
string. INFO is a plist holding export options. string. INFO is a plist holding export options.
Return transcoded string." Return a string."
(let ((memo (gethash data (plist-get info :exported-data) 'no-memo))) (or (gethash data (plist-get info :exported-data))
(if (not (eq memo 'no-memo)) memo
(let* ((type (org-element-type data)) (let* ((type (org-element-type data))
(results (results
(cond (cond
@ -2174,9 +2189,9 @@ Return transcoded string."
;; Secondary string. ;; Secondary string.
((not type) ((not type)
(mapconcat (lambda (obj) (org-export-data obj info)) data "")) (mapconcat (lambda (obj) (org-export-data obj info)) data ""))
;; Element/Object without contents or, as a special case, ;; Element/Object without contents or, as a special
;; headline with archive tag and archived trees restricted ;; case, headline with archive tag and archived trees
;; to title only. ;; restricted to title only.
((or (not (org-element-contents data)) ((or (not (org-element-contents data))
(and (eq type 'headline) (and (eq type 'headline)
(eq (plist-get info :with-archived-trees) 'headline) (eq (plist-get info :with-archived-trees) 'headline)
@ -2201,16 +2216,16 @@ Return transcoded string."
(lambda (element) (org-export-data element info)) (lambda (element) (org-export-data element info))
(org-element-contents (org-element-contents
(if (or greaterp objectp) data (if (or greaterp objectp) data
;; Elements directly containing objects ;; Elements directly containing
;; must have their indentation normalized ;; objects must have their indentation
;; first. ;; normalized first.
(org-element-normalize-contents (org-element-normalize-contents
data data
;; When normalizing contents of the first ;; When normalizing contents of the
;; paragraph in an item or a footnote ;; first paragraph in an item or
;; definition, ignore first line's ;; a footnote definition, ignore
;; indentation: there is none and it ;; first line's indentation: there is
;; might be misleading. ;; none and it might be misleading.
(when (eq type 'paragraph) (when (eq type 'paragraph)
(let ((parent (org-export-get-parent data))) (let ((parent (org-export-get-parent data)))
(and (and
@ -2227,10 +2242,10 @@ Return transcoded string."
(puthash (puthash
data data
(cond (cond
((not results) nil) ((not results) "")
((memq type '(org-data plain-text nil)) results) ((memq type '(org-data plain-text nil)) results)
;; Append the same white space between elements or objects as in ;; Append the same white space between elements or objects
;; the original buffer, and call appropriate filters. ;; as in the original buffer, and call appropriate filters.
(t (t
(let ((results (let ((results
(org-export-filter-apply-functions (org-export-filter-apply-functions
@ -2240,10 +2255,10 @@ Return transcoded string."
(if (memq type org-element-all-elements) (if (memq type org-element-all-elements)
(concat (org-element-normalize-string results) (concat (org-element-normalize-string results)
(make-string post-blank ?\n)) (make-string post-blank ?\n))
(concat results (make-string post-blank ? )))) (concat results (make-string post-blank ?\s))))
info))) info)))
results))) results)))
(plist-get info :exported-data)))))) (plist-get info :exported-data)))))
(defun org-export-data-with-backend (data backend info) (defun org-export-data-with-backend (data backend info)
"Convert DATA into BACKEND format. "Convert DATA into BACKEND format.
@ -3011,6 +3026,14 @@ Return code as a string."
(org-export-install-filters (org-export-install-filters
(org-combine-plists (org-combine-plists
info (org-export-get-environment backend subtreep ext-plist)))) info (org-export-get-environment backend subtreep ext-plist))))
;; Special case: provide original file name or buffer name as
;; default value for :title property.
(unless (plist-get info :title)
(plist-put
info :title
(let ((file (plist-get info :input-file)))
(if file (file-name-sans-extension (file-name-nondirectory file))
(plist-get info :input-buffer)))))
;; Expand export-specific set of macros: {{{author}}}, ;; Expand export-specific set of macros: {{{author}}},
;; {{{date}}}, {{{email}}} and {{{title}}}. It must be done ;; {{{date}}}, {{{email}}} and {{{title}}}. It must be done
;; once regular macros have been expanded, since document ;; once regular macros have been expanded, since document
@ -5106,11 +5129,7 @@ Return the new string."
;; `org-export-get-genealogy' returns the full genealogy of a given ;; `org-export-get-genealogy' returns the full genealogy of a given
;; element or object, from closest parent to full parse tree. ;; element or object, from closest parent to full parse tree.
(defsubst org-export-get-parent (blob) ;; defsubst org-export-get-parent must be defined before first use
"Return BLOB parent or nil.
BLOB is the element or object considered."
(org-element-property :parent blob))
(defun org-export-get-genealogy (blob) (defun org-export-get-genealogy (blob)
"Return full genealogy relative to a given element or object. "Return full genealogy relative to a given element or object.
@ -5638,7 +5657,8 @@ The function returns either a file name returned by POST-PROCESS,
or FILE." or FILE."
(declare (indent 2)) (declare (indent 2))
(if (not (file-writable-p file)) (error "Output file not writable") (if (not (file-writable-p file)) (error "Output file not writable")
(let ((encoding (or org-export-coding-system buffer-file-coding-system))) (let ((ext-plist (org-combine-plists `(:output-file ,file) ext-plist))
(encoding (or org-export-coding-system buffer-file-coding-system)))
(if async (if async
(org-export-async-start (org-export-async-start
`(lambda (file) `(lambda (file)