Update to Org version 7.8.07 (commit da0e6f in Org's repo)
This commit is contained in:
parent
42ee526b1a
commit
153ae947f8
51 changed files with 3468 additions and 1276 deletions
|
@ -1,3 +1,115 @@
|
|||
2012-04-01 Jambunathan K <kjambunathan@gmail.com>
|
||||
|
||||
* org.texi (Customizing tables in ODT export): Correct few errors.
|
||||
|
||||
2012-04-01 Jambunathan K <kjambunathan@gmail.com>
|
||||
|
||||
* org.texi (Links in ODT export): Update.
|
||||
(Labels and captions in ODT export): New node.
|
||||
|
||||
2012-04-01 Jambunathan K <kjambunathan@gmail.com>
|
||||
|
||||
* org.texi (Literal examples in ODT export): htmlfontify.el in
|
||||
Emacs-24.1 now supports fontification. So ODT source blocks will
|
||||
be fontified by default.
|
||||
|
||||
2012-04-01 Julian Gehring <julian.gehring@googlemail.com> (tiny change)
|
||||
|
||||
* org.texi (Refiling notes): Remove duplicated keybinding.
|
||||
|
||||
2012-04-01 Eric Schulte <eric.schulte@gmx.com>
|
||||
|
||||
* org.texi (noweb): Documentation of this new option to the :noweb
|
||||
header argument.
|
||||
|
||||
2012-04-01 Suvayu Ali <fatkasuvayu+linux@gmail.com>
|
||||
|
||||
* org.texi (Header and sectioning): Add example demonstrating how
|
||||
to use "LaTeX_CLASS_OPTIONS".
|
||||
|
||||
2012-04-01 Eric Schulte <eric.schulte@gmx.com>
|
||||
|
||||
* org.texi (Noweb reference syntax): Describe the ability to
|
||||
execute noweb references in the manual.
|
||||
|
||||
2012-04-01 Eric Schulte <eric.schulte@gmx.com>
|
||||
|
||||
* org.texi (cache): Improve cache documentation when session
|
||||
evaluation is used.
|
||||
|
||||
2012-04-01 Nicolas Goaziou <n.goaziou@gmail.com>
|
||||
|
||||
* org.texi (Plain lists): Document removal.
|
||||
|
||||
2012-04-01 Michael Brand <michael.ch.brand@gmail.com>
|
||||
|
||||
* org.texi: Decapitalize file name in references to Calc manual.
|
||||
|
||||
2012-04-01 Nicolas Goaziou <n.goaziou@gmail.com>
|
||||
|
||||
* org.texi (Plain lists): Document removal.
|
||||
|
||||
2012-04-01 Jambunathan K <kjambunathan@gmail.com>
|
||||
|
||||
* org.texi (Top, OpenDocument Text export)
|
||||
(ODT export commands, Extending ODT export)
|
||||
(Images in ODT export, Tables in ODT export)
|
||||
(Configuring a document converter): Add or Update.
|
||||
|
||||
2012-04-01 Carsten Dominik <carsten.dominik@gmail.com>
|
||||
|
||||
* org.texi (MobileOrg): Change the wording to reflect that the
|
||||
Android Version is no longer just the little brother of the iOS
|
||||
version.
|
||||
|
||||
2012-04-01 Eric Schulte <eric.schulte@gmx.com>
|
||||
|
||||
* org.texi (Key bindings and useful functions): Updated babel key
|
||||
binding documentation in manual.
|
||||
|
||||
2012-04-01 Eric Schulte <eric.schulte@gmx.com>
|
||||
|
||||
* org.texi (noweb): Document new noweb header value.
|
||||
|
||||
2012-04-01 Eric Schulte <eric.schulte@gmx.com>
|
||||
|
||||
* org.texi (noweb-sep): Document new header argument.
|
||||
|
||||
2012-04-01 Eric Schulte <eric.schulte@gmx.com>
|
||||
|
||||
* org.texi (noweb-ref): Documentation of this new custom variable.
|
||||
|
||||
2012-04-01 Eric Schulte <eric.schulte@gmx.com>
|
||||
|
||||
* org.texi (wrap): Update the new :wrap documentation to match the
|
||||
current implementation.
|
||||
|
||||
2012-04-01 Thomas Dye <dk@poto.myhome.westell.com>
|
||||
|
||||
* org.texi: Added documentation for :wrap.
|
||||
|
||||
2012-04-01 Thomas Dye <dk@poto.myhome.westell.com>
|
||||
|
||||
* org.texi: #+RESULTS now user-configurable.
|
||||
|
||||
2012-04-01 Thomas Dye <dk@poto.myhome.westell.com>
|
||||
|
||||
* org.texi: Documented :noweb no-export.
|
||||
|
||||
2012-04-01 Thomas Dye <dk@poto.local>
|
||||
|
||||
* org.texi: Edit :noweb no header argument for correctness.
|
||||
|
||||
2012-04-01 Bastien Guerry <bzg@altern.org>
|
||||
|
||||
* org.texi (Customization): Update the approximate number of Org
|
||||
variables.
|
||||
|
||||
2012-04-01 Thomas Dye <dk@poto.local>
|
||||
|
||||
* org.texi: The :results wrap produces a drawer instead of a
|
||||
begin_results block.
|
||||
|
||||
2012-03-22 Peder O. Klingenberg <peder@klingenberg.no> (tiny change)
|
||||
|
||||
* gnus.texi (Archived Messages): Update `gnus-message-archive-group' to
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
@setfilename ../../info/org
|
||||
@settitle The Org Manual
|
||||
|
||||
@set VERSION 7.8.03
|
||||
@set DATE January 2012
|
||||
@set VERSION 7.8.07
|
||||
@set DATE March 2012
|
||||
|
||||
@c Use proper quote and backtick for code sections in PDF output
|
||||
@c Cf. Texinfo manual 14.2
|
||||
|
@ -265,7 +265,7 @@
|
|||
@copying
|
||||
This manual is for Org version @value{VERSION}.
|
||||
|
||||
Copyright @copyright{} 2004-2012 Free Software Foundation, Inc.
|
||||
Copyright @copyright{} 2004-2011 Free Software Foundation, Inc.
|
||||
|
||||
@quotation
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
|
@ -612,27 +612,29 @@ DocBook export
|
|||
|
||||
OpenDocument Text export
|
||||
|
||||
* Pre-requisites for @acronym{ODT} export:: What packages @acronym{ODT} exporter relies on
|
||||
* @acronym{ODT} export commands:: How to invoke @acronym{ODT} export
|
||||
* Pre-requisites for ODT export:: What packages ODT exporter relies on
|
||||
* ODT export commands:: How to invoke ODT export
|
||||
* Extending ODT export:: How to produce @samp{doc}, @samp{pdf} files
|
||||
* Applying custom styles:: How to apply custom styles to the output
|
||||
* Links in @acronym{ODT} export:: How links will be interpreted and formatted
|
||||
* Tables in @acronym{ODT} export:: How Tables are exported
|
||||
* Images in @acronym{ODT} export:: How to insert images
|
||||
* Math formatting in @acronym{ODT} export:: How @LaTeX{} fragments are formatted
|
||||
* Literal examples in @acronym{ODT} export:: How source and example blocks are formatted
|
||||
* Advanced topics in @acronym{ODT} export:: Read this if you are a power user
|
||||
* Links in ODT export:: How links will be interpreted and formatted
|
||||
* Tables in ODT export:: How Tables are exported
|
||||
* Images in ODT export:: How to insert images
|
||||
* Math formatting in ODT export:: How @LaTeX{} fragments are formatted
|
||||
* Labels and captions in ODT export:: How captions are rendered
|
||||
* Literal examples in ODT export:: How source and example blocks are formatted
|
||||
* Advanced topics in ODT export:: Read this if you are a power user
|
||||
|
||||
Math formatting in @acronym{ODT} export
|
||||
Math formatting in ODT export
|
||||
|
||||
* Working with @LaTeX{} math snippets:: How to embed @LaTeX{} math fragments
|
||||
* Working with MathML or OpenDocument formula files:: How to embed equations in native format
|
||||
|
||||
Advanced topics in @acronym{ODT} export
|
||||
Advanced topics in ODT export
|
||||
|
||||
* Exporting and converting to other formats:: How to produce @samp{pdf} and other formats
|
||||
* Configuring a document converter:: How to register a document converter
|
||||
* Working with OpenDocument style files:: Explore the internals
|
||||
* Creating one-off styles:: How to produce custom highlighting etc
|
||||
* Customizing tables in @acronym{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
|
||||
|
||||
Publishing
|
||||
|
@ -708,6 +710,7 @@ Specific header arguments
|
|||
* session:: Preserve the state of code evaluation
|
||||
* noweb:: Toggle expansion of noweb references
|
||||
* noweb-ref:: Specify block's noweb reference resolution target
|
||||
* noweb-sep:: String used to separate noweb references
|
||||
* cache:: Avoid re-evaluating unchanged code blocks
|
||||
* sep:: Delimiter for writing tabular results outside Org
|
||||
* hlines:: Handle horizontal lines in tables
|
||||
|
@ -1004,7 +1007,7 @@ from within Emacs, please copy and paste the content into your Email program.
|
|||
|
||||
Sometimes you might face a problem due to an error in your Emacs or Org mode
|
||||
setup. Before reporting a bug, it is very helpful to start Emacs with minimal
|
||||
customizations and reproduce the problem. Doing so often helps you determine
|
||||
customisations and reproduce the problem. Doing so often helps you determine
|
||||
if the problem is with your customization or with Org mode itself. You can
|
||||
start a typical minimal session with a command like the example below.
|
||||
|
||||
|
@ -1435,8 +1438,7 @@ creation time, scheduled time, deadline time), by priority, by TODO keyword
|
|||
(in the sequence the keywords have been defined in the setup) or by the value
|
||||
of a property. Reverse sorting is possible as well. You can also supply
|
||||
your own function to extract the sorting key. With a @kbd{C-u} prefix,
|
||||
sorting will be case-sensitive. With two @kbd{C-u C-u} prefixes, duplicate
|
||||
entries will also be removed.
|
||||
sorting will be case-sensitive.
|
||||
@orgcmd{C-x n s,org-narrow-to-subtree}
|
||||
Narrow buffer to current subtree.
|
||||
@orgcmd{C-x n b,org-narrow-to-block}
|
||||
|
@ -1587,16 +1589,11 @@ line. In particular, if an ordered list reaches number @samp{10.}, then the
|
|||
list. An item ends before the next line that is less or equally indented
|
||||
than its bullet/number.
|
||||
|
||||
@vindex org-list-ending-method
|
||||
@vindex org-list-end-regexp
|
||||
@vindex org-empty-line-terminates-plain-lists
|
||||
Two methods@footnote{To disable either of them, configure
|
||||
@code{org-list-ending-method}.} are provided to terminate lists. A list ends
|
||||
whenever every item has ended, which means before any line less or equally
|
||||
indented than items at top level. It also ends before two blank
|
||||
A list ends whenever every item has ended, which means before any line less
|
||||
or equally indented than items at top level. It also ends before two blank
|
||||
lines@footnote{See also @code{org-empty-line-terminates-plain-lists}.}. In
|
||||
that case, all items are closed. For finer control, you can end lists with
|
||||
any pattern set in @code{org-list-end-regexp}. Here is an example:
|
||||
that case, all items are closed. Here is an example:
|
||||
|
||||
@example
|
||||
@group
|
||||
|
@ -1949,13 +1946,7 @@ item.
|
|||
|
||||
Org comes with a fast and intuitive table editor. Spreadsheet-like
|
||||
calculations are supported using the Emacs @file{calc} package
|
||||
@ifinfo
|
||||
(@pxref{Top,Calc,,Calc,Gnu Emacs Calculator Manual}).
|
||||
@end ifinfo
|
||||
@ifnotinfo
|
||||
(see the Emacs Calculator manual for more information about the Emacs
|
||||
calculator).
|
||||
@end ifnotinfo
|
||||
(@pxref{Top, Calc, , calc, Gnu Emacs Calculator Manual}).
|
||||
|
||||
@menu
|
||||
* Built-in table editor:: Simple tables
|
||||
|
@ -2253,7 +2244,8 @@ of columns, much like horizontal lines can do for groups of rows. In
|
|||
order to specify column groups, you can use a special row where the
|
||||
first field contains only @samp{/}. The further fields can either
|
||||
contain @samp{<} to indicate that this column should start a group,
|
||||
@samp{>} to indicate the end of a column, or @samp{<>} to make a column
|
||||
@samp{>} to indicate the end of a column, or @samp{<>} (no space between @samp{<}
|
||||
and @samp{>}) to make a column
|
||||
a group of its own. Boundaries between column groups will upon export be
|
||||
marked with vertical lines. Here is an example:
|
||||
|
||||
|
@ -2515,9 +2507,8 @@ A formula can be any algebraic expression understood by the Emacs
|
|||
non-standard convention that @samp{/} has lower precedence than
|
||||
@samp{*}, so that @samp{a/b*c} is interpreted as @samp{a/(b*c)}.} Before
|
||||
evaluation by @code{calc-eval} (@pxref{Calling Calc from
|
||||
Your Programs,calc-eval,Calling Calc from Your Lisp Programs,Calc,GNU
|
||||
Your Programs, calc-eval, Calling Calc from Your Lisp Programs, calc, GNU
|
||||
Emacs Calc Manual}),
|
||||
@c FIXME: The link to the Calc manual in HTML does not work.
|
||||
variable substitution takes place according to the rules described above.
|
||||
@cindex vectors, in table calculations
|
||||
The range vectors can be directly fed into the Calc vector functions
|
||||
|
@ -5407,10 +5398,11 @@ the settings. This has been the source of much confusion. Org mode users
|
|||
can resort to special versions of these functions like @code{org-date} or
|
||||
@code{org-anniversary}. These work just like the corresponding @code{diary-}
|
||||
functions, but with stable ISO order of arguments (year, month, day) wherever
|
||||
applicable, independent of the value of @code{calendar-date-style}.}. For example
|
||||
applicable, independent of the value of @code{calendar-date-style}.}. For
|
||||
example with optional time
|
||||
|
||||
@example
|
||||
* The nerd meeting on every 2nd Thursday of the month
|
||||
* 22:00-23:00 The nerd meeting on every 2nd Thursday of the month
|
||||
<%%(org-float t 4 2)>
|
||||
@end example
|
||||
|
||||
|
@ -6162,7 +6154,7 @@ applying it to another one.
|
|||
By customizing the variable @code{org-clock-idle-time} to some integer, such
|
||||
as 10 or 15, Emacs can alert you when you get back to your computer after
|
||||
being idle for that many minutes@footnote{On computers using Mac OS X,
|
||||
idleness is based on actual user idleness, not just Emacs's idle time. For
|
||||
idleness is based on actual user idleness, not just Emacs' idle time. For
|
||||
X11, you can install a utility program @file{x11idle.c}, available in the
|
||||
UTILITIES directory of the Org git distribution, to get the same general
|
||||
treatment of idleness. On other systems, idle time refers to Emacs idle time
|
||||
|
@ -6905,10 +6897,7 @@ Use the refile interface to jump to a heading.
|
|||
Jump to the location where @code{org-refile} last moved a tree to.
|
||||
@item C-2 C-c C-w
|
||||
Refile as the child of the item currently being clocked.
|
||||
@item C-0 C-c C-w @ @r{or} @ C-u C-u C-u C-c C-w
|
||||
|
||||
@orgcmdtkc{C-0 C-c C-w @ @r{or} @ C-u C-u C-u C-c C-w,C-0 C-c C-w,org-refile-cache-clear}
|
||||
|
||||
Clear the target cache. Caching of refile targets can be turned on by
|
||||
setting @code{org-refile-use-cache}. To make the command see new possible
|
||||
targets, you have to clear the cache with this command.
|
||||
|
@ -9548,7 +9537,7 @@ the web, while the XOXO format provides a solid base for exchange with a
|
|||
broad range of other applications. @LaTeX{} export lets you use Org mode and
|
||||
its structured editing functions to easily create @LaTeX{} files. DocBook
|
||||
export makes it possible to convert Org files to many other formats using
|
||||
DocBook tools. OpenDocument Text(@acronym{ODT}) export allows seamless
|
||||
DocBook tools. OpenDocument Text(ODT) export allows seamless
|
||||
collaboration across organizational boundaries. For project management you
|
||||
can create gantt and resource charts by using TaskJuggler export. To
|
||||
incorporate entries with associated times like deadlines or appointments into
|
||||
|
@ -10803,34 +10792,36 @@ special characters included in XHTML entities:
|
|||
@cindex org-modules
|
||||
|
||||
Orgmode@footnote{Versions 7.8 or later} supports export to OpenDocument Text
|
||||
(@acronym{ODT}) format using the @file{org-odt.el} module. Documents created
|
||||
(ODT) format using the @file{org-odt.el} module. Documents created
|
||||
by this exporter use the @cite{OpenDocument-v1.2
|
||||
specification}@footnote{@url{http://docs.oasis-open.org/office/v1.2/OpenDocument-v1.2.html,
|
||||
Open Document Format for Office Applications (OpenDocument) Version 1.2}} and
|
||||
are compatible with LibreOffice 3.4.
|
||||
|
||||
@menu
|
||||
* Pre-requisites for @acronym{ODT} export:: What packages @acronym{ODT} exporter relies on
|
||||
* @acronym{ODT} export commands:: How to invoke @acronym{ODT} export
|
||||
* Pre-requisites for ODT export:: What packages ODT exporter relies on
|
||||
* ODT export commands:: How to invoke ODT export
|
||||
* Extending ODT export:: How to produce @samp{doc}, @samp{pdf} files
|
||||
* Applying custom styles:: How to apply custom styles to the output
|
||||
* Links in @acronym{ODT} export:: How links will be interpreted and formatted
|
||||
* Tables in @acronym{ODT} export:: How Tables are exported
|
||||
* Images in @acronym{ODT} export:: How to insert images
|
||||
* Math formatting in @acronym{ODT} export:: How @LaTeX{} fragments are formatted
|
||||
* Literal examples in @acronym{ODT} export:: How source and example blocks are formatted
|
||||
* Advanced topics in @acronym{ODT} export:: Read this if you are a power user
|
||||
* Links in ODT export:: How links will be interpreted and formatted
|
||||
* Tables in ODT export:: How Tables are exported
|
||||
* Images in ODT export:: How to insert images
|
||||
* Math formatting in ODT export:: How @LaTeX{} fragments are formatted
|
||||
* Labels and captions in ODT export:: How captions are rendered
|
||||
* Literal examples in ODT export:: How source and example blocks are formatted
|
||||
* Advanced topics in ODT export:: Read this if you are a power user
|
||||
@end menu
|
||||
|
||||
@node Pre-requisites for @acronym{ODT} export, @acronym{ODT} export commands, OpenDocument Text export, OpenDocument Text export
|
||||
@subsection Pre-requisites for @acronym{ODT} export
|
||||
@node Pre-requisites for ODT export, ODT export commands, OpenDocument Text export, OpenDocument Text export
|
||||
@subsection Pre-requisites for ODT export
|
||||
@cindex zip
|
||||
The @acronym{ODT} exporter relies on the @file{zip} program to create the final
|
||||
The ODT exporter relies on the @file{zip} program to create the final
|
||||
output. Check the availability of this program before proceeding further.
|
||||
|
||||
@node @acronym{ODT} export commands, Applying custom styles, Pre-requisites for @acronym{ODT} export, OpenDocument Text export
|
||||
@subsection @acronym{ODT} export commands
|
||||
@node ODT export commands, Extending ODT export, Pre-requisites for ODT export, OpenDocument Text export
|
||||
@subsection ODT export commands
|
||||
|
||||
@subsubheading Exporting to @acronym{ODT}
|
||||
@subsubheading Exporting to ODT
|
||||
@anchor{x-export-to-odt}
|
||||
|
||||
@cindex region, active
|
||||
|
@ -10841,12 +10832,13 @@ output. Check the availability of this program before proceeding further.
|
|||
@cindex property EXPORT_FILE_NAME
|
||||
|
||||
Export as OpenDocument Text file.
|
||||
|
||||
@vindex org-export-odt-preferred-output-format
|
||||
If @code{org-export-odt-preferred-output-format} is specified, automatically
|
||||
convert the exported file to that format.
|
||||
@xref{x-export-to-other-formats,,Automatically exporting to other formats}.
|
||||
convert the exported file to that format. @xref{x-export-to-other-formats, ,
|
||||
Automatically exporting to other formats}.
|
||||
|
||||
For an Org file @file{myfile.org}, the @acronym{ODT} file will be
|
||||
For an Org file @file{myfile.org}, the ODT file will be
|
||||
@file{myfile.odt}. The file will be overwritten without warning. If there
|
||||
is an active region,@footnote{This requires @code{transient-mark-mode} to be
|
||||
turned on} only the region will be exported. If the selected region is a
|
||||
|
@ -10857,30 +10849,66 @@ export.
|
|||
|
||||
@orgcmd{C-c C-e O,org-export-as-odt-and-open}
|
||||
Export as OpenDocument Text file and open the resulting file.
|
||||
|
||||
@vindex org-export-odt-preferred-output-format
|
||||
If @code{org-export-odt-preferred-output-format} is specified, open the
|
||||
converted file instead.
|
||||
@xref{x-export-to-other-formats,,Automatically exporting to other formats}.
|
||||
converted file instead. @xref{x-export-to-other-formats, , Automatically
|
||||
exporting to other formats}.
|
||||
@end table
|
||||
|
||||
@subsubheading Automatically exporting to other formats
|
||||
@node Extending ODT export, Applying custom styles, ODT export commands, OpenDocument Text export
|
||||
@subsection Extending ODT export
|
||||
|
||||
The ODT exporter can interface with a variety of document
|
||||
converters and supports popular converters out of the box. As a result, you
|
||||
can use it to export to formats like @samp{doc} or convert a document from
|
||||
one format (say @samp{csv}) to another format (say @samp{ods} or @samp{xls}).
|
||||
|
||||
@cindex @file{unoconv}
|
||||
@cindex LibreOffice
|
||||
If you have a working installation of LibreOffice, a document converter is
|
||||
pre-configured for you and you can use it right away. If you would like to
|
||||
use @file{unoconv} as your preferred converter, customize the variable
|
||||
@code{org-export-odt-convert-process} to point to @code{unoconv}. If you
|
||||
would like to use a converter of your own choosing or tweak the default
|
||||
settings of the default @file{LibreOffice} and @samp{unoconv} converters
|
||||
@xref{Configuring a document converter}.
|
||||
|
||||
@subsubsection Automatically exporting to other formats
|
||||
@anchor{x-export-to-other-formats}
|
||||
|
||||
@vindex org-export-odt-preferred-output-format
|
||||
Very often, you will find yourself exporting to @acronym{ODT} format, only to
|
||||
immediately save the exported document to a different format like @samp{pdf}.
|
||||
In such cases, you will find it convenient to configure a converter
|
||||
(@pxref{Exporting and converting to other formats}) and specify your
|
||||
Very often, you will find yourself exporting to ODT format, only to
|
||||
immediately save the exported document to other formats like @samp{doc},
|
||||
@samp{docx}, @samp{rtf}, @samp{pdf} etc. In such cases, you can specify your
|
||||
preferred output format by customizing the variable
|
||||
@code{org-export-odt-preferred-output-format}. This way, the export commands
|
||||
(@pxref{x-export-to-odt,,Exporting to ODT}) can be extended to also export to
|
||||
the preferred format.
|
||||
(@pxref{x-export-to-odt,,Exporting to ODT}) can be extended to export to a
|
||||
format that is of immediate interest to you.
|
||||
|
||||
@node Applying custom styles, Links in @acronym{ODT} export, @acronym{ODT} export commands, OpenDocument Text export
|
||||
@subsubsection Converting between document formats
|
||||
@anchor{x-convert-to-other-formats}
|
||||
|
||||
There are many document converters in the wild which support conversion to
|
||||
and from various file formats, including, but not limited to the
|
||||
ODT format. LibreOffice converter, mentioned above, is one such
|
||||
converter. Once a converter is configured, you can interact with it using
|
||||
the following command.
|
||||
|
||||
@vindex org-export-odt-convert
|
||||
@table @kbd
|
||||
|
||||
@item M-x org-export-odt-convert
|
||||
Convert an existing document from one format to another. With a prefix
|
||||
argument, also open the newly produced file.
|
||||
@end table
|
||||
|
||||
@node Applying custom styles, Links in ODT export, Extending ODT export, OpenDocument Text export
|
||||
@subsection Applying custom styles
|
||||
@cindex styles, custom
|
||||
@cindex template, custom
|
||||
|
||||
The @acronym{ODT} exporter ships with a set of OpenDocument styles
|
||||
The ODT exporter ships with a set of OpenDocument styles
|
||||
(@pxref{Working with OpenDocument style files}) that ensure a well-formatted
|
||||
output. These factory styles, however, may not cater to your specific
|
||||
tastes. To customize the output, you can either modify the above styles
|
||||
|
@ -10893,7 +10921,7 @@ users alike, and is described here.
|
|||
@enumerate
|
||||
@item
|
||||
Create a sample @file{example.org} file with the below settings and export it
|
||||
to @acronym{ODT} format.
|
||||
to ODT format.
|
||||
|
||||
@example
|
||||
#+OPTIONS: H:10 num:t
|
||||
|
@ -10936,15 +10964,22 @@ met, the output is going to be less than satisfactory. So it is highly
|
|||
recommended that you only work with templates that are directly derived from
|
||||
the factory settings.
|
||||
|
||||
@node Links in @acronym{ODT} export, Tables in @acronym{ODT} export, Applying custom styles, OpenDocument Text export
|
||||
@subsection Links in @acronym{ODT} export
|
||||
@node Links in ODT export, Tables in ODT export, Applying custom styles, OpenDocument Text export
|
||||
@subsection Links in ODT export
|
||||
@cindex tables, in DocBook export
|
||||
|
||||
The @acronym{ODT} exporter creates cross-references (aka bookmarks) for
|
||||
internal links. It creates Internet-style links for all other links.
|
||||
ODT exporter creates native cross-references for internal links. It creates
|
||||
Internet-style links for all other links.
|
||||
|
||||
@node Tables in @acronym{ODT} export, Images in @acronym{ODT} export, Links in @acronym{ODT} export, OpenDocument Text export
|
||||
@subsection Tables in @acronym{ODT} export
|
||||
A link with no description and destined to a regular (un-itemized) outline
|
||||
heading is replaced with a cross-reference and section number of the heading.
|
||||
|
||||
A @samp{\ref@{label@}}-style reference to an image, table etc. is replaced
|
||||
with a cross-reference and sequence number of the labelled entity.
|
||||
@xref{Labels and captions in ODT export}.
|
||||
|
||||
@node Tables in ODT export, Images in ODT export, Links in ODT export, OpenDocument Text export
|
||||
@subsection Tables in ODT export
|
||||
@cindex tables, in DocBook export
|
||||
|
||||
Export of native Org mode tables (@pxref{Tables}) and simple @file{table.el}
|
||||
|
@ -10952,21 +10987,47 @@ tables is supported. However, export of complex @file{table.el} tables -
|
|||
tables that have column or row spans - is not supported. Such tables are
|
||||
stripped from the exported document.
|
||||
|
||||
By default, a table is exported with top and bottom frames and with
|
||||
rules separating row and column groups (@pxref{Column groups}). If the table
|
||||
specifies alignment and relative width for its columns (@pxref{Column width
|
||||
and alignment}) then these are honored on export.@footnote{The column widths
|
||||
are interpreted as weighted ratios with the default weight being 1}
|
||||
By default, a table is exported with top and bottom frames and with rules
|
||||
separating row and column groups (@pxref{Column groups}). Furthermore, all
|
||||
tables are typeset to occupy the same width. If the table specifies
|
||||
alignment and relative width for its columns (@pxref{Column width and
|
||||
alignment}) then these are honored on export.@footnote{The column widths are
|
||||
interpreted as weighted ratios with the default weight being 1}
|
||||
|
||||
@cindex #+ATTR_ODT
|
||||
If you are not satisfied with the default formatting of tables, you can
|
||||
create custom table styles and associate them with a table using
|
||||
the @code{#+ATTR_ODT} line. @xref{Customizing tables in @acronym{ODT} export}.
|
||||
You can control the width of the table by specifying @code{:rel-width}
|
||||
property using an @code{#+ATTR_ODT} line.
|
||||
|
||||
@node Images in @acronym{ODT} export, Math formatting in @acronym{ODT} export, Tables in @acronym{ODT} export, OpenDocument Text export
|
||||
@subsection Images in @acronym{ODT} export
|
||||
@cindex images, embedding in @acronym{ODT}
|
||||
@cindex embedding images in @acronym{ODT}
|
||||
For example, consider the following table which makes use of all the rules
|
||||
mentoned above.
|
||||
|
||||
@example
|
||||
#+ATTR_ODT: :rel-width 50
|
||||
| Area/Month | Jan | Feb | Mar | Sum |
|
||||
|---------------+-------+-------+-------+-------|
|
||||
| / | < | | | < |
|
||||
| <l13> | <r5> | <r5> | <r5> | <r6> |
|
||||
| North America | 1 | 21 | 926 | 948 |
|
||||
| Middle East | 6 | 75 | 844 | 925 |
|
||||
| Asia Pacific | 9 | 27 | 790 | 826 |
|
||||
|---------------+-------+-------+-------+-------|
|
||||
| Sum | 16 | 123 | 2560 | 2699 |
|
||||
@end example
|
||||
|
||||
On export, the table will occupy 50% of text area. The columns will be sized
|
||||
(roughly) in the ratio of 13:5:5:5:6. The first column will be left-aligned
|
||||
and rest of the columns will be right-aligned. There will be vertical rules
|
||||
after separating the header and last columns from other columns. There will
|
||||
be horizontal rules separating the header and last rows from other rows.
|
||||
|
||||
If you are not satisfied with the above formatting options, you can create
|
||||
custom table styles and associate them with a table using the
|
||||
@code{#+ATTR_ODT} line. @xref{Customizing tables in ODT export}.
|
||||
|
||||
@node Images in ODT export, Math formatting in ODT export, Tables in ODT export, OpenDocument Text export
|
||||
@subsection Images in ODT export
|
||||
@cindex images, embedding in ODT
|
||||
@cindex embedding images in ODT
|
||||
|
||||
@subsubheading Embedding images
|
||||
You can embed images within the exported document by providing a link to the
|
||||
|
@ -10993,14 +11054,21 @@ link to an image file. For example, to embed a image
|
|||
|
||||
@subsubheading Sizing and scaling of embedded images
|
||||
|
||||
@cindex #+ATTR_ODT
|
||||
You can control the size and scale of the embedded images using the
|
||||
@code{#+ATTR_ODT} attribute.
|
||||
|
||||
@cindex identify, ImageMagick
|
||||
@vindex org-export-odt-pixels-per-inch
|
||||
Note that the exporter specifies the desired size of the image in the final
|
||||
document in units of centimeters. In order to scale the embedded images, the
|
||||
exporter needs to compute the size of the image. This is done by retrieving
|
||||
the image size in pixels and converting the pixel units to centimeters using
|
||||
The exporter specifies the desired size of the image in the final document in
|
||||
units of centimeters. In order to scale the embedded images, the exporter
|
||||
queries for pixel dimensions of the images using one of a) ImageMagick's
|
||||
@file{identify} program or b) Emacs `create-image' and `image-size'
|
||||
APIs.@footnote{Use of @file{ImageMagick} is only desirable. However, if you
|
||||
routinely produce documents that have large images or you export your Org
|
||||
files that has images using a Emacs batch script, then the use of
|
||||
@file{ImageMagick} is mandatory.} The pixel dimensions are subsequently
|
||||
converted in to units of centimeters using
|
||||
@code{org-export-odt-pixels-per-inch}. The default value of this variable is
|
||||
set to @code{display-pixels-per-inch}. You can tweak this variable to
|
||||
achieve the best results.
|
||||
|
@ -11008,7 +11076,6 @@ achieve the best results.
|
|||
The examples below illustrate the various possibilities.
|
||||
|
||||
@table @asis
|
||||
|
||||
@item Explicitly size the image
|
||||
To embed @file{img.png} as a 10 cm x 10 cm image, do the following:
|
||||
|
||||
|
@ -11044,17 +11111,31 @@ height:width ratio, do the following
|
|||
@end example
|
||||
@end table
|
||||
|
||||
@node Math formatting in @acronym{ODT} export, Literal examples in @acronym{ODT} export, Images in @acronym{ODT} export, OpenDocument Text export
|
||||
@subsection Math formatting in @acronym{ODT} export
|
||||
@subsubheading Anchoring of images
|
||||
|
||||
The @acronym{ODT} exporter has special support for handling math.
|
||||
@cindex #+ATTR_ODT
|
||||
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
|
||||
of the the following three values for the @code{:anchor} property -
|
||||
@samp{"as-char"}, @samp{"paragraph"} and @samp{"page"}.
|
||||
|
||||
To create an image that is anchored to a page, do the following:
|
||||
@example
|
||||
#+ATTR_ODT: :anchor "page"
|
||||
[[./img.png]]
|
||||
@end example
|
||||
|
||||
@node Math formatting in ODT export, Labels and captions in ODT export, Images in ODT export, OpenDocument Text export
|
||||
@subsection Math formatting in ODT export
|
||||
|
||||
The ODT exporter has special support for handling math.
|
||||
|
||||
@menu
|
||||
* Working with @LaTeX{} math snippets:: How to embed @LaTeX{} math fragments
|
||||
* Working with MathML or OpenDocument formula files:: How to embed equations in native format
|
||||
@end menu
|
||||
|
||||
@node Working with @LaTeX{} math snippets, Working with MathML or OpenDocument formula files, Math formatting in @acronym{ODT} export, Math formatting in @acronym{ODT} export
|
||||
@node Working with @LaTeX{} math snippets, Working with MathML or OpenDocument formula files, Math formatting in ODT export, Math formatting in ODT export
|
||||
@subsubsection Working with @LaTeX{} math snippets
|
||||
|
||||
@LaTeX{} math snippets (@pxref{@LaTeX{} fragments}) can be embedded in the ODT
|
||||
|
@ -11120,11 +11201,11 @@ resulting images are embedded in the exported document. This method requires
|
|||
that the @file{dvipng} program be available on your system.
|
||||
@end enumerate
|
||||
|
||||
@node Working with MathML or OpenDocument formula files, , Working with @LaTeX{} math snippets, Math formatting in @acronym{ODT} export
|
||||
@node Working with MathML or OpenDocument formula files, , Working with @LaTeX{} math snippets, Math formatting in ODT export
|
||||
@subsubsection Working with MathML or OpenDocument formula files
|
||||
|
||||
For various reasons, you may find embedding @LaTeX{} math snippets in an
|
||||
@acronym{ODT} document less than reliable. In that case, you can embed a
|
||||
ODT document less than reliable. In that case, you can embed a
|
||||
math equation by linking to its MathML(@file{.mml}) source or its
|
||||
OpenDocument formula (@file{.odf}) file as shown below:
|
||||
|
||||
|
@ -11138,102 +11219,95 @@ or
|
|||
[[./equation.odf]]
|
||||
@end example
|
||||
|
||||
@node Literal examples in @acronym{ODT} export, Advanced topics in @acronym{ODT} export, Math formatting in @acronym{ODT} export, OpenDocument Text export
|
||||
@subsection Literal examples in @acronym{ODT} export
|
||||
@node Labels and captions in ODT export, Literal examples in ODT export, Math formatting in ODT export, OpenDocument Text export
|
||||
@subsection Labels and captions in ODT export
|
||||
|
||||
You can label and caption various category of objects - an inline image, a
|
||||
table, a @LaTeX{} fragment or a Math formula - using @code{#+LABEL} and
|
||||
@code{#+CAPTION} lines. @xref{Images and tables}. ODT exporter enumerates
|
||||
each labelled or captioned object of a given category separately. As a
|
||||
result, each such object is assigned a sequence number based on order of it's
|
||||
appearance in the Org file.
|
||||
|
||||
In the exported document, a user-provided caption is augmented with the
|
||||
category and sequence number. Consider the following inline image in an Org
|
||||
file.
|
||||
|
||||
@example
|
||||
#+CAPTION: Bell curve
|
||||
#+LABEL: fig:SED-HR4049
|
||||
[[./img/a.png]]
|
||||
@end example
|
||||
|
||||
It could be rendered as shown below in the exported document.
|
||||
|
||||
@example
|
||||
Figure 2: Bell curve
|
||||
@end example
|
||||
|
||||
@vindex org-export-odt-category-strings
|
||||
You can modify the category component of the caption by customizing the
|
||||
variable @code{org-export-odt-category-strings}. For example, to tag all
|
||||
embedded images with the string @samp{Illustration} (instead of the default
|
||||
@samp{Figure}) use the following setting.
|
||||
|
||||
@lisp
|
||||
(setq org-export-odt-category-strings
|
||||
'(("en" "Table" "Illustration" "Equation" "Equation")))
|
||||
@end lisp
|
||||
|
||||
With this, previous image will be captioned as below in the exported
|
||||
document.
|
||||
|
||||
@example
|
||||
Illustration 2: Bell curve
|
||||
@end example
|
||||
|
||||
@node Literal examples in ODT export, Advanced topics in ODT export, Labels and captions in ODT export, OpenDocument Text export
|
||||
@subsection Literal examples in ODT export
|
||||
|
||||
Export of literal examples (@pxref{Literal examples}) with full fontification
|
||||
is supported. This feature is enabled by default and is activated
|
||||
automatically if an enhanced version of @file{htmlfontify.el} is available in
|
||||
the @code{load-path}.@footnote{The @file{htmlfontify.el} that ships with
|
||||
standard Emacs <= 24.1 has no support for @acronym{ODT} fontification. A
|
||||
copy of the proposed version is available as an attachment to
|
||||
@url{http://debbugs.gnu.org/cgi/bugreport.cgi?msg=5;filename=htmlfontify.el;att=9;bug=9914,
|
||||
Emacs Bug #9914}.}
|
||||
is supported. Internally, the exporter relies on @file{htmlfontify.el} to
|
||||
generate all style definitions needed for a fancy listing.@footnote{Your
|
||||
@file{htmlfontify.el} library must atleast be at Emacs 24.1 levels for
|
||||
fontification to be turned on.} The auto-generated styles have @samp{OrgSrc}
|
||||
as prefix and inherit their color from the faces used by Emacs
|
||||
@code{font-lock} library for the source language.
|
||||
|
||||
@vindex org-export-odt-fontify-srcblocks
|
||||
|
||||
The character styles used for fontification of the literal blocks are
|
||||
auto-generated by the exporter in conjunction with @file{htmlfontify.el}
|
||||
library and need not be included in the default @file{styles.xml} file.
|
||||
These auto-generated styles have the @samp{OrgSrc} prefix and inherit their color
|
||||
based on the face used by Emacs @code{font-lock} library.
|
||||
|
||||
@vindex org-export-odt-create-custom-styles-for-srcblocks
|
||||
If you prefer to use your own custom styles for fontification and disable
|
||||
their auto-generation altogether, you can do so by customizing the variable
|
||||
If you prefer to use your own custom styles for fontification, you can do so
|
||||
by customizing the variable
|
||||
@code{org-export-odt-create-custom-styles-for-srcblocks}.
|
||||
|
||||
You can turn off fontification support for literal examples by customizing
|
||||
the variable @code{org-export-odt-fontify-srcblocks}.
|
||||
@vindex org-export-odt-create-custom-styles-for-srcblocks
|
||||
You can turn off fontification of literal examples by customizing the
|
||||
variable @code{org-export-odt-fontify-srcblocks}.
|
||||
|
||||
@node Advanced topics in ODT export, , Literal examples in ODT export, OpenDocument Text export
|
||||
@subsection Advanced topics in ODT export
|
||||
|
||||
@node Advanced topics in @acronym{ODT} export, , Literal examples in @acronym{ODT} export, OpenDocument Text export
|
||||
@subsection Advanced topics in @acronym{ODT} export
|
||||
|
||||
If you rely heavily on @acronym{ODT} export, you may want to exploit the full
|
||||
If you rely heavily on ODT export, you may want to exploit the full
|
||||
set of features that the exporter offers. This section describes features
|
||||
that would be of interest to power users.
|
||||
|
||||
@menu
|
||||
* Exporting and converting to other formats:: How to produce @samp{pdf} and other formats
|
||||
* Configuring a document converter:: How to register a document converter
|
||||
* Working with OpenDocument style files:: Explore the internals
|
||||
* Creating one-off styles:: How to produce custom highlighting etc
|
||||
* Customizing tables in @acronym{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
|
||||
@end menu
|
||||
|
||||
@node Exporting and converting to other formats, Working with OpenDocument style files, Advanced topics in @acronym{ODT} export, Advanced topics in @acronym{ODT} export
|
||||
@subsubsection Exporting and converting to other formats
|
||||
@node Configuring a document converter, Working with OpenDocument style files, Advanced topics in ODT export, Advanced topics in ODT export
|
||||
@subsubsection Configuring a document converter
|
||||
@cindex convert
|
||||
@cindex doc, docx
|
||||
|
||||
The @acronym{ODT} exporter adds support for exporting Org outlines to formats
|
||||
that are not supported natively by Org. It also adds support to convert
|
||||
document from one format to another. To use these features, you need to
|
||||
configure a command-line converter. Once a command-line converter is
|
||||
configured you can use it to extend the list of formats to which Org can
|
||||
export. @xref{x-export-to-other-formats,,Automatically exporting to other
|
||||
formats}. You can also use it to perform one-off document conversion as
|
||||
detailed below.
|
||||
|
||||
@vindex org-export-odt-convert
|
||||
@table @kbd
|
||||
|
||||
@item M-x org-export-odt-convert
|
||||
Convert an existing document from one format to another as determined by the
|
||||
variable @code{org-export-odt-convert-capabilities}
|
||||
(@pxref{x-odt-converter-capabilities,,Configure converter
|
||||
capabilities}). @strong{Please note} that you can use this command to even
|
||||
convert documents that are produced outside of Org and in other formats than
|
||||
@acronym{ODT} format.
|
||||
@end table
|
||||
|
||||
@subsubheading Pre-configured converters
|
||||
|
||||
@cindex doc, docx, rtf
|
||||
@cindex converter
|
||||
The @acronym{ODT} exporter supports two converters out of the box:
|
||||
|
||||
@enumerate
|
||||
|
||||
@cindex @file{unoconv}
|
||||
@item @file{unoconv}
|
||||
|
||||
This converter is available as an installable package in your favorite
|
||||
distribution.
|
||||
|
||||
@cindex @file{BasicODConverter}
|
||||
@item @file{BasicODConverter}
|
||||
|
||||
@vindex org-odt-data-dir
|
||||
This converter is distributed as a LibreOffice extension and can be found in
|
||||
your Org distribution. See the subdirectory pointed to by the variable
|
||||
@code{org-odt-data-dir}.
|
||||
|
||||
@end enumerate
|
||||
|
||||
@subsubheading Installing a new converter
|
||||
If you prefer to use a converter other than the two mentioned above, then you
|
||||
may have to do additional configuration. You can proceed as follows:
|
||||
The ODT exporter can work with popular converters with little or no
|
||||
extra configuration from your side. @xref{Extending ODT export}.
|
||||
If you are using a converter that is not supported by default or if you would
|
||||
like to tweak the default converter settings, proceed as below.
|
||||
|
||||
@enumerate
|
||||
@item Register the converter
|
||||
|
@ -11262,12 +11336,12 @@ Select the newly added converter as the preferred one by customizing the
|
|||
variable @code{org-export-odt-convert-process}.
|
||||
@end enumerate
|
||||
|
||||
@node Working with OpenDocument style files, Creating one-off styles, Exporting and converting to other formats, Advanced topics in @acronym{ODT} export
|
||||
@node Working with OpenDocument style files, Creating one-off styles, Configuring a document converter, Advanced topics in ODT export
|
||||
@subsubsection Working with OpenDocument style files
|
||||
@cindex styles, custom
|
||||
@cindex template, custom
|
||||
|
||||
This section explores the internals of the @acronym{ODT} exporter and the
|
||||
This section explores the internals of the ODT exporter and the
|
||||
means by which it produces styled documents. Read this section if you are
|
||||
interested in exploring the automatic and custom OpenDocument styles used by
|
||||
the exporter.
|
||||
|
@ -11275,7 +11349,7 @@ the exporter.
|
|||
@anchor{x-factory-styles}
|
||||
@subsubheading Factory styles
|
||||
|
||||
The @acronym{ODT} exporter relies on two files for generating its output.
|
||||
The ODT exporter relies on two files for generating its output.
|
||||
These files are bundled with the distribution under the directory pointed to
|
||||
by the variable @code{org-odt-styles-dir}. The two files are:
|
||||
|
||||
|
@ -11321,7 +11395,7 @@ are numbered.
|
|||
|
||||
@anchor{x-overriding-factory-styles}
|
||||
@subsubheading Overriding factory styles
|
||||
The following two variables control the location from which the @acronym{ODT}
|
||||
The following two variables control the location from which the ODT
|
||||
exporter picks up the custom styles and content template files. You can
|
||||
customize these variables to override the factory styles used by the
|
||||
exporter.
|
||||
|
@ -11366,7 +11440,7 @@ Use this variable to specify the blank @file{content.xml} that will be used
|
|||
in the final output.
|
||||
@end itemize
|
||||
|
||||
@node Creating one-off styles, Customizing tables in @acronym{ODT} export, Working with OpenDocument style files, Advanced topics in @acronym{ODT} export
|
||||
@node Creating one-off styles, Customizing tables in ODT export, Working with OpenDocument style files, Advanced topics in ODT export
|
||||
@subsubsection Creating one-off styles
|
||||
|
||||
There are times when you would want one-off formatting in the exported
|
||||
|
@ -11433,14 +11507,14 @@ This paragraph is specially formatted and uses bold text.
|
|||
|
||||
@end enumerate
|
||||
|
||||
@node Customizing tables in @acronym{ODT} export, Validating OpenDocument XML, Creating one-off styles, Advanced topics in @acronym{ODT} export
|
||||
@subsubsection Customizing tables in @acronym{ODT} export
|
||||
@node Customizing tables in ODT export, Validating OpenDocument XML, Creating one-off styles, Advanced topics in ODT export
|
||||
@subsubsection Customizing tables in ODT export
|
||||
@cindex tables, in ODT export
|
||||
|
||||
@cindex #+ATTR_ODT
|
||||
You can override the default formatting of the table by specifying a custom
|
||||
table style with the @code{#+ATTR_ODT} line. For a discussion on default
|
||||
formatting of tables @pxref{Tables in @acronym{ODT} export}.
|
||||
formatting of tables @pxref{Tables in ODT export}.
|
||||
|
||||
This feature closely mimics the way table templates are defined in the
|
||||
OpenDocument-v1.2
|
||||
|
@ -11466,7 +11540,7 @@ the table that follows.
|
|||
@end lisp
|
||||
|
||||
@example
|
||||
#+ATTR_ODT: TableWithHeaderRowAndColumn
|
||||
#+ATTR_ODT: :style "TableWithHeaderRowAndColumn"
|
||||
| Name | Phone | Age |
|
||||
| Peter | 1234 | 17 |
|
||||
| Anna | 4321 | 25 |
|
||||
|
@ -11571,9 +11645,9 @@ To define a table style, create an entry for the style in the variable
|
|||
@end itemize
|
||||
|
||||
For example, the entry below defines two different table styles
|
||||
@samp{TableWithHeaderRowsAndColumns} and @samp{TableWithHeaderColumns} based
|
||||
on the same template @samp{Custom}. The styles achieve their intended effect
|
||||
by selectively activating the individual cell styles in that template.
|
||||
@samp{TableWithHeaderRowAndColumn} and @samp{TableWithFirstRowandLastRow}
|
||||
based on the same template @samp{Custom}. The styles achieve their intended
|
||||
effect by selectively activating the individual cell styles in that template.
|
||||
|
||||
@lisp
|
||||
(setq org-export-odt-table-styles
|
||||
|
@ -11593,18 +11667,18 @@ To do this, specify the table style created in step (2) as part of
|
|||
the @code{ATTR_ODT} line as shown below.
|
||||
|
||||
@example
|
||||
#+ATTR_ODT: TableWithHeaderRowAndColumn
|
||||
#+ATTR_ODT: :style "TableWithHeaderRowAndColumn"
|
||||
| Name | Phone | Age |
|
||||
| Peter | 1234 | 17 |
|
||||
| Anna | 4321 | 25 |
|
||||
@end example
|
||||
@end enumerate
|
||||
|
||||
@node Validating OpenDocument XML, , Customizing tables in @acronym{ODT} export, Advanced topics in @acronym{ODT} export
|
||||
@node Validating OpenDocument XML, , Customizing tables in ODT export, Advanced topics in ODT export
|
||||
@subsubsection Validating OpenDocument XML
|
||||
|
||||
Occasionally, you will discover that the document created by the
|
||||
@acronym{ODT} exporter cannot be opened by your favorite application. One of
|
||||
ODT exporter cannot be opened by your favorite application. One of
|
||||
the common reasons for this is that the @file{.odt} file is corrupt. In such
|
||||
cases, you may want to validate the document against the OpenDocument RELAX
|
||||
NG Compact Syntax (RNC) schema.
|
||||
|
@ -11618,7 +11692,7 @@ general help with validation (and schema-sensitive editing) of XML files:
|
|||
If you have ready access to OpenDocument @file{.rnc} files and the needed
|
||||
schema-locating rules in a single folder, you can customize the variable
|
||||
@code{org-export-odt-schema-dir} to point to that directory. The
|
||||
@acronym{ODT} exporter will take care of updating the
|
||||
ODT exporter will take care of updating the
|
||||
@code{rng-schema-locating-files} for you.
|
||||
|
||||
@c end opendocument
|
||||
|
@ -12622,17 +12696,24 @@ of tangled code files.
|
|||
@section Evaluating code blocks
|
||||
@cindex code block, evaluating
|
||||
@cindex source code, evaluating
|
||||
@cindex #+RESULTS
|
||||
|
||||
Code blocks can be evaluated@footnote{Whenever code is evaluated there is a
|
||||
potential for that code to do harm. Org mode provides safeguards to ensure
|
||||
that code is only evaluated after explicit confirmation from the user. For
|
||||
information on these safeguards (and on how to disable them) see @ref{Code
|
||||
evaluation security}.} and the results of evaluation optionally placed in the
|
||||
Org mode buffer. By default, the evaluation facility is only enabled for
|
||||
Lisp code blocks specified as @code{emacs-lisp}. However, source code blocks
|
||||
in many languages can be evaluated within Org mode (see @ref{Languages} for a
|
||||
list of supported languages and @ref{Structure of code blocks} for
|
||||
information on the syntax used to define a code block).
|
||||
Org mode buffer. The results of evaluation are placed following a line that
|
||||
begins by default with @code{#+RESULTS} and optionally a cache identifier
|
||||
and/or the name of the evaluated code block. The default value of
|
||||
@code{#+RESULTS} can be changed with the customizable variable
|
||||
@code{org-babel-results-keyword}.
|
||||
|
||||
By default, the evaluation facility is only enabled for Lisp code blocks
|
||||
specified as @code{emacs-lisp}. However, source code blocks in many languages
|
||||
can be evaluated within Org mode (see @ref{Languages} for a list of supported
|
||||
languages and @ref{Structure of code blocks} for information on the syntax
|
||||
used to define a code block).
|
||||
|
||||
@kindex C-c C-c
|
||||
There are a number of ways to evaluate code blocks. The simplest is to press
|
||||
|
@ -13000,6 +13081,7 @@ argument in lowercase letters. The following header arguments are defined:
|
|||
* session:: Preserve the state of code evaluation
|
||||
* noweb:: Toggle expansion of noweb references
|
||||
* noweb-ref:: Specify block's noweb reference resolution target
|
||||
* noweb-sep:: String used to separate noweb references
|
||||
* cache:: Avoid re-evaluating unchanged code blocks
|
||||
* sep:: Delimiter for writing tabular results outside Org
|
||||
* hlines:: Handle horizontal lines in tables
|
||||
|
@ -13351,9 +13433,9 @@ The result is converted to pretty-printed code and is enclosed in a code
|
|||
block. This option currently supports Emacs Lisp, Python, and Ruby. E.g.,
|
||||
@code{:results value pp}.
|
||||
@item @code{wrap}
|
||||
The result is wrapped in a @code{begin_result} block. This can be useful for
|
||||
The result is wrapped in a RESULTS drawer. This can be useful for
|
||||
inserting @code{raw} or @code{org} syntax results in such a way that their
|
||||
extend is known and they can be automatically removed or replaced.
|
||||
extent is known and they can be automatically removed or replaced.
|
||||
@end itemize
|
||||
|
||||
@subsubheading Handling
|
||||
|
@ -13583,9 +13665,8 @@ argument can have one of three values: @code{yes}, @code{no}, or @code{tangle}.
|
|||
All ``noweb'' syntax references in the body of the code block will be
|
||||
expanded before the block is evaluated, tangled or exported.
|
||||
@item @code{no}
|
||||
The default. No ``noweb'' syntax specific action is taken on evaluating
|
||||
code blocks, However, noweb references will still be expanded during
|
||||
tangling.
|
||||
The default. No ``noweb'' syntax specific action is taken when the code
|
||||
block is evaluated, tangled or exported.
|
||||
@item @code{tangle}
|
||||
All ``noweb'' syntax references in the body of the code block will be
|
||||
expanded before the block is tangled, however ``noweb'' references will not
|
||||
|
@ -13617,7 +13698,7 @@ Note that noweb replacement text that does not contain any newlines will not
|
|||
be affected by this change, so it is still possible to use inline noweb
|
||||
references.
|
||||
|
||||
@node noweb-ref, cache, noweb, Specific header arguments
|
||||
@node noweb-ref, noweb-sep, noweb, Specific header arguments
|
||||
@subsubsection @code{:noweb-ref}
|
||||
When expanding ``noweb'' style references the bodies of all code block with
|
||||
@emph{either} a block name matching the reference name @emph{or} a
|
||||
|
@ -13661,13 +13742,27 @@ inheritance}).}.
|
|||
#+END_SRC
|
||||
@end example
|
||||
|
||||
@node cache, sep, noweb-ref, Specific header arguments
|
||||
The @code{:noweb-sep} (see @ref{noweb-sep}) header argument holds the string
|
||||
used to separate accumulate noweb references like those above. By default a
|
||||
newline is used.
|
||||
|
||||
@node noweb-sep, cache, noweb-ref, Specific header arguments
|
||||
@subsubsection @code{:noweb-sep}
|
||||
|
||||
The @code{:noweb-sep} header argument holds the string used to separate
|
||||
accumulate noweb references (see @ref{noweb-ref}). By default a newline is
|
||||
used.
|
||||
|
||||
@node cache, sep, noweb-sep, Specific header arguments
|
||||
@subsubsection @code{:cache}
|
||||
|
||||
The @code{:cache} header argument controls the use of in-buffer caching of
|
||||
the results of evaluating code blocks. It can be used to avoid re-evaluating
|
||||
unchanged code blocks. This header argument can have one of two
|
||||
values: @code{yes} or @code{no}.
|
||||
unchanged code blocks. Note that the @code{:cache} header argument will not
|
||||
attempt to cache results when the @code{:session} header argument is used,
|
||||
because the results of the code block execution may be stored in the session
|
||||
outside of the Org-mode buffer. The @code{:cache} header argument can have
|
||||
one of two values: @code{yes} or @code{no}.
|
||||
|
||||
@itemize @bullet
|
||||
@item @code{no}
|
||||
|
@ -14004,6 +14099,14 @@ evaluation. If @code{:noweb no}, the default, then the reference is not
|
|||
expanded before evaluation. See the @ref{noweb-ref} header argument for
|
||||
a more flexible way to resolve noweb references.
|
||||
|
||||
It is possible to include the @emph{results} of a code block rather than the
|
||||
body. This is done by appending parenthesis to the code block name which may
|
||||
optionally contain arguments to the code block as shown below.
|
||||
|
||||
@example
|
||||
<<code-block-name(optional arguments)>>
|
||||
@end example
|
||||
|
||||
Note: the default value, @code{:noweb no}, was chosen to ensure that
|
||||
correct code is not broken in a language, such as Ruby, where
|
||||
@code{<<arg>>} is a syntactically valid construct. If @code{<<arg>>} is not
|
||||
|
@ -14040,34 +14143,72 @@ are active:
|
|||
In an Org mode buffer, the following key bindings are active:
|
||||
|
||||
@multitable @columnfractions 0.45 0.55
|
||||
@kindex C-c C-v a
|
||||
@kindex C-c C-v C-a
|
||||
@item @kbd{C-c C-v a} @ @ @r{or} @ @ @kbd{C-c C-v C-a} @tab @code{org-babel-sha1-hash}
|
||||
@kindex C-c C-v p
|
||||
@kindex C-c C-v C-p
|
||||
@item @kbd{C-c C-v p} @ @ @r{or} @ @ @kbd{C-c C-v C-p} @tab @code{org-babel-previous-src-block}
|
||||
@kindex C-c C-v n
|
||||
@kindex C-c C-v C-n
|
||||
@item @kbd{C-c C-v n} @ @ @r{or} @ @ @kbd{C-c C-v C-n} @tab @code{org-babel-next-src-block}
|
||||
@kindex C-c C-v e
|
||||
@kindex C-c C-v C-e
|
||||
@item @kbd{C-c C-v e} @ @ @r{or} @ @ @kbd{C-c C-v C-e} @tab @code{org-babel-execute-maybe}
|
||||
@kindex C-c C-v o
|
||||
@kindex C-c C-v C-o
|
||||
@item @kbd{C-c C-v o} @ @ @r{or} @ @ @kbd{C-c C-v C-o} @tab @code{org-babel-open-src-block-result}
|
||||
@kindex C-c C-v v
|
||||
@kindex C-c C-v C-v
|
||||
@item @kbd{C-c C-v v} @ @ @r{or} @ @ @kbd{C-c C-v C-v} @tab @code{org-babel-expand-src-block}
|
||||
@kindex C-c C-v u
|
||||
@kindex C-c C-v C-u
|
||||
@item @kbd{C-c C-v u} @ @ @r{or} @ @ @kbd{C-c C-v C-u} @tab @code{org-babel-goto-src-block-head}
|
||||
@kindex C-c C-v g
|
||||
@kindex C-c C-v C-g
|
||||
@item @kbd{C-c C-v g} @ @ @r{or} @ @ @kbd{C-c C-v C-g} @tab @code{org-babel-goto-named-src-block}
|
||||
@kindex C-c C-v r
|
||||
@kindex C-c C-v C-r
|
||||
@item @kbd{C-c C-v r} @ @ @r{or} @ @ @kbd{C-c C-v C-r} @tab @code{org-babel-goto-named-result}
|
||||
@kindex C-c C-v b
|
||||
@kindex C-c C-v C-b
|
||||
@item @kbd{C-c C-v b} @ @ @r{or} @ @ @kbd{C-c C-v C-b} @tab @code{org-babel-execute-buffer}
|
||||
@kindex C-c C-v f
|
||||
@kindex C-c C-v C-f
|
||||
@item @kbd{C-c C-v f} @ @ @r{or} @ @ @kbd{C-c C-v C-f} @tab @code{org-babel-tangle-file}
|
||||
@kindex C-c C-v g
|
||||
@item @kbd{C-c C-v g} @tab @code{org-babel-goto-named-source-block}
|
||||
@kindex C-c C-v h
|
||||
@item @kbd{C-c C-v h} @tab @code{org-babel-describe-bindings}
|
||||
@kindex C-c C-v l
|
||||
@kindex C-c C-v C-l
|
||||
@item @kbd{C-c C-v l} @ @ @r{or} @ @ @kbd{C-c C-v C-l} @tab @code{org-babel-lob-ingest}
|
||||
@kindex C-c C-v p
|
||||
@kindex C-c C-v C-p
|
||||
@item @kbd{C-c C-v p} @ @ @r{or} @ @ @kbd{C-c C-v C-p} @tab @code{org-babel-expand-src-block}
|
||||
@kindex C-c C-v s
|
||||
@kindex C-c C-v C-s
|
||||
@item @kbd{C-c C-v s} @ @ @r{or} @ @ @kbd{C-c C-v C-s} @tab @code{org-babel-execute-subtree}
|
||||
@kindex C-c C-v d
|
||||
@kindex C-c C-v C-d
|
||||
@item @kbd{C-c C-v d} @ @ @r{or} @ @ @kbd{C-c C-v C-d} @tab @code{org-babel-demarcate-block}
|
||||
@kindex C-c C-v t
|
||||
@kindex C-c C-v C-t
|
||||
@item @kbd{C-c C-v t} @ @ @r{or} @ @ @kbd{C-c C-v C-t} @tab @code{org-babel-tangle}
|
||||
@kindex C-c C-v f
|
||||
@kindex C-c C-v C-f
|
||||
@item @kbd{C-c C-v f} @ @ @r{or} @ @ @kbd{C-c C-v C-f} @tab @code{org-babel-tangle-file}
|
||||
@kindex C-c C-v c
|
||||
@kindex C-c C-v C-c
|
||||
@item @kbd{C-c C-v c} @ @ @r{or} @ @ @kbd{C-c C-v C-c} @tab @code{org-babel-check-src-block}
|
||||
@kindex C-c C-v j
|
||||
@kindex C-c C-v C-j
|
||||
@item @kbd{C-c C-v j} @ @ @r{or} @ @ @kbd{C-c C-v C-j} @tab @code{org-babel-insert-header-arg}
|
||||
@kindex C-c C-v l
|
||||
@kindex C-c C-v C-l
|
||||
@item @kbd{C-c C-v l} @ @ @r{or} @ @ @kbd{C-c C-v C-l} @tab @code{org-babel-load-in-session}
|
||||
@kindex C-c C-v i
|
||||
@kindex C-c C-v C-i
|
||||
@item @kbd{C-c C-v i} @ @ @r{or} @ @ @kbd{C-c C-v C-i} @tab @code{org-babel-lob-ingest}
|
||||
@kindex C-c C-v I
|
||||
@kindex C-c C-v C-I
|
||||
@item @kbd{C-c C-v I} @ @ @r{or} @ @ @kbd{C-c C-v C-I} @tab @code{org-babel-view-src-block-info}
|
||||
@kindex C-c C-v z
|
||||
@kindex C-c C-v C-z
|
||||
@item @kbd{C-c C-v z} @ @ @r{or} @ @ @kbd{C-c C-v C-z} @tab @code{org-babel-switch-to-session}
|
||||
@item @kbd{C-c C-v z} @ @ @r{or} @ @ @kbd{C-c C-v C-z} @tab @code{org-babel-switch-to-session-with-code}
|
||||
@kindex C-c C-v a
|
||||
@kindex C-c C-v C-a
|
||||
@item @kbd{C-c C-v a} @ @ @r{or} @ @ @kbd{C-c C-v C-a} @tab @code{org-babel-sha1-hash}
|
||||
@kindex C-c C-v h
|
||||
@kindex C-c C-v C-h
|
||||
@item @kbd{C-c C-v h} @ @ @r{or} @ @ @kbd{C-c C-v C-h} @tab @code{org-babel-describe-bindings}
|
||||
@kindex C-c C-v x
|
||||
@kindex C-c C-v C-x
|
||||
@item @kbd{C-c C-v x} @ @ @r{or} @ @ @kbd{C-c C-v C-x} @tab @code{org-babel-do-key-sequence-in-edit-buffer}
|
||||
@end multitable
|
||||
|
||||
@c When possible these keybindings were extended to work when the control key is
|
||||
|
@ -14839,7 +14980,7 @@ checks for the availability of Calc by looking for the function
|
|||
been installed properly. As of Emacs 22, Calc is part of the Emacs
|
||||
distribution. Another possibility for interaction between the two
|
||||
packages is using Calc for embedded calculations. @xref{Embedded Mode,
|
||||
, Embedded Mode, Calc, GNU Emacs Calc Manual}.
|
||||
, Embedded Mode, calc, GNU Emacs Calc Manual}.
|
||||
@item @file{constants.el} by Carsten Dominik
|
||||
@cindex @file{constants.el}
|
||||
@cindex Dominik, Carsten
|
||||
|
@ -15215,7 +15356,7 @@ not accept any arguments, and return the full link with prefix.
|
|||
@vindex org-ctrl-c-ctrl-c-hook
|
||||
|
||||
Org has several commands that act differently depending on context. The most
|
||||
important example it the @kbd{C-c C-c} (@pxref{The very busy C-c C-c key}).
|
||||
important example is the @kbd{C-c C-c} (@pxref{The very busy C-c C-c key}).
|
||||
Also the @kbd{M-cursor} and @kbd{M-S-cursor} keys have this property.
|
||||
|
||||
Add-ons can tap into this functionality by providing a function that detects
|
||||
|
@ -16431,7 +16572,7 @@ with links transformation to Org syntax.
|
|||
@i{David O'Toole} wrote @file{org-publish.el} and drafted the manual
|
||||
chapter about publishing.
|
||||
@item
|
||||
@i{Jambunathan K} contributed the @acronym{ODT} exporter.
|
||||
@i{Jambunathan K} contributed the ODT exporter.
|
||||
@item
|
||||
@i{Sebastien Vauban} reported many issues with @LaTeX{} and BEAMER export and
|
||||
enabled source code highlighting in Gnus.
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
2012-04-01 Jambunathan K <kjambunathan@gmail.com>
|
||||
|
||||
* org/OrgOdtContentTemplate.xml (OrgIndentedSection-Level-*):
|
||||
New section styles. These sections are indented to the same
|
||||
level as the corresponding list entries. These sections hold
|
||||
tables that occur within a list. (OrgTable): Increased
|
||||
relative width from 90% to 96% for aesthetic reasons.
|
||||
|
||||
2012-03-16 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* HELLO: Say that this is not a comprehensive list.
|
||||
|
|
|
@ -46,8 +46,61 @@
|
|||
|
||||
<!-- automatic styles -->
|
||||
<office:automatic-styles>
|
||||
<!-- Section styles -->
|
||||
<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:columns fo:column-count="1" fo:column-gap="0cm"/>
|
||||
</style:section-properties>
|
||||
</style:style>
|
||||
<style:style style:name="OrgIndentedSection-Level-2" style:family="section">
|
||||
<style:section-properties text:dont-balance-text-columns="false" fo:margin-left="1.905cm" fo:margin-right="0cm" style:editable="false">
|
||||
<style:columns fo:column-count="1" fo:column-gap="0cm"/>
|
||||
</style:section-properties>
|
||||
</style:style>
|
||||
<style:style style:name="OrgIndentedSection-Level-3" style:family="section">
|
||||
<style:section-properties text:dont-balance-text-columns="false" fo:margin-left="2.54cm" fo:margin-right="0cm" style:editable="false">
|
||||
<style:columns fo:column-count="1" fo:column-gap="0cm"/>
|
||||
</style:section-properties>
|
||||
</style:style>
|
||||
<style:style style:name="OrgIndentedSection-Level-4" style:family="section">
|
||||
<style:section-properties text:dont-balance-text-columns="false" fo:margin-left="3.175cm" fo:margin-right="0cm" style:editable="false">
|
||||
<style:columns fo:column-count="1" fo:column-gap="0cm"/>
|
||||
</style:section-properties>
|
||||
</style:style>
|
||||
<style:style style:name="OrgIndentedSection-Level-5" style:family="section">
|
||||
<style:section-properties text:dont-balance-text-columns="false" fo:margin-left="3.81cm" fo:margin-right="0cm" style:editable="false">
|
||||
<style:columns fo:column-count="1" fo:column-gap="0cm"/>
|
||||
</style:section-properties>
|
||||
</style:style>
|
||||
<style:style style:name="OrgIndentedSection-Level-6" style:family="section">
|
||||
<style:section-properties text:dont-balance-text-columns="false" fo:margin-left="4.445cm" fo:margin-right="0cm" style:editable="false">
|
||||
<style:columns fo:column-count="1" fo:column-gap="0cm"/>
|
||||
</style:section-properties>
|
||||
</style:style>
|
||||
<style:style style:name="OrgIndentedSection-Level-7" style:family="section">
|
||||
<style:section-properties text:dont-balance-text-columns="false" fo:margin-left="5.08cm" fo:margin-right="0cm" style:editable="false">
|
||||
<style:columns fo:column-count="1" fo:column-gap="0cm"/>
|
||||
</style:section-properties>
|
||||
</style:style>
|
||||
<style:style style:name="OrgIndentedSection-Level-8" style:family="section">
|
||||
<style:section-properties text:dont-balance-text-columns="false" fo:margin-left="5.715cm" fo:margin-right="0cm" style:editable="false">
|
||||
<style:columns fo:column-count="1" fo:column-gap="0cm"/>
|
||||
</style:section-properties>
|
||||
</style:style>
|
||||
<style:style style:name="OrgIndentedSection-Level-9" style:family="section">
|
||||
<style:section-properties text:dont-balance-text-columns="false" fo:margin-left="6.35cm" fo:margin-right="0cm" style:editable="false">
|
||||
<style:columns fo:column-count="1" fo:column-gap="0cm"/>
|
||||
</style:section-properties>
|
||||
</style:style>
|
||||
<style:style style:name="OrgIndentedSection-Level-10" style:family="section">
|
||||
<style:section-properties text:dont-balance-text-columns="false" fo:margin-left="6.985cm" fo:margin-right="0cm" style:editable="false">
|
||||
<style:columns fo:column-count="1" fo:column-gap="0cm"/>
|
||||
</style:section-properties>
|
||||
</style:style>
|
||||
|
||||
<!-- Table styles -->
|
||||
<style:style style:name="OrgTable" style:family="table">
|
||||
<style:table-properties style:rel-width="90%" fo:margin-top="0cm" fo:margin-bottom="0.20cm" table:align="center"/>
|
||||
<style:table-properties style:rel-width="96%" fo:margin-top="0cm" fo:margin-bottom="0.20cm" table:align="center"/>
|
||||
</style:style>
|
||||
|
||||
<style:style style:name="OrgTableColumn" style:family="table-column">
|
||||
|
|
|
@ -718,15 +718,75 @@
|
|||
<text:linenumbering-configuration text:number-lines="false" text:offset="0.499cm" style:num-format="1" text:number-position="left" text:increment="5"/>
|
||||
</office:styles>
|
||||
<office:automatic-styles>
|
||||
<style:page-layout style:name="Mpm1">
|
||||
<style:style style:name="MP1" style:family="paragraph" style:parent-style-name="Footer">
|
||||
<style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/>
|
||||
</style:style>
|
||||
<style:page-layout style:name="Mpm1" style:page-usage="mirrored">
|
||||
<style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:footnote-max-height="0cm">
|
||||
<style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
|
||||
<style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="none" style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
|
||||
</style:page-layout-properties>
|
||||
<style:header-style/>
|
||||
<style:footer-style>
|
||||
<style:header-footer-properties fo:min-height="0.6cm" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-top="0.499cm" style:dynamic-spacing="false"/>
|
||||
</style:footer-style>
|
||||
</style:page-layout>
|
||||
<style:page-layout style:name="Mpm2">
|
||||
<style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:footnote-max-height="0cm">
|
||||
<style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="solid" style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
|
||||
</style:page-layout-properties>
|
||||
<style:header-style/>
|
||||
<style:footer-style/>
|
||||
</style:page-layout>
|
||||
<style:page-layout style:name="Mpm3" style:page-usage="mirrored">
|
||||
<style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="i" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:footnote-max-height="0cm">
|
||||
<style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="solid" style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
|
||||
</style:page-layout-properties>
|
||||
<style:header-style/>
|
||||
<style:footer-style>
|
||||
<style:header-footer-properties fo:min-height="0cm" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-top="0.499cm"/>
|
||||
</style:footer-style>
|
||||
</style:page-layout>
|
||||
<style:page-layout style:name="Mpm4" style:page-usage="right">
|
||||
<style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" fo:background-color="transparent" style:writing-mode="lr-tb" style:footnote-max-height="0cm">
|
||||
<style:background-image/>
|
||||
<style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="solid" style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
|
||||
</style:page-layout-properties>
|
||||
<style:header-style/>
|
||||
<style:footer-style>
|
||||
<style:header-footer-properties fo:min-height="0.6cm" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-top="0.499cm" style:dynamic-spacing="false"/>
|
||||
</style:footer-style>
|
||||
</style:page-layout>
|
||||
<style:page-layout style:name="Mpm5" style:page-usage="mirrored">
|
||||
<style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:footnote-max-height="0cm">
|
||||
<style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="solid" style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
|
||||
</style:page-layout-properties>
|
||||
<style:header-style/>
|
||||
<style:footer-style>
|
||||
<style:header-footer-properties fo:min-height="0.6cm" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-top="0.499cm" style:dynamic-spacing="false"/>
|
||||
</style:footer-style>
|
||||
</style:page-layout>
|
||||
</office:automatic-styles>
|
||||
<office:master-styles>
|
||||
<style:master-page style:name="Standard" style:page-layout-name="Mpm1"/>
|
||||
<style:master-page style:name="Standard" style:page-layout-name="Mpm1">
|
||||
<style:footer>
|
||||
<text:p text:style-name="MP1"><text:page-number text:select-page="current"></text:page-number></text:p>
|
||||
</style:footer>
|
||||
</style:master-page>
|
||||
<style:master-page style:name="OrgTitlePage" style:page-layout-name="Mpm2" style:next-style-name="OrgFrontMatterPage"/>
|
||||
<style:master-page style:name="OrgFrontMatterPage" style:page-layout-name="Mpm3">
|
||||
<style:footer>
|
||||
<text:p text:style-name="MP1"><text:page-number text:select-page="current"/></text:p>
|
||||
</style:footer>
|
||||
</style:master-page>
|
||||
<style:master-page style:name="OrgFirstPage" style:page-layout-name="Mpm4" style:next-style-name="OrgPage">
|
||||
<style:footer>
|
||||
<text:p text:style-name="MP1"><text:page-number text:select-page="current"/></text:p>
|
||||
</style:footer>
|
||||
</style:master-page>
|
||||
<style:master-page style:name="OrgPage" style:page-layout-name="Mpm5">
|
||||
<style:footer>
|
||||
<text:p text:style-name="MP1"><text:page-number text:select-page="current"/></text:p>
|
||||
</style:footer>
|
||||
</style:master-page>
|
||||
</office:master-styles>
|
||||
</office:document-styles>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
The files OrgOdtContentTemplate.xml and OrgOdtStyles.xml have the
|
||||
following copyright information:
|
||||
|
||||
Copyright (C) 2010-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 2010-2011 Free Software Foundation, Inc.
|
||||
|
||||
These files are part of GNU Emacs.
|
||||
|
||||
|
|
Binary file not shown.
|
@ -1,6 +1,6 @@
|
|||
% Reference Card for Org Mode
|
||||
\def\orgversionnumber{7.8.02}
|
||||
\def\versionyear{2011} % latest update
|
||||
\def\orgversionnumber{7.8.07}
|
||||
\def\versionyear{2012} % latest update
|
||||
\def\year{2012} % latest copyright year
|
||||
|
||||
%**start of header
|
||||
|
@ -17,7 +17,7 @@
|
|||
\pdflayout=(0l)
|
||||
|
||||
% Nothing else needs to be changed below this line.
|
||||
% Copyright (C) 1987, 1993, 1996-1997, 2001-2012
|
||||
% Copyright (C) 1987, 1993, 1996-1997, 2001-2011
|
||||
% Free Software Foundation, Inc.
|
||||
|
||||
% This file is part of GNU Emacs.
|
||||
|
|
1439
lisp/org/ChangeLog
1439
lisp/org/ChangeLog
File diff suppressed because it is too large
Load diff
|
@ -88,7 +88,9 @@ or `org-babel-execute:C++'."
|
|||
(cond
|
||||
((equal org-babel-c-variant 'c) ".c")
|
||||
((equal org-babel-c-variant 'cpp) ".cpp"))))
|
||||
(tmp-bin-file (org-babel-temp-file "C-bin-"))
|
||||
(tmp-bin-file (org-babel-temp-file
|
||||
"C-bin-"
|
||||
(if (equal system-type 'windows-nt) ".exe" "")))
|
||||
(cmdline (cdr (assoc :cmdline params)))
|
||||
(flags (cdr (assoc :flags params)))
|
||||
(full-body (org-babel-C-expand body params))
|
||||
|
|
|
@ -279,7 +279,8 @@ last statement in BODY, as elisp."
|
|||
(with-temp-buffer
|
||||
(insert (org-babel-chomp body))
|
||||
(let ((ess-local-process-name
|
||||
(process-name (get-buffer-process session))))
|
||||
(process-name (get-buffer-process session)))
|
||||
(ess-eval-visibly-p nil))
|
||||
(ess-eval-buffer nil)))
|
||||
(let ((tmp-file (org-babel-temp-file "R-")))
|
||||
(org-babel-comint-eval-invisibly-and-wait-for-file
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
;;; - clojure (at least 1.2.0)
|
||||
;;; - clojure-mode
|
||||
;;; - slime
|
||||
;;; - swank-clojure
|
||||
|
||||
;;; By far, the best way to install these components is by following
|
||||
;;; the directions as set out by Phil Hagelberg (Technomancy) on the
|
||||
|
@ -75,7 +74,7 @@
|
|||
|
||||
(defun org-babel-execute:clojure (body params)
|
||||
"Execute a block of Clojure code with Babel."
|
||||
(require 'slime) (require 'swank-clojure)
|
||||
(require 'slime)
|
||||
(with-temp-buffer
|
||||
(insert (org-babel-expand-body:clojure body params))
|
||||
((lambda (result)
|
||||
|
@ -86,7 +85,7 @@
|
|||
(condition-case nil (org-babel-script-escape result)
|
||||
(error result)))))
|
||||
(slime-eval
|
||||
`(swank:interactive-eval-region
|
||||
`(swank:eval-and-grab-output
|
||||
,(buffer-substring-no-properties (point-min) (point-max)))
|
||||
(cdr (assoc :package params))))))
|
||||
|
||||
|
|
|
@ -39,22 +39,10 @@
|
|||
(require 'ob)
|
||||
|
||||
(defvar org-babel-default-header-args:ditaa
|
||||
'((:results . "file")
|
||||
(:exports . "results")
|
||||
(:java . "-Dfile.encoding=UTF-8"))
|
||||
'((:results . "file") (:exports . "results") (:java . "-Dfile.encoding=UTF-8"))
|
||||
"Default arguments for evaluating a ditaa source block.")
|
||||
|
||||
(defcustom org-ditaa-jar-path nil
|
||||
"Path for the ditaa jar file."
|
||||
:group 'org-babel
|
||||
:type 'string)
|
||||
|
||||
(defcustom org-ditaa-jar-option "-jar"
|
||||
"Option for the ditaa jar file.
|
||||
Do not leave leading or trailing spaces in this string."
|
||||
:group 'org-babel
|
||||
:type 'string)
|
||||
|
||||
(defvar org-ditaa-jar-path)
|
||||
(defun org-babel-execute:ditaa (body params)
|
||||
"Execute a block of Ditaa code with org-babel.
|
||||
This function is called by `org-babel-execute-src-block'."
|
||||
|
@ -67,7 +55,7 @@ This function is called by `org-babel-execute-src-block'."
|
|||
(cmdline (cdr (assoc :cmdline params)))
|
||||
(java (cdr (assoc :java params)))
|
||||
(in-file (org-babel-temp-file "ditaa-"))
|
||||
(cmd (concat "java " java " " org-ditaa-jar-option " "
|
||||
(cmd (concat "java " java " -jar "
|
||||
(shell-quote-argument
|
||||
(expand-file-name org-ditaa-jar-path))
|
||||
" " cmdline
|
||||
|
|
|
@ -41,13 +41,13 @@
|
|||
(result-params (cdr (assoc :result-params params)))
|
||||
(print-level nil) (print-length nil)
|
||||
(body (if (> (length vars) 0)
|
||||
(concat "(let ("
|
||||
(mapconcat
|
||||
(lambda (var)
|
||||
(format "%S" (print `(,(car var) ',(cdr var)))))
|
||||
vars "\n ")
|
||||
")\n" body ")")
|
||||
body)))
|
||||
(concat "(let ("
|
||||
(mapconcat
|
||||
(lambda (var)
|
||||
(format "%S" (print `(,(car var) ',(cdr var)))))
|
||||
vars "\n ")
|
||||
")\n" body "\n)")
|
||||
(concat body "\n"))))
|
||||
(if (or (member "code" result-params)
|
||||
(member "pp" result-params))
|
||||
(concat "(pp " body ")") body)))
|
||||
|
|
|
@ -34,8 +34,7 @@
|
|||
(defvar org-babel-ref-split-regexp)
|
||||
(declare-function org-babel-lob-get-info "ob-lob" ())
|
||||
(declare-function org-babel-eval-wipe-error-buffer "ob-eval" ())
|
||||
(add-to-list 'org-export-interblocks '(src org-babel-exp-inline-src-blocks))
|
||||
(add-to-list 'org-export-interblocks '(lob org-babel-exp-lob-one-liners))
|
||||
(add-to-list 'org-export-interblocks '(src org-babel-exp-non-block-elements))
|
||||
|
||||
(org-export-blocks-add-block '(src org-babel-exp-src-block nil))
|
||||
|
||||
|
@ -117,33 +116,74 @@ none ----- do not display either code or results upon export"
|
|||
(nth 1 info)))
|
||||
(org-babel-exp-do-export info 'block hash)))))
|
||||
|
||||
(defun org-babel-exp-inline-src-blocks (start end)
|
||||
"Process inline source blocks between START and END for export.
|
||||
See `org-babel-exp-src-block' for export options, currently the
|
||||
options and are taken from `org-babel-default-inline-header-args'."
|
||||
(defvar org-babel-default-lob-header-args)
|
||||
(defun org-babel-exp-non-block-elements (start end)
|
||||
"Process inline source and call lines between START and END for export."
|
||||
(interactive)
|
||||
(save-excursion
|
||||
(goto-char start)
|
||||
(while (and (< (point) end)
|
||||
(re-search-forward org-babel-inline-src-block-regexp end t))
|
||||
(let* ((info (save-match-data (org-babel-parse-inline-src-block-match)))
|
||||
(params (nth 2 info)))
|
||||
(save-match-data
|
||||
(goto-char (match-beginning 2))
|
||||
(unless (markerp end)
|
||||
(let ((m (make-marker)))
|
||||
(set-marker m end (current-buffer))
|
||||
(setq end m)))
|
||||
(let ((rx (concat "\\(" org-babel-inline-src-block-regexp
|
||||
"\\|" org-babel-lob-one-liner-regexp "\\)")))
|
||||
(while (and (< (point) (marker-position end))
|
||||
(re-search-forward rx end t))
|
||||
(if (save-excursion
|
||||
(goto-char (match-beginning 0))
|
||||
(looking-at org-babel-inline-src-block-regexp))
|
||||
(progn
|
||||
(forward-char 1)
|
||||
(let* ((info (save-match-data
|
||||
(org-babel-parse-inline-src-block-match)))
|
||||
(params (nth 2 info)))
|
||||
(save-match-data
|
||||
(goto-char (match-beginning 2))
|
||||
(unless (org-babel-in-example-or-verbatim)
|
||||
;; expand noweb references in the original file
|
||||
(setf (nth 1 info)
|
||||
(if (and (cdr (assoc :noweb params))
|
||||
(string= "yes" (cdr (assoc :noweb params))))
|
||||
(org-babel-expand-noweb-references
|
||||
info (get-file-buffer org-current-export-file))
|
||||
(nth 1 info)))
|
||||
(let ((code-replacement (save-match-data
|
||||
(org-babel-exp-do-export
|
||||
info 'inline))))
|
||||
(if code-replacement
|
||||
(progn (replace-match code-replacement nil nil nil 1)
|
||||
(delete-char 1))
|
||||
(org-babel-examplize-region (match-beginning 1)
|
||||
(match-end 1))
|
||||
(forward-char 2)))))))
|
||||
(unless (org-babel-in-example-or-verbatim)
|
||||
;; expand noweb references in the original file
|
||||
(setf (nth 1 info)
|
||||
(if (and (cdr (assoc :noweb params))
|
||||
(string= "yes" (cdr (assoc :noweb params))))
|
||||
(org-babel-expand-noweb-references
|
||||
info (get-file-buffer org-current-export-file))
|
||||
(nth 1 info)))
|
||||
(let ((code-replacement (save-match-data
|
||||
(org-babel-exp-do-export info 'inline))))
|
||||
(if code-replacement
|
||||
(replace-match code-replacement nil nil nil 1)
|
||||
(org-babel-examplize-region (match-beginning 1) (match-end 1))
|
||||
(forward-char 2)))))))))
|
||||
(let* ((lob-info (org-babel-lob-get-info))
|
||||
(inlinep (match-string 11))
|
||||
(inline-start (match-end 11))
|
||||
(inline-end (match-end 0))
|
||||
(rep (let ((lob-info (org-babel-lob-get-info)))
|
||||
(save-match-data
|
||||
(org-babel-exp-do-export
|
||||
(list "emacs-lisp" "results"
|
||||
(org-babel-merge-params
|
||||
org-babel-default-header-args
|
||||
org-babel-default-lob-header-args
|
||||
(org-babel-params-from-properties)
|
||||
(org-babel-parse-header-arguments
|
||||
(org-babel-clean-text-properties
|
||||
(concat ":var results="
|
||||
(mapconcat #'identity
|
||||
(butlast lob-info)
|
||||
" ")))))
|
||||
"" nil (car (last lob-info)))
|
||||
'lob)))))
|
||||
(if inlinep
|
||||
(save-excursion
|
||||
(goto-char inline-start)
|
||||
(delete-region inline-start inline-end)
|
||||
(insert rep))
|
||||
(replace-match rep t t)))))))))
|
||||
|
||||
(defun org-babel-in-example-or-verbatim ()
|
||||
"Return true if point is in example or verbatim code.
|
||||
|
@ -158,46 +198,6 @@ org-mode text."
|
|||
(org-in-block-p org-list-forbidden-blocks)
|
||||
(org-between-regexps-p "^[ \t]*#\\+begin_src" "^[ \t]*#\\+end_src")))
|
||||
|
||||
(defvar org-babel-default-lob-header-args)
|
||||
(defun org-babel-exp-lob-one-liners (start end)
|
||||
"Process Library of Babel calls between START and END for export.
|
||||
See `org-babel-exp-src-block' for export options. Currently the
|
||||
options are taken from `org-babel-default-header-args'."
|
||||
(interactive)
|
||||
(save-excursion
|
||||
(goto-char start)
|
||||
(while (and (< (point) end)
|
||||
(re-search-forward org-babel-lob-one-liner-regexp end t))
|
||||
(unless (org-babel-in-example-or-verbatim)
|
||||
(let* ((lob-info (org-babel-lob-get-info))
|
||||
(inlinep (match-string 11))
|
||||
(inline-start (match-end 11))
|
||||
(inline-end (match-end 0))
|
||||
(rep (let ((lob-info (org-babel-lob-get-info)))
|
||||
(save-match-data
|
||||
(org-babel-exp-do-export
|
||||
(list "emacs-lisp" "results"
|
||||
(org-babel-merge-params
|
||||
org-babel-default-header-args
|
||||
org-babel-default-lob-header-args
|
||||
(org-babel-params-from-properties)
|
||||
(org-babel-parse-header-arguments
|
||||
(org-babel-clean-text-properties
|
||||
(concat ":var results="
|
||||
(mapconcat #'identity
|
||||
(butlast lob-info) " ")))))
|
||||
"" nil (car (last lob-info)))
|
||||
'lob)))))
|
||||
(setq end (+ end (- (length rep)
|
||||
(- (length (match-string 0))
|
||||
(length (or (match-string 11) ""))))))
|
||||
(if inlinep
|
||||
(save-excursion
|
||||
(goto-char inline-start)
|
||||
(delete-region inline-start inline-end)
|
||||
(insert rep))
|
||||
(replace-match rep t t)))))))
|
||||
|
||||
(defun org-babel-exp-do-export (info type &optional hash)
|
||||
"Return a string with the exported content of a code block.
|
||||
The function respects the value of the :exports header argument."
|
||||
|
@ -218,7 +218,9 @@ The function respects the value of the :exports header argument."
|
|||
"#+BEGIN_SRC %lang%flags\n%body\n#+END_SRC"
|
||||
`(("lang" . ,(nth 0 info))
|
||||
("flags" . ,((lambda (f) (when f (concat " " f))) (nth 3 info)))
|
||||
("body" . ,(nth 1 info)))))
|
||||
("body" . ,(if (string= (nth 0 info) "org")
|
||||
(replace-regexp-in-string "^" "," (nth 1 info))
|
||||
(nth 1 info))))))
|
||||
|
||||
(defun org-babel-exp-results (info type &optional silent hash)
|
||||
"Evaluate and return the results of the current code block for export.
|
||||
|
|
|
@ -1,32 +1,29 @@
|
|||
;;; ob-fortran.el --- org-babel functions for fortran
|
||||
|
||||
;; Copyright (C) 2011-2012 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2011-2012 Sergey Litvinov, Eric Schulte
|
||||
|
||||
;; Authors: Sergey Litvinov
|
||||
;; Eric Schulte
|
||||
;; Authors: Sergey Litvinov (based on ob-C.el by Eric Schulte), Eric Schulte
|
||||
;; Keywords: literate programming, reproducible research, fortran
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.8.02
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs is free software: you can redistribute it and/or modify
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
|
||||
;; GNU Emacs is distributed in the hope that it will be useful,
|
||||
;; the Free Software Foundation; either version 3, or (at your option)
|
||||
;; any later version.
|
||||
;;
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
|
||||
;;
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
|
||||
;; along with GNU Emacs; see the file COPYING. If not, write to the
|
||||
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
;; Boston, MA 02110-1301, USA.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; Org-Babel support for evaluating fortran code.
|
||||
;; Based on ob-C.el by Eric Schulte.
|
||||
|
||||
;;; Code:
|
||||
(require 'ob)
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
;; Author: Martyn Jago
|
||||
;; Keywords: babel language, literate programming
|
||||
;; Homepage: https://github.com/mjago/ob-lilypond
|
||||
;; Homepage: http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-lilypond.html
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
@ -30,18 +30,14 @@
|
|||
(require 'ob)
|
||||
(require 'ob-eval)
|
||||
(require 'ob-tangle)
|
||||
(require 'outline)
|
||||
(defalias 'lilypond-mode 'LilyPond-mode)
|
||||
|
||||
(declare-function show-all "outline" ())
|
||||
|
||||
(add-to-list 'org-babel-tangle-lang-exts '("LilyPond" . "ly"))
|
||||
|
||||
(defvar org-babel-default-header-args:lilypond '()
|
||||
"Default header arguments for js code blocks.")
|
||||
|
||||
(defconst ly-version "0.3"
|
||||
"The version number of the file ob-lilypond.el.")
|
||||
|
||||
(defvar ly-compile-post-tangle t
|
||||
"Following the org-babel-tangle (C-c C-v t) command,
|
||||
ly-compile-post-tangle determines whether ob-lilypond should
|
||||
|
@ -408,13 +404,7 @@ If TEST is non-nil, it contains a simulation of the OS for test purposes"
|
|||
(message (concat "Arrange mode has been "
|
||||
(if ly-arrange-mode "ENABLED." "DISABLED."))))
|
||||
|
||||
(defun ly-version (&optional insert-at-point)
|
||||
(interactive)
|
||||
(let ((version (format "ob-lilypond version %s" ly-version)))
|
||||
(when insert-at-point (insert version))
|
||||
(message version)))
|
||||
|
||||
(defun ly-switch-extension (file-name ext)
|
||||
(defun ly-switch-extension (file-name ext)
|
||||
"Utility command to swap current FILE-NAME extension with EXT"
|
||||
|
||||
(concat (file-name-sans-extension
|
||||
|
|
|
@ -65,14 +65,14 @@ To add files to this list use the `org-babel-lob-ingest' command."
|
|||
|
||||
(defconst org-babel-block-lob-one-liner-regexp
|
||||
(concat
|
||||
"^\\([ \t]*\\)#\\+call:[ \t]+\\([^\(\)\n]+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)"
|
||||
"\(\\([^\n]*\\)\)\\(\\[.+\\]\\|\\)[ \t]*\\(\\([^\n]*\\)\\)?")
|
||||
"^\\([ \t]*?\\)#\\+call:[ \t]+\\([^\(\)\n]+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)"
|
||||
"\(\\([^\n]*?\\)\)\\(\\[.+\\]\\|\\)[ \t]*\\(\\([^\n]*\\)\\)?")
|
||||
"Regexp to match non-inline calls to predefined source block functions.")
|
||||
|
||||
(defconst org-babel-inline-lob-one-liner-regexp
|
||||
(concat
|
||||
"\\([^\n]*\\)call_\\([^\(\)\n]+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)"
|
||||
"\(\\([^\n]*\\)\)\\(\\[\\(.*?\\)\\]\\)?")
|
||||
"\\([^\n]*?\\)call_\\([^\(\)\n]+?\\)\\(\\[\\(.*?\\)\\]\\|\\(\\)\\)"
|
||||
"\(\\([^\n]*?\\)\)\\(\\[\\(.*?\\)\\]\\)?")
|
||||
"Regexp to match inline calls to predefined source block functions.")
|
||||
|
||||
(defconst org-babel-lob-one-liner-regexp
|
||||
|
@ -108,8 +108,8 @@ if so then run the appropriate source block from the Library."
|
|||
(list
|
||||
(format "%s%s(%s)%s"
|
||||
(nonempty 3 12)
|
||||
(if (not (= 0 (length (nonempty 5 13))))
|
||||
(concat "[" (nonempty 5 13) "]") "")
|
||||
(if (not (= 0 (length (nonempty 5 14))))
|
||||
(concat "[" (nonempty 5 14) "]") "")
|
||||
(or (nonempty 7 16) "")
|
||||
(or (nonempty 8 19) ""))
|
||||
(nonempty 9 18)))
|
||||
|
|
|
@ -40,6 +40,11 @@
|
|||
|
||||
(defvar org-babel-default-header-args:maxima '())
|
||||
|
||||
(defcustom org-babel-maxima-command
|
||||
(if (boundp 'maxima-command) maxima-command "maxima")
|
||||
"Command used to call maxima on the shell."
|
||||
:group 'org-babel)
|
||||
|
||||
(defun org-babel-maxima-expand (body params)
|
||||
"Expand a block of Maxima code according to its header arguments."
|
||||
(let ((vars (mapcar #'cdr (org-babel-get-header params :var))))
|
||||
|
@ -67,8 +72,8 @@ called by `org-babel-execute-src-block'."
|
|||
(result
|
||||
(let* ((cmdline (cdr (assoc :cmdline params)))
|
||||
(in-file (org-babel-temp-file "maxima-" ".max"))
|
||||
(cmd (format "maxima --very-quiet -r 'batchload(%S)$' %s"
|
||||
in-file cmdline)))
|
||||
(cmd (format "%s --very-quiet -r 'batchload(%S)$' %s"
|
||||
org-babel-maxima-command in-file cmdline)))
|
||||
(with-temp-file in-file (insert (org-babel-maxima-expand body params)))
|
||||
(message cmd)
|
||||
((lambda (raw) ;; " | grep -v batch | grep -v 'replaced' | sed '/^$/d' "
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
;;; Commentary:
|
||||
|
||||
;; Org-Babel support for evaluating sql source code.
|
||||
;; (see also ob-sqlite.el)
|
||||
;;
|
||||
;; SQL is somewhat unique in that there are many different engines for
|
||||
;; the evaluation of sql (Mysql, PostgreSQL, etc...), so much of this
|
||||
|
|
|
@ -93,7 +93,14 @@ This function is called by `org-babel-execute-src-block'."
|
|||
(member "code" result-params)
|
||||
(equal (point-min) (point-max)))
|
||||
(buffer-string)
|
||||
(org-table-convert-region (point-min) (point-max))
|
||||
(org-table-convert-region (point-min) (point-max)
|
||||
(if (or (member :csv others)
|
||||
(member :column others)
|
||||
(member :line others)
|
||||
(member :list others)
|
||||
(member :html others) separator)
|
||||
nil
|
||||
'(4)))
|
||||
(org-babel-sqlite-table-or-scalar
|
||||
(org-babel-sqlite-offset-colnames
|
||||
(org-table-to-lisp) headers-p))))))
|
||||
|
|
|
@ -75,9 +75,8 @@ results
|
|||
|
||||
NOTE: by default string variable names are interpreted as
|
||||
references to source-code blocks, to force interpretation of a
|
||||
cell's value as a string, prefix the identifier with two \"$\"s
|
||||
rather than a single \"$\" (i.e. \"$$2\" instead of \"$2\" in the
|
||||
example above.
|
||||
cell's value as a string, prefix the identifier a \"$\" (e.g.,
|
||||
\"$$2\" instead of \"$2\" or \"$@2$2\" instead of \"@2$2\").
|
||||
|
||||
NOTE: it is also possible to pass header arguments to the code
|
||||
block. In this case a table cell should hold the string value of
|
||||
|
@ -97,7 +96,7 @@ as shown in the example below.
|
|||
(delq nil (mapcar
|
||||
(lambda (el)
|
||||
(if (eq '$ el)
|
||||
(setq quote t)
|
||||
(prog1 nil (setq quote t))
|
||||
(prog1 (if quote
|
||||
(format "\"%s\"" el)
|
||||
(org-babel-clean-text-properties el))
|
||||
|
|
|
@ -185,9 +185,11 @@ exported source code blocks by language."
|
|||
(when only-this-block
|
||||
(unless (org-babel-where-is-src-block-head)
|
||||
(error "Point is not currently inside of a code block"))
|
||||
(unless target-file
|
||||
(setq target-file
|
||||
(read-from-minibuffer "Tangle to: " (buffer-file-name))))
|
||||
(save-match-data
|
||||
(unless (or (cdr (assoc :tangle (nth 2 (org-babel-get-src-block-info))))
|
||||
target-file)
|
||||
(setq target-file
|
||||
(read-from-minibuffer "Tangle to: " (buffer-file-name)))))
|
||||
(narrow-to-region (match-beginning 0) (match-end 0)))
|
||||
(save-excursion
|
||||
(let ((block-counter 0)
|
||||
|
@ -393,7 +395,7 @@ form
|
|||
(start-line file link source-name params body comment)"
|
||||
(let* ((start-line (nth 0 spec))
|
||||
(file (nth 1 spec))
|
||||
(link (org-link-escape (nth 2 spec)))
|
||||
(link (nth 2 spec))
|
||||
(source-name (nth 3 spec))
|
||||
(body (nth 5 spec))
|
||||
(comment (nth 6 spec))
|
||||
|
|
199
lisp/org/ob.el
199
lisp/org/ob.el
|
@ -79,6 +79,7 @@
|
|||
(declare-function org-list-struct "org-list" ())
|
||||
(declare-function org-list-prevs-alist "org-list" (struct))
|
||||
(declare-function org-list-get-list-end "org-list" (item struct prevs))
|
||||
(declare-function org-strip-protective-commas "org" (beg end))
|
||||
|
||||
(defgroup org-babel nil
|
||||
"Code block evaluation and management in `org-mode' documents."
|
||||
|
@ -113,6 +114,13 @@ remove code block execution from the C-c C-c keybinding."
|
|||
:group 'org-babel
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom org-babel-results-keyword "RESULTS"
|
||||
"Keyword used to name results generated by code blocks.
|
||||
Should be either RESULTS or NAME however any capitalization may
|
||||
be used."
|
||||
:group 'org-babel
|
||||
:type 'string)
|
||||
|
||||
(defvar org-babel-src-name-regexp
|
||||
"^[ \t]*#\\+name:[ \t]*"
|
||||
"Regular expression used to match a source name line.")
|
||||
|
@ -169,8 +177,8 @@ Returns non-nil if match-data set"
|
|||
(first-line-p (= 1 (line-number-at-pos)))
|
||||
(orig (point)))
|
||||
(let ((search-for (cond ((and src-at-0-p first-line-p "src_"))
|
||||
(first-line-p "[ \t]src_")
|
||||
(t "[ \f\t\n\r\v]src_")))
|
||||
(first-line-p "[[:punct:] \t]src_")
|
||||
(t "[[:punct:] \f\t\n\r\v]src_")))
|
||||
(lower-limit (if first-line-p
|
||||
nil
|
||||
(- (point-at-bol) 1))))
|
||||
|
@ -376,6 +384,7 @@ then run `org-babel-pop-to-session'."
|
|||
(noeval)
|
||||
(noweb . ((yes no tangle)))
|
||||
(noweb-ref . :any)
|
||||
(noweb-sep . :any)
|
||||
(padline . ((yes no)))
|
||||
(results . ((file list vector table scalar verbatim)
|
||||
(raw org html latex code pp wrap)
|
||||
|
@ -469,7 +478,10 @@ the header arguments specified at the front of the source code
|
|||
block."
|
||||
(interactive)
|
||||
(let ((info (or info (org-babel-get-src-block-info))))
|
||||
(when (org-babel-confirm-evaluate info)
|
||||
(when (org-babel-confirm-evaluate
|
||||
(let ((i info))
|
||||
(setf (nth 2 i) (org-babel-merge-params (nth 2 info) params))
|
||||
i))
|
||||
(let* ((lang (nth 0 info))
|
||||
(params (if params
|
||||
(org-babel-process-params
|
||||
|
@ -597,15 +609,17 @@ arguments and pop open the results in a preview buffer."
|
|||
;; TODO: report malformed code block
|
||||
;; TODO: report incompatible combinations of header arguments
|
||||
;; TODO: report uninitialized variables
|
||||
(let ((too-close 2)) ;; <- control closeness to report potential match
|
||||
(let ((too-close 2) ;; <- control closeness to report potential match
|
||||
(names (mapcar #'symbol-name org-babel-header-arg-names)))
|
||||
(dolist (header (mapcar (lambda (arg) (substring (symbol-name (car arg)) 1))
|
||||
(and (org-babel-where-is-src-block-head)
|
||||
(org-babel-parse-header-arguments
|
||||
(org-babel-clean-text-properties
|
||||
(match-string 4))))))
|
||||
(dolist (name (mapcar #'symbol-name org-babel-header-arg-names))
|
||||
(dolist (name names)
|
||||
(when (and (not (string= header name))
|
||||
(<= (org-babel-edit-distance header name) too-close))
|
||||
(<= (org-babel-edit-distance header name) too-close)
|
||||
(not (member header names)))
|
||||
(error "supplied header \"%S\" is suspiciously close to \"%S\""
|
||||
header name))))
|
||||
(message "No suspicious header arguments found.")))
|
||||
|
@ -884,6 +898,31 @@ buffer."
|
|||
(goto-char point))))
|
||||
(def-edebug-spec org-babel-map-call-lines (form body))
|
||||
|
||||
;;;###autoload
|
||||
(defmacro org-babel-map-executables (file &rest body)
|
||||
(declare (indent 1))
|
||||
(let ((tempvar (make-symbol "file"))
|
||||
(rx (make-symbol "rx")))
|
||||
`(let* ((,tempvar ,file)
|
||||
(,rx (concat "\\(" org-babel-src-block-regexp
|
||||
"\\|" org-babel-inline-src-block-regexp
|
||||
"\\|" org-babel-lob-one-liner-regexp "\\)"))
|
||||
(visited-p (or (null ,tempvar)
|
||||
(get-file-buffer (expand-file-name ,tempvar))))
|
||||
(point (point)) to-be-removed)
|
||||
(save-window-excursion
|
||||
(when ,tempvar (find-file ,tempvar))
|
||||
(setq to-be-removed (current-buffer))
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward ,rx nil t)
|
||||
(goto-char (match-beginning 1))
|
||||
(when (looking-at org-babel-inline-src-block-regexp)(forward-char 1))
|
||||
(save-match-data ,@body)
|
||||
(goto-char (match-end 0))))
|
||||
(unless visited-p (kill-buffer to-be-removed))
|
||||
(goto-char point))))
|
||||
(def-edebug-spec org-babel-map-executables (form body))
|
||||
|
||||
;;;###autoload
|
||||
(defun org-babel-execute-buffer (&optional arg)
|
||||
"Execute source code blocks in a buffer.
|
||||
|
@ -892,12 +931,10 @@ the current buffer."
|
|||
(interactive "P")
|
||||
(org-babel-eval-wipe-error-buffer)
|
||||
(org-save-outline-visibility t
|
||||
(org-babel-map-src-blocks nil
|
||||
(org-babel-execute-src-block arg))
|
||||
(org-babel-map-inline-src-blocks nil
|
||||
(org-babel-execute-src-block arg))
|
||||
(org-babel-map-call-lines nil
|
||||
(org-babel-lob-execute-maybe))))
|
||||
(org-babel-map-executables nil
|
||||
(if (looking-at org-babel-lob-one-liner-regexp)
|
||||
(org-babel-lob-execute-maybe)
|
||||
(org-babel-execute-src-block arg)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun org-babel-execute-subtree (&optional arg)
|
||||
|
@ -999,6 +1036,89 @@ This can be called with C-c C-c."
|
|||
(when hash (kill-new hash) (message hash))))
|
||||
(add-hook 'org-ctrl-c-ctrl-c-hook 'org-babel-hash-at-point)
|
||||
|
||||
(defun org-babel-result-hide-spec ()
|
||||
"Hide portions of results lines.
|
||||
Add `org-babel-hide-result' as an invisibility spec for hiding
|
||||
portions of results lines."
|
||||
(add-to-invisibility-spec '(org-babel-hide-result . t)))
|
||||
(add-hook 'org-mode-hook 'org-babel-result-hide-spec)
|
||||
|
||||
(defvar org-babel-hide-result-overlays nil
|
||||
"Overlays hiding results.")
|
||||
|
||||
(defun org-babel-result-hide-all ()
|
||||
"Fold all results in the current buffer."
|
||||
(interactive)
|
||||
(org-babel-show-result-all)
|
||||
(save-excursion
|
||||
(while (re-search-forward org-babel-result-regexp nil t)
|
||||
(save-excursion (goto-char (match-beginning 0))
|
||||
(org-babel-hide-result-toggle-maybe)))))
|
||||
|
||||
(defun org-babel-show-result-all ()
|
||||
"Unfold all results in the current buffer."
|
||||
(mapc 'delete-overlay org-babel-hide-result-overlays)
|
||||
(setq org-babel-hide-result-overlays nil))
|
||||
|
||||
;;;###autoload
|
||||
(defun org-babel-hide-result-toggle-maybe ()
|
||||
"Toggle visibility of result at point."
|
||||
(interactive)
|
||||
(let ((case-fold-search t))
|
||||
(if (save-excursion
|
||||
(beginning-of-line 1)
|
||||
(looking-at org-babel-result-regexp))
|
||||
(progn (org-babel-hide-result-toggle)
|
||||
t) ;; to signal that we took action
|
||||
nil))) ;; to signal that we did not
|
||||
|
||||
(defun org-babel-hide-result-toggle (&optional force)
|
||||
"Toggle the visibility of the current result."
|
||||
(interactive)
|
||||
(save-excursion
|
||||
(beginning-of-line)
|
||||
(if (re-search-forward org-babel-result-regexp nil t)
|
||||
(let ((start (progn (beginning-of-line 2) (- (point) 1)))
|
||||
(end (progn
|
||||
(while (looking-at org-babel-multi-line-header-regexp)
|
||||
(forward-line 1))
|
||||
(goto-char (- (org-babel-result-end) 1)) (point)))
|
||||
ov)
|
||||
(if (memq t (mapcar (lambda (overlay)
|
||||
(eq (overlay-get overlay 'invisible)
|
||||
'org-babel-hide-result))
|
||||
(overlays-at start)))
|
||||
(if (or (not force) (eq force 'off))
|
||||
(mapc (lambda (ov)
|
||||
(when (member ov org-babel-hide-result-overlays)
|
||||
(setq org-babel-hide-result-overlays
|
||||
(delq ov org-babel-hide-result-overlays)))
|
||||
(when (eq (overlay-get ov 'invisible)
|
||||
'org-babel-hide-result)
|
||||
(delete-overlay ov)))
|
||||
(overlays-at start)))
|
||||
(setq ov (make-overlay start end))
|
||||
(overlay-put ov 'invisible 'org-babel-hide-result)
|
||||
;; make the block accessible to isearch
|
||||
(overlay-put
|
||||
ov 'isearch-open-invisible
|
||||
(lambda (ov)
|
||||
(when (member ov org-babel-hide-result-overlays)
|
||||
(setq org-babel-hide-result-overlays
|
||||
(delq ov org-babel-hide-result-overlays)))
|
||||
(when (eq (overlay-get ov 'invisible)
|
||||
'org-babel-hide-result)
|
||||
(delete-overlay ov))))
|
||||
(push ov org-babel-hide-result-overlays)))
|
||||
(error "Not looking at a result line"))))
|
||||
|
||||
;; org-tab-after-check-for-cycling-hook
|
||||
(add-hook 'org-tab-first-hook 'org-babel-hide-result-toggle-maybe)
|
||||
;; Remove overlays when changing major mode
|
||||
(add-hook 'org-mode-hook
|
||||
(lambda () (org-add-hook 'change-major-mode-hook
|
||||
'org-babel-show-result-all 'append 'local)))
|
||||
|
||||
(defvar org-file-properties)
|
||||
(defun org-babel-params-from-properties (&optional lang)
|
||||
"Retrieve parameters specified as properties.
|
||||
|
@ -1042,7 +1162,7 @@ may be specified in the properties of the current outline entry."
|
|||
;; get block body less properties, protective commas, and indentation
|
||||
(with-temp-buffer
|
||||
(save-match-data
|
||||
(insert (org-babel-strip-protective-commas body))
|
||||
(insert (org-babel-strip-protective-commas body lang))
|
||||
(unless preserve-indentation (org-do-remove-indentation))
|
||||
(buffer-string)))
|
||||
(org-babel-merge-params
|
||||
|
@ -1060,7 +1180,7 @@ may be specified in the properties of the current outline entry."
|
|||
(lang-headers (intern (concat "org-babel-default-header-args:" lang))))
|
||||
(list lang
|
||||
(org-babel-strip-protective-commas
|
||||
(org-babel-clean-text-properties (match-string 5)))
|
||||
(org-babel-clean-text-properties (match-string 5)) lang)
|
||||
(org-babel-merge-params
|
||||
org-babel-default-inline-header-args
|
||||
(org-babel-params-from-properties lang)
|
||||
|
@ -1376,9 +1496,10 @@ buffer or nil if no such result exists."
|
|||
(catch 'is-a-code-block
|
||||
(when (re-search-forward
|
||||
(concat org-babel-result-regexp
|
||||
"[ \t]" (regexp-quote name) "[ \t\n\f\v\r]") nil t)
|
||||
"[ \t]" (regexp-quote name) "[ \t\n\f\v\r]+") nil t)
|
||||
(when (and (string= "name" (downcase (match-string 1)))
|
||||
(or (looking-at org-babel-src-block-regexp)
|
||||
(or (beginning-of-line 1)
|
||||
(looking-at org-babel-src-block-regexp)
|
||||
(looking-at org-babel-multi-line-header-regexp)))
|
||||
(throw 'is-a-code-block (org-babel-find-named-result name (point))))
|
||||
(beginning-of-line 0) (point)))))
|
||||
|
@ -1491,7 +1612,7 @@ following the source block."
|
|||
(inlinep (when (org-babel-get-inline-src-block-matches)
|
||||
(match-end 0)))
|
||||
(name (if on-lob-line
|
||||
(nth 0 (org-babel-lob-get-info))
|
||||
(mapconcat #'identity (butlast (org-babel-lob-get-info)) "")
|
||||
(nth 4 (or info (org-babel-get-src-block-info 'light)))))
|
||||
(head (unless on-lob-line (org-babel-where-is-src-block-head)))
|
||||
found beg end)
|
||||
|
@ -1544,7 +1665,7 @@ following the source block."
|
|||
(lambda (el) " ")
|
||||
(org-number-sequence 1 indent) "")
|
||||
"")
|
||||
"#+results"
|
||||
"#+" org-babel-results-keyword
|
||||
(when hash (concat "["hash"]"))
|
||||
":"
|
||||
(when name (concat " " name)) "\n"))
|
||||
|
@ -1715,8 +1836,9 @@ code ---- the results are extracted in the syntax of the source
|
|||
(setq results-switches
|
||||
(if results-switches (concat " " results-switches) ""))
|
||||
(flet ((wrap (start finish)
|
||||
(goto-char beg) (insert (concat start "\n"))
|
||||
(goto-char end) (insert (concat finish "\n"))
|
||||
(goto-char beg) (insert (concat start "\n"))
|
||||
(goto-char end) (goto-char (point-at-eol))
|
||||
(setq end (point-marker)))
|
||||
(proper-list-p (it) (and (listp it) (null (cdr (last it))))))
|
||||
;; insert results based on type
|
||||
|
@ -1802,7 +1924,8 @@ code ---- the results are extracted in the syntax of the source
|
|||
(prvs (org-list-prevs-alist struct)))
|
||||
(org-list-get-list-end (point-at-bol) struct prvs)))
|
||||
((looking-at "^\\([ \t]*\\):RESULTS:")
|
||||
(re-search-forward (concat "^" (match-string 1) ":END:")))
|
||||
(progn (re-search-forward (concat "^" (match-string 1) ":END:"))
|
||||
(forward-char 1) (point)))
|
||||
(t
|
||||
(let ((case-fold-search t)
|
||||
(blocks-re (regexp-opt
|
||||
|
@ -1835,7 +1958,8 @@ file's directory then expand relative links."
|
|||
(defun org-babel-examplize-region (beg end &optional results-switches)
|
||||
"Comment out region using the inline '==' or ': ' org example quote."
|
||||
(interactive "*r")
|
||||
(flet ((chars-between (b e) (string-match "[\\S]" (buffer-substring b e))))
|
||||
(flet ((chars-between (b e)
|
||||
(not (string-match "^[\\s]*$" (buffer-substring b e)))))
|
||||
(if (or (chars-between (save-excursion (goto-char beg) (point-at-bol)) beg)
|
||||
(chars-between end (save-excursion (goto-char end) (point-at-eol))))
|
||||
(save-excursion
|
||||
|
@ -2031,7 +2155,8 @@ block but are passed literally to the \"example-block\"."
|
|||
(with-temp-buffer
|
||||
(insert body) (goto-char (point-min))
|
||||
(setq index (point))
|
||||
(while (and (re-search-forward "<<\\(.+?\\)>>" nil t))
|
||||
(while (and (re-search-forward "<<\\([^ \t\n].+?[^ \t\n]\\|[^ \t\n]\\)>>"
|
||||
nil t))
|
||||
(save-match-data (setf source-name (match-string 1)))
|
||||
(save-match-data (setq evaluate (string-match "\(.*\)" source-name)))
|
||||
(save-match-data
|
||||
|
@ -2046,6 +2171,8 @@ block but are passed literally to the \"example-block\"."
|
|||
(setq index (point))
|
||||
(nb-add
|
||||
(with-current-buffer parent-buffer
|
||||
(save-restriction
|
||||
(widen)
|
||||
(mapconcat ;; interpose PREFIX between every line
|
||||
#'identity
|
||||
(split-string
|
||||
|
@ -2061,7 +2188,7 @@ block but are passed literally to the \"example-block\"."
|
|||
(when (org-babel-ref-goto-headline-id source-name)
|
||||
(org-babel-ref-headline-body)))
|
||||
;; find the expansion of reference in this buffer
|
||||
(let ((rx (concat rx-prefix source-name))
|
||||
(let ((rx (concat rx-prefix source-name "[ \t\n]"))
|
||||
expansion)
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
|
@ -2069,6 +2196,8 @@ block but are passed literally to the \"example-block\"."
|
|||
(while (re-search-forward rx nil t)
|
||||
(let* ((i (org-babel-get-src-block-info 'light))
|
||||
(body (org-babel-expand-noweb-references i))
|
||||
(sep (or (cdr (assoc :noweb-sep (nth 2 i)))
|
||||
"\n"))
|
||||
(full (if comment
|
||||
((lambda (cs)
|
||||
(concat (c-wrap (car cs)) "\n"
|
||||
|
@ -2076,13 +2205,15 @@ block but are passed literally to the \"example-block\"."
|
|||
(c-wrap (cadr cs))))
|
||||
(org-babel-tangle-comment-links i))
|
||||
body)))
|
||||
(setq expansion (concat expansion full))))
|
||||
(setq expansion (cons sep (cons full expansion)))))
|
||||
(org-babel-map-src-blocks nil
|
||||
(let ((i (org-babel-get-src-block-info 'light)))
|
||||
(when (equal (or (cdr (assoc :noweb-ref (nth 2 i)))
|
||||
(nth 4 i))
|
||||
source-name)
|
||||
(let* ((body (org-babel-expand-noweb-references i))
|
||||
(sep (or (cdr (assoc :noweb-sep (nth 2 i)))
|
||||
"\n"))
|
||||
(full (if comment
|
||||
((lambda (cs)
|
||||
(concat (c-wrap (car cs)) "\n"
|
||||
|
@ -2090,8 +2221,10 @@ block but are passed literally to the \"example-block\"."
|
|||
(c-wrap (cadr cs))))
|
||||
(org-babel-tangle-comment-links i))
|
||||
body)))
|
||||
(setq expansion (concat expansion full))))))))
|
||||
expansion)
|
||||
(setq expansion
|
||||
(cons sep (cons full expansion)))))))))
|
||||
(and expansion
|
||||
(mapconcat #'identity (nreverse (cdr expansion)) "")))
|
||||
;; possibly raise an error if named block doesn't exist
|
||||
(if (member lang org-babel-noweb-error-langs)
|
||||
(error "%s" (concat
|
||||
|
@ -2099,7 +2232,7 @@ block but are passed literally to the \"example-block\"."
|
|||
"could not be resolved (see "
|
||||
"`org-babel-noweb-error-langs')"))
|
||||
"")))
|
||||
"[\n\r]") (concat "\n" prefix)))))
|
||||
"[\n\r]") (concat "\n" prefix))))))
|
||||
(nb-add (buffer-substring index (point-max)))))
|
||||
new-body))
|
||||
|
||||
|
@ -2108,10 +2241,16 @@ block but are passed literally to the \"example-block\"."
|
|||
(when text
|
||||
(set-text-properties 0 (length text) nil text) text))
|
||||
|
||||
(defun org-babel-strip-protective-commas (body)
|
||||
(defun org-babel-strip-protective-commas (body &optional lang)
|
||||
"Strip protective commas from bodies of source blocks."
|
||||
(when body
|
||||
(replace-regexp-in-string "^,#" "#" body)))
|
||||
(with-temp-buffer
|
||||
(insert body)
|
||||
(if (and lang (string= lang "org"))
|
||||
(progn (goto-char (point-min))
|
||||
(while (re-search-forward "^[ \t]*\\(,\\)" nil t)
|
||||
(replace-match "" nil nil nil 1)))
|
||||
(org-strip-protective-commas (point-min) (point-max)))
|
||||
(buffer-string)))
|
||||
|
||||
(defun org-babel-script-escape (str &optional force)
|
||||
"Safely convert tables into elisp lists."
|
||||
|
|
|
@ -91,7 +91,7 @@
|
|||
(defvar org-agenda-buffer-name)
|
||||
(defvar org-agenda-overriding-header)
|
||||
(defvar org-agenda-title-append nil)
|
||||
(defvar entry)
|
||||
(defvar org-entry)
|
||||
(defvar date)
|
||||
(defvar org-agenda-undo-list)
|
||||
(defvar org-agenda-pending-undo-list)
|
||||
|
@ -247,9 +247,7 @@ you can \"misuse\" it to also add other text to the header. However,
|
|||
|
||||
;; Keep custom values for `org-agenda-filter-preset' compatible with
|
||||
;; the new variable `org-agenda-tag-filter-preset'.
|
||||
(if (fboundp 'defvaralias)
|
||||
(defvaralias 'org-agenda-filter-preset 'org-agenda-tag-filter-preset)
|
||||
(defvaralias 'org-agenda-filter 'org-agenda-tag-filter))
|
||||
(defvaralias 'org-agenda-filter-preset 'org-agenda-tag-filter-preset)
|
||||
|
||||
(defconst org-agenda-custom-commands-local-options
|
||||
`(repeat :tag "Local settings for this command. Remember to quote values"
|
||||
|
@ -306,11 +304,13 @@ you can \"misuse\" it to also add other text to the header. However,
|
|||
(string :tag "+tag or -tag"))))
|
||||
(list :tag "Set daily/weekly entry types"
|
||||
(const org-agenda-entry-types)
|
||||
(set :greedy t :value (:deadline :scheduled :timestamp :sexp)
|
||||
(const :deadline)
|
||||
(const :scheduled)
|
||||
(const :timestamp)
|
||||
(const :sexp)))
|
||||
(list
|
||||
(const :format "" quote)
|
||||
(set :greedy t :value (:deadline :scheduled :timestamp :sexp)
|
||||
(const :deadline)
|
||||
(const :scheduled)
|
||||
(const :timestamp)
|
||||
(const :sexp))))
|
||||
(list :tag "Standard skipping condition"
|
||||
:value (org-agenda-skip-function '(org-agenda-skip-entry-if))
|
||||
(const org-agenda-skip-function)
|
||||
|
@ -408,7 +408,7 @@ where
|
|||
|
||||
desc A description string to be displayed in the dispatcher menu.
|
||||
cmd An agenda command, similar to the above. However, tree commands
|
||||
are no allowed, but instead you can get agenda and global todo list.
|
||||
are not allowed, but instead you can get agenda and global todo list.
|
||||
So valid commands for a set are:
|
||||
(agenda \"\" settings)
|
||||
(alltodo \"\" settings)
|
||||
|
@ -1770,7 +1770,7 @@ works you probably want to add it to `org-agenda-custom-commands' for good."
|
|||
(setcdr ass (cdr entry))
|
||||
(push entry org-agenda-custom-commands))))
|
||||
|
||||
;;; Define the org-agenda-mode
|
||||
;;; Define the Org-agenda-mode
|
||||
|
||||
(defvar org-agenda-mode-map (make-sparse-keymap)
|
||||
"Keymap for `org-agenda-mode'.")
|
||||
|
@ -3075,7 +3075,6 @@ the global options and expect it to be applied to the entire view.")
|
|||
|
||||
(defun org-prepare-agenda (&optional name)
|
||||
(setq org-todo-keywords-for-agenda nil)
|
||||
(setq org-done-keywords-for-agenda nil)
|
||||
(setq org-drawers-for-agenda nil)
|
||||
(unless org-agenda-persistent-filter
|
||||
(setq org-agenda-tag-filter nil
|
||||
|
@ -3094,6 +3093,7 @@ the global options and expect it to be applied to the entire view.")
|
|||
(make-string (window-width) org-agenda-block-separator))
|
||||
"\n"))
|
||||
(narrow-to-region (point) (point-max)))
|
||||
(setq org-done-keywords-for-agenda nil)
|
||||
(org-agenda-reset-markers)
|
||||
(setq org-agenda-contributing-files nil)
|
||||
(setq org-agenda-columns-active nil)
|
||||
|
@ -4221,7 +4221,7 @@ See `org-agenda-skip-if' for details."
|
|||
(defun org-agenda-skip-if (subtree conditions)
|
||||
"Checks current entity for CONDITIONS.
|
||||
If SUBTREE is non-nil, the entire subtree is checked. Otherwise, only
|
||||
the entry, i.e. the text before the next heading is checked.
|
||||
the entry (i.e. the text before the next heading) is checked.
|
||||
|
||||
CONDITIONS is a list of symbols, boolean OR is used to combine the results
|
||||
from different tests. Valid conditions are:
|
||||
|
@ -4247,12 +4247,12 @@ keywords, which may include \"*\" to match any todo keyword.
|
|||
|
||||
would skip all entries with \"TODO\" or \"WAITING\" keywords.
|
||||
|
||||
Instead of a list a keyword class may be given
|
||||
Instead of a list, a keyword class may be given. For example:
|
||||
|
||||
(org-agenda-skip-entry-if 'nottodo 'done)
|
||||
|
||||
would skip entries that haven't been marked with any of \"DONE\"
|
||||
keywords. Possible classes are: `todo', `done', `any'.
|
||||
keywords. Possible classes are: `todo', `done', `any'.
|
||||
|
||||
If any of these conditions is met, this function returns the end point of
|
||||
the entity, causing the search to continue from there. This is a function
|
||||
|
@ -4285,8 +4285,8 @@ that can be put into `org-agenda-skip-function' for the duration of a command."
|
|||
(stringp (nth 1 m))
|
||||
(not (re-search-forward (nth 1 m) end t)))
|
||||
(and (or
|
||||
(setq m (memq 'todo conditions))
|
||||
(setq m (memq 'nottodo conditions)))
|
||||
(setq m (memq 'nottodo conditions))
|
||||
(setq m (memq 'todo conditions)))
|
||||
(org-agenda-skip-if-todo m end)))
|
||||
end)))
|
||||
|
||||
|
@ -4377,7 +4377,7 @@ of what a project is and how to check if it stuck, customize the variable
|
|||
;;; Diary integration
|
||||
|
||||
(defvar org-disable-agenda-to-diary nil) ;Dynamically-scoped param.
|
||||
(defvar diary-list-entries-hook)
|
||||
(defvar list-diary-entries-hook)
|
||||
(defvar diary-time-regexp)
|
||||
(defun org-get-entries-from-diary (date)
|
||||
"Get the (Emacs Calendar) diary entries for DATE."
|
||||
|
@ -4386,8 +4386,8 @@ of what a project is and how to check if it stuck, customize the variable
|
|||
(diary-display-hook '(fancy-diary-display))
|
||||
(diary-display-function 'fancy-diary-display)
|
||||
(pop-up-frames nil)
|
||||
(diary-list-entries-hook
|
||||
(cons 'org-diary-default-entry diary-list-entries-hook))
|
||||
(list-diary-entries-hook
|
||||
(cons 'org-diary-default-entry list-diary-entries-hook))
|
||||
(diary-file-name-prefix-function nil) ; turn this feature off
|
||||
(diary-modify-entry-list-string-function 'org-modify-diary-entry-string)
|
||||
entries
|
||||
|
@ -4530,8 +4530,8 @@ function from a program - use `org-agenda-get-day-entries' instead."
|
|||
(org-compile-prefix-format 'agenda)
|
||||
(org-set-sorting-strategy 'agenda)
|
||||
(setq args (or args '(:deadline :scheduled :timestamp :sexp)))
|
||||
(let* ((files (if (and entry (stringp entry) (string-match "\\S-" entry))
|
||||
(list entry)
|
||||
(let* ((files (if (and org-entry (stringp org-entry) (string-match "\\S-" org-entry))
|
||||
(list org-entry)
|
||||
(org-agenda-files t)))
|
||||
(time (org-float-time))
|
||||
file rtn results)
|
||||
|
@ -4936,7 +4936,7 @@ holiday will also be skipped."
|
|||
(not (member (car (calendar-iso-from-absolute d)) skip-weeks))))
|
||||
(not (and (memq 'holidays skip-weeks)
|
||||
(calendar-check-holidays date)))
|
||||
entry)))
|
||||
org-entry)))
|
||||
|
||||
(defun org-diary-class (m1 d1 y1 m2 d2 y2 dayname &rest skip-weeks)
|
||||
"Like `org-class', but honor `calendar-date-style'.
|
||||
|
@ -5870,8 +5870,18 @@ could bind the variable in the options section of a custom command.")
|
|||
(let ((pl (text-property-any 0 (length x) 'org-heading t x)))
|
||||
(setq re (get-text-property 0 'org-todo-regexp x))
|
||||
(when (and re
|
||||
;; Test `pl' because if there's no heading content,
|
||||
;; there's no point matching to highlight. Note
|
||||
;; that if we didn't test `pl' first, and there
|
||||
;; happened to be no keyword from `org-todo-regexp'
|
||||
;; on this heading line, then the `equal' comparison
|
||||
;; afterwards would spuriously succeed in the case
|
||||
;; where `pl' is nil -- causing an args-out-of-range
|
||||
;; error when we try to add text properties to text
|
||||
;; that isn't there.
|
||||
pl
|
||||
(equal (string-match (concat "\\(\\.*\\)" re "\\( +\\)")
|
||||
x (or pl 0)) pl))
|
||||
x pl) pl))
|
||||
(add-text-properties
|
||||
(or (match-end 1) (match-end 0)) (match-end 0)
|
||||
(list 'face (org-get-todo-face (match-string 2 x)))
|
||||
|
@ -6182,8 +6192,8 @@ When this is the global TODO list, a prefix argument will be interpreted."
|
|||
(recenter window-line)))
|
||||
|
||||
(defvar org-global-tags-completion-table nil)
|
||||
(defvar org-agenda-filtered-by-category nil)
|
||||
(defvar org-agenda-filter-form nil)
|
||||
(defvar org-agenda-filtered-by-category nil)
|
||||
|
||||
(defun org-agenda-filter-by-category (strip)
|
||||
"Keep only those lines in the agenda buffer that have a specific category.
|
||||
|
@ -7282,16 +7292,18 @@ use the dedicated frame)."
|
|||
(if (and current-prefix-arg (listp current-prefix-arg))
|
||||
(org-agenda-do-tree-to-indirect-buffer)
|
||||
(let ((agenda-window (selected-window))
|
||||
(indirect-window (get-buffer-window org-last-indirect-buffer)))
|
||||
(indirect-window
|
||||
(and org-last-indirect-buffer
|
||||
(get-buffer-window org-last-indirect-buffer))))
|
||||
(save-window-excursion (org-agenda-do-tree-to-indirect-buffer))
|
||||
(unwind-protect
|
||||
(progn
|
||||
(unless indirect-window
|
||||
(unless (and indirect-window (window-live-p indirect-window))
|
||||
(setq indirect-window (split-window agenda-window)))
|
||||
(select-window indirect-window)
|
||||
(switch-to-buffer org-last-indirect-buffer :norecord)
|
||||
(fit-window-to-buffer indirect-window))
|
||||
(select-window agenda-window)))))
|
||||
(select-window (get-buffer-window org-agenda-buffer-name))))))
|
||||
|
||||
(defun org-agenda-do-tree-to-indirect-buffer ()
|
||||
"Same as `org-agenda-tree-to-indirect-buffer' without saving window."
|
||||
|
|
|
@ -438,7 +438,9 @@ publishing directory."
|
|||
link (concat (match-string 1 line) path)
|
||||
type (match-string 2 line)
|
||||
desc0 (match-string 5 line)
|
||||
desc (or desc0 link))
|
||||
desc0 (replace-regexp-in-string "\\\\_" "_" desc0)
|
||||
desc (or desc0 link)
|
||||
desc (replace-regexp-in-string "\\\\_" "_" desc))
|
||||
(if (and (> (length link) 8)
|
||||
(equal (substring link 0 8) "coderef:"))
|
||||
(setq line (replace-match
|
||||
|
|
|
@ -104,7 +104,7 @@ ln create a hard link. Note that this is not supported
|
|||
:type '(choice
|
||||
(const :tag "Don't store link" nil)
|
||||
(const :tag "Link to origin location" t)
|
||||
(const :tag "Link to the attach-dir location" 'attached)))
|
||||
(const :tag "Link to the attach-dir location" attached)))
|
||||
|
||||
;;;###autoload
|
||||
(defun org-attach ()
|
||||
|
|
|
@ -112,20 +112,14 @@
|
|||
(&optional dont-check-disk already-in-db-buffer))
|
||||
(declare-function bbdb-split "ext:bbdb" (string separators))
|
||||
(declare-function bbdb-string-trim "ext:bbdb" (string))
|
||||
(declare-function bbdb-record-get-field "ext:bbdb"
|
||||
(fn file &optional arglist fileonly))
|
||||
;; These two functions below are part of BBDB3:
|
||||
(declare-function bbdb-search-name "ext:bbdb" (regexp &optional layout))
|
||||
(declare-function bbdb-search-organization "ext:bbdb" (regexp &optional layout))
|
||||
(declare-function bbdb-record-get-field "ext:bbdb" (record field))
|
||||
(declare-function bbdb-search-name "ext:bbdb-com" (regexp &optional layout))
|
||||
(declare-function bbdb-search-organization "ext:bbdb-com" (regexp &optional layout))
|
||||
|
||||
(declare-function calendar-leap-year-p "calendar" (year))
|
||||
(declare-function diary-ordinal-suffix "diary-lib" (n))
|
||||
|
||||
(defvar date) ;; dynamically scoped from Org
|
||||
(defvar name) ;; dynamically scoped from Org
|
||||
|
||||
;; Support for version 2.35
|
||||
(defvar org-bbdb-old (fboundp 'bbdb-record-get-field-internal))
|
||||
|
||||
;; Customization
|
||||
|
||||
|
@ -206,7 +200,7 @@ date year)."
|
|||
;; This is BBDB, we make this link!
|
||||
(let* ((rec (bbdb-current-record))
|
||||
(name (bbdb-record-name rec))
|
||||
(company (if org-bbdb-old
|
||||
(company (if (fboundp 'bbdb-record-getprop)
|
||||
(bbdb-record-getprop rec 'company)
|
||||
(car (bbdb-record-get-field rec 'organization))))
|
||||
(link (org-make-link "bbdb:" name)))
|
||||
|
@ -227,14 +221,14 @@ italicized, in all other cases it is left unchanged."
|
|||
|
||||
(defun org-bbdb-open (name)
|
||||
"Follow a BBDB link to NAME."
|
||||
(require 'bbdb)
|
||||
(require 'bbdb-com)
|
||||
(let ((inhibit-redisplay (not debug-on-error))
|
||||
(bbdb-electric-p nil))
|
||||
(if org-bbdb-old
|
||||
(org-bbdb-open-old)
|
||||
(org-bbdb-open-new))))
|
||||
(if (fboundp 'bbdb-name)
|
||||
(org-bbdb-open-old name)
|
||||
(org-bbdb-open-new name))))
|
||||
|
||||
(defun org-bbdb-open-old ()
|
||||
(defun org-bbdb-open-old (name)
|
||||
(catch 'exit
|
||||
;; Exact match on name
|
||||
(bbdb-name (concat "\\`" name "\\'") nil)
|
||||
|
@ -254,7 +248,7 @@ italicized, in all other cases it is left unchanged."
|
|||
(delete-window (get-buffer-window "*BBDB*"))
|
||||
(error "No matching BBDB record"))))
|
||||
|
||||
(defun org-bbdb-open-new ()
|
||||
(defun org-bbdb-open-new (name)
|
||||
(catch 'exit
|
||||
;; Exact match on name
|
||||
(bbdb-search-name (concat "\\`" name "\\'") nil)
|
||||
|
|
|
@ -235,7 +235,7 @@ in org-export-latex-classes."
|
|||
(envs (append org-beamer-environments-extra
|
||||
org-beamer-environments-default))
|
||||
(props (org-get-text-property-any 0 'org-props text))
|
||||
(in "") (out "") option action defaction environment extra
|
||||
(in "") (out "") org-beamer-option org-beamer-action org-beamer-defaction org-beamer-environment org-beamer-extra
|
||||
columns-option column-option
|
||||
env have-text ass tmp)
|
||||
(if (= frame-level 0) (setq frame-level nil))
|
||||
|
@ -266,10 +266,10 @@ in org-export-latex-classes."
|
|||
|
||||
(setq in (org-fill-template
|
||||
"\\begin{frame}%a%A%o%T%S%x"
|
||||
(list (cons "a" (or action ""))
|
||||
(cons "A" (or defaction ""))
|
||||
(cons "o" (or option org-beamer-frame-default-options ""))
|
||||
(cons "x" (if extra (concat "\n" extra) ""))
|
||||
(list (cons "a" (or org-beamer-action ""))
|
||||
(cons "A" (or org-beamer-defaction ""))
|
||||
(cons "o" (or org-beamer-option org-beamer-frame-default-options ""))
|
||||
(cons "x" (if org-beamer-extra (concat "\n" org-beamer-extra) ""))
|
||||
(cons "h" "%s")
|
||||
(cons "T" (if (string-match "\\S-" text)
|
||||
"\n\\frametitle{%s}" ""))
|
||||
|
@ -294,10 +294,10 @@ in org-export-latex-classes."
|
|||
(setq have-text (string-match "\\S-" text))
|
||||
(setq in (org-fill-template
|
||||
(nth 2 ass)
|
||||
(list (cons "a" (or action ""))
|
||||
(cons "A" (or defaction ""))
|
||||
(cons "o" (or option ""))
|
||||
(cons "x" (if extra (concat "\n" extra) ""))
|
||||
(list (cons "a" (or org-beamer-action ""))
|
||||
(cons "A" (or org-beamer-defaction ""))
|
||||
(cons "o" (or org-beamer-option ""))
|
||||
(cons "x" (if org-beamer-extra (concat "\n" org-beamer-extra) ""))
|
||||
(cons "h" "%s")
|
||||
(cons "H" (if have-text (concat "{" text "}") ""))
|
||||
(cons "U" (if have-text (concat "[" text "]") ""))))
|
||||
|
@ -321,31 +321,31 @@ in org-export-latex-classes."
|
|||
(cons text (cdr (assoc level default))))
|
||||
(t nil))))
|
||||
|
||||
(defvar extra)
|
||||
(defvar option)
|
||||
(defvar action)
|
||||
(defvar defaction)
|
||||
(defvar environment)
|
||||
(defvar org-beamer-extra)
|
||||
(defvar org-beamer-option)
|
||||
(defvar org-beamer-action)
|
||||
(defvar org-beamer-defaction)
|
||||
(defvar org-beamer-environment)
|
||||
(defun org-beamer-get-special (props)
|
||||
"Extract an option, action, and default action string from text.
|
||||
The variables option, action, defaction, extra are all scoped into
|
||||
this function dynamically."
|
||||
The variables org-beamer-option, org-beamer-action, org-beamer-defaction,
|
||||
org-beamer-extra are all scoped into this function dynamically."
|
||||
(let (tmp)
|
||||
(setq environment (org-beamer-assoc-not-empty "BEAMER_env" props))
|
||||
(setq extra (org-beamer-assoc-not-empty "BEAMER_extra" props))
|
||||
(when extra
|
||||
(setq extra (replace-regexp-in-string "\\\\n" "\n" extra)))
|
||||
(setq org-beamer-environment (org-beamer-assoc-not-empty "BEAMER_env" props))
|
||||
(setq org-beamer-extra (org-beamer-assoc-not-empty "BEAMER_extra" props))
|
||||
(when org-beamer-extra
|
||||
(setq org-beamer-extra (replace-regexp-in-string "\\\\n" "\n" org-beamer-extra)))
|
||||
(setq tmp (org-beamer-assoc-not-empty "BEAMER_envargs" props))
|
||||
(when tmp
|
||||
(setq tmp (copy-sequence tmp))
|
||||
(if (string-match "\\[<[^][<>]*>\\]" tmp)
|
||||
(setq defaction (match-string 0 tmp)
|
||||
(setq org-beamer-defaction (match-string 0 tmp)
|
||||
tmp (replace-match "" t t tmp)))
|
||||
(if (string-match "\\[[^][]*\\]" tmp)
|
||||
(setq option (match-string 0 tmp)
|
||||
(setq org-beamer-option (match-string 0 tmp)
|
||||
tmp (replace-match "" t t tmp)))
|
||||
(if (string-match "<[^<>]*>" tmp)
|
||||
(setq action (match-string 0 tmp)
|
||||
(setq org-beamer-action (match-string 0 tmp)
|
||||
tmp (replace-match "" t t tmp))))))
|
||||
|
||||
(defun org-beamer-assoc-not-empty (elt list)
|
||||
|
@ -579,7 +579,7 @@ include square brackets."
|
|||
(add-hook 'org-export-preprocess-before-selecting-backend-code-hook
|
||||
'org-beamer-select-beamer-code)
|
||||
|
||||
(defun org-insert-beamer-options-template (kind)
|
||||
(defun org-insert-beamer-options-template (&optional kind)
|
||||
"Insert a settings template, to make sure users do this right."
|
||||
(interactive (progn
|
||||
(message "Current [s]ubtree or [g]lobal?")
|
||||
|
|
|
@ -112,7 +112,7 @@
|
|||
(eval-when-compile
|
||||
(require 'cl))
|
||||
|
||||
(defvar description nil) ; dynamically scoped from org.el
|
||||
(defvar org-bibtex-description nil) ; dynamically scoped from org.el
|
||||
(defvar org-id-locations)
|
||||
|
||||
(declare-function bibtex-beginning-of-entry "bibtex" ())
|
||||
|
@ -467,7 +467,7 @@ With optional argument OPTIONAL, also prompt for optional fields."
|
|||
:btype (or (cdr (assoc "=type=" entry)) "[no type]")
|
||||
:type "bibtex"
|
||||
:link link
|
||||
:description description))))
|
||||
:description org-bibtex-description))))
|
||||
|
||||
(defun org-create-file-search-in-bibtex ()
|
||||
"Create the search string and description for a BibTeX database entry."
|
||||
|
@ -485,7 +485,7 @@ With optional argument OPTIONAL, also prompt for optional fields."
|
|||
(bibtex-autokey-titleword-case-convert-function 'identity)
|
||||
(bibtex-autokey-titleword-length 'infty)
|
||||
(bibtex-autokey-year-title-separator ": "))
|
||||
(setq description (bibtex-generate-autokey)))
|
||||
(setq org-bibtex-description (bibtex-generate-autokey)))
|
||||
;; Now parse the entry, get the key and return it.
|
||||
(save-excursion
|
||||
(bibtex-beginning-of-entry)
|
||||
|
|
|
@ -911,30 +911,30 @@ it. When it is a variable, retrieve the value. Return whatever we get."
|
|||
(target-entry-p (org-capture-get :target-entry-p))
|
||||
(ind 0)
|
||||
beg end)
|
||||
(cond
|
||||
((org-capture-get :exact-position)
|
||||
(goto-char (org-capture-get :exact-position)))
|
||||
((not target-entry-p)
|
||||
;; Insert as top-level entry, either at beginning or at end of file
|
||||
(setq beg (point-min) end (point-max)))
|
||||
(t
|
||||
(setq beg (1+ (point-at-eol))
|
||||
end (save-excursion (outline-next-heading) (point)))))
|
||||
(if (org-capture-get :prepend)
|
||||
(progn
|
||||
(goto-char beg)
|
||||
(if (org-list-search-forward (org-item-beginning-re) end t)
|
||||
(progn
|
||||
(goto-char (match-beginning 0))
|
||||
(setq ind (org-get-indentation)))
|
||||
(goto-char end)
|
||||
(setq ind 0)))
|
||||
(goto-char end)
|
||||
(if (org-list-search-backward (org-item-beginning-re) beg t)
|
||||
(if (org-capture-get :exact-position)
|
||||
(goto-char (org-capture-get :exact-position))
|
||||
(cond
|
||||
((not target-entry-p)
|
||||
;; Insert as top-level entry, either at beginning or at end of file
|
||||
(setq beg (point-min) end (point-max)))
|
||||
(t
|
||||
(setq beg (1+ (point-at-eol))
|
||||
end (save-excursion (outline-next-heading) (point)))))
|
||||
(if (org-capture-get :prepend)
|
||||
(progn
|
||||
(setq ind (org-get-indentation))
|
||||
(org-end-of-item))
|
||||
(setq ind 0)))
|
||||
(goto-char beg)
|
||||
(if (org-list-search-forward (org-item-beginning-re) end t)
|
||||
(progn
|
||||
(goto-char (match-beginning 0))
|
||||
(setq ind (org-get-indentation)))
|
||||
(goto-char end)
|
||||
(setq ind 0)))
|
||||
(goto-char end)
|
||||
(if (org-list-search-backward (org-item-beginning-re) beg t)
|
||||
(progn
|
||||
(setq ind (org-get-indentation))
|
||||
(org-end-of-item))
|
||||
(setq ind 0))))
|
||||
;; Remove common indentation
|
||||
(setq txt (org-remove-indentation txt))
|
||||
;; Make sure this is indeed an item
|
||||
|
|
|
@ -1691,7 +1691,7 @@ from the `before-change-functions' in the current buffer."
|
|||
(remove-hook 'before-change-functions
|
||||
'org-clock-remove-overlays 'local))))
|
||||
|
||||
(defvar state) ;; dynamically scoped into this function
|
||||
(defvar org-clock-state) ;; dynamically scoped into this function
|
||||
(defun org-clock-out-if-current ()
|
||||
"Clock out if the current entry contains the running clock.
|
||||
This is used to stop the clock after a TODO entry is marked DONE,
|
||||
|
@ -1700,9 +1700,9 @@ and is only done if the variable `org-clock-out-when-done' is not nil."
|
|||
org-clock-out-when-done
|
||||
(marker-buffer org-clock-marker)
|
||||
(or (and (eq t org-clock-out-when-done)
|
||||
(member state org-done-keywords))
|
||||
(member org-clock-state org-done-keywords))
|
||||
(and (listp org-clock-out-when-done)
|
||||
(member state org-clock-out-when-done)))
|
||||
(member org-clock-state org-clock-out-when-done)))
|
||||
(equal (or (buffer-base-buffer (org-clocking-buffer))
|
||||
(org-clocking-buffer))
|
||||
(or (buffer-base-buffer (current-buffer))
|
||||
|
@ -1763,17 +1763,6 @@ buffer and update it."
|
|||
(org-combine-plists org-clock-clocktable-default-properties props))))
|
||||
(org-update-dblock))
|
||||
|
||||
(defun org-in-clocktable-p ()
|
||||
"Check if the cursor is in a clocktable."
|
||||
(let ((pos (point)) start)
|
||||
(save-excursion
|
||||
(end-of-line 1)
|
||||
(and (re-search-backward "^[ \t]*#\\+BEGIN:[ \t]+clocktable" nil t)
|
||||
(setq start (match-beginning 0))
|
||||
(re-search-forward "^[ \t]*#\\+END:.*" nil t)
|
||||
(>= (match-end 0) pos)
|
||||
start))))
|
||||
|
||||
(defun org-day-of-week (day month year)
|
||||
"Returns the day of the week as an integer."
|
||||
(nth 6
|
||||
|
@ -2445,6 +2434,7 @@ TIME: The sum of all time spend in this tree, in minutes. This time
|
|||
(tags (plist-get params :tags))
|
||||
(properties (plist-get params :properties))
|
||||
(inherit-property-p (plist-get params :inherit-props))
|
||||
todo-only
|
||||
(matcher (if tags (cdr (org-make-tags-matcher tags))))
|
||||
cc range-text st p time level hdl props tsp tbl)
|
||||
|
||||
|
|
|
@ -194,7 +194,9 @@ This is the compiled version of the format.")
|
|||
(point-at-bol) (point-at-eol)))))
|
||||
;; In agenda, just get the `txt' property
|
||||
(org-no-properties
|
||||
(org-get-at-bol 'txt))))
|
||||
(or (org-get-at-bol 'txt)
|
||||
(buffer-substring
|
||||
(point) (progn (end-of-line) (point)))))))
|
||||
(assoc property props))
|
||||
width (or (cdr (assoc property org-columns-current-maxwidths))
|
||||
(nth 2 column)
|
||||
|
@ -355,7 +357,7 @@ CPHR is the complex heading regexp to use for parsing ITEM."
|
|||
'org-whitespace (* 2 (1- (org-reduced-level (- (match-end 1) (match-beginning 1))))))
|
||||
(and (match-end 2) (not (assoc "TODO" fmt)) (concat " " (match-string 2 item)))
|
||||
(and (match-end 3) (not (assoc "PRIORITY" fmt)) (concat " " (match-string 3 item)))
|
||||
" " (save-match-data (org-columns-compact-links (match-string 4 item)))
|
||||
" " (save-match-data (org-columns-compact-links (or (match-string 4 item) "")))
|
||||
(and (match-end 5) (not (assoc "TAGS" fmt)) (concat " " (match-string 5 item)))))
|
||||
(add-text-properties
|
||||
0 (1+ (match-end 1))
|
||||
|
@ -928,6 +930,8 @@ Don't set this, this is meant for dynamic scoping.")
|
|||
(overlay-put ov 'display (format fmt val)))))
|
||||
org-columns-overlays))))
|
||||
|
||||
(defvar org-inlinetask-min-level
|
||||
(if (featurep 'org-inlinetask) org-inlinetask-min-level 15))
|
||||
(defun org-columns-compute (property)
|
||||
"Sum the values of property PROPERTY hierarchically, for the entire buffer."
|
||||
(interactive)
|
||||
|
@ -942,7 +946,9 @@ Don't set this, this is meant for dynamic scoping.")
|
|||
(fun (nth 6 ass))
|
||||
(calc (or (nth 7 ass) 'identity))
|
||||
(beg org-columns-top-level-marker)
|
||||
last-level val valflag flag end sumpos sum-alist sum str str1 useval)
|
||||
(inminlevel org-inlinetask-min-level)
|
||||
(last-level org-inlinetask-min-level)
|
||||
val valflag flag end sumpos sum-alist sum str str1 useval)
|
||||
(save-excursion
|
||||
;; Find the region to compute
|
||||
(goto-char beg)
|
||||
|
@ -951,16 +957,21 @@ Don't set this, this is meant for dynamic scoping.")
|
|||
;; Walk the tree from the back and do the computations
|
||||
(while (re-search-backward re beg t)
|
||||
(setq sumpos (match-beginning 0)
|
||||
last-level level
|
||||
last-level (if (not (or (zerop level) (eq level inminlevel)))
|
||||
level last-level)
|
||||
level (org-outline-level)
|
||||
val (org-entry-get nil property)
|
||||
valflag (and val (string-match "\\S-" val)))
|
||||
(cond
|
||||
((< level last-level)
|
||||
;; put the sum of lower levels here as a property
|
||||
(setq sum (when (aref lvals last-level)
|
||||
(apply fun (aref lvals last-level)))
|
||||
flag (aref lflag last-level) ; any valid entries from children?
|
||||
(setq sum (+ (if (and (/= last-level inminlevel)
|
||||
(aref lvals last-level))
|
||||
(apply fun (aref lvals last-level)) 0)
|
||||
(if (aref lvals inminlevel)
|
||||
(apply fun (aref lvals inminlevel)) 0))
|
||||
flag (or (aref lflag last-level) ; any valid entries from children?
|
||||
(aref lflag inminlevel)) ; or inline tasks?
|
||||
str (org-columns-number-to-string sum format printf)
|
||||
str1 (org-add-props (copy-sequence str) nil 'org-computed t 'face 'bold)
|
||||
useval (if flag str1 (if valflag val ""))
|
||||
|
|
|
@ -236,16 +236,20 @@ See `org-crypt-disable-auto-save'."
|
|||
(defun org-encrypt-entries ()
|
||||
"Encrypt all top-level entries in the current buffer."
|
||||
(interactive)
|
||||
(org-scan-tags
|
||||
'org-encrypt-entry
|
||||
(cdr (org-make-tags-matcher org-crypt-tag-matcher))))
|
||||
(let (todo-only)
|
||||
(org-scan-tags
|
||||
'org-encrypt-entry
|
||||
(cdr (org-make-tags-matcher org-crypt-tag-matcher))
|
||||
todo-only)))
|
||||
|
||||
(defun org-decrypt-entries ()
|
||||
"Decrypt all entries in the current buffer."
|
||||
(interactive)
|
||||
(org-scan-tags
|
||||
'org-decrypt-entry
|
||||
(cdr (org-make-tags-matcher org-crypt-tag-matcher))))
|
||||
(let (todo-only)
|
||||
(org-scan-tags
|
||||
'org-decrypt-entry
|
||||
(cdr (org-make-tags-matcher org-crypt-tag-matcher))
|
||||
todo-only)))
|
||||
|
||||
(defun org-crypt-use-before-save-magic ()
|
||||
"Add a hook to automatically encrypt entries before a file is saved to disk."
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
;; Copyright (C) 2011-2012 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Konrad Hinsen <konrad.hinsen AT fastmail.net>
|
||||
;; Version: 0.1
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
|
|
@ -57,9 +57,9 @@
|
|||
;; using the dot utility. For information on dot see
|
||||
;; http://www.graphviz.org/
|
||||
;;
|
||||
;; comment :: Wrap comments with titles and author information, in
|
||||
;; their own divs with author-specific ids allowing for css
|
||||
;; coloring of comments based on the author.
|
||||
;; export-comment :: Wrap comments with titles and author information,
|
||||
;; in their own divs with author-specific ids allowing for
|
||||
;; css coloring of comments based on the author.
|
||||
;;
|
||||
;;; Adding new blocks
|
||||
;;
|
||||
|
@ -73,6 +73,7 @@
|
|||
(eval-when-compile
|
||||
(require 'cl))
|
||||
(require 'org)
|
||||
(require 'find-func)
|
||||
|
||||
(defun org-export-blocks-set (var value)
|
||||
"Set the value of `org-export-blocks' and install fontification."
|
||||
|
@ -87,7 +88,7 @@
|
|||
value))
|
||||
|
||||
(defcustom org-export-blocks
|
||||
'((comment org-export-blocks-format-comment t)
|
||||
'((export-comment org-export-blocks-format-comment t)
|
||||
(ditaa org-export-blocks-format-ditaa nil)
|
||||
(dot org-export-blocks-format-dot nil))
|
||||
"Use this alist to associate block types with block exporting functions.
|
||||
|
@ -224,7 +225,7 @@ which defaults to the value of `org-export-blocks-witheld'."
|
|||
|
||||
;;--------------------------------------------------------------------------------
|
||||
;; ditaa: create images from ASCII art using the ditaa utility
|
||||
(defvar org-ditaa-jar-path (expand-file-name
|
||||
(defcustom org-ditaa-jar-path (expand-file-name
|
||||
"ditaa.jar"
|
||||
(file-name-as-directory
|
||||
(expand-file-name
|
||||
|
@ -232,8 +233,10 @@ which defaults to the value of `org-export-blocks-witheld'."
|
|||
(file-name-as-directory
|
||||
(expand-file-name
|
||||
"../contrib"
|
||||
(file-name-directory (or load-file-name buffer-file-name)))))))
|
||||
"Path to the ditaa jar executable.")
|
||||
(file-name-directory (find-library-name "org")))))))
|
||||
"Path to the ditaa jar executable."
|
||||
:group 'org-babel
|
||||
:type 'string)
|
||||
|
||||
(defvar org-export-current-backend) ; dynamically bound in org-exp.el
|
||||
(defun org-export-blocks-format-ditaa (body &rest headers)
|
||||
|
|
|
@ -1730,10 +1730,11 @@ from the buffer."
|
|||
":[ \t]*\\(.*\\)") nil t)
|
||||
(if (not (eq backend org-export-current-backend))
|
||||
(delete-region (point-at-bol) (min (1+ (point-at-eol)) (point-max)))
|
||||
(replace-match "\\1\\2" t)
|
||||
(add-text-properties
|
||||
(point-at-bol) (min (1+ (point-at-eol)) (point-max))
|
||||
`(org-protected t original-indentation ,ind org-native-text t))))
|
||||
(let ((ind (get-text-property (point-at-bol) 'original-indentation)))
|
||||
(replace-match "\\1\\2" t)
|
||||
(add-text-properties
|
||||
(point-at-bol) (min (1+ (point-at-eol)) (point-max))
|
||||
`(org-protected t original-indentation ,ind org-native-text t)))))
|
||||
;; Delete #+ATTR_BACKEND: stuff of another backend. Those
|
||||
;; matching the current backend will be taken care of by
|
||||
;; `org-export-attach-captions-and-attributes'
|
||||
|
@ -1748,7 +1749,8 @@ from the buffer."
|
|||
(while (re-search-forward (concat "^[ \t]*#\\+BEGIN_" backend-name "\\>.*\n?")
|
||||
nil t)
|
||||
(setq beg (match-beginning 0) beg-content (match-end 0))
|
||||
(setq ind (save-excursion (goto-char beg) (org-get-indentation)))
|
||||
(setq ind (or (get-text-property beg 'original-indentation)
|
||||
(save-excursion (goto-char beg) (org-get-indentation))))
|
||||
(when (re-search-forward (concat "^[ \t]*#\\+END_" backend-name "\\>.*\n?")
|
||||
nil t)
|
||||
(setq end (match-end 0) end-content (match-beginning 0))
|
||||
|
@ -1759,17 +1761,7 @@ from the buffer."
|
|||
beg-content end-content
|
||||
`(org-protected t original-indentation ,ind org-native-text t))
|
||||
;; strip protective commas
|
||||
(save-excursion
|
||||
(save-match-data
|
||||
(goto-char beg-content)
|
||||
(let ((front-line (save-excursion
|
||||
(re-search-forward
|
||||
"[^[:space:]]" end-content t)
|
||||
(goto-char (match-beginning 0))
|
||||
(current-column))))
|
||||
(while (re-search-forward "^[ \t]*\\(,\\)" end-content t)
|
||||
(when (= (current-column) front-line)
|
||||
(replace-match "" nil nil nil 1))))))
|
||||
(org-strip-protective-commas beg-content end-content)
|
||||
(delete-region (match-beginning 0) (match-end 0))
|
||||
(save-excursion
|
||||
(goto-char beg)
|
||||
|
@ -1816,8 +1808,7 @@ These special cookies will later be interpreted by the backend."
|
|||
(top (point-at-bol))
|
||||
(top-ind (org-list-get-ind top struct)))
|
||||
(goto-char bottom)
|
||||
(when (and (not (eq org-list-ending-method 'indent))
|
||||
(not (looking-at "[ \t]*$"))
|
||||
(when (and (not (looking-at "[ \t]*$"))
|
||||
(looking-at org-list-end-re))
|
||||
(replace-match ""))
|
||||
(unless (bolp) (insert "\n"))
|
||||
|
@ -1875,8 +1866,7 @@ These special properties will later be interpreted by the backend."
|
|||
;; useful to line processing exporters.
|
||||
(goto-char bottom)
|
||||
(when (or (looking-at "^ORG-LIST-END-MARKER\n")
|
||||
(and (not (eq org-list-ending-method 'indent))
|
||||
(not (looking-at "[ \t]*$"))
|
||||
(and (not (looking-at "[ \t]*$"))
|
||||
(looking-at org-list-end-re)))
|
||||
(replace-match ""))
|
||||
(unless (bolp) (insert "\n"))
|
||||
|
@ -2203,7 +2193,7 @@ can work correctly."
|
|||
;; This is a subtree, we take the title from the first heading
|
||||
(goto-char rbeg)
|
||||
(looking-at org-todo-line-tags-regexp)
|
||||
(setq title (if (eq tags t)
|
||||
(setq title (if (and (eq tags t) (match-string 4))
|
||||
(format "%s\t%s" (match-string 3) (match-string 4))
|
||||
(match-string 3)))
|
||||
(org-unmodified
|
||||
|
@ -3277,7 +3267,7 @@ If yes remove the column and the special lines."
|
|||
((org-table-cookie-line-p x)
|
||||
;; This line contains formatting cookies, discard it
|
||||
nil)
|
||||
((string-match "^[ \t]*| *[!_^/] *|" x)
|
||||
((string-match "^[ \t]*| *\\([!_^/$]\\|\\\\\\$\\) *|" x)
|
||||
;; ignore this line
|
||||
nil)
|
||||
((or (string-match "^\\([ \t]*\\)|-+\\+" x)
|
||||
|
|
|
@ -58,6 +58,7 @@
|
|||
(declare-function org-show-context "org" (&optional key))
|
||||
(declare-function org-trim "org" (s))
|
||||
(declare-function outline-next-heading "outline")
|
||||
(declare-function org-skip-whitespace "org" ())
|
||||
|
||||
(defvar org-outline-regexp-bol) ; defined in org.el
|
||||
(defvar org-odd-levels-only) ; defined in org.el
|
||||
|
@ -84,8 +85,8 @@
|
|||
(org-re "^\\[\\([0-9]+\\|fn:[-_[:word:]]+\\)\\]")
|
||||
"Regular expression matching the definition of a footnote.")
|
||||
|
||||
(defvar org-footnote-forbidden-blocks '("example" "verse" "src" "ascii" "beamer"
|
||||
"docbook" "html" "latex" "odt")
|
||||
(defconst org-footnote-forbidden-blocks
|
||||
'("ascii" "beamer" "comment" "docbook" "example" "html" "latex" "odt" "src")
|
||||
"Names of blocks where footnotes are not allowed.")
|
||||
|
||||
(defgroup org-footnote nil
|
||||
|
@ -242,40 +243,46 @@ positions, and the definition, when inlined."
|
|||
(match-end 0) (1- end)))))))))
|
||||
|
||||
(defun org-footnote-at-definition-p ()
|
||||
"Is the cursor at a footnote definition?
|
||||
"Is point within a footnote definition?
|
||||
|
||||
This matches only pure definitions like [1] or [fn:name] at the beginning
|
||||
of a line. It does not match references like [fn:name:definition], where the
|
||||
footnote text is included and defined locally.
|
||||
This matches only pure definitions like [1] or [fn:name] at the
|
||||
beginning of a line. It does not match references like
|
||||
\[fn:name:definition], where the footnote text is included and
|
||||
defined locally.
|
||||
|
||||
The return value will be nil if not at a footnote definition, and a list with
|
||||
label, start, end and definition of the footnote otherwise."
|
||||
The return value will be nil if not at a footnote definition, and
|
||||
a list with label, start, end and definition of the footnote
|
||||
otherwise."
|
||||
(when (save-excursion (beginning-of-line) (org-footnote-in-valid-context-p))
|
||||
(save-excursion
|
||||
(end-of-line)
|
||||
;; Footnotes definitions are separated by new headlines or blank
|
||||
;; lines.
|
||||
(let ((lim (save-excursion (re-search-backward
|
||||
(concat org-outline-regexp-bol
|
||||
"\\|^[ \t]*$") nil t))))
|
||||
(when (re-search-backward org-footnote-definition-re lim t)
|
||||
(end-of-line)
|
||||
(list (org-match-string-no-properties 1)
|
||||
(match-beginning 0)
|
||||
(save-match-data
|
||||
;; In a message, limit search to signature.
|
||||
(let ((bound (and (derived-mode-p 'message-mode)
|
||||
(save-excursion
|
||||
(goto-char (point-max))
|
||||
(re-search-backward
|
||||
message-signature-separator nil t)))))
|
||||
(or (and (re-search-forward
|
||||
(let ((label (org-match-string-no-properties 1))
|
||||
(beg (match-beginning 0))
|
||||
(beg-def (match-end 0))
|
||||
;; In message-mode, do not search after signature.
|
||||
(end (let ((bound (and (derived-mode-p 'message-mode)
|
||||
(save-excursion
|
||||
(goto-char (point-max))
|
||||
(re-search-backward
|
||||
message-signature-separator nil t)))))
|
||||
(if (progn
|
||||
(end-of-line)
|
||||
(re-search-forward
|
||||
(concat org-outline-regexp-bol "\\|"
|
||||
org-footnote-definition-re "\\|"
|
||||
"^[ \t]*$")
|
||||
bound 'move)
|
||||
(progn (skip-chars-forward " \t\n") (point-at-bol)))
|
||||
(point))))
|
||||
(org-trim (buffer-substring-no-properties
|
||||
(match-end 0) (point)))))))))
|
||||
"^[ \t]*$") bound 'move))
|
||||
(progn (goto-char (match-beginning 0))
|
||||
(org-skip-whitespace)
|
||||
(point-at-bol))
|
||||
(point)))))
|
||||
(list label beg end
|
||||
(org-trim (buffer-substring-no-properties beg-def end)))))))))
|
||||
|
||||
(defun org-footnote-get-next-reference (&optional label backward limit)
|
||||
"Return complete reference of the next footnote.
|
||||
|
@ -541,7 +548,9 @@ or new, let the user edit the definition of the footnote."
|
|||
(unless (bolp) (newline))
|
||||
(set-marker max nil))))
|
||||
;; Insert footnote label.
|
||||
(insert "\n[" label "] ")
|
||||
(when (zerop (org-back-over-empty-lines)) (newline))
|
||||
(insert "[" label "] \n")
|
||||
(backward-char)
|
||||
;; Only notify user about next possible action when in an Org
|
||||
;; buffer, as the bindings may have different meanings otherwise.
|
||||
(when (eq major-mode 'org-mode)
|
||||
|
@ -651,6 +660,7 @@ Additional note on `org-footnote-insert-pos-for-preprocessor':
|
|||
(goto-char (point-min))
|
||||
(while (setq ref (org-footnote-get-next-reference))
|
||||
(let* ((lbl (car ref))
|
||||
(pos (nth 1 ref))
|
||||
;; When footnote isn't anonymous, check if it's label
|
||||
;; (REF) is already stored in REF-TABLE. In that case,
|
||||
;; extract number used to identify it (MARKER). If
|
||||
|
@ -667,8 +677,7 @@ Additional note on `org-footnote-insert-pos-for-preprocessor':
|
|||
;; If EXPORT-PROPS isn't nil, also add `org-footnote'
|
||||
;; property to it, so it can be easily recognized by
|
||||
;; exporters.
|
||||
(if sort-only
|
||||
(goto-char (nth 2 ref))
|
||||
(if sort-only (goto-char (nth 2 ref))
|
||||
(delete-region (nth 1 ref) (nth 2 ref))
|
||||
(goto-char (nth 1 ref))
|
||||
(let ((new-ref (format "[%d]" marker)))
|
||||
|
@ -678,7 +687,8 @@ Additional note on `org-footnote-insert-pos-for-preprocessor':
|
|||
org-footnote-fill-after-inline-note-extraction
|
||||
(org-fill-paragraph)))
|
||||
;; Add label (REF), identifier (MARKER), definition (DEF)
|
||||
;; and type (INLINEP) to REF-TABLE if data was unknown.
|
||||
;; type (INLINEP) and position (POS) to REF-TABLE if data
|
||||
;; was unknown.
|
||||
(unless a
|
||||
(let ((def (or (nth 3 ref) ; inline
|
||||
(and export-props
|
||||
|
@ -696,27 +706,35 @@ Additional note on `org-footnote-insert-pos-for-preprocessor':
|
|||
'(:todo-keywords t :tags t :priority t))))
|
||||
(org-export-preprocess-string def parameters))
|
||||
def)
|
||||
inlinep) ref-table)))))
|
||||
;; Reference beginning position is a marker
|
||||
;; to preserve it during further buffer
|
||||
;; modifications.
|
||||
inlinep (copy-marker pos)) ref-table)))))
|
||||
;; 2. Find and remove the footnote section, if any. Also
|
||||
;; determine where footnotes shall be inserted (INS-POINT).
|
||||
(goto-char (point-min))
|
||||
(cond
|
||||
((and org-footnote-section
|
||||
(eq major-mode 'org-mode)
|
||||
(re-search-forward
|
||||
((and org-footnote-section (eq major-mode 'org-mode))
|
||||
(goto-char (point-min))
|
||||
(if (re-search-forward
|
||||
(concat "^\\*[ \t]+" (regexp-quote org-footnote-section)
|
||||
"[ \t]*$")
|
||||
nil t))
|
||||
(delete-region (match-beginning 0) (org-end-of-subtree t)))
|
||||
((eq major-mode 'org-mode)
|
||||
"[ \t]*$") nil t)
|
||||
(delete-region (match-beginning 0) (org-end-of-subtree t t)))
|
||||
;; A new footnote section is inserted by default at the end of
|
||||
;; the buffer.
|
||||
(goto-char (point-max))
|
||||
(skip-chars-backward " \r\t\n")
|
||||
(forward-line)
|
||||
(unless (bolp) (newline)))
|
||||
;; No footnote section set: Footnotes will be added at the end
|
||||
;; of the section containing their first reference.
|
||||
((eq major-mode 'org-mode))
|
||||
(t
|
||||
;; Remove any left-over tag in the buffer, if one is set up.
|
||||
(when org-footnote-tag-for-non-org-mode-files
|
||||
(let ((tag (concat "^" (regexp-quote
|
||||
org-footnote-tag-for-non-org-mode-files)
|
||||
"[ \t]*$")))
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward tag nil t)
|
||||
(replace-match "")
|
||||
(delete-region (point) (progn (forward-line) (point))))))
|
||||
|
@ -742,18 +760,21 @@ Additional note on `org-footnote-insert-pos-for-preprocessor':
|
|||
(lambda (x)
|
||||
(cond
|
||||
;; When only sorting, ignore inline footnotes.
|
||||
((and sort-only (nth 3 x)) nil)
|
||||
;; Also clear position marker.
|
||||
((and sort-only (nth 3 x))
|
||||
(set-marker (nth 4 x) nil) nil)
|
||||
;; No definition available: provide one.
|
||||
((not (nth 2 x))
|
||||
(append (butlast x 2)
|
||||
(list (format "DEFINITION NOT FOUND: %s" (car x))
|
||||
(nth 3 x))))
|
||||
(append
|
||||
(list (car x) (nth 1 x)
|
||||
(format "DEFINITION NOT FOUND: %s" (car x)))
|
||||
(nthcdr 3 x)))
|
||||
(t x)))
|
||||
ref-table)))
|
||||
(setq ref-table (nreverse ref-table))
|
||||
;; 4. Remove left-over definitions in the buffer.
|
||||
(mapc (lambda (x) (unless (nth 3 x)
|
||||
(org-footnote-delete-definitions (car x))))
|
||||
(mapc (lambda (x)
|
||||
(unless (nth 3 x) (org-footnote-delete-definitions (car x))))
|
||||
ref-table)
|
||||
;; 5. Insert the footnotes again in the buffer, at the
|
||||
;; appropriate spot.
|
||||
|
@ -764,7 +785,7 @@ Additional note on `org-footnote-insert-pos-for-preprocessor':
|
|||
;; Cases when footnotes should be inserted in one place.
|
||||
((or (not (eq major-mode 'org-mode))
|
||||
org-footnote-section
|
||||
(not sort-only))
|
||||
export-props)
|
||||
;; Insert again the section title, if any. Ensure that title,
|
||||
;; or the subsequent footnotes, will be separated by a blank
|
||||
;; lines from the rest of the document. In an Org buffer,
|
||||
|
@ -775,11 +796,6 @@ Additional note on `org-footnote-insert-pos-for-preprocessor':
|
|||
(skip-chars-backward " \t\n\r")
|
||||
(delete-region (point) ins-point)
|
||||
(unless (bolp) (newline))
|
||||
;; Keep one blank line between footnotes and signature.
|
||||
(when (and (derived-mode-p 'message-mode)
|
||||
(save-excursion
|
||||
(re-search-forward message-signature-separator nil t)))
|
||||
(open-line 1))
|
||||
(when org-footnote-tag-for-non-org-mode-files
|
||||
(insert "\n" org-footnote-tag-for-non-org-mode-files "\n")))
|
||||
((and org-footnote-section (not export-props))
|
||||
|
@ -789,31 +805,31 @@ Additional note on `org-footnote-insert-pos-for-preprocessor':
|
|||
(insert "* " org-footnote-section "\n")))
|
||||
(set-marker ins-point nil)
|
||||
;; Insert the footnotes, separated by a blank line.
|
||||
(insert (mapconcat (lambda (x) (format "\n[%s] %s"
|
||||
(nth (if sort-only 0 1) x) (nth 2 x)))
|
||||
ref-table "\n"))
|
||||
(unless (eobp) (insert "\n"))
|
||||
(insert
|
||||
(mapconcat
|
||||
(lambda (x)
|
||||
;; Clean markers.
|
||||
(set-marker (nth 4 x) nil)
|
||||
(format "\n[%s] %s" (nth (if sort-only 0 1) x) (nth 2 x)))
|
||||
ref-table "\n"))
|
||||
(unless (eobp) (insert "\n\n"))
|
||||
;; When exporting, add newly inserted markers along with their
|
||||
;; associated definition to `org-export-footnotes-seen'.
|
||||
(when export-props
|
||||
(setq org-export-footnotes-seen ref-table)))
|
||||
;; Else, insert each definition at the end of the section
|
||||
;; containing their first reference. Happens only in Org files
|
||||
;; with no special footnote section, and only when doing
|
||||
;; sorting.
|
||||
(t (mapc 'org-insert-footnote-reference-near-definition
|
||||
ref-table))))))
|
||||
|
||||
(defun org-insert-footnote-reference-near-definition (entry)
|
||||
"Find first reference of footnote ENTRY and insert the definition there.
|
||||
ENTRY is (fn-label num-mark definition)."
|
||||
(when (car entry)
|
||||
(goto-char (point-min))
|
||||
(let ((ref (org-footnote-get-next-reference (car entry))))
|
||||
(when ref
|
||||
(goto-char (nth 2 ref))
|
||||
(org-footnote-goto-local-insertion-point)
|
||||
(insert (format "\n[%s] %s\n" (car entry) (nth 2 entry)))))))
|
||||
(when export-props (setq org-export-footnotes-seen ref-table)))
|
||||
;; Each footnote definition has to be inserted at the end of
|
||||
;; the section where its first reference belongs.
|
||||
(t
|
||||
(mapc
|
||||
(lambda (x)
|
||||
(let ((pos (nth 4 x)))
|
||||
(goto-char pos)
|
||||
;; Clean marker.
|
||||
(set-marker pos nil))
|
||||
(org-footnote-goto-local-insertion-point)
|
||||
(insert (format "\n[%s] %s\n"
|
||||
(if sort-only (car x) (nth 1 x))
|
||||
(nth 2 x))))
|
||||
ref-table))))))
|
||||
|
||||
(defun org-footnote-goto-local-insertion-point ()
|
||||
"Find insertion point for footnote, just before next outline heading."
|
||||
|
@ -848,8 +864,9 @@ Return the number of footnotes removed."
|
|||
(ndef 0))
|
||||
(while (re-search-forward def-re nil t)
|
||||
(let ((full-def (org-footnote-at-definition-p)))
|
||||
(delete-region (nth 1 full-def) (nth 2 full-def)))
|
||||
(incf ndef))
|
||||
(when full-def
|
||||
(delete-region (nth 1 full-def) (nth 2 full-def))
|
||||
(incf ndef))))
|
||||
ndef)))
|
||||
|
||||
(defun org-footnote-delete (&optional label)
|
||||
|
|
|
@ -334,7 +334,14 @@ current time."
|
|||
(let ((inhibit-read-only t) l c
|
||||
(buffer-invisibility-spec '(org-link))
|
||||
(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
|
||||
(goto-char (if line (point-at-bol) (point-min)))
|
||||
(while (not (eobp))
|
||||
|
@ -344,14 +351,15 @@ current time."
|
|||
(delete-char (min (+ 1 org-habit-preceding-days
|
||||
org-habit-following-days)
|
||||
(- (line-end-position) (point))))
|
||||
(insert (org-habit-build-graph
|
||||
habit
|
||||
(time-subtract moment
|
||||
(days-to-time org-habit-preceding-days))
|
||||
moment
|
||||
(time-add moment
|
||||
(days-to-time org-habit-following-days))))))
|
||||
(forward-line)))))
|
||||
(insert-before-markers
|
||||
(org-habit-build-graph
|
||||
habit
|
||||
(time-subtract moment (days-to-time org-habit-preceding-days))
|
||||
moment
|
||||
(time-add moment (days-to-time org-habit-following-days))))))
|
||||
(forward-line)))
|
||||
(mapc (lambda (ol) (overlay-put ol 'invisible t))
|
||||
disabled-overlays)))
|
||||
|
||||
(defun org-habit-toggle-habits ()
|
||||
"Toggle display of habits in an agenda buffer."
|
||||
|
|
|
@ -1351,7 +1351,7 @@ PUB-DIR is set, use this as the publishing directory."
|
|||
;; insert html preamble
|
||||
(when (plist-get opt-plist :html-preamble)
|
||||
(let ((html-pre (plist-get opt-plist :html-preamble))
|
||||
html-pre-real-contents)
|
||||
(html-pre-real-contents ""))
|
||||
(cond ((stringp html-pre)
|
||||
(setq html-pre-real-contents
|
||||
(format-spec html-pre `((?t . ,title) (?a . ,author)
|
||||
|
@ -1422,7 +1422,7 @@ PUB-DIR is set, use this as the publishing directory."
|
|||
(if (string-match
|
||||
(org-re "[ \t]+:\\([[:alnum:]_@:]+\\):[ \t]*$") txt)
|
||||
(setq txt (replace-match
|
||||
" <span class=\"tag\"> \\1</span>" t nil txt)))
|
||||
" <span class=\"tag\">\\1</span>" t nil txt)))
|
||||
(if (string-match quote-re0 txt)
|
||||
(setq txt (replace-match "" t t txt)))
|
||||
(setq snumber (org-section-number level))
|
||||
|
@ -1630,7 +1630,7 @@ PUB-DIR is set, use this as the publishing directory."
|
|||
"done" "todo")
|
||||
" " (org-export-html-get-todo-kwd-class-name
|
||||
(match-string 2 line))
|
||||
"\"> " (match-string 2 line)
|
||||
"\">" (match-string 2 line)
|
||||
"</span>" (substring line (match-end 2)))))
|
||||
|
||||
;; Does this contain a reference to a footnote?
|
||||
|
|
|
@ -412,6 +412,7 @@ This function is meant to be called by `after-change-functions'."
|
|||
(if (or org-indent-modified-headline-flag
|
||||
(save-excursion
|
||||
(goto-char beg)
|
||||
(beginning-of-line)
|
||||
(re-search-forward org-outline-regexp-bol end t)))
|
||||
(let ((end (save-excursion
|
||||
(goto-char end)
|
||||
|
|
|
@ -218,6 +218,7 @@ For example, adding an entry
|
|||
will cause \\usepackage[utf8x]{inputenc} to be used for buffers that
|
||||
are written as utf8 files."
|
||||
:group 'org-export-latex
|
||||
:version "24.1"
|
||||
:type '(repeat
|
||||
(cons
|
||||
(string :tag "Derived from buffer")
|
||||
|
@ -283,6 +284,7 @@ markup defined, the first one in the association list will be used."
|
|||
(defcustom org-export-latex-tag-markup "\\textbf{%s}"
|
||||
"Markup for tags, as a printf format."
|
||||
:group 'org-export-latex
|
||||
:version "24.1"
|
||||
:type 'string)
|
||||
|
||||
(defcustom org-export-latex-timestamp-markup "\\textit{%s}"
|
||||
|
@ -293,6 +295,7 @@ markup defined, the first one in the association list will be used."
|
|||
(defcustom org-export-latex-timestamp-inactive-markup "\\textit{%s}"
|
||||
"A printf format string to be applied to inactive time stamps."
|
||||
:group 'org-export-latex
|
||||
:version "24.1"
|
||||
:type 'string)
|
||||
|
||||
(defcustom org-export-latex-timestamp-keyword-markup "\\texttt{%s}"
|
||||
|
@ -307,6 +310,7 @@ If it contains two %s instances, the first will be filled with
|
|||
the link, the second with the link description. If it contains
|
||||
only one, the %s will be filled with the link."
|
||||
:group 'org-export-latex
|
||||
:version "24.1"
|
||||
:type 'string)
|
||||
|
||||
(defcustom org-export-latex-hyperref-format "\\hyperref[%s]{%s}"
|
||||
|
@ -314,11 +318,13 @@ only one, the %s will be filled with the link."
|
|||
The format must contain one or two %s instances. The first one
|
||||
will be filled with the link, the second with its description."
|
||||
:group 'org-export-latex
|
||||
:version "24.1"
|
||||
:type 'string)
|
||||
|
||||
(defcustom org-export-latex-footnote-separator "\\textsuperscript{,}\\,"
|
||||
"Text used to separate footnotes."
|
||||
:group 'org-export-latex
|
||||
:version "24.1"
|
||||
:type 'string)
|
||||
|
||||
(defcustom org-export-latex-quotes
|
||||
|
@ -336,6 +342,7 @@ For each item in a CONS, the first string is a regexp
|
|||
for allowed characters before/after the quote, the second
|
||||
string defines the replacement string for this quote."
|
||||
:group 'org-export-latex
|
||||
:version "24.1"
|
||||
:type '(list
|
||||
(cons :tag "Opening quote"
|
||||
(string :tag "Regexp for char before")
|
||||
|
@ -361,6 +368,7 @@ string defines the replacement string for this quote."
|
|||
"When non-nil, the caption is set above the table. When nil,
|
||||
the caption is set below the table."
|
||||
:group 'org-export-latex
|
||||
:version "24.1"
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom org-export-latex-tables-column-borders nil
|
||||
|
@ -478,6 +486,7 @@ Code blocks exported with the listings package (controlled by the
|
|||
`org-export-latex-listings' variable) can be named in the style
|
||||
of noweb."
|
||||
:group 'org-export-latex
|
||||
:version "24.1"
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom org-export-latex-minted-langs
|
||||
|
@ -499,6 +508,7 @@ with:
|
|||
pygmentize -L lexers
|
||||
"
|
||||
:group 'org-export-latex
|
||||
:version "24.1"
|
||||
:type '(repeat
|
||||
(list
|
||||
(symbol :tag "Major mode ")
|
||||
|
@ -522,6 +532,7 @@ black keywords.
|
|||
Note that the same options will be applied to blocks of all
|
||||
languages."
|
||||
:group 'org-export-latex
|
||||
:version "24.1"
|
||||
:type '(repeat
|
||||
(list
|
||||
(string :tag "Listings option name ")
|
||||
|
@ -545,6 +556,7 @@ will result in src blocks being exported with
|
|||
as the start of the minted environment. Note that the same
|
||||
options will be applied to blocks of all languages."
|
||||
:group 'org-export-latex
|
||||
:version "24.1"
|
||||
:type '(repeat
|
||||
(list
|
||||
(string :tag "Minted option name ")
|
||||
|
@ -586,11 +598,13 @@ and `org-export-with-tags' instead."
|
|||
(defcustom org-latex-default-figure-position "htb"
|
||||
"Default position for latex figures."
|
||||
:group 'org-export-latex
|
||||
:version "24.1"
|
||||
:type 'string)
|
||||
|
||||
(defcustom org-export-latex-tabular-environment "tabular"
|
||||
"Default environment used to build tables."
|
||||
:group 'org-export-latex
|
||||
:version "24.1"
|
||||
:type 'string)
|
||||
|
||||
(defcustom org-export-latex-inline-image-extensions
|
||||
|
@ -657,6 +671,18 @@ This function should accept the file name as its single argument."
|
|||
"bibtex %b"
|
||||
"pdflatex -interaction nonstopmode -output-directory %o %f"
|
||||
"pdflatex -interaction nonstopmode -output-directory %o %f"))
|
||||
(const :tag "2 runs of xelatex"
|
||||
("xelatex -interaction nonstopmode -output-directory %o %f"
|
||||
"xelatex -interaction nonstopmode -output-directory %o %f"))
|
||||
(const :tag "3 runs of xelatex"
|
||||
("xelatex -interaction nonstopmode -output-directory %o %f"
|
||||
"xelatex -interaction nonstopmode -output-directory %o %f"
|
||||
"xelatex -interaction nonstopmode -output-directory %o %f"))
|
||||
(const :tag "xelatex,bibtex,xelatex,xelatex"
|
||||
("xelatex -interaction nonstopmode -output-directory %o %f"
|
||||
"bibtex %b"
|
||||
"xelatex -interaction nonstopmode -output-directory %o %f"
|
||||
"xelatex -interaction nonstopmode -output-directory %o %f"))
|
||||
(const :tag "texi2dvi"
|
||||
("texi2dvi -p -b -c -V %f"))
|
||||
(const :tag "rubber"
|
||||
|
@ -667,6 +693,7 @@ This function should accept the file name as its single argument."
|
|||
'("aux" "idx" "log" "out" "toc" "nav" "snm" "vrb")
|
||||
"The list of file extensions to consider as LaTeX logfiles."
|
||||
:group 'org-export-pdf
|
||||
:version "24.1"
|
||||
:type '(repeat (string :tag "Extension")))
|
||||
|
||||
(defcustom org-export-pdf-remove-logfiles t
|
||||
|
@ -855,7 +882,7 @@ when PUB-DIR is set, use this as the publishing directory."
|
|||
(concat
|
||||
(file-name-as-directory
|
||||
(or pub-dir
|
||||
(org-export-directory :LaTeX ext-plist)))
|
||||
(org-export-directory :LaTeX org-export-latex-options-plist)))
|
||||
(file-name-sans-extension
|
||||
(or (and subtree-p
|
||||
(org-entry-get rbeg "EXPORT_FILE_NAME" t))
|
||||
|
@ -870,7 +897,7 @@ when PUB-DIR is set, use this as the publishing directory."
|
|||
(concat filename ".tex")
|
||||
filename)))
|
||||
(auto-insert nil); Avoid any auto-insert stuff for the new file
|
||||
(TeX-master t) ; Avoid the Query for TeX master from AUCTeX
|
||||
(TeX-master (boundp 'TeX-master))
|
||||
(buffer (if to-buffer
|
||||
(cond
|
||||
((eq to-buffer 'string) (get-buffer-create
|
||||
|
@ -1224,7 +1251,7 @@ numbered sections and lower levels as unnumbered sections."
|
|||
org-export-target-aliases))))
|
||||
(sectioning org-export-latex-sectioning)
|
||||
(depth org-export-latex-sectioning-depth)
|
||||
main-heading sub-heading)
|
||||
main-heading sub-heading ctnt)
|
||||
(when (symbolp (car sectioning))
|
||||
(setq sectioning (funcall (car sectioning) level heading))
|
||||
(when sectioning
|
||||
|
@ -1291,16 +1318,20 @@ numbered sections and lower levels as unnumbered sections."
|
|||
(delete-region (point-at-bol 0) (point))
|
||||
(insert (format "\\begin{%s}\n"
|
||||
(symbol-name org-export-latex-low-levels))))
|
||||
(insert (format "\n\\item %s\\\\\n%s%%"
|
||||
heading
|
||||
(if label (format "\\label{%s}" label) "")))
|
||||
(insert (org-export-latex-content content))
|
||||
(let ((ctnt (org-export-latex-content content)))
|
||||
(insert (format (if (not (equal (replace-regexp-in-string "\n" "" ctnt) ""))
|
||||
"\n\\item %s\\\\\n%s%%"
|
||||
"\n\\item %s\n%s%%")
|
||||
heading
|
||||
(if label (format "\\label{%s}" label) "")))
|
||||
(insert ctnt))
|
||||
(cond ((stringp subcontent) (insert subcontent))
|
||||
((listp subcontent) (org-export-latex-sub subcontent)))
|
||||
(insert (format "\\end{%s} %% ends low level\n"
|
||||
(symbol-name org-export-latex-low-levels))))
|
||||
|
||||
((listp org-export-latex-low-levels)
|
||||
((and (listp org-export-latex-low-levels)
|
||||
org-export-latex-low-levels)
|
||||
(if (string-match "% ends low level$"
|
||||
(buffer-substring (point-at-bol 0) (point)))
|
||||
(delete-region (point-at-bol 0) (point))
|
||||
|
@ -1902,10 +1933,14 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
|
|||
'org-label raw-table)
|
||||
longtblp (and attr (stringp attr)
|
||||
(string-match "\\<longtable\\>" attr))
|
||||
tblenv (if (and attr (stringp attr)
|
||||
(or (string-match (regexp-quote "table*") attr)
|
||||
(string-match "\\<multicolumn\\>" attr)))
|
||||
"table*" "table")
|
||||
tblenv (if (and attr (stringp attr))
|
||||
(cond ((string-match "\\<sidewaystable\\>" attr)
|
||||
"sidewaystable")
|
||||
((or (string-match (regexp-quote "table*") attr)
|
||||
(string-match "\\<multicolumn\\>" attr))
|
||||
"table*")
|
||||
(t "table"))
|
||||
"table")
|
||||
tabular-env
|
||||
(if (and attr (stringp attr)
|
||||
(string-match "\\(tabular.\\)" attr))
|
||||
|
@ -1988,7 +2023,8 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
|
|||
(if shortn (concat "[" shortn "]") "")
|
||||
(or caption "")
|
||||
(if label (format "\\label{%s}" label) "")))
|
||||
(if (and longtblp caption) "\\\\\n" "\n")
|
||||
(if (and longtblp caption org-export-latex-table-caption-above)
|
||||
"\\\\\n" "\n")
|
||||
(if (and org-export-latex-tables-centered (not longtblp))
|
||||
"\\begin{center}\n")
|
||||
(if (not longtblp)
|
||||
|
@ -2572,9 +2608,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
|
|||
"Convert plain text lists in current buffer into LaTeX lists."
|
||||
;; `org-list-end-re' output has changed since preprocess from
|
||||
;; org-exp.el. Make sure it is taken into account.
|
||||
(let ((org-list-ending-method
|
||||
(if (eq org-list-ending-method 'regexp) 'regexp 'both))
|
||||
(org-list-end-re "^ORG-LIST-END-MARKER\n"))
|
||||
(let ((org-list-end-re "^ORG-LIST-END-MARKER\n"))
|
||||
(mapc
|
||||
(lambda (e)
|
||||
;; For each type of context allowed for list export (E), find
|
||||
|
|
|
@ -207,7 +207,7 @@ Valid values are ?. and ?\). To get both terminators, use t."
|
|||
:group 'org-plain-lists
|
||||
:type '(choice (const :tag "dot like in \"2.\"" ?.)
|
||||
(const :tag "paren like in \"2)\"" ?\))
|
||||
(const :tab "both" t)))
|
||||
(const :tag "both" t)))
|
||||
|
||||
(defcustom org-alphabetical-lists nil
|
||||
"Non-nil means single character alphabetical bullets are allowed.
|
||||
|
@ -229,42 +229,12 @@ spaces instead of one after the bullet in each item of the list."
|
|||
(const :tag "never" nil)
|
||||
(regexp)))
|
||||
|
||||
(defcustom org-list-ending-method 'both
|
||||
"Determine where plain lists should end.
|
||||
Valid values are: `regexp', `indent' or `both'.
|
||||
|
||||
When set to `regexp', Org will look into two variables,
|
||||
`org-empty-line-terminates-plain-lists' and the more general
|
||||
`org-list-end-regexp', to determine what will end lists.
|
||||
|
||||
When set to `indent', a list will end whenever a line following
|
||||
an item, but not starting one, is less or equally indented than
|
||||
the first item of the list.
|
||||
|
||||
When set to `both', each of the preceding methods is applied to
|
||||
determine lists endings. This is the default method."
|
||||
:group 'org-plain-lists
|
||||
:type '(choice
|
||||
(const :tag "With a regexp defining ending" regexp)
|
||||
(const :tag "With indentation of regular (no bullet) text" indent)
|
||||
(const :tag "With both methods" both)))
|
||||
|
||||
(defcustom org-empty-line-terminates-plain-lists nil
|
||||
"Non-nil means an empty line ends all plain list levels.
|
||||
This variable only makes sense if `org-list-ending-method' is set
|
||||
to `regexp' or `both'. This is then equivalent to set
|
||||
`org-list-end-regexp' to \"^[ \\t]*$\"."
|
||||
Otherwise, two of them will be necessary."
|
||||
:group 'org-plain-lists
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom org-list-end-regexp "^[ \t]*\n[ \t]*\n"
|
||||
"Regexp matching the end of all plain list levels.
|
||||
It must start with \"^\" and end with \"\\n\". It defaults to 2
|
||||
blank lines. `org-empty-line-terminates-plain-lists' has
|
||||
precedence over it."
|
||||
:group 'org-plain-lists
|
||||
:type 'string)
|
||||
|
||||
(defcustom org-list-automatic-rules '((bullet . t)
|
||||
(checkbox . t)
|
||||
(indent . t))
|
||||
|
@ -381,9 +351,8 @@ specifically, type `block' is determined by the variable
|
|||
|
||||
;;; Predicates and regexps
|
||||
|
||||
(defconst org-list-end-re (if org-empty-line-terminates-plain-lists
|
||||
"^[ \t]*\n"
|
||||
org-list-end-regexp)
|
||||
(defconst org-list-end-re (if org-empty-line-terminates-plain-lists "^[ \t]*\n"
|
||||
"^[ \t]*\n[ \t]*\n")
|
||||
"Regex corresponding to the end of a list.
|
||||
It depends on `org-empty-line-terminates-plain-lists'.")
|
||||
|
||||
|
@ -432,8 +401,7 @@ group 4: description tag")
|
|||
(not (org-in-block-p org-list-forbidden-blocks)))
|
||||
|
||||
(defun org-in-item-p ()
|
||||
"Return item beginning position when in a plain list, nil otherwise.
|
||||
This checks `org-list-ending-method'."
|
||||
"Return item beginning position when in a plain list, nil otherwise."
|
||||
(save-excursion
|
||||
(beginning-of-line)
|
||||
(let* ((case-fold-search t)
|
||||
|
@ -460,8 +428,7 @@ This checks `org-list-ending-method'."
|
|||
;; to compute its boundaries END-BOUNDS. When point is
|
||||
;; in-between, move cursor before regexp beginning.
|
||||
(let ((hl 0) (i -1) end-bounds)
|
||||
(when (and (not (eq org-list-ending-method 'indent))
|
||||
(progn
|
||||
(when (and (progn
|
||||
(while (setq i (string-match
|
||||
"[\r\n]" org-list-end-re (1+ i)))
|
||||
(setq hl (1+ hl)))
|
||||
|
@ -470,23 +437,18 @@ This checks `org-list-ending-method'."
|
|||
(< (point) (cdr end-bounds)))
|
||||
(goto-char (car end-bounds))
|
||||
(forward-line -1)))
|
||||
;; Look for an item, less indented that reference line if
|
||||
;; `org-list-ending-method' isn't `regexp'.
|
||||
;; Look for an item, less indented that reference line.
|
||||
(catch 'exit
|
||||
(while t
|
||||
(let ((ind (org-get-indentation)))
|
||||
(cond
|
||||
;; This is exactly what we want.
|
||||
((and (looking-at item-re)
|
||||
(or (< ind ind-ref)
|
||||
(eq org-list-ending-method 'regexp)))
|
||||
((and (looking-at item-re) (< ind ind-ref))
|
||||
(throw 'exit (point)))
|
||||
;; At upper bound of search or looking at the end of a
|
||||
;; previous list: search is over.
|
||||
((<= (point) lim-up) (throw 'exit nil))
|
||||
((and (not (eq org-list-ending-method 'indent))
|
||||
(looking-at org-list-end-re))
|
||||
(throw 'exit nil))
|
||||
((looking-at org-list-end-re) (throw 'exit nil))
|
||||
;; Skip blocks, drawers, inline-tasks, blank lines
|
||||
((and (looking-at "^[ \t]*#\\+end_")
|
||||
(re-search-backward "^[ \t]*#\\+begin_" lim-up t)))
|
||||
|
@ -703,8 +665,7 @@ Assume point is at an item."
|
|||
(forward-line -1))
|
||||
;; Looking at a list ending regexp. Dismiss useless
|
||||
;; data recorded above BEG-CELL. Jump to part 2.
|
||||
((and (not (eq org-list-ending-method 'indent))
|
||||
(looking-at org-list-end-re))
|
||||
((looking-at org-list-end-re)
|
||||
(throw 'exit
|
||||
(setq itm-lst
|
||||
(memq (assq (car beg-cell) itm-lst) itm-lst))))
|
||||
|
@ -716,10 +677,7 @@ Assume point is at an item."
|
|||
((looking-at item-re)
|
||||
(push (funcall assoc-at-point ind) itm-lst)
|
||||
(push (cons ind (point)) end-lst)
|
||||
(when (or (and (eq org-list-ending-method 'regexp)
|
||||
(<= ind (cdr beg-cell)))
|
||||
(< ind text-min-ind))
|
||||
(setq beg-cell (cons (point) ind)))
|
||||
(when (< ind text-min-ind) (setq beg-cell (cons (point) ind)))
|
||||
(forward-line -1))
|
||||
;; Skip blocks, drawers, inline tasks, blank lines.
|
||||
((and (looking-at "^[ \t]*#\\+end_")
|
||||
|
@ -732,14 +690,13 @@ Assume point is at an item."
|
|||
(forward-line -1))
|
||||
((looking-at "^[ \t]*$")
|
||||
(forward-line -1))
|
||||
;; From there, point is not at an item. Unless ending
|
||||
;; method is `regexp', interpret line's indentation:
|
||||
;; From there, point is not at an item. Interpret
|
||||
;; line's indentation:
|
||||
;; - text at column 0 is necessarily out of any list.
|
||||
;; Dismiss data recorded above BEG-CELL. Jump to
|
||||
;; part 2.
|
||||
;; - any other case may be an ending position for an
|
||||
;; hypothetical item above. Store it and proceed.
|
||||
((eq org-list-ending-method 'regexp) (forward-line -1))
|
||||
((zerop ind)
|
||||
(throw 'exit
|
||||
(setq itm-lst
|
||||
|
@ -771,8 +728,7 @@ Assume point is at an item."
|
|||
(next-single-property-change (point) 'org-example nil lim-down)))
|
||||
;; Looking at a list ending regexp. Save point as an
|
||||
;; ending position and jump to part 3.
|
||||
((and (not (eq org-list-ending-method 'indent))
|
||||
(looking-at org-list-end-re))
|
||||
((looking-at org-list-end-re)
|
||||
(throw 'exit (push (cons 0 (point)) end-lst-2)))
|
||||
((looking-at item-re)
|
||||
;; Point is at an item. Add data to ITM-LST-2. It may
|
||||
|
@ -788,16 +744,14 @@ Assume point is at an item."
|
|||
;; Ind is lesser or equal than BEG-CELL's. The list is
|
||||
;; over: store point as an ending position and jump to
|
||||
;; part 3.
|
||||
((and (not (eq org-list-ending-method 'regexp))
|
||||
(<= ind (cdr beg-cell)))
|
||||
((<= ind (cdr beg-cell))
|
||||
(throw 'exit
|
||||
(push (cons 0 (funcall end-before-blank)) end-lst-2)))
|
||||
;; Else, if ind is lesser or equal than previous item's,
|
||||
;; this is an ending position: store it. In any case,
|
||||
;; skip block or drawer at point, and move to next line.
|
||||
(t
|
||||
(when (and (not (eq org-list-ending-method 'regexp))
|
||||
(<= ind (nth 1 (car itm-lst-2))))
|
||||
(when (<= ind (nth 1 (car itm-lst-2)))
|
||||
(push (cons ind (point)) end-lst-2))
|
||||
(cond
|
||||
((and (looking-at "^[ \t]*#\\+begin_")
|
||||
|
@ -1192,9 +1146,7 @@ some heuristics to guess the result."
|
|||
(point))))))))
|
||||
(cond
|
||||
;; Trivial cases where there should be none.
|
||||
((or (and (not (eq org-list-ending-method 'indent))
|
||||
org-empty-line-terminates-plain-lists)
|
||||
(not insert-blank-p)) 0)
|
||||
((or org-empty-line-terminates-plain-lists (not insert-blank-p)) 0)
|
||||
;; When `org-blank-before-new-entry' says so, it is 1.
|
||||
((eq insert-blank-p t) 1)
|
||||
;; `plain-list-item' is 'auto. Count blank lines separating
|
||||
|
@ -2929,9 +2881,7 @@ Point is left at list end."
|
|||
(goto-char top)
|
||||
(when delete
|
||||
(delete-region top bottom)
|
||||
(when (and (not (eq org-list-ending-method 'indent))
|
||||
(not (looking-at "[ \t]*$"))
|
||||
(looking-at org-list-end-re))
|
||||
(when (and (not (looking-at "[ \t]*$")) (looking-at org-list-end-re))
|
||||
(replace-match "")))
|
||||
out))
|
||||
|
||||
|
|
|
@ -484,37 +484,33 @@ This is a helper routine for interactive use."
|
|||
(error "Cannot convert from %s format to %s format?"
|
||||
in-fmt out-fmt)))
|
||||
(convert-process (car how))
|
||||
(program (car convert-process))
|
||||
(dummy (and (or program (error "Converter not configured"))
|
||||
(or (executable-find program)
|
||||
(error "Cannot find converter %s" program))))
|
||||
(out-file (concat (file-name-sans-extension in-file) "."
|
||||
(nth 1 (or (cdr how) out-fmt))))
|
||||
(extra-options (or (nth 2 (cdr how)) ""))
|
||||
(out-dir (file-name-directory in-file))
|
||||
(arglist (mapcar (lambda (arg)
|
||||
(format-spec
|
||||
arg `((?i . ,in-file)
|
||||
(?I . ,(browse-url-file-url in-file))
|
||||
(?f . ,out-fmt)
|
||||
(?o . ,out-file)
|
||||
(?O . ,(browse-url-file-url out-file))
|
||||
(?d . ,out-dir)
|
||||
(?D . ,(browse-url-file-url out-dir)))))
|
||||
(cdr convert-process))))
|
||||
(cmd (format-spec convert-process
|
||||
`((?i . ,(shell-quote-argument in-file))
|
||||
(?I . ,(browse-url-file-url in-file))
|
||||
(?f . ,out-fmt)
|
||||
(?o . ,out-file)
|
||||
(?O . ,(browse-url-file-url out-file))
|
||||
(?d . , (shell-quote-argument out-dir))
|
||||
(?D . ,(browse-url-file-url out-dir))
|
||||
(?x . ,extra-options)))))
|
||||
(when (file-exists-p out-file)
|
||||
(delete-file out-file))
|
||||
|
||||
(message "Executing %s %s" program (mapconcat 'identity arglist " "))
|
||||
(apply 'call-process program nil nil nil arglist)
|
||||
(message "Executing %s" cmd)
|
||||
(let ((cmd-output (shell-command-to-string cmd)))
|
||||
(message "%s" cmd-output))
|
||||
|
||||
(cond
|
||||
((file-exists-p out-file)
|
||||
(message "Exported to %s using %s" out-file program)
|
||||
(message "Exported to %s" out-file)
|
||||
(when prefix-arg
|
||||
(message "Opening %s..." out-file)
|
||||
(org-open-file out-file))
|
||||
out-file
|
||||
;; (set-buffer (find-file-noselect out-file))
|
||||
)
|
||||
out-file)
|
||||
(t
|
||||
(message "Export to %s failed" out-file)
|
||||
nil))))
|
||||
|
@ -598,11 +594,7 @@ version."
|
|||
(org-lparse-par-open-stashed 0)
|
||||
|
||||
;; list related vars
|
||||
(org-lparse-list-level 0) ; list level starts at 1. A
|
||||
; value of 0 implies we are
|
||||
; outside of any list
|
||||
(org-lparse-list-item-count 0)
|
||||
org-lparse-list-stack
|
||||
(org-lparse-list-stack '())
|
||||
|
||||
;; list-table related vars
|
||||
org-lparse-list-table-p
|
||||
|
@ -817,6 +809,8 @@ version."
|
|||
(setq umax-toc (if (integerp org-export-with-toc)
|
||||
(min org-export-with-toc umax)
|
||||
umax))
|
||||
(setq org-lparse-opt-plist
|
||||
(plist-put org-lparse-opt-plist :headline-levels umax))
|
||||
|
||||
(when (and org-export-with-toc (not body-only))
|
||||
(setq lines (org-lparse-prepare-toc
|
||||
|
@ -853,48 +847,6 @@ version."
|
|||
(org-lparse-end-environment 'fixedwidth))
|
||||
(throw 'nextline nil))
|
||||
|
||||
;; Notes: The baseline version of org-html.el (git commit
|
||||
;; 3d802e), while encountering a *line-long* protected text,
|
||||
;; does one of the following two things based on the state
|
||||
;; of the export buffer.
|
||||
|
||||
;; 1. If a paragraph element has just been opened and
|
||||
;; contains only whitespace as content, insert the
|
||||
;; protected text as part of the previous paragraph.
|
||||
|
||||
;; 2. If the paragraph element has already been opened and
|
||||
;; contains some valid content insert the protected text
|
||||
;; as part of the current paragraph.
|
||||
|
||||
;; I think --->
|
||||
|
||||
;; Scenario 1 mentioned above kicks in when a block of
|
||||
;; protected text has to be inserted en bloc. For example,
|
||||
;; this happens, when inserting an source or example block
|
||||
;; or preformatted content enclosed in #+backend,
|
||||
;; #+begin_backend ... #+end_backend)
|
||||
|
||||
;; Scenario 2 mentioned above kicks in when the protected
|
||||
;; text is part of a running sentence. For example this
|
||||
;; happens in the case of an *multiline* LaTeX equation that
|
||||
;; needs to be inserted verbatim.
|
||||
|
||||
;; org-html.el in the master branch seems to do some
|
||||
;; jugglery by moving paragraphs around. Inorder to make
|
||||
;; these changes backend-agnostic introduce a new text
|
||||
;; property org-native-text and impose the added semantics
|
||||
;; that these protected blocks appear outside of a
|
||||
;; conventional paragraph element.
|
||||
;;
|
||||
;; Extra Note: Check whether org-example and org-native-text
|
||||
;; are entirely equivalent.
|
||||
|
||||
;; Fixes bug reported by Christian Moe concerning verbatim
|
||||
;; LaTeX fragments.
|
||||
;; on git commit 533ba3f90250a1f25f494c390d639ea6274f235c
|
||||
;; http://repo.or.cz/w/org-mode/org-jambu.git/shortlog/refs/heads/staging
|
||||
;; See http://lists.gnu.org/archive/html/emacs-orgmode/2011-03/msg01379.html
|
||||
|
||||
;; Native Text
|
||||
(when (and (get-text-property 0 'org-native-text line)
|
||||
;; Make sure it is the entire line that is protected
|
||||
|
@ -1081,10 +1033,11 @@ version."
|
|||
table-buffer (nreverse table-buffer)
|
||||
table-orig-buffer (nreverse table-orig-buffer))
|
||||
(org-lparse-end-paragraph)
|
||||
(when org-lparse-list-table-p
|
||||
(error "Regular tables are not allowed in a list-table block"))
|
||||
(org-lparse-insert 'TABLE table-buffer table-orig-buffer)))
|
||||
|
||||
;; Normal lines
|
||||
|
||||
(t
|
||||
;; This line either is list item or end a list.
|
||||
(when (get-text-property 0 'list-item line)
|
||||
|
@ -1820,6 +1773,12 @@ Stripping happens only when the exported backend is not one of
|
|||
(org-lparse-end 'FOOTNOTE-DEFINITION n)
|
||||
(setq org-lparse-insert-tag-with-newlines 'both)
|
||||
(let ((footnote-def (org-lparse-end-collect)))
|
||||
;; Cleanup newlines in footnote definition. This ensures that a
|
||||
;; transcoded line is never (wrongly) broken in to multiple lines.
|
||||
(let ((pos 0))
|
||||
(while (string-match "[\r\n]+" footnote-def pos)
|
||||
(setq pos (1+ (match-beginning 0)))
|
||||
(setq footnote-def (replace-match " " t t footnote-def))))
|
||||
(push (cons n footnote-def) org-lparse-footnote-definitions)))
|
||||
|
||||
(defvar org-lparse-collect-buffer nil
|
||||
|
@ -2104,8 +2063,6 @@ When TITLE is nil, just close all open levels."
|
|||
("d" . description)))))
|
||||
|
||||
;; following vars are bound during `org-do-lparse'
|
||||
(defvar org-lparse-list-level)
|
||||
(defvar org-lparse-list-item-count)
|
||||
(defvar org-lparse-list-stack)
|
||||
(defvar org-lparse-list-table:table-row)
|
||||
(defvar org-lparse-list-table:lines)
|
||||
|
@ -2147,73 +2104,69 @@ When TITLE is nil, just close all open levels."
|
|||
;; https://lists.gnu.org/archive/html/emacs-orgmode/2011-03/msg01101.html
|
||||
|
||||
(defun org-lparse-begin-list (ltype)
|
||||
(incf org-lparse-list-level)
|
||||
(push org-lparse-list-item-count org-lparse-list-stack)
|
||||
(setq org-lparse-list-item-count 0)
|
||||
(cond
|
||||
((not org-lparse-list-table-p)
|
||||
(org-lparse-begin 'LIST ltype))
|
||||
;; process LIST-TABLE
|
||||
((= 1 org-lparse-list-level)
|
||||
;; begin LIST-TABLE
|
||||
(setq org-lparse-list-table:lines nil)
|
||||
(setq org-lparse-list-table:table-row nil))
|
||||
((= 2 org-lparse-list-level)
|
||||
(ignore))
|
||||
(t
|
||||
(org-lparse-begin 'LIST ltype))))
|
||||
(push ltype org-lparse-list-stack)
|
||||
(let ((list-level (length org-lparse-list-stack)))
|
||||
(cond
|
||||
((not org-lparse-list-table-p)
|
||||
(org-lparse-begin 'LIST ltype))
|
||||
;; process LIST-TABLE
|
||||
((= 1 list-level)
|
||||
;; begin LIST-TABLE
|
||||
(setq org-lparse-list-table:lines nil)
|
||||
(setq org-lparse-list-table:table-row nil))
|
||||
((= 2 list-level)
|
||||
(ignore))
|
||||
(t
|
||||
(org-lparse-begin 'LIST ltype)))))
|
||||
|
||||
(defun org-lparse-end-list (ltype)
|
||||
(setq org-lparse-list-item-count (pop org-lparse-list-stack))
|
||||
(decf org-lparse-list-level)
|
||||
(cond
|
||||
((not org-lparse-list-table-p)
|
||||
(org-lparse-end 'LIST ltype))
|
||||
;; process LIST-TABLE
|
||||
((= 0 org-lparse-list-level)
|
||||
;; end LIST-TABLE
|
||||
(insert (org-lparse-format-list-table
|
||||
(nreverse org-lparse-list-table:lines))))
|
||||
((= 1 org-lparse-list-level)
|
||||
(ignore))
|
||||
(t
|
||||
(org-lparse-end 'LIST ltype))))
|
||||
(pop org-lparse-list-stack)
|
||||
(let ((list-level (length org-lparse-list-stack)))
|
||||
(cond
|
||||
((not org-lparse-list-table-p)
|
||||
(org-lparse-end 'LIST ltype))
|
||||
;; process LIST-TABLE
|
||||
((= 0 list-level)
|
||||
;; end LIST-TABLE
|
||||
(insert (org-lparse-format-list-table
|
||||
(nreverse org-lparse-list-table:lines))))
|
||||
((= 1 list-level)
|
||||
(ignore))
|
||||
(t
|
||||
(org-lparse-end 'LIST ltype)))))
|
||||
|
||||
(defun org-lparse-begin-list-item (ltype &optional arg headline)
|
||||
(incf org-lparse-list-item-count)
|
||||
(cond
|
||||
((not org-lparse-list-table-p)
|
||||
(org-lparse-begin 'LIST-ITEM ltype arg headline))
|
||||
;; process LIST-TABLE
|
||||
((and (= 1 org-lparse-list-level)
|
||||
(= 1 org-lparse-list-item-count))
|
||||
;; begin TABLE-ROW for LIST-TABLE
|
||||
(setq org-lparse-list-table:table-row nil)
|
||||
(org-lparse-begin-list-table:table-cell))
|
||||
((and (= 2 org-lparse-list-level)
|
||||
(= 1 org-lparse-list-item-count))
|
||||
;; begin TABLE-CELL for LIST-TABLE
|
||||
(org-lparse-begin-list-table:table-cell))
|
||||
(t
|
||||
(org-lparse-begin 'LIST-ITEM ltype arg headline))))
|
||||
(let ((list-level (length org-lparse-list-stack)))
|
||||
(cond
|
||||
((not org-lparse-list-table-p)
|
||||
(org-lparse-begin 'LIST-ITEM ltype arg headline))
|
||||
;; process LIST-TABLE
|
||||
((= 1 list-level)
|
||||
;; begin TABLE-ROW for LIST-TABLE
|
||||
(setq org-lparse-list-table:table-row nil)
|
||||
(org-lparse-begin-list-table:table-cell))
|
||||
((= 2 list-level)
|
||||
;; begin TABLE-CELL for LIST-TABLE
|
||||
(org-lparse-begin-list-table:table-cell))
|
||||
(t
|
||||
(org-lparse-begin 'LIST-ITEM ltype arg headline)))))
|
||||
|
||||
(defun org-lparse-end-list-item (ltype)
|
||||
(decf org-lparse-list-item-count)
|
||||
(cond
|
||||
((not org-lparse-list-table-p)
|
||||
(org-lparse-end 'LIST-ITEM ltype))
|
||||
;; process LIST-TABLE
|
||||
((and (= 1 org-lparse-list-level)
|
||||
(= 0 org-lparse-list-item-count))
|
||||
;; end TABLE-ROW for LIST-TABLE
|
||||
(org-lparse-end-list-table:table-cell)
|
||||
(push (nreverse org-lparse-list-table:table-row)
|
||||
org-lparse-list-table:lines))
|
||||
((= 2 org-lparse-list-level)
|
||||
;; end TABLE-CELL for LIST-TABLE
|
||||
(org-lparse-end-list-table:table-cell))
|
||||
(t
|
||||
(org-lparse-end 'LIST-ITEM ltype))))
|
||||
(let ((list-level (length org-lparse-list-stack)))
|
||||
(cond
|
||||
((not org-lparse-list-table-p)
|
||||
(org-lparse-end 'LIST-ITEM ltype))
|
||||
;; process LIST-TABLE
|
||||
((= 1 list-level)
|
||||
;; end TABLE-ROW for LIST-TABLE
|
||||
(org-lparse-end-list-table:table-cell)
|
||||
(push (nreverse org-lparse-list-table:table-row)
|
||||
org-lparse-list-table:lines))
|
||||
((= 2 list-level)
|
||||
;; end TABLE-CELL for LIST-TABLE
|
||||
(org-lparse-end-list-table:table-cell))
|
||||
(t
|
||||
(org-lparse-end 'LIST-ITEM ltype)))))
|
||||
|
||||
(defvar org-lparse-list-table:table-cell-open)
|
||||
(defun org-lparse-begin-list-table:table-cell ()
|
||||
|
|
|
@ -315,11 +315,11 @@ nor a function, elements of KEYWORDS are used directly."
|
|||
(replace-match "")
|
||||
(just-one-space))
|
||||
|
||||
(defvar rest)
|
||||
(defvar org-mouse-rest)
|
||||
(defun org-mouse-replace-match-and-surround (newtext &optional fixedcase
|
||||
literal string subexp)
|
||||
"The same as `replace-match', but surrounds the replacement with spaces."
|
||||
(apply 'replace-match rest)
|
||||
(apply 'replace-match org-mouse-rest)
|
||||
(save-excursion
|
||||
(goto-char (match-beginning (or subexp 0)))
|
||||
(just-one-space)
|
||||
|
@ -990,7 +990,7 @@ This means, between the beginning of line and the point."
|
|||
(replace-match replace-text))
|
||||
(forward-line))))
|
||||
|
||||
(defvar _cmd) ;dynamically scoped from `org-with-remote-undo'.
|
||||
(defvar org-mouse-cmd) ;dynamically scoped from `org-with-remote-undo'.
|
||||
|
||||
(defun org-mouse-do-remotely (command)
|
||||
; (org-agenda-check-no-diary)
|
||||
|
@ -1021,7 +1021,7 @@ This means, between the beginning of line and the point."
|
|||
(setq marker (copy-marker (point)))
|
||||
(goto-char (max (point-at-bol) (- (point-at-eol) anticol)))
|
||||
(funcall command)
|
||||
(message "_cmd: %S" _cmd)
|
||||
(message "_cmd: %S" org-mouse-cmd)
|
||||
(message "this-command: %S" this-command)
|
||||
(unless (eq (marker-position marker) (marker-position endmarker))
|
||||
(setq newhead (org-get-heading))))
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,11 +1,12 @@
|
|||
;;; org-protocol.el --- Intercept calls from emacsclient to trigger custom actions.
|
||||
|
||||
;; Copyright (C) 2008-2012 Free Software Foundation, Inc.
|
||||
|
||||
;;
|
||||
;; Copyright (C) 2008-2012
|
||||
;; Free Software Foundation, Inc.
|
||||
;;
|
||||
;; Author: Bastien Guerry <bzg AT gnu DOT org>
|
||||
;; Daniel M German <dmg AT uvic DOT org>
|
||||
;; Sebastian Rose <sebastian_rose AT gmx DOT de>
|
||||
;; Ross Patterson <me AT rpatterson DOT net>
|
||||
;; Author: Daniel M German <dmg AT uvic DOT org>
|
||||
;; Author: Sebastian Rose <sebastian_rose AT gmx DOT de>
|
||||
;; Author: Ross Patterson <me AT rpatterson DOT net>
|
||||
;; Maintainer: Sebastian Rose <sebastian_rose AT gmx DOT de>
|
||||
;; Keywords: org, emacsclient, wp
|
||||
|
||||
|
|
|
@ -79,17 +79,17 @@ seen. This is run after a few special cases are taken care of."
|
|||
(add-hook 'org-export-latex-after-blockquotes-hook
|
||||
'org-special-blocks-convert-latex-special-cookies)
|
||||
|
||||
(defvar line)
|
||||
(defvar org-special-blocks-line)
|
||||
(defun org-special-blocks-convert-html-special-cookies ()
|
||||
"Converts the special cookies into div blocks."
|
||||
;; Uses the dynamically-bound variable `line'.
|
||||
(when (string-match "^ORG-\\(.*\\)-\\(START\\|END\\)$" line)
|
||||
;; Uses the dynamically-bound variable `org-special-blocks-line'.
|
||||
(when (string-match "^ORG-\\(.*\\)-\\(START\\|END\\)$" org-special-blocks-line)
|
||||
(message "%s" (match-string 1))
|
||||
(when (equal (match-string 2 line) "START")
|
||||
(when (equal (match-string 2 org-special-blocks-line) "START")
|
||||
(org-close-par-maybe)
|
||||
(insert "\n<div class=\"" (match-string 1 line) "\">")
|
||||
(insert "\n<div class=\"" (match-string 1 org-special-blocks-line) "\">")
|
||||
(org-open-par))
|
||||
(when (equal (match-string 2 line) "END")
|
||||
(when (equal (match-string 2 org-special-blocks-line) "END")
|
||||
(org-close-par-maybe)
|
||||
(insert "\n</div>")
|
||||
(org-open-par))
|
||||
|
|
|
@ -43,6 +43,8 @@
|
|||
(declare-function org-switch-to-buffer-other-window "org" (&rest args))
|
||||
(declare-function org-pop-to-buffer-same-window
|
||||
"org-compat" (&optional buffer-or-name norecord label))
|
||||
(declare-function org-strip-protective-commas "org" (beg end))
|
||||
(declare-function org-base-buffer "org" (buffer))
|
||||
|
||||
(defcustom org-edit-src-region-extra nil
|
||||
"Additional regexps to identify regions for editing with `org-edit-src-code'.
|
||||
|
@ -153,7 +155,8 @@ but which mess up the display of a snippet in Org exported files.")
|
|||
(defcustom org-src-lang-modes
|
||||
'(("ocaml" . tuareg) ("elisp" . emacs-lisp) ("ditaa" . artist)
|
||||
("asymptote" . asy) ("dot" . fundamental) ("sqlite" . sql)
|
||||
("calc" . fundamental) ("C" . c) ("cpp" . c++))
|
||||
("calc" . fundamental) ("C" . c) ("cpp" . c++)
|
||||
("screen" . shell-script))
|
||||
"Alist mapping languages to their major mode.
|
||||
The key is the language name, the value is the string that should
|
||||
be inserted as the name of the major mode. For many languages this is
|
||||
|
@ -211,16 +214,16 @@ buffer."
|
|||
(interactive)
|
||||
(unless (eq context 'save)
|
||||
(setq org-edit-src-saved-temp-window-config (current-window-configuration)))
|
||||
(let ((mark (and (org-region-active-p) (mark)))
|
||||
(case-fold-search t)
|
||||
(info (org-edit-src-find-region-and-lang))
|
||||
(full-info (org-babel-get-src-block-info))
|
||||
(org-mode-p (derived-mode-p 'org-mode)) ;; derived-mode-p is reflexive
|
||||
(beg (make-marker))
|
||||
(end (make-marker))
|
||||
(allow-write-back-p (null code))
|
||||
block-nindent total-nindent ovl lang lang-f single lfmt buffer msg
|
||||
begline markline markcol line col transmitted-variables)
|
||||
(let* ((mark (and (org-region-active-p) (mark)))
|
||||
(case-fold-search t)
|
||||
(info (org-edit-src-find-region-and-lang))
|
||||
(full-info (org-babel-get-src-block-info 'light))
|
||||
(org-mode-p (derived-mode-p 'org-mode)) ;; derived-mode-p is reflexive
|
||||
(beg (make-marker))
|
||||
(end (make-marker))
|
||||
(allow-write-back-p (null code))
|
||||
block-nindent total-nindent ovl lang lang-f single lfmt buffer msg
|
||||
begline markline markcol line col transmitted-variables)
|
||||
(if (not info)
|
||||
nil
|
||||
(setq beg (move-marker beg (nth 0 info))
|
||||
|
@ -306,11 +309,13 @@ buffer."
|
|||
(error "Language mode `%s' fails with: %S" lang-f (nth 1 e)))))
|
||||
(dolist (pair transmitted-variables)
|
||||
(org-set-local (car pair) (cadr pair)))
|
||||
(when (eq major-mode 'org-mode)
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward "^," nil t)
|
||||
(if (eq (org-current-line) line) (setq total-nindent (1+ total-nindent)))
|
||||
(replace-match "")))
|
||||
(if (eq major-mode 'org-mode)
|
||||
(progn
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward "^," nil t)
|
||||
(if (eq (org-current-line) line) (setq total-nindent (1+ total-nindent)))
|
||||
(replace-match "")))
|
||||
(org-strip-protective-commas (point-min) (point-max)))
|
||||
(when markline
|
||||
(org-goto-line (1+ (- markline begline)))
|
||||
(org-move-to-column
|
||||
|
@ -369,6 +374,15 @@ buffer."
|
|||
"Construct the buffer name for a source editing buffer."
|
||||
(concat "*Org Src " org-buffer-name "[ " lang " ]*"))
|
||||
|
||||
(defun org-src-edit-buffer-p (&optional buffer)
|
||||
"Test whether BUFFER (or the current buffer if BUFFER is nil)
|
||||
is a source block editing buffer."
|
||||
(let ((buffer (org-base-buffer (or buffer (current-buffer)))))
|
||||
(and (buffer-name buffer)
|
||||
(string-match "\\`*Org Src " (buffer-name buffer))
|
||||
(local-variable-p 'org-edit-src-beg-marker buffer)
|
||||
(local-variable-p 'org-edit-src-end-marker buffer))))
|
||||
|
||||
(defun org-edit-src-find-buffer (beg end)
|
||||
"Find a source editing buffer that is already editing the region BEG to END."
|
||||
(catch 'exit
|
||||
|
|
|
@ -1299,7 +1299,7 @@ However, when FORCE is non-nil, create new columns if necessary."
|
|||
(defun org-table-line-to-dline (line &optional above)
|
||||
"Turn a buffer line number into a data line number.
|
||||
If there is no data line in this line, return nil.
|
||||
If there is no matching dline (most likely the reference was a hline), the
|
||||
If there is no matching dline (most likely te reference was a hline), the
|
||||
first dline below it is used. When ABOVE is non-nil, the one above is used."
|
||||
(catch 'exit
|
||||
(let ((ll (length org-table-dlines))
|
||||
|
@ -2364,7 +2364,7 @@ of the new mark."
|
|||
(looking-at org-table-auto-recalculate-regexp))
|
||||
(org-table-recalculate) t))
|
||||
|
||||
(defvar modes)
|
||||
(defvar org-table-modes)
|
||||
(defsubst org-set-calc-mode (var &optional value)
|
||||
(if (stringp var)
|
||||
(setq var (assoc var '(("D" calc-angle-mode deg)
|
||||
|
@ -2372,10 +2372,10 @@ of the new mark."
|
|||
("F" calc-prefer-frac t)
|
||||
("S" calc-symbolic-mode t)))
|
||||
value (nth 2 var) var (nth 1 var)))
|
||||
(if (memq var modes)
|
||||
(setcar (cdr (memq var modes)) value)
|
||||
(cons var (cons value modes)))
|
||||
modes)
|
||||
(if (memq var org-table-modes)
|
||||
(setcar (cdr (memq var org-table-modes)) value)
|
||||
(cons var (cons value org-table-modes)))
|
||||
org-table-modes)
|
||||
|
||||
(defun org-table-eval-formula (&optional arg equation
|
||||
suppress-align suppress-const
|
||||
|
@ -2931,7 +2931,7 @@ known that the table will be realigned a little later anyway."
|
|||
|
||||
(defun org-table-iterate (&optional arg)
|
||||
"Recalculate the table until it does not change anymore.
|
||||
The maximum number of iterations is 10, but you can choose a different value
|
||||
The maximun number of iterations is 10, but you can choose a different value
|
||||
with the prefix ARG."
|
||||
(interactive "P")
|
||||
(let ((imax (if arg (prefix-numeric-value arg) 10))
|
||||
|
@ -4154,7 +4154,7 @@ overwritten, and the table is not marked as requiring realignment."
|
|||
(looking-at "[^|\n]* +|"))
|
||||
(let (org-table-may-need-update)
|
||||
(goto-char (1- (match-end 0)))
|
||||
(delete-char -1)
|
||||
(backward-delete-char 1)
|
||||
(goto-char (match-beginning 0))
|
||||
(self-insert-command N))
|
||||
(setq org-table-may-need-update t)
|
||||
|
|
376
lisp/org/org.el
376
lisp/org/org.el
|
@ -6,7 +6,7 @@
|
|||
;; Maintainer: Bastien Guerry <bzg at gnu dot org>
|
||||
;; Keywords: outlines, hypermedia, calendar, wp
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.8.03
|
||||
;; Version: 7.8.07
|
||||
;;
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -75,6 +75,7 @@
|
|||
(require 'gnus-sum))
|
||||
|
||||
(require 'calendar)
|
||||
(require 'format-spec)
|
||||
|
||||
;; Emacs 22 calendar compatibility: Make sure the new variables are available
|
||||
(when (fboundp 'defvaralias)
|
||||
|
@ -203,9 +204,10 @@ identifier."
|
|||
|
||||
;;; Version
|
||||
|
||||
(defconst org-version "7.8.03"
|
||||
(defconst org-version "7.8.07"
|
||||
"The version number of the file org.el.")
|
||||
|
||||
;;;###autoload
|
||||
(defun org-version (&optional here)
|
||||
"Show the org-mode version in the echo area.
|
||||
With prefix arg HERE, insert it at point."
|
||||
|
@ -2246,10 +2248,7 @@ TODO state changes
|
|||
Also, if a parent has an :ORDERED: property, switching an entry to DONE will
|
||||
be blocked if any prior sibling is not yet done.
|
||||
Finally, if the parent is blocked because of ordered siblings of its own,
|
||||
the child will also be blocked.
|
||||
This variable needs to be set before org.el is loaded, and you need to
|
||||
restart Emacs after a change to make the change effective. The only way
|
||||
to change is while Emacs is running is through the customize interface."
|
||||
the child will also be blocked."
|
||||
:set (lambda (var val)
|
||||
(set var val)
|
||||
(if val
|
||||
|
@ -4446,12 +4445,13 @@ means to push this value onto the list in the variable.")
|
|||
|
||||
(defun org-update-property-plist (key val props)
|
||||
"Update PROPS with KEY and VAL."
|
||||
(if (string= "+" (substring key (- (length key) 1)))
|
||||
(let* ((key (substring key 0 (- (length key) 1)))
|
||||
(previous (cdr (assoc key props))))
|
||||
(cons (cons key (concat previous " " val))
|
||||
(org-remove-if (lambda (p) (string= (car p) key)) props)))
|
||||
(cons (cons key val) props)))
|
||||
(let* ((appending (string= "+" (substring key (- (length key) 1))))
|
||||
(key (if appending (substring key 0 (- (length key) 1)) key))
|
||||
(remainder (org-remove-if (lambda (p) (string= (car p) key)) props))
|
||||
(previous (cdr (assoc key props))))
|
||||
(if appending
|
||||
(cons (cons key (if previous (concat previous " " val) val)) remainder)
|
||||
(cons (cons key val) remainder))))
|
||||
|
||||
(defconst org-block-regexp
|
||||
"^[ \t]*#\\+begin_?\\([^ \n]+\\)\\(\\([^\n]+\\)\\)?\n\\([^\000]+?\\)#\\+end_?\\1[ \t]*$"
|
||||
|
@ -4841,8 +4841,8 @@ This is for getting out of special buffers like remember.")
|
|||
|
||||
;; FIXME: Occasionally check by commenting these, to make sure
|
||||
;; no other functions uses these, forgetting to let-bind them.
|
||||
(defvar entry)
|
||||
(defvar last-state)
|
||||
(defvar org-entry)
|
||||
(defvar org-last-state)
|
||||
(defvar date)
|
||||
|
||||
;; Defined somewhere in this file, but used before definition.
|
||||
|
@ -4892,6 +4892,8 @@ sure that we are at the beginning of the line.")
|
|||
"Matches an headline, putting stars and text into groups.
|
||||
Stars are put in group 1 and the trimmed body in group 2.")
|
||||
|
||||
(defvar buffer-face-mode-face)
|
||||
|
||||
;;;###autoload
|
||||
(define-derived-mode org-mode outline-mode "Org"
|
||||
"Outline-based notes management and organizer, alias
|
||||
|
@ -5025,8 +5027,9 @@ The following commands are available:
|
|||
(set (make-local-variable 'pcomplete-parse-arguments-function)
|
||||
'org-parse-arguments)
|
||||
(set (make-local-variable 'pcomplete-termination-string) "")
|
||||
(set (make-local-variable 'face-remapping-alist)
|
||||
'((default org-default)))
|
||||
(when (>= emacs-major-version 23)
|
||||
(set (make-local-variable 'buffer-face-mode-face) 'org-default)
|
||||
(buffer-face-mode))
|
||||
|
||||
;; If empty file that did not turn on org-mode automatically, make it to.
|
||||
(if (and org-insert-mode-line-in-empty-file
|
||||
|
@ -5459,6 +5462,22 @@ will be prompted for."
|
|||
'(font-lock-fontified t face font-lock-comment-face)))
|
||||
(t nil))))))
|
||||
|
||||
(defun org-strip-protective-commas (beg end)
|
||||
"Strip protective commas between BEG and END in the current buffer."
|
||||
(interactive "r")
|
||||
(save-excursion
|
||||
(save-match-data
|
||||
(goto-char beg)
|
||||
(let ((front-line (save-excursion
|
||||
(re-search-forward
|
||||
"[^[:space:]]" end t)
|
||||
(goto-char (match-beginning 0))
|
||||
(current-column))))
|
||||
(while (re-search-forward "^[ \t]*\\(,\\)\\([*]\\|#\\+\\)" end t)
|
||||
(goto-char (match-beginning 1))
|
||||
(when (= (current-column) front-line)
|
||||
(replace-match "" nil nil nil 1)))))))
|
||||
|
||||
(defun org-activate-angle-links (limit)
|
||||
"Run through the buffer and add overlays to links."
|
||||
(if (re-search-forward org-angle-link-re limit t)
|
||||
|
@ -5791,7 +5810,7 @@ needs to be inserted at a specific position in the font-lock sequence.")
|
|||
(if org-fontify-done-headline
|
||||
(list (format org-heading-keyword-regexp-format
|
||||
(concat
|
||||
"\\("
|
||||
"\\(?:"
|
||||
(mapconcat 'regexp-quote org-done-keywords "\\|")
|
||||
"\\)"))
|
||||
'(2 'org-headline-done t))
|
||||
|
@ -6295,7 +6314,12 @@ in special contexts.
|
|||
(if (org-at-item-p)
|
||||
(org-list-set-item-visibility (point-at-bol) struct 'children)
|
||||
(org-show-entry)
|
||||
(show-children)
|
||||
(org-with-limited-levels (show-children))
|
||||
;; FIXME: This slows down the func way too much.
|
||||
;; How keep drawers hidden in subtree anyway?
|
||||
;; (when (memq 'org-cycle-hide-drawers org-cycle-hook)
|
||||
;; (org-cycle-hide-drawers 'subtree))
|
||||
|
||||
;; Fold every list in subtree to top-level items.
|
||||
(when (eq org-cycle-include-plain-lists 'integrate)
|
||||
(save-excursion
|
||||
|
@ -6786,7 +6810,7 @@ This command works around this by showing a copy of the current buffer
|
|||
in an indirect buffer, in overview mode. You can dive into the tree in
|
||||
that copy, use org-occur and incremental search to find a location.
|
||||
When pressing RET or `Q', the command returns to the original buffer in
|
||||
which the visibility is still unchanged. After RET is will also jump to
|
||||
which the visibility is still unchanged. After RET it will also jump to
|
||||
the location selected in the indirect buffer and expose the headline
|
||||
hierarchy above."
|
||||
(interactive "P")
|
||||
|
@ -6803,7 +6827,7 @@ hierarchy above."
|
|||
(selected-point
|
||||
(if (eq interface 'outline)
|
||||
(car (org-get-location (current-buffer) org-goto-help))
|
||||
(let ((pa (org-refile-get-location "Goto")))
|
||||
(let ((pa (org-refile-get-location "Goto" nil nil t)))
|
||||
(org-refile-check-position pa)
|
||||
(nth 3 pa)))))
|
||||
(if selected-point
|
||||
|
@ -7890,7 +7914,7 @@ the following will happen:
|
|||
repeater intact.
|
||||
- the start days in the repeater in the original entry will be shifted
|
||||
to past the last clone.
|
||||
I this way you can spell out a number of instances of a repeating task,
|
||||
In this way you can spell out a number of instances of a repeating task,
|
||||
and still retain the repeater to cover future instances of the task."
|
||||
(interactive "nNumber of clones to produce: \nsDate shift per clone (e.g. +1w, empty to copy unchanged): ")
|
||||
(let (beg end template task idprop
|
||||
|
@ -7917,7 +7941,7 @@ and still retain the repeater to cover future instances of the task."
|
|||
(setq end (point))
|
||||
(setq template (buffer-substring beg end))
|
||||
(when (and doshift
|
||||
(string-match "<[^<>\n]+ \\+[0-9]+[dwmy][^<>\n]*>" template))
|
||||
(string-match "<[^<>\n]+ [.+]?\\+[0-9]+[dwmy][^<>\n]*>" template))
|
||||
(delete-region beg end)
|
||||
(setq end beg)
|
||||
(setq nmin 0 nmax (1+ nmax) n-no-remove nmax))
|
||||
|
@ -7948,7 +7972,7 @@ and still retain the repeater to cover future instances of the task."
|
|||
(while (re-search-forward org-ts-regexp nil t)
|
||||
(save-excursion
|
||||
(goto-char (match-beginning 0))
|
||||
(if (looking-at "<[^<>\n]+\\( +\\+[0-9]+[dwmy]\\)")
|
||||
(if (looking-at "<[^<>\n]+\\( +[.+]?\\+[0-9]+[dwmy]\\)")
|
||||
(delete-region (match-beginning 1) (match-end 1)))))))
|
||||
(setq task (buffer-string)))
|
||||
(insert task))
|
||||
|
@ -7958,8 +7982,7 @@ and still retain the repeater to cover future instances of the task."
|
|||
|
||||
(defun org-sort (with-case)
|
||||
"Call `org-sort-entries', `org-table-sort-lines' or `org-sort-list'.
|
||||
Optional argument WITH-CASE means sort case-sensitively.
|
||||
With a double prefix argument, also remove duplicate entries."
|
||||
Optional argument WITH-CASE means sort case-sensitively."
|
||||
(interactive "P")
|
||||
(cond
|
||||
((org-at-table-p) (org-call-with-arg 'org-table-sort-lines with-case))
|
||||
|
@ -8477,11 +8500,12 @@ call CMD."
|
|||
|
||||
(defun org-get-category (&optional pos force-refresh)
|
||||
"Get the category applying to position POS."
|
||||
(if force-refresh (org-refresh-category-properties))
|
||||
(let ((pos (or pos (point))))
|
||||
(or (get-text-property pos 'org-category)
|
||||
(progn (org-refresh-category-properties)
|
||||
(get-text-property pos 'org-category)))))
|
||||
(save-match-data
|
||||
(if force-refresh (org-refresh-category-properties))
|
||||
(let ((pos (or pos (point))))
|
||||
(or (get-text-property pos 'org-category)
|
||||
(progn (org-refresh-category-properties)
|
||||
(get-text-property pos 'org-category))))))
|
||||
|
||||
(defun org-refresh-category-properties ()
|
||||
"Refresh category text properties in the buffer."
|
||||
|
@ -8625,7 +8649,7 @@ For file links, arg negates `org-context-in-file-links'."
|
|||
(setq link (plist-get org-store-link-plist :link)
|
||||
desc (or (plist-get org-store-link-plist :description) link)))
|
||||
|
||||
((equal (buffer-name) "*Org Edit Src Example*")
|
||||
((org-src-edit-buffer-p)
|
||||
(let (label gc)
|
||||
(while (or (not label)
|
||||
(save-excursion
|
||||
|
@ -9439,7 +9463,7 @@ Org-mode syntax."
|
|||
(interactive "sLink: \nP")
|
||||
(let ((reference-buffer (or reference-buffer (current-buffer))))
|
||||
(with-temp-buffer
|
||||
(let ((org-inhibit-startup t))
|
||||
(let ((org-inhibit-startup (not reference-buffer)))
|
||||
(org-mode)
|
||||
(insert s)
|
||||
(goto-char (point-min))
|
||||
|
@ -10358,8 +10382,8 @@ on the system \"/user@host:\"."
|
|||
targets tgs txt re files f desc descre fast-path-p level pos0)
|
||||
(message "Getting targets...")
|
||||
(with-current-buffer (or default-buffer (current-buffer))
|
||||
(while (setq entry (pop entries))
|
||||
(setq files (car entry) desc (cdr entry))
|
||||
(while (setq org-entry (pop entries))
|
||||
(setq files (car org-entry) desc (cdr org-entry))
|
||||
(setq fast-path-p nil)
|
||||
(cond
|
||||
((null files) (setq files (list (current-buffer))))
|
||||
|
@ -10621,7 +10645,8 @@ prefix argument (`C-u C-u C-u C-c C-w')."
|
|||
(t (concat "Refile subtree \""
|
||||
heading-text "\" to")))
|
||||
default-buffer
|
||||
org-refile-allow-creating-parent-nodes
|
||||
(and (not (equal '(4) goto))
|
||||
org-refile-allow-creating-parent-nodes)
|
||||
goto))))))
|
||||
(setq file (nth 1 it)
|
||||
re (nth 2 it)
|
||||
|
@ -11028,11 +11053,11 @@ This function can be used in a hook."
|
|||
"<example>\n?\n</example>")
|
||||
("q" "#+begin_quote\n?\n#+end_quote"
|
||||
"<quote>\n?\n</quote>")
|
||||
("v" "#+begin_verse\n?\n#+end_verse"
|
||||
"<verse>\n?\n/verse>")
|
||||
("c" "#+begin_center\n?\n#+end_center"
|
||||
"<center>\n?\n/center>")
|
||||
("l" "#+begin_latex\n?\n#+end_latex"
|
||||
("v" "#+BEGIN_VERSE\n?\n#+END_VERSE"
|
||||
"<verse>\n?\n</verse>")
|
||||
("c" "#+BEGIN_CENTER\n?\n#+END_CENTER"
|
||||
"<center>\n?\n</center>")
|
||||
("l" "#+BEGIN_LaTeX\n?\n#+END_LaTeX"
|
||||
"<literal style=\"latex\">\n?\n</literal>")
|
||||
("L" "#+latex: "
|
||||
"<literal style=\"latex\">?</literal>")
|
||||
|
@ -11847,7 +11872,7 @@ of repeating deadline/scheduled time stamps to new date.
|
|||
This function is run automatically after each state change to a DONE state."
|
||||
;; last-state is dynamically scoped into this function
|
||||
(let* ((repeat (org-get-repeat))
|
||||
(aa (assoc last-state org-todo-kwd-alist))
|
||||
(aa (assoc org-last-state org-todo-kwd-alist))
|
||||
(interpret (nth 1 aa))
|
||||
(head (nth 2 aa))
|
||||
(whata '(("d" . day) ("m" . month) ("y" . year)))
|
||||
|
@ -11860,7 +11885,7 @@ This function is run automatically after each state change to a DONE state."
|
|||
(setq to-state (or (org-entry-get nil "REPEAT_TO_STATE")
|
||||
org-todo-repeat-to-state))
|
||||
(unless (and to-state (member to-state org-todo-keywords-1))
|
||||
(setq to-state (if (eq interpret 'type) last-state head)))
|
||||
(setq to-state (if (eq interpret 'type) org-last-state head)))
|
||||
(org-todo to-state)
|
||||
(when (or org-log-repeat (org-entry-get nil "CLOCK"))
|
||||
(org-entry-put nil "LAST_REPEAT" (format-time-string
|
||||
|
@ -11874,7 +11899,7 @@ This function is run automatically after each state change to a DONE state."
|
|||
(setq org-log-note-how 'note))
|
||||
;; Set up for taking a record
|
||||
(org-add-log-setup 'state (or done-word (car org-done-keywords))
|
||||
last-state
|
||||
org-last-state
|
||||
'findpos org-log-repeat)))
|
||||
(org-back-to-heading t)
|
||||
(org-add-planning-info nil nil 'closed)
|
||||
|
@ -12742,7 +12767,7 @@ obtain a list of properties. Building the tags list for each entry in such
|
|||
a file becomes an N^2 operation - but with this variable set, it scales
|
||||
as N.")
|
||||
|
||||
(defun org-scan-tags (action matcher &optional todo-only start-level)
|
||||
(defun org-scan-tags (action matcher todo-only &optional start-level)
|
||||
"Scan headline tags with inheritance and produce output ACTION.
|
||||
|
||||
ACTION can be `sparse-tree' to produce a sparse tree in the current buffer,
|
||||
|
@ -12752,7 +12777,9 @@ this case the return value is a list of all return values from these calls.
|
|||
|
||||
MATCHER is a Lisp form to be evaluated, testing if a given set of tags
|
||||
qualifies a headline for inclusion. When TODO-ONLY is non-nil,
|
||||
only lines with a TODO keyword are included in the output.
|
||||
only lines with a not-done TODO keyword are included in the output.
|
||||
This should be the same variable that was scoped into
|
||||
and set by `org-make-tags-matcher' when it constructed MATCHER.
|
||||
|
||||
START-LEVEL can be a string with asterisks, reducing the scope to
|
||||
headlines matching this string."
|
||||
|
@ -12861,7 +12888,7 @@ headlines matching this string."
|
|||
(and org-highlight-sparse-tree-matches
|
||||
(org-get-heading) (match-end 0)
|
||||
(org-highlight-new-match
|
||||
(match-beginning 0) (match-beginning 1)))
|
||||
(match-beginning 1) (match-end 1)))
|
||||
(org-show-context 'tags-tree))
|
||||
((eq action 'agenda)
|
||||
(setq txt (org-agenda-format-item
|
||||
|
@ -12922,8 +12949,6 @@ headlines matching this string."
|
|||
(if (member x org-use-tag-inheritance) x nil))
|
||||
tags)))))
|
||||
|
||||
(defvar todo-only) ;; dynamically scoped
|
||||
|
||||
(defun org-match-sparse-tree (&optional todo-only match)
|
||||
"Create a sparse tree according to tags string MATCH.
|
||||
MATCH can contain positive and negative selection of tags, like
|
||||
|
@ -12970,9 +12995,29 @@ instead of the agenda files."
|
|||
(org-agenda-files))))))))
|
||||
|
||||
(defun org-make-tags-matcher (match)
|
||||
"Create the TAGS/TODO matcher form for the selection string MATCH."
|
||||
;; todo-only is scoped dynamically into this function, and the function
|
||||
;; may change it if the matcher asks for it.
|
||||
"Create the TAGS/TODO matcher form for the selection string MATCH.
|
||||
|
||||
The variable `todo-only' is scoped dynamically into this function; it will be
|
||||
set to t if the matcher restricts matching to TODO entries,
|
||||
otherwise will not be touched.
|
||||
|
||||
Returns a cons of the selection string MATCH and the constructed
|
||||
lisp form implementing the matcher. The matcher is to be
|
||||
evaluated at an Org entry, with point on the headline,
|
||||
and returns t if the entry matches the
|
||||
selection string MATCH. The returned lisp form references
|
||||
two variables with information about the entry, which must be
|
||||
bound around the form's evaluation: todo, the TODO keyword at the
|
||||
entry (or nil of none); and tags-list, the list of all tags at the
|
||||
entry including inherited ones. Additionally, the category
|
||||
of the entry (if any) must be specified as the text property
|
||||
'org-category on the headline.
|
||||
|
||||
See also `org-scan-tags'.
|
||||
"
|
||||
(declare (special todo-only))
|
||||
(unless (boundp 'todo-only)
|
||||
(error "org-make-tags-matcher expects todo-only to be scoped in"))
|
||||
(unless match
|
||||
;; Get a new match request, with completion
|
||||
(let ((org-last-tags-completion-table
|
||||
|
@ -13089,6 +13134,9 @@ instead of the agenda files."
|
|||
(setq matcher (if todomatcher
|
||||
(list 'and tagsmatcher todomatcher)
|
||||
tagsmatcher))
|
||||
(when todo-only
|
||||
(setq matcher (list 'and '(member todo org-not-done-keywords)
|
||||
matcher)))
|
||||
(cons match0 matcher)))
|
||||
|
||||
(defun org-op-to-function (op &optional stringp)
|
||||
|
@ -13344,7 +13392,8 @@ With prefix ARG, realign all tags in headings in the current buffer."
|
|||
;; Get a new set of tags from the user
|
||||
(save-excursion
|
||||
(setq table (append org-tag-persistent-alist
|
||||
(or org-tag-alist (org-get-buffer-tags))
|
||||
org-tag-alist
|
||||
(org-get-buffer-tags)
|
||||
(and
|
||||
org-complete-tags-always-offer-all-agenda-tags
|
||||
(org-global-tags-completion-table
|
||||
|
@ -13362,7 +13411,7 @@ With prefix ARG, realign all tags in headings in the current buffer."
|
|||
current-tags inherited-tags table
|
||||
(if org-fast-tag-selection-include-todo
|
||||
org-todo-key-alist))
|
||||
(let ((org-add-colon-after-tag-completion t))
|
||||
(let ((org-add-colon-after-tag-completion (< 1 (length table))))
|
||||
(org-trim
|
||||
(org-icompleting-read "Tags: "
|
||||
'org-tags-completion-function
|
||||
|
@ -13646,9 +13695,11 @@ Returns the new tags string, or nil to not change the current settings."
|
|||
(condition-case nil
|
||||
(setq tg (org-icompleting-read
|
||||
"Tag: "
|
||||
(or buffer-tags
|
||||
(with-current-buffer buf
|
||||
(org-get-buffer-tags)))))
|
||||
(delete-dups
|
||||
(append (or buffer-tags
|
||||
(with-current-buffer buf
|
||||
(mapcar 'car (org-get-buffer-tags))))
|
||||
(mapcar 'car table)))))
|
||||
(quit (setq tg "")))
|
||||
(when (string-match "\\S-" tg)
|
||||
(add-to-list 'buffer-tags (list tg))
|
||||
|
@ -13802,7 +13853,8 @@ a *different* entry, you cannot use these techniques."
|
|||
org-done-keywords-for-agenda
|
||||
org-todo-keyword-alist-for-agenda
|
||||
org-drawers-for-agenda
|
||||
org-tag-alist-for-agenda)
|
||||
org-tag-alist-for-agenda
|
||||
todo-only)
|
||||
|
||||
(cond
|
||||
((eq match t) (setq matcher t))
|
||||
|
@ -13835,7 +13887,7 @@ a *different* entry, you cannot use these techniques."
|
|||
(progn
|
||||
(org-prepare-agenda-buffers
|
||||
(list (buffer-file-name (current-buffer))))
|
||||
(setq res (org-scan-tags func matcher nil start-level)))
|
||||
(setq res (org-scan-tags func matcher todo-only start-level)))
|
||||
;; Get the right scope
|
||||
(cond
|
||||
((and scope (listp scope) (symbolp (car scope)))
|
||||
|
@ -13856,7 +13908,7 @@ a *different* entry, you cannot use these techniques."
|
|||
(save-restriction
|
||||
(widen)
|
||||
(goto-char (point-min))
|
||||
(setq res (append res (org-scan-tags func matcher))))))))))
|
||||
(setq res (append res (org-scan-tags func matcher todo-only))))))))))
|
||||
res)))
|
||||
|
||||
;;;; Properties
|
||||
|
@ -14137,24 +14189,26 @@ when a \"nil\" value can supersede a non-nil value higher up the hierarchy."
|
|||
;; retrieve it, but specify the wanted property
|
||||
(cdr (assoc property (org-entry-properties nil 'special property)))
|
||||
(let ((range (unless (org-before-first-heading-p)
|
||||
(org-get-property-block))))
|
||||
(when (and range (goto-char (car range)))
|
||||
((lambda (val) (when val (if literal-nil val (org-not-nil val))))
|
||||
(cond
|
||||
((re-search-forward
|
||||
(org-re-property property) (cdr range) t)
|
||||
(if (match-end 1) (org-match-string-no-properties 1) ""))
|
||||
((re-search-forward
|
||||
(org-re-property (concat property "+")) (cdr range) t)
|
||||
(cdr (assoc
|
||||
property
|
||||
(org-update-property-plist
|
||||
(concat property "+")
|
||||
(if (match-end 1) (org-match-string-no-properties 1) "")
|
||||
(list (or (assoc property org-file-properties)
|
||||
(assoc property org-global-properties)
|
||||
(assoc property org-global-properties-fixed)
|
||||
))))))))))))))
|
||||
(org-get-property-block)))
|
||||
(props (list (or (assoc property org-file-properties)
|
||||
(assoc property org-global-properties)
|
||||
(assoc property org-global-properties-fixed))))
|
||||
val)
|
||||
(flet ((ap (key)
|
||||
(when (re-search-forward
|
||||
(org-re-property key) (cdr range) t)
|
||||
(setq props
|
||||
(org-update-property-plist
|
||||
key
|
||||
(if (match-end 1)
|
||||
(org-match-string-no-properties 1) "")
|
||||
props)))))
|
||||
(when (and range (goto-char (car range)))
|
||||
(ap property)
|
||||
(goto-char (car range))
|
||||
(while (ap (concat property "+")))
|
||||
(setq val (cdr (assoc property props)))
|
||||
(when val (if literal-nil val (org-not-nil val))))))))))
|
||||
|
||||
(defun org-property-or-variable-value (var &optional inherit)
|
||||
"Check if there is a property fixing the value of VAR.
|
||||
|
@ -14543,7 +14597,7 @@ in the current file."
|
|||
(org-re-property property)
|
||||
nil t)
|
||||
(setq cnt (1+ cnt))
|
||||
(replace-match ""))
|
||||
(delete-region (match-beginning 0) (1+ (point-at-eol))))
|
||||
(message "Property \"%s\" removed from %d entries" property cnt)))))
|
||||
|
||||
(defvar org-columns-current-fmt-compiled) ; defined in org-colview.el
|
||||
|
@ -14848,7 +14902,7 @@ So these are more for recording a certain time/date."
|
|||
(defvar org-read-date-analyze-futurep nil)
|
||||
(defvar org-read-date-analyze-forced-year nil)
|
||||
|
||||
(defun org-read-date (&optional with-time to-time from-string prompt
|
||||
(defun org-read-date (&optional org-with-time to-time from-string prompt
|
||||
default-time default-input)
|
||||
"Read a date, possibly a time, and make things smooth for the user.
|
||||
The prompt will suggest to enter an ISO date, but you can also enter anything
|
||||
|
@ -14881,9 +14935,7 @@ plus or minus, it is relative to the date in DEFAULT-TIME. E.g.
|
|||
+2w --> two weeks from today
|
||||
++5 --> five days from default date
|
||||
|
||||
The function understands only English month and weekday abbreviations,
|
||||
but this can be configured with the variables `parse-time-months' and
|
||||
`parse-time-weekdays'.
|
||||
The function understands only English month and weekday abbreviations.
|
||||
|
||||
While prompting, a calendar is popped up - you can also select the
|
||||
date with the mouse (button 1). The calendar shows a period of three
|
||||
|
@ -14904,24 +14956,24 @@ the time/date that is used for everything that is not specified by the
|
|||
user."
|
||||
(require 'parse-time)
|
||||
(let* ((org-time-stamp-rounding-minutes
|
||||
(if (equal with-time '(16)) '(0 0) org-time-stamp-rounding-minutes))
|
||||
(if (equal org-with-time '(16)) '(0 0) org-time-stamp-rounding-minutes))
|
||||
(org-dcst org-display-custom-times)
|
||||
(ct (org-current-time))
|
||||
(def (or org-overriding-default-time default-time ct))
|
||||
(defdecode (decode-time def))
|
||||
(org-def (or org-overriding-default-time default-time ct))
|
||||
(org-defdecode (decode-time org-def))
|
||||
(dummy (progn
|
||||
(when (< (nth 2 defdecode) org-extend-today-until)
|
||||
(setcar (nthcdr 2 defdecode) -1)
|
||||
(setcar (nthcdr 1 defdecode) 59)
|
||||
(setq def (apply 'encode-time defdecode)
|
||||
defdecode (decode-time def)))))
|
||||
(when (< (nth 2 org-defdecode) org-extend-today-until)
|
||||
(setcar (nthcdr 2 org-defdecode) -1)
|
||||
(setcar (nthcdr 1 org-defdecode) 59)
|
||||
(setq org-def (apply 'encode-time org-defdecode)
|
||||
org-defdecode (decode-time org-def)))))
|
||||
(calendar-frame-setup nil)
|
||||
(calendar-setup nil)
|
||||
(calendar-move-hook nil)
|
||||
(calendar-view-diary-initially-flag nil)
|
||||
(calendar-view-holidays-initially-flag nil)
|
||||
(timestr (format-time-string
|
||||
(if with-time "%Y-%m-%d %H:%M" "%Y-%m-%d") def))
|
||||
(if org-with-time "%Y-%m-%d %H:%M" "%Y-%m-%d") org-def))
|
||||
(prompt (concat (if prompt (concat prompt " ") "")
|
||||
(format "Date+time [%s]: " timestr)))
|
||||
ans (org-ans0 "") org-ans1 org-ans2 final)
|
||||
|
@ -14934,7 +14986,7 @@ user."
|
|||
(calendar)
|
||||
(unwind-protect
|
||||
(progn
|
||||
(calendar-forward-day (- (time-to-days def)
|
||||
(calendar-forward-day (- (time-to-days org-def)
|
||||
(calendar-absolute-from-gregorian
|
||||
(calendar-current-date))))
|
||||
(org-eval-in-calendar nil t)
|
||||
|
@ -15020,7 +15072,7 @@ user."
|
|||
(delete-overlay org-read-date-overlay)
|
||||
(setq org-read-date-overlay nil)))))
|
||||
|
||||
(setq final (org-read-date-analyze ans def defdecode))
|
||||
(setq final (org-read-date-analyze ans org-def org-defdecode))
|
||||
|
||||
(when org-read-date-analyze-forced-year
|
||||
(message "Year was forced into %s"
|
||||
|
@ -15042,9 +15094,9 @@ user."
|
|||
(nth 2 final) (nth 1 final))
|
||||
(format "%04d-%02d-%02d" (nth 5 final) (nth 4 final) (nth 3 final))))))
|
||||
|
||||
(defvar def)
|
||||
(defvar defdecode)
|
||||
(defvar with-time)
|
||||
(defvar org-def)
|
||||
(defvar org-defdecode)
|
||||
(defvar org-with-time)
|
||||
(defun org-read-date-display ()
|
||||
"Display the current date prompt interpretation in the minibuffer."
|
||||
(when org-read-date-display-live
|
||||
|
@ -15060,11 +15112,11 @@ user."
|
|||
(let* ((ans (concat (buffer-substring (point-at-bol) (point-max))
|
||||
" " (or org-ans1 org-ans2)))
|
||||
(org-end-time-was-given nil)
|
||||
(f (org-read-date-analyze ans def defdecode))
|
||||
(f (org-read-date-analyze ans org-def org-defdecode))
|
||||
(fmts (if org-dcst
|
||||
org-time-stamp-custom-formats
|
||||
org-time-stamp-formats))
|
||||
(fmt (if (or with-time
|
||||
(fmt (if (or org-with-time
|
||||
(and (boundp 'org-time-was-given) org-time-was-given))
|
||||
(cdr fmts)
|
||||
(car fmts)))
|
||||
|
@ -15080,7 +15132,7 @@ user."
|
|||
(make-overlay (1- (point-at-eol)) (point-at-eol)))
|
||||
(org-overlay-display org-read-date-overlay txt 'secondary-selection))))
|
||||
|
||||
(defun org-read-date-analyze (ans def defdecode)
|
||||
(defun org-read-date-analyze (ans org-def org-defdecode)
|
||||
"Analyze the combined answer of the date prompt."
|
||||
;; FIXME: cleanup and comment
|
||||
(let ((nowdecode (decode-time (current-time)))
|
||||
|
@ -15092,7 +15144,7 @@ user."
|
|||
(when (string-match "\\`[ \t]*\\.[ \t]*\\'" ans)
|
||||
(setq ans "+0"))
|
||||
|
||||
(when (setq delta (org-read-date-get-relative ans (current-time) def))
|
||||
(when (setq delta (org-read-date-get-relative ans (current-time) org-def))
|
||||
(setq ans (replace-match "" t t ans)
|
||||
deltan (car delta)
|
||||
deltaw (nth 1 delta)
|
||||
|
@ -15186,19 +15238,19 @@ user."
|
|||
(substring ans (match-end 7))))))
|
||||
|
||||
(setq tl (parse-time-string ans)
|
||||
day (or (nth 3 tl) (nth 3 defdecode))
|
||||
day (or (nth 3 tl) (nth 3 org-defdecode))
|
||||
month (or (nth 4 tl)
|
||||
(if (and org-read-date-prefer-future
|
||||
(nth 3 tl) (< (nth 3 tl) (nth 3 nowdecode)))
|
||||
(prog1 (1+ (nth 4 nowdecode)) (setq futurep t))
|
||||
(nth 4 defdecode)))
|
||||
(nth 4 org-defdecode)))
|
||||
year (or (and (not kill-year) (nth 5 tl))
|
||||
(if (and org-read-date-prefer-future
|
||||
(nth 4 tl) (< (nth 4 tl) (nth 4 nowdecode)))
|
||||
(prog1 (1+ (nth 5 nowdecode)) (setq futurep t))
|
||||
(nth 5 defdecode)))
|
||||
hour (or (nth 2 tl) (nth 2 defdecode))
|
||||
minute (or (nth 1 tl) (nth 1 defdecode))
|
||||
(nth 5 org-defdecode)))
|
||||
hour (or (nth 2 tl) (nth 2 org-defdecode))
|
||||
minute (or (nth 1 tl) (nth 1 org-defdecode))
|
||||
second (or (nth 0 tl) 0)
|
||||
wday (nth 6 tl))
|
||||
|
||||
|
@ -15269,13 +15321,12 @@ user."
|
|||
(condition-case nil
|
||||
(ignore (encode-time second minute hour day month year))
|
||||
(error
|
||||
(setq year (nth 5 defdecode))
|
||||
(setq year (nth 5 org-defdecode))
|
||||
(setq org-read-date-analyze-forced-year t))))
|
||||
(setq org-read-date-analyze-futurep futurep)
|
||||
(list second minute hour day month year)))
|
||||
|
||||
(defvar parse-time-weekdays)
|
||||
|
||||
(defun org-read-date-get-relative (s today default)
|
||||
"Check string S for special relative date string.
|
||||
TODAY and DEFAULT are internal times, for today and for a default.
|
||||
|
@ -16072,14 +16123,12 @@ in the timestamp determines what will be changed."
|
|||
|
||||
(defun org-recenter-calendar (date)
|
||||
"If the calendar is visible, recenter it to DATE."
|
||||
(let* ((win (selected-window))
|
||||
(cwin (get-buffer-window "*Calendar*" t))
|
||||
(calendar-move-hook nil))
|
||||
(let ((cwin (get-buffer-window "*Calendar*" t)))
|
||||
(when cwin
|
||||
(select-window cwin)
|
||||
(calendar-goto-date (if (listp date) date
|
||||
(calendar-gregorian-from-absolute date)))
|
||||
(select-window win))))
|
||||
(let ((calendar-move-hook nil))
|
||||
(with-selected-window cwin
|
||||
(calendar-goto-date (if (listp date) date
|
||||
(calendar-gregorian-from-absolute date))))))))
|
||||
|
||||
(defun org-goto-calendar (&optional arg)
|
||||
"Go to the Emacs calendar at the current date.
|
||||
|
@ -16695,6 +16744,8 @@ the cursor is before the first headline,
|
|||
display all fragments in the buffer.
|
||||
The images can be removed again with \\[org-ctrl-c-ctrl-c]."
|
||||
(interactive "P")
|
||||
(unless buffer-file-name
|
||||
(error "Can't preview LaTeX fragment in a non-file buffer"))
|
||||
(org-remove-latex-fragment-image-overlays)
|
||||
(save-excursion
|
||||
(save-restriction
|
||||
|
@ -16966,7 +17017,7 @@ inspection."
|
|||
(dvifile (concat texfilebase ".dvi"))
|
||||
(pngfile (concat texfilebase ".png"))
|
||||
(fnh (if (featurep 'xemacs)
|
||||
(font-height (get-face-font 'default))
|
||||
(font-height (face-font 'default))
|
||||
(face-attribute 'default :height nil)))
|
||||
(scale (or (plist-get options (if buffer :scale :html-scale)) 1.0))
|
||||
(dpi (number-to-string (* scale (floor (* 0.9 (if buffer fnh 140.))))))
|
||||
|
@ -16995,13 +17046,19 @@ inspection."
|
|||
(if (not (file-exists-p dvifile))
|
||||
(progn (message "Failed to create dvi file from %s" texfile) nil)
|
||||
(condition-case nil
|
||||
(call-process "dvipng" nil nil nil
|
||||
(if (featurep 'xemacs)
|
||||
(call-process "dvipng" nil nil nil
|
||||
"-fg" fg "-bg" bg
|
||||
"-D" dpi
|
||||
;;"-x" scale "-y" scale
|
||||
"-T" "tight"
|
||||
"-o" pngfile
|
||||
dvifile)
|
||||
(call-process "dvipng" nil nil nil
|
||||
"-fg" fg "-bg" bg
|
||||
"-D" dpi
|
||||
;;"-x" scale "-y" scale
|
||||
"-T" "tight"
|
||||
"-o" pngfile
|
||||
dvifile))
|
||||
(error nil))
|
||||
(if (not (file-exists-p pngfile))
|
||||
(if org-format-latex-signal-error
|
||||
|
@ -17077,7 +17134,12 @@ SNIPPETS-P indicates if this is run to create snippet images for HTML."
|
|||
"Return an rgb color specification for dvipng."
|
||||
(apply 'format "rgb %s %s %s"
|
||||
(mapcar 'org-normalize-color
|
||||
(color-values (face-attribute 'default attr nil)))))
|
||||
(if (featurep 'xemacs)
|
||||
(color-rgb-components
|
||||
(face-property 'default
|
||||
(cond ((eq attr :foreground) 'foreground)
|
||||
((eq attr :background) 'background))))
|
||||
(color-values (face-attribute 'default attr nil))))))
|
||||
|
||||
(defun org-normalize-color (value)
|
||||
"Return string to be used as color value for an RGB component."
|
||||
|
@ -17121,7 +17183,7 @@ BEG and END default to the buffer boundaries."
|
|||
(save-restriction
|
||||
(widen)
|
||||
(setq beg (or beg (point-min)) end (or end (point-max)))
|
||||
(goto-char (point-min))
|
||||
(goto-char beg)
|
||||
(let ((re (concat "\\[\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?"
|
||||
(substring (org-image-file-name-regexp) 0 -2)
|
||||
"\\)\\]" (if include-linked "" "\\]")))
|
||||
|
@ -17204,9 +17266,7 @@ BEG and END default to the buffer boundaries."
|
|||
(org-defkey org-mode-map "\C-i" 'org-cycle)
|
||||
(org-defkey org-mode-map [(tab)] 'org-cycle)
|
||||
(org-defkey org-mode-map [(control tab)] 'org-force-cycle-archived)
|
||||
(org-defkey org-mode-map [(meta tab)] 'pcomplete)
|
||||
(org-defkey org-mode-map "\M-\t" 'pcomplete)
|
||||
(org-defkey org-mode-map "\M-\C-i" 'pcomplete)
|
||||
;; The following line is necessary under Suse GNU/Linux
|
||||
(unless (featurep 'xemacs)
|
||||
(org-defkey org-mode-map [S-iso-lefttab] 'org-shifttab))
|
||||
|
@ -17570,7 +17630,7 @@ overwritten, and the table is not marked as requiring realignment."
|
|||
(looking-at "[^|\n]* |"))
|
||||
(let (org-table-may-need-update)
|
||||
(goto-char (1- (match-end 0)))
|
||||
(delete-char -1)
|
||||
(backward-delete-char 1)
|
||||
(goto-char (match-beginning 0))
|
||||
(self-insert-command N)))
|
||||
(t
|
||||
|
@ -18424,22 +18484,22 @@ This command does many different things, depending on context:
|
|||
;; only if function was called with an argument. Send list only
|
||||
;; if at top item.
|
||||
(let* ((struct (org-list-struct))
|
||||
(new-struct struct)
|
||||
(firstp (= (org-list-get-top-point struct) (point-at-bol))))
|
||||
(firstp (= (org-list-get-top-point struct) (point-at-bol)))
|
||||
old-struct)
|
||||
(when arg
|
||||
(setq new-struct (copy-tree struct))
|
||||
(setq old-struct (copy-tree struct))
|
||||
(if firstp
|
||||
;; If at first item of sub-list, add check-box to every
|
||||
;; item at the same level.
|
||||
(mapc
|
||||
(lambda (pos)
|
||||
(unless (org-list-get-checkbox pos new-struct)
|
||||
(org-list-set-checkbox pos new-struct "[ ]")))
|
||||
(unless (org-list-get-checkbox pos struct)
|
||||
(org-list-set-checkbox pos struct "[ ]")))
|
||||
(org-list-get-all-items
|
||||
(point-at-bol) new-struct (org-list-prevs-alist new-struct)))
|
||||
(org-list-set-checkbox (point-at-bol) new-struct "[ ]")))
|
||||
(point-at-bol) struct (org-list-prevs-alist struct)))
|
||||
(org-list-set-checkbox (point-at-bol) struct "[ ]")))
|
||||
(org-list-write-struct
|
||||
new-struct (org-list-parents-alist new-struct) struct)
|
||||
struct (org-list-parents-alist struct) old-struct)
|
||||
(when arg (org-update-checkbox-count-maybe))
|
||||
(when firstp (org-list-send-list 'maybe))))
|
||||
((save-excursion (beginning-of-line 1) (looking-at org-dblock-start-re))
|
||||
|
@ -19026,7 +19086,8 @@ See the individual commands for more information."
|
|||
(org-inside-LaTeX-fragment-p)]
|
||||
["Insert citation" org-reftex-citation t]
|
||||
"--"
|
||||
["Template for BEAMER" org-insert-beamer-options-template t])
|
||||
["Template for BEAMER" (progn (require 'org-beamer)
|
||||
(org-insert-beamer-options-template)) t])
|
||||
"--"
|
||||
("MobileOrg"
|
||||
["Push Files and Views" org-mobile-push t]
|
||||
|
@ -19253,6 +19314,17 @@ With prefix arg UNCOMPILED, load the uncompiled versions."
|
|||
(eval form)
|
||||
(error (format "%%![Error: %s]" error))))
|
||||
|
||||
(defun org-in-clocktable-p ()
|
||||
"Check if the cursor is in a clocktable."
|
||||
(let ((pos (point)) start)
|
||||
(save-excursion
|
||||
(end-of-line 1)
|
||||
(and (re-search-backward "^[ \t]*#\\+BEGIN:[ \t]+clocktable" nil t)
|
||||
(setq start (match-beginning 0))
|
||||
(re-search-forward "^[ \t]*#\\+END:.*" nil t)
|
||||
(>= (match-end 0) pos)
|
||||
start))))
|
||||
|
||||
(defun org-in-commented-line ()
|
||||
"Is point in a line starting with `#'?"
|
||||
(equal (char-after (point-at-bol)) ?#))
|
||||
|
@ -20404,14 +20476,28 @@ beyond the end of the headline."
|
|||
((not (eq last-command this-command)) (point))
|
||||
(t refpos)))))
|
||||
((org-at-item-p)
|
||||
(goto-char
|
||||
(if (eq special t)
|
||||
(cond ((> pos (match-end 0)) (match-end 0))
|
||||
((= pos (point)) (match-end 0))
|
||||
(t (point)))
|
||||
(cond ((> pos (point)) (point))
|
||||
((not (eq last-command this-command)) (point))
|
||||
(t (match-end 0))))))))
|
||||
;; Being at an item and not looking at an the item means point
|
||||
;; was previously moved to beginning of a visual line, whiche
|
||||
;; doesn't contain the item. Therefore, do nothing special,
|
||||
;; just stay here.
|
||||
(when (looking-at org-list-full-item-re)
|
||||
;; Set special position at first white space character after
|
||||
;; bullet, and check-box, if any.
|
||||
(let ((after-bullet
|
||||
(let ((box (match-end 3)))
|
||||
(if (not box) (match-end 1)
|
||||
(let ((after (char-after box)))
|
||||
(if (and after (= after ? )) (1+ box) box))))))
|
||||
;; Special case: Move point to special position when
|
||||
;; currently after it or at beginning of line.
|
||||
(if (eq special t)
|
||||
(when (or (> pos after-bullet) (= (point) pos))
|
||||
(goto-char after-bullet))
|
||||
;; Reversed case: Move point to special position when
|
||||
;; point was already at beginning of line and command is
|
||||
;; repeated.
|
||||
(when (and (= (point) pos) (eq last-command this-command))
|
||||
(goto-char after-bullet))))))))
|
||||
(org-no-warnings
|
||||
(and (featurep 'xemacs) (setq zmacs-region-stays t)))))
|
||||
|
||||
|
@ -20450,7 +20536,10 @@ beyond the end of the headline."
|
|||
(move-end-of-line 1)
|
||||
(when (overlays-at (1- (point))) (backward-char 1)))
|
||||
;; At an item: Move before any hidden text.
|
||||
(t (call-interactively 'end-of-line)))
|
||||
(t (call-interactively
|
||||
(cond ((org-bound-and-true-p line-move-visual) 'end-of-visual-line)
|
||||
((fboundp 'move-end-of-line) 'move-end-of-line)
|
||||
(t 'end-of-line)))))
|
||||
(org-no-warnings
|
||||
(and (featurep 'xemacs) (setq zmacs-region-stays t)))))
|
||||
|
||||
|
@ -20899,6 +20988,7 @@ Stop at the first and last subheadings of a superior heading."
|
|||
|
||||
(defun org-show-subtree ()
|
||||
"Show everything after this heading at deeper levels."
|
||||
(interactive)
|
||||
(outline-flag-region
|
||||
(point)
|
||||
(save-excursion
|
||||
|
@ -20987,8 +21077,8 @@ Show the heading too, if it is currently invisible."
|
|||
(goto-char (point-max))
|
||||
(while (re-search-backward re nil t)
|
||||
(setq level (org-reduced-level (funcall outline-level)))
|
||||
(when (<= level n)
|
||||
(looking-at org-complex-heading-regexp)
|
||||
(when (and (<= level n)
|
||||
(looking-at org-complex-heading-regexp))
|
||||
(setq head (org-link-display-format
|
||||
(org-match-string-no-properties 4))
|
||||
m (org-imenu-new-marker))
|
||||
|
|
Loading…
Add table
Reference in a new issue