Merge Org 7.8.03
This commit is contained in:
parent
88c5c7c831
commit
e66ba1dfc4
116 changed files with 15215 additions and 3740 deletions
|
@ -1,3 +1,157 @@
|
|||
2012-01-03 Eric Schulte <eric.schulte@gmx.com>
|
||||
|
||||
* org.texi (Noweb reference syntax): Adding documentation of
|
||||
the `*org-babel-use-quick-and-dirty-noweb-expansion*'
|
||||
variable.
|
||||
|
||||
2012-01-03 Bastien Guerry <bzg@gnu.org>
|
||||
|
||||
* org.texi (Plain lists): Split the table to fix the display
|
||||
of items.
|
||||
|
||||
2012-01-03 Bastien Guerry <bzg@gnu.org>
|
||||
|
||||
* org.texi (Plain lists): Fix misplaced explanation.
|
||||
|
||||
2012-01-03 Bastien Guerry <bzg@gnu.org>
|
||||
|
||||
* org.texi (Plain lists, Agenda files): Add index entries.
|
||||
|
||||
2012-01-03 Julian Gehring <julian.gehring@googlemail.com>
|
||||
|
||||
* org.texi: Use "Org mode" instead of alternatives like
|
||||
"Org-mode" or "org-mode".
|
||||
|
||||
2012-01-03 Bernt Hansen <bernt@norang.ca>
|
||||
|
||||
* org.texi (Agenda commands): Document
|
||||
`org-clock-report-include-clocking-task'.
|
||||
|
||||
2012-01-03 Bastien Guerry <bzg@gnu.org>
|
||||
|
||||
* org.texi (Checkboxes): Document the new behavior of `C-u C-c
|
||||
C-c' on checkboxes.
|
||||
|
||||
2012-01-03 Julian Gehring <julian.gehring@googlemail.com>
|
||||
|
||||
* org.texi: End sentences with two spaces.
|
||||
|
||||
2012-01-03 Michael Brand <michael.ch.brand@gmail.com>
|
||||
|
||||
* org.texi (External links): Document the link types file+sys
|
||||
and file+emacs, slightly narrow used page width.
|
||||
|
||||
2012-01-03 Eric Schulte <eric.schulte@gmx.com>
|
||||
|
||||
* org.texi (colnames): Note that colnames behavior may differ
|
||||
across languages.
|
||||
|
||||
2012-01-03 Bastien Guerry <bzg@gnu.org>
|
||||
|
||||
* org.texi (Weekly/daily agenda, Agenda commands): Fix typos.
|
||||
|
||||
2012-01-03 Thomas Dye <dk@poto.westell.com>
|
||||
|
||||
* org.texi: Augmented discussion of babel property
|
||||
inheritance. Put footnote outside sentence ending period.
|
||||
|
||||
2012-01-03 Eric Schulte <schulte.eric@gmail.com>
|
||||
|
||||
* org.texi (eval): Documenting the full range of :eval header
|
||||
argument values.
|
||||
|
||||
2012-01-03 Eric Schulte <schulte.eric@gmail.com>
|
||||
|
||||
* org.texi (eval): Documentation of the new :eval option.
|
||||
|
||||
2012-01-03 Thomas Dye <dk@poto.local>
|
||||
|
||||
* org.texi: Add accumulated properties.
|
||||
|
||||
2012-01-03 Thomas Dye <dk@poto.local>
|
||||
|
||||
* org.texi: Documented no spaces in name=assign, another
|
||||
correction to :var table.
|
||||
|
||||
2012-01-03 Thomas Dye <dk@poto.local>
|
||||
|
||||
* org.texi: Changed DATA to NAME in Working With Source Code
|
||||
section.
|
||||
|
||||
2012-01-03 Tom Dye <tsd@tsdye.com>
|
||||
|
||||
* org.texi: Minor change to :var table.
|
||||
|
||||
2012-01-03 Tom Dye <tsd@tsdye.com>
|
||||
|
||||
* org.texi: More changes to :var table (some examples were wrong).
|
||||
|
||||
2012-01-03 Tom Dye <tsd@tsdye.com>
|
||||
|
||||
* org.texi: Cleaned up :var table.
|
||||
|
||||
2012-01-03 Bastien Guerry <bzg@gnu.org>
|
||||
|
||||
* org.texi (Timestamps, Weekly/daily agenda)
|
||||
(Weekly/daily agenda): Add @cindex for "appointment".
|
||||
|
||||
2012-01-03 Eric Schulte <schulte.eric@gmail.com>
|
||||
|
||||
* org.texi (Literal examples): A new link to the template for
|
||||
inserting empty code blocks.
|
||||
(Structure of code blocks): A new link to the template for
|
||||
inserting empty code blocks.
|
||||
|
||||
2012-01-03 Rafael Laboissiere <rafael@laboissiere.net> (tiny change)
|
||||
|
||||
* org.texi (External links): Add footnote on how the behavior
|
||||
of the text search in Org files are controled by the variable
|
||||
`org-link-search-must-match-exact-headline'.
|
||||
|
||||
2012-01-03 Eric Schulte <schulte.eric@gmail.com>
|
||||
|
||||
* org.texi (Buffer-wide header arguments): Update
|
||||
documentation to reflect removal of #+PROPERTIES.
|
||||
|
||||
2012-01-03 Carsten Dominik <carsten.dominik@gmail.com>
|
||||
|
||||
* org.texi (The clock table): Mention that ACHIVED trees
|
||||
contribute to the clock table.
|
||||
|
||||
2012-01-03 Carsten Dominik <carsten.dominik@gmail.com> (tiny change)
|
||||
|
||||
* org.texi (Conflicts): Better yasnippet config info.
|
||||
|
||||
2012-01-03 Bastien Guerry <bzg@gnu.org> (tiny change)
|
||||
|
||||
* org.texi (Selective export): Explicitely mention the default
|
||||
values for `org-export-select-tags',
|
||||
`org-export-exclude-tags'.
|
||||
|
||||
2012-01-03 Tom Dye <tsd@tsdye.com>
|
||||
|
||||
* org.texi: Added a line to specify that header arguments are
|
||||
lowercase.
|
||||
|
||||
2012-01-03 Tom Dye <tsd@tsdye.com>
|
||||
|
||||
* org.texi: :var requires default value when declared.
|
||||
|
||||
2012-01-03 Bastien Guerry <bzg@gnu.org>
|
||||
|
||||
* org.texi (Handling links): Add a note about the
|
||||
`org-link-frame-setup' option.
|
||||
|
||||
2012-01-03 David Maus <dmaus@ictsoc.de>
|
||||
|
||||
* org.texi (Exporting Agenda Views, Extracting agenda
|
||||
information): Fix command line syntax, quote symbol parameter
|
||||
values.
|
||||
|
||||
2012-01-03 David Maus <dmaus@ictsoc.de>
|
||||
|
||||
* org.texi (Exporting Agenda Views): Fix command line syntax.
|
||||
|
||||
2011-12-28 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* gnus.texi (Mail Source Customization, Mail Back End Variables):
|
||||
|
|
2305
doc/misc/org.texi
2305
doc/misc/org.texi
File diff suppressed because it is too large
Load diff
|
@ -1,3 +1,17 @@
|
|||
2012-01-03 Bastien Guerry <bzg@altern.org>
|
||||
|
||||
* org/COPYRIGHT-AND-LICENSE: New file.
|
||||
|
||||
* org/OrgOdtContentTemplate.xml: New file.
|
||||
|
||||
* org/OrgOdtStyles.xml: New file.
|
||||
|
||||
* org/: New directory.
|
||||
|
||||
2012-01-03 Julian Gehring <julian.gehring@googlemail.com>
|
||||
|
||||
* refcards/orgcard.tex: Correct one markup in the "Timestamps" section.
|
||||
|
||||
2011-12-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
|
||||
|
||||
* NEWS: Mention auth-source twice in connection with smtpmail to
|
||||
|
|
36
etc/org/COPYRIGHT-AND-LICENSE
Normal file
36
etc/org/COPYRIGHT-AND-LICENSE
Normal file
|
@ -0,0 +1,36 @@
|
|||
OrgOdtContentTemplate.xml --- Aux XML file (Org-mode's OpenDocument export)
|
||||
OrgOdtStyles.xml --- Aux XML file (Org-mode's OpenDocument export)
|
||||
|
||||
Copyright (C) 2010-2011 Free Software Foundation, Inc.
|
||||
|
||||
Author: Jambunathan K <kjambunathan at gmail dot com>
|
||||
Keywords: outlines, hypermedia, calendar, wp
|
||||
Homepage: http://orgmode.org
|
||||
|
||||
These file are not (yet) part of GNU Emacs.
|
||||
However, it is distributed under the same license.
|
||||
|
||||
GNU Emacs 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,
|
||||
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/>.
|
||||
|
||||
Commentary:
|
||||
|
||||
Above files are part of Org-mode's OpenDocument export module.
|
||||
|
||||
OrgOdtContentTemplate.xml provides a template within which the content
|
||||
of an exported document is enclosed. This file contributes to
|
||||
"content.xml" file within an exported document and acts as a
|
||||
repository of automatic styles.
|
||||
|
||||
OrgOdtStyles.xml contributes to "styles.xml" file within an exported
|
||||
document and acts as a repository of custom styles.
|
208
etc/org/OrgOdtContentTemplate.xml
Normal file
208
etc/org/OrgOdtContentTemplate.xml
Normal file
|
@ -0,0 +1,208 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<office:document-content
|
||||
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
|
||||
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
|
||||
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
|
||||
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
|
||||
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
|
||||
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
|
||||
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
|
||||
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
|
||||
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
|
||||
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
|
||||
xmlns:math="http://www.w3.org/1998/Math/MathML"
|
||||
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
|
||||
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
|
||||
xmlns:ooo="http://openoffice.org/2004/office"
|
||||
xmlns:ooow="http://openoffice.org/2004/writer"
|
||||
xmlns:oooc="http://openoffice.org/2004/calc"
|
||||
xmlns:dom="http://www.w3.org/2001/xml-events"
|
||||
xmlns:xforms="http://www.w3.org/2002/xforms"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:rpt="http://openoffice.org/2005/report"
|
||||
xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2"
|
||||
xmlns:xodt="http://www.w3.org/1999/xodt"
|
||||
xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" office:version="1.2">
|
||||
<!-- scripts -->
|
||||
<office:scripts/>
|
||||
|
||||
<!-- font face declarations -->
|
||||
<office:font-face-decls>
|
||||
<style:font-face style:name="Tahoma1" svg:font-family="Tahoma"/>
|
||||
<style:font-face style:name="courier" svg:font-family="courier, monospace"/>
|
||||
<style:font-face style:name="Arial Unicode MS" svg:font-family="'Arial Unicode MS'" style:font-pitch="variable"/>
|
||||
<style:font-face style:name="HG Mincho Light J" svg:font-family="'HG Mincho Light J'" style:font-pitch="variable"/>
|
||||
<style:font-face style:name="Thorndale" svg:font-family="Thorndale" style:font-family-generic="roman" style:font-pitch="variable"/>
|
||||
<style:font-face style:name="Times New Roman" svg:font-family="'Times New Roman'" style:font-family-generic="roman" style:font-pitch="variable"/>
|
||||
<style:font-face style:name="Albany" svg:font-family="Albany" style:font-family-generic="swiss" style:font-pitch="variable"/>
|
||||
<style:font-face style:name="SimSun" svg:font-family="SimSun" style:font-family-generic="system" style:font-pitch="variable"/>
|
||||
<style:font-face style:name="Tahoma" svg:font-family="Tahoma" style:font-family-generic="system" style:font-pitch="variable"/>
|
||||
</office:font-face-decls>
|
||||
|
||||
<!-- automatic styles -->
|
||||
<office:automatic-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:style>
|
||||
|
||||
<style:style style:name="OrgTableColumn" style:family="table-column">
|
||||
<style:table-column-properties style:rel-column-width="1*"/>
|
||||
</style:style>
|
||||
|
||||
<style:style style:name="OrgTblCell" style:family="table-cell">
|
||||
<style:table-cell-properties style:vertical-align="top" fo:padding="0.159cm" fo:border-top="none" fo:border-bottom="none" fo:border-left="none" fo:border-right="none"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgTblCellL" style:family="table-cell" style:parent-style-name="OrgTblCell">
|
||||
<style:table-cell-properties fo:padding="0.159cm" fo:border-top="none" fo:border-bottom="none" fo:border-left="0.002cm solid #000000" fo:border-right="none"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgTblCellR" style:family="table-cell" style:parent-style-name="OrgTblCell">
|
||||
<style:table-cell-properties fo:padding="0.159cm" fo:border-top="none" fo:border-bottom="none" fo:border-left="none" fo:border-right="0.002cm solid #000000"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgTblCellLR" style:family="table-cell" style:parent-style-name="OrgTblCell">
|
||||
<style:table-cell-properties fo:padding="0.159cm" fo:border-top="none" fo:border-bottom="none" fo:border-left="0.002cm solid #000000" fo:border-right="0.002cm solid #000000"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgTblCellT" style:family="table-cell" style:parent-style-name="OrgTblCell">
|
||||
<style:table-cell-properties fo:padding="0.159cm" fo:border-top="0.002cm solid #000000" fo:border-bottom="none" fo:border-left="none" fo:border-right="none"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgTblCellTL" style:family="table-cell" style:parent-style-name="OrgTblCell">
|
||||
<style:table-cell-properties fo:padding="0.159cm" fo:border-top="0.002cm solid #000000" fo:border-bottom="none" fo:border-left="0.002cm solid #000000" fo:border-right="none"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgTblCellTR" style:family="table-cell" style:parent-style-name="OrgTblCell">
|
||||
<style:table-cell-properties fo:padding="0.159cm" fo:border-top="0.002cm solid #000000" fo:border-bottom="none" fo:border-left="none" fo:border-right="0.002cm solid #000000"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgTblCellTLR" style:family="table-cell" style:parent-style-name="OrgTblCell">
|
||||
<style:table-cell-properties fo:padding="0.159cm" fo:border-top="0.002cm solid #000000" fo:border-bottom="none" fo:border-left="0.002cm solid #000000" fo:border-right="0.002cm solid #000000"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgTblCellB" style:family="table-cell" style:parent-style-name="OrgTblCell">
|
||||
<style:table-cell-properties fo:padding="0.159cm" fo:border-top="none" fo:border-bottom="0.002cm solid #000000" fo:border-left="none" fo:border-right="none"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgTblCellBL" style:family="table-cell" style:parent-style-name="OrgTblCell">
|
||||
<style:table-cell-properties fo:padding="0.159cm" fo:border-top="none" fo:border-bottom="0.002cm solid #000000" fo:border-left="0.002cm solid #000000" fo:border-right="none"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgTblCellBR" style:family="table-cell" style:parent-style-name="OrgTblCell">
|
||||
<style:table-cell-properties fo:padding="0.159cm" fo:border-top="none" fo:border-bottom="0.002cm solid #000000" fo:border-left="none" fo:border-right="0.002cm solid #000000"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgTblCellBLR" style:family="table-cell" style:parent-style-name="OrgTblCell">
|
||||
<style:table-cell-properties fo:padding="0.159cm" fo:border-top="none" fo:border-bottom="0.002cm solid #000000" fo:border-left="0.002cm solid #000000" fo:border-right="0.002cm solid #000000"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgTblCellTB" style:family="table-cell" style:parent-style-name="OrgTblCell">
|
||||
<style:table-cell-properties fo:padding="0.159cm" fo:border-top="0.002cm solid #000000" fo:border-bottom="0.002cm solid #000000" fo:border-left="none" fo:border-right="none"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgTblCellTBL" style:family="table-cell" style:parent-style-name="OrgTblCell">
|
||||
<style:table-cell-properties fo:padding="0.159cm" fo:border-top="0.002cm solid #000000" fo:border-bottom="0.002cm solid #000000" fo:border-left="0.002cm solid #000000" fo:border-right="none"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgTblCellTBR" style:family="table-cell" style:parent-style-name="OrgTblCell">
|
||||
<style:table-cell-properties fo:padding="0.159cm" fo:border-top="0.002cm solid #000000" fo:border-bottom="0.002cm solid #000000" fo:border-left="none" fo:border-right="0.002cm solid #000000"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgTblCellTBLR" style:family="table-cell" style:parent-style-name="OrgTblCell">
|
||||
<style:table-cell-properties fo:padding="0.159cm" fo:border-top="0.002cm solid #000000" fo:border-bottom="0.002cm solid #000000" fo:border-left="0.002cm solid #000000" fo:border-right="0.002cm solid #000000"/>
|
||||
</style:style>
|
||||
|
||||
<!-- BEGIN: Table styles for numbered equations -->
|
||||
<style:style style:name="OrgEquation" style:family="table">
|
||||
<style:table-properties style:rel-width="100%" fo:margin-top="0cm" fo:margin-bottom="0.20cm" table:align="center"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgEquationTableColumn" style:family="table-column">
|
||||
<style:table-column-properties style:rel-column-width="1*"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgFirstEquationFirstColumnTableCell" style:family="table-cell">
|
||||
<style:table-cell-properties style:vertical-align="middle" fo:padding="0.159cm" fo:border-top="none" fo:border-bottom="none" fo:border-left="none" fo:border-right="none"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgEquationLastColumnTableCell" style:family="table-cell">
|
||||
<style:table-cell-properties style:vertical-align="middle" fo:padding="0.159cm" fo:border-top="none" fo:border-bottom="none" fo:border-left="none" fo:border-right="none"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgEquationFirstColumnTableParagraph" style:family="paragraph" style:parent-style-name="Table_20_Contents">
|
||||
<style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgEquationLastColumnTableParagraph" style:family="paragraph" style:parent-style-name="Table_20_Contents">
|
||||
<style:paragraph-properties fo:text-align="end" style:justify-single-word="false"/>
|
||||
</style:style>
|
||||
<!-- END: Table styles for numbered equations -->
|
||||
|
||||
<!-- BEGIN: Custom Table Template -->
|
||||
<style:style style:name="Custom" style:family="table">
|
||||
<style:table-properties style:rel-width="80%" table:align="center"/>
|
||||
</style:style>
|
||||
|
||||
<style:style style:name="CustomColumn" style:family="table-column">
|
||||
<style:table-column-properties style:rel-column-width="1*"/>
|
||||
</style:style>
|
||||
|
||||
<!-- Table Paragraph Styles -->
|
||||
<style:style style:name="CustomTableParagraph" style:family="paragraph" style:parent-style-name="Table_20_Contents">
|
||||
<style:paragraph-properties fo:text-align="start" style:justify-single-word="false"/>
|
||||
<style:text-properties fo:color="#000000" style:text-outline="false" style:text-line-through-style="none" style:font-name="Times New Roman" fo:font-size="12pt" fo:font-style="normal" fo:text-shadow="none" style:text-underline-style="none" fo:font-weight="normal" style:font-size-asian="12pt" style:font-style-asian="normal" style:font-weight-asian="normal" style:font-size-complex="12pt" style:font-style-complex="normal" style:font-weight-complex="normal" style:text-overline-style="none" style:text-overline-color="font-color"/>
|
||||
</style:style>
|
||||
|
||||
<style:style style:name="CustomLastRowTableParagraph" style:family="paragraph" style:parent-style-name="Table_20_Contents">
|
||||
<style:paragraph-properties fo:text-align="start" style:justify-single-word="false"/>
|
||||
<style:text-properties fo:color="#000000" style:text-outline="false" style:text-line-through-style="none" style:font-name="Times New Roman" fo:font-size="12pt" fo:font-style="normal" fo:text-shadow="none" style:text-underline-style="none" fo:font-weight="normal" style:font-size-asian="12pt" style:font-style-asian="normal" style:font-weight-asian="normal" style:font-size-complex="12pt" style:font-style-complex="normal" style:font-weight-complex="normal" style:text-overline-style="none" style:text-overline-color="font-color"/>
|
||||
</style:style>
|
||||
|
||||
<style:style style:name="CustomLastColumnTableParagraph" style:family="paragraph" style:parent-style-name="Table_20_Contents">
|
||||
<style:paragraph-properties fo:text-align="start" style:justify-single-word="false"/>
|
||||
<style:text-properties fo:color="#000000" style:text-outline="false" style:text-line-through-style="none" style:font-name="Times New Roman" fo:font-size="12pt" fo:font-style="normal" fo:text-shadow="none" style:text-underline-style="none" fo:font-weight="normal" style:font-size-asian="12pt" style:font-style-asian="normal" style:font-weight-asian="normal" style:font-size-complex="12pt" style:font-style-complex="normal" style:font-weight-complex="normal" style:text-overline-style="none" style:text-overline-color="font-color"/>
|
||||
</style:style>
|
||||
|
||||
<style:style style:name="CustomFirstRowTableParagraph" style:family="paragraph" style:parent-style-name="Table_20_Contents">
|
||||
<style:paragraph-properties fo:text-align="start" style:justify-single-word="false"/>
|
||||
<style:text-properties fo:color="#ffffff" style:text-outline="false" style:text-line-through-style="none" style:font-name="Times New Roman" fo:font-size="12pt" fo:font-style="normal" fo:text-shadow="none" style:text-underline-style="none" fo:font-weight="normal" style:font-size-asian="12pt" style:font-style-asian="normal" style:font-weight-asian="normal" style:font-size-complex="12pt" style:font-style-complex="normal" style:font-weight-complex="normal" style:text-overline-style="none" style:text-overline-color="font-color"/>
|
||||
</style:style>
|
||||
|
||||
<style:style style:name="CustomFirstColumnTableParagraph" style:family="paragraph" style:parent-style-name="Table_20_Contents">
|
||||
<style:paragraph-properties fo:text-align="start" style:justify-single-word="false"/>
|
||||
<style:text-properties fo:color="#ffffff" style:text-outline="false" style:text-line-through-style="none" style:font-name="Times New Roman" fo:font-size="12pt" fo:font-style="normal" fo:text-shadow="none" style:text-underline-style="none" fo:font-weight="normal" style:font-size-asian="12pt" style:font-style-asian="normal" style:font-weight-asian="normal" style:font-size-complex="12pt" style:font-style-complex="normal" style:font-weight-complex="normal" style:text-overline-style="none" style:text-overline-color="font-color"/>
|
||||
</style:style>
|
||||
|
||||
<!-- Table Cell Styles -->
|
||||
<style:style style:name="CustomTableCell" style:family="table-cell">
|
||||
<style:table-cell-properties style:vertical-align="top" fo:background-color="#ffffff" fo:padding="0.097cm" fo:border-left="0.002cm solid #000000" fo:border-right="0.002cm solid #000000" fo:border-top="0.002cm solid #000000" fo:border-bottom="0.002cm solid #000000">
|
||||
<style:background-image/>
|
||||
</style:table-cell-properties>
|
||||
</style:style>
|
||||
|
||||
<style:style style:name="CustomFirstRowTableCell" style:family="table-cell">
|
||||
<style:table-cell-properties style:vertical-align="top" fo:background-color="#000080" fo:padding="0.097cm" fo:border-left="0.002cm solid #000000" fo:border-right="0.002cm solid #000000" fo:border-top="0.002cm solid #000000" fo:border-bottom="0.002cm solid #000000">
|
||||
<style:background-image/>
|
||||
</style:table-cell-properties>
|
||||
</style:style>
|
||||
|
||||
<style:style style:name="CustomLastRowTableCell" style:family="table-cell">
|
||||
<style:table-cell-properties style:vertical-align="top" fo:background-color="#cccccc" fo:padding="0.097cm" fo:border-left="0.002cm solid #000000" fo:border-right="0.002cm solid #000000" fo:border-top="0.002cm solid #000000" fo:border-bottom="0.002cm solid #000000">
|
||||
<style:background-image/>
|
||||
</style:table-cell-properties>
|
||||
</style:style>
|
||||
|
||||
<style:style style:name="CustomFirstColumnTableCell" style:family="table-cell">
|
||||
<style:table-cell-properties style:vertical-align="top" fo:background-color="#4d4d4d" fo:padding="0.097cm" fo:border-left="0.002cm solid #000000" fo:border-right="0.002cm solid #000000" fo:border-top="0.002cm solid #000000" fo:border-bottom="0.002cm solid #000000">
|
||||
<style:background-image/>
|
||||
</style:table-cell-properties>
|
||||
</style:style>
|
||||
|
||||
<style:style style:name="CustomLastColumnTableCell" style:family="table-cell">
|
||||
<style:table-cell-properties style:vertical-align="top" fo:background-color="#cccccc" fo:padding="0.097cm" fo:border-left="0.002cm solid #000000" fo:border-right="0.002cm solid #000000" fo:border-top="0.002cm solid #000000" fo:border-bottom="0.002cm solid #000000">
|
||||
<style:background-image/>
|
||||
</style:table-cell-properties>
|
||||
</style:style>
|
||||
|
||||
<!-- END: Custom Table Template -->
|
||||
|
||||
</office:automatic-styles>
|
||||
|
||||
<office:body>
|
||||
<office:text>
|
||||
<text:sequence-decls>
|
||||
<text:sequence-decl text:display-outline-level="0" text:name="Illustration"/>
|
||||
<text:sequence-decl text:display-outline-level="0" text:name="Table"/>
|
||||
<text:sequence-decl text:display-outline-level="0" text:name="Text"/>
|
||||
<text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
|
||||
<text:sequence-decl text:display-outline-level="0" text:name="Equation"/>
|
||||
<text:sequence-decl text:display-outline-level="0" text:name="Figure"/>
|
||||
</text:sequence-decls>
|
||||
</office:text>
|
||||
</office:body>
|
||||
</office:document-content>
|
731
etc/org/OrgOdtStyles.xml
Normal file
731
etc/org/OrgOdtStyles.xml
Normal file
|
@ -0,0 +1,731 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<office:document-styles xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:rpt="http://openoffice.org/2005/report" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:grddl="http://www.w3.org/2003/g/data-view#" office:version="1.2">
|
||||
<office:font-face-decls>
|
||||
<style:font-face style:name="OpenSymbol" svg:font-family="OpenSymbol"/>
|
||||
<style:font-face style:name="Tahoma1" svg:font-family="Tahoma"/>
|
||||
<style:font-face style:name="Courier New" svg:font-family="'Courier New'" style:font-family-generic="modern" style:font-pitch="fixed"/>
|
||||
<style:font-face style:name="NSimSun" svg:font-family="NSimSun" style:font-family-generic="modern" style:font-pitch="fixed"/>
|
||||
<style:font-face style:name="Times New Roman" svg:font-family="'Times New Roman'" style:font-family-generic="roman" style:font-pitch="variable"/>
|
||||
<style:font-face style:name="Arial" svg:font-family="Arial" style:font-family-generic="swiss" style:font-pitch="variable"/>
|
||||
<style:font-face style:name="SimSun" svg:font-family="SimSun" style:font-family-generic="system" style:font-pitch="variable"/>
|
||||
<style:font-face style:name="Tahoma" svg:font-family="Tahoma" style:font-family-generic="system" style:font-pitch="variable"/>
|
||||
</office:font-face-decls>
|
||||
<office:styles>
|
||||
<style:default-style style:family="graphic">
|
||||
<style:graphic-properties draw:shadow-offset-x="0.3cm" draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" draw:start-line-spacing-vertical="0.283cm" draw:end-line-spacing-horizontal="0.283cm" draw:end-line-spacing-vertical="0.283cm" style:flow-with-text="false"/>
|
||||
<style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" style:writing-mode="lr-tb" style:font-independent-line-spacing="false">
|
||||
<style:tab-stops/>
|
||||
</style:paragraph-properties>
|
||||
<style:text-properties style:use-window-font-color="true" fo:font-size="12pt" fo:language="en" fo:country="GB" style:letter-kerning="true" style:font-size-asian="12pt" style:language-asian="zh" style:country-asian="CN" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN"/>
|
||||
</style:default-style>
|
||||
<style:default-style style:family="paragraph">
|
||||
<style:paragraph-properties fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="1.251cm" style:writing-mode="page"/>
|
||||
<style:text-properties style:use-window-font-color="true" style:font-name="Times New Roman" fo:font-size="12pt" fo:language="en" fo:country="GB" style:letter-kerning="true" style:font-name-asian="SimSun" style:font-size-asian="12pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Tahoma" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN" fo:hyphenate="false" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2"/>
|
||||
</style:default-style>
|
||||
<style:default-style style:family="table">
|
||||
<style:table-properties table:border-model="collapsing"/>
|
||||
</style:default-style>
|
||||
<style:default-style style:family="table-row">
|
||||
<style:table-row-properties fo:keep-together="auto"/>
|
||||
</style:default-style>
|
||||
|
||||
<!-- Outline numbering -->
|
||||
<text:outline-style style:name="OrgOutline">
|
||||
<text:outline-level-style text:level="1" style:num-suffix=". " style:num-format="1">
|
||||
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
|
||||
<style:list-level-label-alignment text:label-followed-by="nothing" fo:text-indent="-0.762cm" fo:margin-left="0.762cm"/>
|
||||
</style:list-level-properties>
|
||||
</text:outline-level-style>
|
||||
<text:outline-level-style text:level="2" style:num-suffix=". " style:num-format="1" text:display-levels="2">
|
||||
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
|
||||
<style:list-level-label-alignment text:label-followed-by="nothing" fo:text-indent="-1.016cm" fo:margin-left="1.016cm"/>
|
||||
</style:list-level-properties>
|
||||
</text:outline-level-style>
|
||||
<text:outline-level-style text:level="3" style:num-suffix=". " style:num-format="1" text:display-levels="3">
|
||||
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
|
||||
<style:list-level-label-alignment text:label-followed-by="nothing" fo:text-indent="-1.27cm" fo:margin-left="1.27cm"/>
|
||||
</style:list-level-properties>
|
||||
</text:outline-level-style>
|
||||
<text:outline-level-style text:level="4" style:num-suffix=". " style:num-format="1" text:display-levels="4">
|
||||
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
|
||||
<style:list-level-label-alignment text:label-followed-by="nothing" fo:text-indent="-1.524cm" fo:margin-left="1.524cm"/>
|
||||
</style:list-level-properties>
|
||||
</text:outline-level-style>
|
||||
<text:outline-level-style text:level="5" style:num-suffix=". " style:num-format="1" text:display-levels="5">
|
||||
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
|
||||
<style:list-level-label-alignment text:label-followed-by="nothing" fo:text-indent="-1.778cm" fo:margin-left="1.778cm"/>
|
||||
</style:list-level-properties>
|
||||
</text:outline-level-style>
|
||||
<text:outline-level-style text:level="6" style:num-suffix=". " style:num-format="1" text:display-levels="6">
|
||||
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
|
||||
<style:list-level-label-alignment text:label-followed-by="nothing" fo:text-indent="-2.032cm" fo:margin-left="2.032cm"/>
|
||||
</style:list-level-properties>
|
||||
</text:outline-level-style>
|
||||
<text:outline-level-style text:level="7" style:num-suffix=". " style:num-format="1" text:display-levels="7">
|
||||
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
|
||||
<style:list-level-label-alignment text:label-followed-by="nothing" fo:text-indent="-2.286cm" fo:margin-left="2.286cm"/>
|
||||
</style:list-level-properties>
|
||||
</text:outline-level-style>
|
||||
<text:outline-level-style text:level="8" style:num-suffix=". " style:num-format="1" text:display-levels="8">
|
||||
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
|
||||
<style:list-level-label-alignment text:label-followed-by="nothing" fo:text-indent="-2.54cm" fo:margin-left="2.54cm"/>
|
||||
</style:list-level-properties>
|
||||
</text:outline-level-style>
|
||||
<text:outline-level-style text:level="9" style:num-suffix=". " style:num-format="1" text:display-levels="9">
|
||||
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
|
||||
<style:list-level-label-alignment text:label-followed-by="nothing" fo:text-indent="-2.794cm" fo:margin-left="2.794cm"/>
|
||||
</style:list-level-properties>
|
||||
</text:outline-level-style>
|
||||
<text:outline-level-style text:level="10" style:num-suffix=". " style:num-format="1" text:display-levels="10">
|
||||
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
|
||||
<style:list-level-label-alignment text:label-followed-by="nothing" fo:text-indent="-3.048cm" fo:margin-left="3.048cm"/>
|
||||
</style:list-level-properties>
|
||||
</text:outline-level-style>
|
||||
</text:outline-style>
|
||||
|
||||
<style:style style:name="Standard" style:family="paragraph" style:class="text"/>
|
||||
<style:style style:name="Heading" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Text_20_body" style:class="text">
|
||||
<style:paragraph-properties fo:margin-top="0.423cm" fo:margin-bottom="0.212cm" fo:keep-with-next="always"/>
|
||||
<style:text-properties style:font-name="Arial" fo:font-size="14pt" style:font-name-asian="SimSun" style:font-size-asian="14pt" style:font-name-complex="Tahoma" style:font-size-complex="14pt"/>
|
||||
</style:style>
|
||||
<style:style style:name="Text_20_body" style:display-name="Text body" style:family="paragraph" style:parent-style-name="Standard" style:class="text">
|
||||
<style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0.212cm"/>
|
||||
</style:style>
|
||||
<style:style style:name="List" style:family="paragraph" style:parent-style-name="Text_20_body" style:class="list">
|
||||
<style:text-properties style:font-name-complex="Tahoma1"/>
|
||||
</style:style>
|
||||
<style:style style:name="Caption" style:family="paragraph" style:parent-style-name="Standard" style:class="extra">
|
||||
<style:paragraph-properties fo:margin-top="0.212cm" fo:margin-bottom="0.212cm" text:number-lines="false" text:line-number="0"/>
|
||||
<style:text-properties fo:font-size="12pt" fo:font-style="italic" style:font-size-asian="12pt" style:font-style-asian="italic" style:font-name-complex="Tahoma1" style:font-size-complex="12pt" style:font-style-complex="italic"/>
|
||||
</style:style>
|
||||
<style:style style:name="Index" style:family="paragraph" style:parent-style-name="Standard" style:class="index">
|
||||
<style:paragraph-properties text:number-lines="false" text:line-number="0"/>
|
||||
<style:text-properties style:font-name-complex="Tahoma1"/>
|
||||
</style:style>
|
||||
<style:style style:name="Heading_20_1" style:display-name="Heading 1" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="1" style:class="text">
|
||||
<style:text-properties fo:font-size="115%" fo:font-weight="bold" style:font-size-asian="115%" style:font-weight-asian="bold" style:font-size-complex="115%" style:font-weight-complex="bold"/>
|
||||
</style:style>
|
||||
<style:style style:name="Heading_20_2" style:display-name="Heading 2" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="2" style:class="text">
|
||||
<style:text-properties fo:font-size="14pt" fo:font-style="italic" fo:font-weight="bold" style:font-size-asian="14pt" style:font-style-asian="italic" style:font-weight-asian="bold" style:font-size-complex="14pt" style:font-style-complex="italic" style:font-weight-complex="bold"/>
|
||||
</style:style>
|
||||
<style:style style:name="Heading_20_3" style:display-name="Heading 3" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="3" style:class="text">
|
||||
<style:text-properties fo:font-size="14pt" fo:font-weight="bold" style:font-size-asian="14pt" style:font-weight-asian="bold" style:font-size-complex="14pt" style:font-weight-complex="bold"/>
|
||||
</style:style>
|
||||
<style:style style:name="Heading_20_4" style:display-name="Heading 4" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="4" style:class="text">
|
||||
<style:text-properties fo:font-size="85%" fo:font-style="italic" fo:font-weight="bold" style:font-size-asian="85%" style:font-style-asian="italic" style:font-weight-asian="bold" style:font-size-complex="85%" style:font-style-complex="italic" style:font-weight-complex="bold"/>
|
||||
</style:style>
|
||||
<style:style style:name="Heading_20_5" style:display-name="Heading 5" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="5" style:class="text">
|
||||
<style:text-properties fo:font-size="85%" fo:font-weight="bold" style:font-size-asian="85%" style:font-weight-asian="bold" style:font-size-complex="85%" style:font-weight-complex="bold"/>
|
||||
</style:style>
|
||||
<style:style style:name="Heading_20_6" style:display-name="Heading 6" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="6" style:class="text">
|
||||
<style:text-properties fo:font-size="75%" fo:font-weight="bold" style:font-size-asian="75%" style:font-weight-asian="bold" style:font-size-complex="75%" style:font-weight-complex="bold"/>
|
||||
</style:style>
|
||||
<style:style style:name="Heading_20_7" style:display-name="Heading 7" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="7" style:class="text">
|
||||
<style:text-properties fo:font-size="75%" fo:font-weight="bold" style:font-size-asian="75%" style:font-weight-asian="bold" style:font-size-complex="75%" style:font-weight-complex="bold"/>
|
||||
</style:style>
|
||||
<style:style style:name="Heading_20_8" style:display-name="Heading 8" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="8" style:class="text">
|
||||
<style:text-properties fo:font-size="75%" fo:font-weight="bold" style:font-size-asian="75%" style:font-weight-asian="bold" style:font-size-complex="75%" style:font-weight-complex="bold"/>
|
||||
</style:style>
|
||||
<style:style style:name="Heading_20_9" style:display-name="Heading 9" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="9" style:class="text">
|
||||
<style:text-properties fo:font-size="75%" fo:font-weight="bold" style:font-size-asian="75%" style:font-weight-asian="bold" style:font-size-complex="75%" style:font-weight-complex="bold"/>
|
||||
</style:style>
|
||||
<style:style style:name="Heading_20_10" style:display-name="Heading 10" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="10" style:class="text">
|
||||
<style:text-properties fo:font-size="75%" fo:font-weight="bold" style:font-size-asian="75%" style:font-weight-asian="bold" style:font-size-complex="75%" style:font-weight-complex="bold"/>
|
||||
</style:style>
|
||||
<style:style style:name="Heading_20_1.title" style:display-name="Heading 1.title" style:family="paragraph" style:parent-style-name="Heading_20_1">
|
||||
<style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/>
|
||||
</style:style>
|
||||
<style:style style:name="Title" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Subtitle" style:class="chapter">
|
||||
<style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/>
|
||||
<style:text-properties fo:font-size="18pt" fo:font-weight="bold" style:font-size-asian="18pt" style:font-weight-asian="bold" style:font-size-complex="18pt" style:font-weight-complex="bold"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgTitle" style:family="paragraph" style:parent-style-name="Title">
|
||||
<style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0cm"/>
|
||||
<style:text-properties fo:font-size="24pt"/>
|
||||
</style:style>
|
||||
<style:style style:name="Subtitle" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:class="chapter">
|
||||
<style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/>
|
||||
<style:text-properties fo:font-size="14pt" fo:font-style="italic" style:font-size-asian="14pt" style:font-style-asian="italic" style:font-size-complex="14pt" style:font-style-complex="italic"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgSubtitle" style:family="paragraph" style:parent-style-name="Subtitle">
|
||||
<style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0cm"/>
|
||||
<style:text-properties fo:font-size="20pt"/>
|
||||
</style:style>
|
||||
<style:style style:name="Text_20_body_20_indent" style:display-name="Text body indent" style:family="paragraph" style:parent-style-name="Text_20_body" style:class="text">
|
||||
<style:paragraph-properties fo:margin-left="0.499cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false"/>
|
||||
</style:style>
|
||||
<style:style style:name="List_20_Indent" style:display-name="List Indent" style:family="paragraph" style:parent-style-name="Text_20_body" style:class="text">
|
||||
<style:paragraph-properties fo:margin-left="5.001cm" fo:margin-right="0cm" fo:text-indent="-4.5cm" style:auto-text-indent="false">
|
||||
<style:tab-stops>
|
||||
<style:tab-stop style:position="0cm"/>
|
||||
</style:tab-stops>
|
||||
</style:paragraph-properties>
|
||||
</style:style>
|
||||
<style:style style:name="First_20_line_20_indent" style:display-name="First line indent" style:family="paragraph" style:parent-style-name="Text_20_body" style:class="text">
|
||||
<style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:text-indent="0.499cm" style:auto-text-indent="false"/>
|
||||
</style:style>
|
||||
<style:style style:name="Hanging_20_indent" style:display-name="Hanging indent" style:family="paragraph" style:parent-style-name="Text_20_body" style:class="text">
|
||||
<style:paragraph-properties fo:margin-left="1cm" fo:margin-right="0cm" fo:text-indent="-0.499cm" style:auto-text-indent="false">
|
||||
<style:tab-stops>
|
||||
<style:tab-stop style:position="0cm"/>
|
||||
</style:tab-stops>
|
||||
</style:paragraph-properties>
|
||||
</style:style>
|
||||
<style:style style:name="Salutation" style:family="paragraph" style:parent-style-name="Standard" style:class="text">
|
||||
<style:paragraph-properties text:number-lines="false" text:line-number="0"/>
|
||||
</style:style>
|
||||
<style:style style:name="Contents_20_Heading" style:display-name="Contents Heading" style:family="paragraph" style:parent-style-name="Heading" style:class="index">
|
||||
<style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false" text:number-lines="false" text:line-number="0"/>
|
||||
<style:text-properties fo:font-size="16pt" fo:font-weight="bold" style:font-size-asian="16pt" style:font-weight-asian="bold" style:font-size-complex="16pt" style:font-weight-complex="bold"/>
|
||||
</style:style>
|
||||
<style:style style:name="Contents_20_1" style:display-name="Contents 1" style:family="paragraph" style:parent-style-name="Index" style:class="index">
|
||||
<style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false">
|
||||
<style:tab-stops>
|
||||
<style:tab-stop style:position="17cm" style:type="right" style:leader-style="dotted" style:leader-text="."/>
|
||||
</style:tab-stops>
|
||||
</style:paragraph-properties>
|
||||
</style:style>
|
||||
<style:style style:name="Contents_20_2" style:display-name="Contents 2" style:family="paragraph" style:parent-style-name="Index" style:class="index">
|
||||
<style:paragraph-properties fo:margin-left="0.499cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false">
|
||||
<style:tab-stops>
|
||||
<style:tab-stop style:position="16.501cm" style:type="right" style:leader-style="dotted" style:leader-text="."/>
|
||||
</style:tab-stops>
|
||||
</style:paragraph-properties>
|
||||
</style:style>
|
||||
<style:style style:name="Contents_20_3" style:display-name="Contents 3" style:family="paragraph" style:parent-style-name="Index" style:class="index">
|
||||
<style:paragraph-properties fo:margin-left="0.998cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false">
|
||||
<style:tab-stops>
|
||||
<style:tab-stop style:position="16.002cm" style:type="right" style:leader-style="dotted" style:leader-text="."/>
|
||||
</style:tab-stops>
|
||||
</style:paragraph-properties>
|
||||
</style:style>
|
||||
<style:style style:name="Contents_20_4" style:display-name="Contents 4" style:family="paragraph" style:parent-style-name="Index" style:class="index">
|
||||
<style:paragraph-properties fo:margin-left="1.498cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false">
|
||||
<style:tab-stops>
|
||||
<style:tab-stop style:position="15.503cm" style:type="right" style:leader-style="dotted" style:leader-text="."/>
|
||||
</style:tab-stops>
|
||||
</style:paragraph-properties>
|
||||
</style:style>
|
||||
<style:style style:name="Contents_20_5" style:display-name="Contents 5" style:family="paragraph" style:parent-style-name="Index" style:class="index">
|
||||
<style:paragraph-properties fo:margin-left="1.997cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false">
|
||||
<style:tab-stops>
|
||||
<style:tab-stop style:position="15.004cm" style:type="right" style:leader-style="dotted" style:leader-text="."/>
|
||||
</style:tab-stops>
|
||||
</style:paragraph-properties>
|
||||
</style:style>
|
||||
<style:style style:name="Contents_20_6" style:display-name="Contents 6" style:family="paragraph" style:parent-style-name="Index" style:class="index">
|
||||
<style:paragraph-properties fo:margin-left="2.496cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false">
|
||||
<style:tab-stops>
|
||||
<style:tab-stop style:position="14.504cm" style:type="right" style:leader-style="dotted" style:leader-text="."/>
|
||||
</style:tab-stops>
|
||||
</style:paragraph-properties>
|
||||
</style:style>
|
||||
<style:style style:name="Contents_20_7" style:display-name="Contents 7" style:family="paragraph" style:parent-style-name="Index" style:class="index">
|
||||
<style:paragraph-properties fo:margin-left="2.995cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false">
|
||||
<style:tab-stops>
|
||||
<style:tab-stop style:position="14.005cm" style:type="right" style:leader-style="dotted" style:leader-text="."/>
|
||||
</style:tab-stops>
|
||||
</style:paragraph-properties>
|
||||
</style:style>
|
||||
<style:style style:name="Contents_20_8" style:display-name="Contents 8" style:family="paragraph" style:parent-style-name="Index" style:class="index">
|
||||
<style:paragraph-properties fo:margin-left="3.494cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false">
|
||||
<style:tab-stops>
|
||||
<style:tab-stop style:position="13.506cm" style:type="right" style:leader-style="dotted" style:leader-text="."/>
|
||||
</style:tab-stops>
|
||||
</style:paragraph-properties>
|
||||
</style:style>
|
||||
<style:style style:name="Contents_20_9" style:display-name="Contents 9" style:family="paragraph" style:parent-style-name="Index" style:class="index">
|
||||
<style:paragraph-properties fo:margin-left="3.993cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false">
|
||||
<style:tab-stops>
|
||||
<style:tab-stop style:position="13.007cm" style:type="right" style:leader-style="dotted" style:leader-text="."/>
|
||||
</style:tab-stops>
|
||||
</style:paragraph-properties>
|
||||
</style:style>
|
||||
<style:style style:name="Contents_20_10" style:display-name="Contents 10" style:family="paragraph" style:parent-style-name="Index" style:class="index">
|
||||
<style:paragraph-properties fo:margin-left="4.493cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false">
|
||||
<style:tab-stops>
|
||||
<style:tab-stop style:position="12.508cm" style:type="right" style:leader-style="dotted" style:leader-text="."/>
|
||||
</style:tab-stops>
|
||||
</style:paragraph-properties>
|
||||
</style:style>
|
||||
<style:style style:name="Quotations" style:family="paragraph" style:parent-style-name="Standard" style:class="html">
|
||||
<style:paragraph-properties fo:margin-left="1cm" fo:margin-right="1cm" fo:margin-top="0cm" fo:margin-bottom="0.499cm" fo:text-indent="0cm" style:auto-text-indent="false"/>
|
||||
</style:style>
|
||||
<style:style style:name="Preformatted_20_Text" style:display-name="Preformatted Text" style:family="paragraph" style:parent-style-name="Standard" style:class="html">
|
||||
<style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0cm"/>
|
||||
<style:text-properties style:font-name="Courier New" fo:font-size="10pt" style:font-name-asian="NSimSun" style:font-size-asian="10pt" style:font-name-complex="Courier New" style:font-size-complex="10pt"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgVerse" style:family="paragraph" style:parent-style-name="Preformatted_20_Text">
|
||||
<style:paragraph-properties fo:background-color="#c0c0c0" fo:padding="0.049cm" fo:border="0.018cm solid #000000" style:shadow="none">
|
||||
<style:background-image/>
|
||||
</style:paragraph-properties>
|
||||
</style:style>
|
||||
|
||||
<style:style style:name="OrgFixedWidthBlock" style:family="paragraph" style:parent-style-name="Preformatted_20_Text">
|
||||
<style:paragraph-properties fo:background-color="#c0c0c0" fo:padding="0.049cm" fo:border="0.018cm solid #000000" style:shadow="none">
|
||||
<style:background-image/>
|
||||
</style:paragraph-properties>
|
||||
</style:style>
|
||||
|
||||
<style:style style:name="OrgFixedWidthBlockLastLine" style:family="paragraph" style:parent-style-name="OrgFixedWidthBlock">
|
||||
<style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0.21cm"/>
|
||||
</style:style>
|
||||
|
||||
<style:style style:name="OrgSrcBlockLastLine" style:family="paragraph" style:parent-style-name="OrgSrcBlock">
|
||||
<style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0.21cm"/>
|
||||
</style:style>
|
||||
|
||||
<style:style style:name="OrgCenter" style:family="paragraph" style:parent-style-name="Text_20_body">
|
||||
<style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgTableContents" style:family="paragraph" style:parent-style-name="Text_20_body"/>
|
||||
<style:style style:name="OrgTableHeading" style:family="paragraph" style:parent-style-name="OrgTableContents" style:class="extra">
|
||||
<style:paragraph-properties fo:text-align="center" style:justify-single-word="false" text:number-lines="false" text:line-number="0"/>
|
||||
<style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold"/>
|
||||
</style:style>
|
||||
|
||||
<style:style style:name="OrgTableHeadingLeft" style:family="paragraph" style:parent-style-name="OrgTableHeading">
|
||||
<style:paragraph-properties fo:text-align="left" style:justify-single-word="false"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgTableHeadingRight" style:family="paragraph" style:parent-style-name="OrgTableHeading">
|
||||
<style:paragraph-properties fo:text-align="right" style:justify-single-word="false"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgTableHeadingCenter" style:family="paragraph" style:parent-style-name="OrgTableHeading">
|
||||
<style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/>
|
||||
</style:style>
|
||||
|
||||
<style:style style:name="OrgTableContentsLeft" style:family="paragraph" style:parent-style-name="OrgTableContents">
|
||||
<style:paragraph-properties fo:text-align="left" style:justify-single-word="false"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgTableContentsRight" style:family="paragraph" style:parent-style-name="OrgTableContents">
|
||||
<style:paragraph-properties fo:text-align="right" style:justify-single-word="false"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgTableContentsCenter" style:family="paragraph" style:parent-style-name="OrgTableContents">
|
||||
<style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/>
|
||||
</style:style>
|
||||
<style:style style:name="Text_20_body_20_bold" style:display-name="Text body bold" style:family="paragraph" style:parent-style-name="Text_20_body" style:next-style-name="Text_20_body">
|
||||
<style:text-properties fo:font-weight="bold"/>
|
||||
</style:style>
|
||||
<style:style style:name="Footnote" style:family="paragraph" style:parent-style-name="Standard" style:class="extra">
|
||||
<style:paragraph-properties fo:margin-left="0.499cm" fo:margin-right="0cm" fo:text-indent="-0.499cm" style:auto-text-indent="false" text:number-lines="false" text:line-number="0"/>
|
||||
<style:text-properties fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
|
||||
</style:style>
|
||||
<style:style style:name="Figure" style:family="paragraph" style:parent-style-name="Caption"/>
|
||||
<style:style style:name="Illustration_20_Index_20_Heading" style:display-name="Illustration Index Heading" style:family="paragraph" style:parent-style-name="Heading" style:class="index">
|
||||
<style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false" text:number-lines="false" text:line-number="0"/>
|
||||
<style:text-properties fo:font-size="16pt" fo:font-weight="bold" style:font-size-asian="16pt" style:font-weight-asian="bold" style:font-size-complex="16pt" style:font-weight-complex="bold"/>
|
||||
</style:style>
|
||||
<style:style style:name="Table" style:family="paragraph" style:parent-style-name="Caption" style:class="extra">
|
||||
<style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/>
|
||||
</style:style>
|
||||
<style:style style:name="Horizontal_20_Line" style:display-name="Horizontal Line" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Text_20_body" style:class="html">
|
||||
<style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0.499cm" style:border-line-width-bottom="0.002cm 0.035cm 0.002cm" fo:padding="0cm" fo:border-left="none" fo:border-right="none" fo:border-top="none" fo:border-bottom="0.039cm double #808080" text:number-lines="false" text:line-number="0" style:join-border="false"/>
|
||||
<style:text-properties fo:font-size="6pt" style:font-size-asian="6pt" style:font-size-complex="6pt"/>
|
||||
</style:style>
|
||||
<style:style style:name="Emphasis" style:family="text">
|
||||
<style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic"/>
|
||||
</style:style>
|
||||
<style:style style:name="Underline" style:family="text">
|
||||
<style:text-properties style:text-underline-style="solid" style:text-underline-width="auto" style:text-underline-color="font-color" fo:background-color="transparent"/>
|
||||
</style:style>
|
||||
<style:style style:name="Strikethrough" style:family="text">
|
||||
<style:text-properties style:text-line-through-style="solid"/>
|
||||
</style:style>
|
||||
<style:style style:name="Source_20_Text" style:display-name="Source Text" style:family="text">
|
||||
<style:text-properties style:font-name="Courier New" fo:background-color="transparent" style:font-name-asian="NSimSun" style:font-name-complex="Courier New"/>
|
||||
</style:style>
|
||||
<style:style style:name="Citation" style:family="text">
|
||||
<style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic"/>
|
||||
</style:style>
|
||||
<style:style style:name="Example" style:family="text">
|
||||
<style:text-properties style:font-name="Courier New" fo:background-color="transparent" style:font-name-asian="NSimSun" style:font-name-complex="Courier New"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgCode" style:family="text" style:parent-style-name="Source_20_Text"/>
|
||||
|
||||
<!-- BEGIN: Org Agenda Styles -->
|
||||
<style:style style:name="OrgTodo" style:family="text">
|
||||
<style:text-properties fo:color="#ff0000"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgDone" style:family="text">
|
||||
<style:text-properties fo:color="#008000"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgTag" style:family="text">
|
||||
<style:text-properties fo:background-color="#add8e6"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgTimestamp" style:family="text">
|
||||
<style:text-properties fo:color="#bebebe"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgTimestampKeyword" style:family="text">
|
||||
<style:text-properties fo:color="#5f9ea0"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgTimestampWrapper" style:family="text"/>
|
||||
<style:style style:name="OrgTarget" style:family="text"/>
|
||||
<!-- END: Org Agenda Styles -->
|
||||
|
||||
<style:style style:name="Bold" style:family="text">
|
||||
<style:text-properties fo:font-weight="bold"/>
|
||||
</style:style>
|
||||
<style:style style:name="Numbering_20_Symbols" style:display-name="Numbering Symbols" style:family="text"/>
|
||||
<style:style style:name="Footnote_20_Symbol" style:display-name="Footnote Symbol" style:family="text"/>
|
||||
<style:style style:name="Footnote_20_anchor" style:display-name="Footnote anchor" style:family="text">
|
||||
<style:text-properties style:text-position="super 58%"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgSuperscript" style:family="text">
|
||||
<style:text-properties style:text-position="super 58%"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgSubscript" style:family="text">
|
||||
<style:text-properties style:text-position="sub 58%"/>
|
||||
</style:style>
|
||||
<style:style style:name="Internet_20_link" style:display-name="Internet link" style:family="text">
|
||||
<style:text-properties fo:color="#000080" fo:language="zxx" fo:country="none" style:text-underline-style="solid" style:text-underline-width="auto" style:text-underline-color="font-color" style:language-asian="zxx" style:country-asian="none" style:language-complex="zxx" style:country-complex="none"/>
|
||||
</style:style>
|
||||
<style:style style:name="Graphics" style:family="graphic">
|
||||
<style:graphic-properties text:anchor-type="paragraph" svg:x="0cm" svg:y="0cm" style:wrap="none" style:vertical-pos="top" style:vertical-rel="paragraph" style:horizontal-pos="center" style:horizontal-rel="paragraph"/>
|
||||
</style:style>
|
||||
<style:style style:name="Frame" style:family="graphic">
|
||||
<style:graphic-properties text:anchor-type="paragraph" svg:x="0cm" svg:y="0cm" fo:margin-left="0.201cm" fo:margin-right="0.201cm" fo:margin-top="0.201cm" fo:margin-bottom="0.201cm" style:wrap="parallel" style:number-wrapped-paragraphs="no-limit" style:wrap-contour="false" style:vertical-pos="top" style:vertical-rel="paragraph-content" style:horizontal-pos="center" style:horizontal-rel="paragraph-content" fo:padding="0.15cm" fo:border="0.002cm solid #000000"/>
|
||||
</style:style>
|
||||
|
||||
<!-- Simple Images -->
|
||||
<style:style style:name="OrgDisplayImage" style:family="graphic" style:parent-style-name="Graphics">
|
||||
<style:graphic-properties text:anchor-type="paragraph" style:wrap="none" style:vertical-pos="top" style:vertical-rel="paragraph" style:horizontal-pos="center" style:horizontal-rel="paragraph"/>
|
||||
</style:style>
|
||||
|
||||
<style:style style:name="OrgPageImage" style:family="graphic" style:parent-style-name="Graphics">
|
||||
<style:graphic-properties text:anchor-type="page" fo:margin-top="0.21cm" fo:margin-bottom="0.21cm" style:vertical-pos="middle" style:vertical-rel="page" style:horizontal-pos="center" style:horizontal-rel="page" fo:background-color="transparent" style:background-transparency="100%" style:shadow="none" style:mirror="none" fo:clip="rect(0cm, 0cm, 0cm, 0cm)" draw:luminance="0%" draw:contrast="0%" draw:red="0%" draw:green="0%" draw:blue="0%" draw:gamma="100%" draw:color-inversion="false" draw:image-opacity="100%" draw:color-mode="standard">
|
||||
<style:background-image/>
|
||||
</style:graphic-properties>
|
||||
</style:style>
|
||||
|
||||
<!-- Captioned Images -->
|
||||
<style:style style:name="OrgCaptionedImage" style:family="graphic" style:parent-style-name="Graphics">
|
||||
<style:graphic-properties style:rel-width="100%" text:anchor-type="paragraph" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-top="0cm" fo:margin-bottom="0cm" style:run-through="foreground" style:wrap="none" style:vertical-pos="from-top" style:vertical-rel="paragraph-content" style:horizontal-pos="from-left" style:horizontal-rel="paragraph-content" fo:padding="0cm" fo:border="none" style:shadow="none"/>
|
||||
</style:style>
|
||||
|
||||
<style:style style:name="OrgImageCaptionFrame" style:family="graphic" style:parent-style-name="Frame">
|
||||
<style:graphic-properties text:anchor-type="paragraph" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-top="0cm" fo:margin-bottom="0cm" style:wrap="none" style:vertical-pos="top" style:vertical-rel="paragraph" style:horizontal-pos="center" style:horizontal-rel="paragraph" fo:padding="0cm" fo:border="none"/>
|
||||
</style:style>
|
||||
|
||||
<style:style style:name="OrgPageImageCaptionFrame" style:family="graphic" style:parent-style-name="Frame">
|
||||
<style:graphic-properties text:anchor-type="paragraph" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-top="0.21cm" fo:margin-bottom="0.21cm" style:wrap="none" style:vertical-pos="middle" style:vertical-rel="page" style:horizontal-pos="center" style:horizontal-rel="page" fo:background-color="transparent" style:background-transparency="100%" fo:padding="0cm" fo:border="none" style:shadow="none">
|
||||
<style:background-image/>
|
||||
</style:graphic-properties>
|
||||
</style:style>
|
||||
|
||||
<!-- Inlined Images -->
|
||||
<style:style style:name="OrgInlineImage" style:family="graphic" style:parent-style-name="Graphics">
|
||||
<style:graphic-properties text:anchor-type="as-char" style:vertical-pos="top" style:vertical-rel="baseline" style:horizontal-pos="center" style:horizontal-rel="paragraph"/>
|
||||
</style:style>
|
||||
|
||||
<!-- Inline Formula -->
|
||||
<style:style style:name="OrgFormula" style:family="graphic">
|
||||
<style:graphic-properties text:anchor-type="as-char" svg:y="0cm" fo:margin-left="0.201cm" fo:margin-right="0.201cm" style:vertical-pos="middle" style:vertical-rel="text" style:shadow="none"/>
|
||||
</style:style>
|
||||
|
||||
<style:style style:name="OrgInlineFormula" style:family="graphic" style:parent-style-name="Formula">
|
||||
<style:graphic-properties text:anchor-type="as-char" fo:margin-left="0.201cm" fo:margin-right="0.201cm" style:vertical-pos="middle" style:vertical-rel="text"/>
|
||||
</style:style>
|
||||
|
||||
<style:style style:name="OrgInlineFormula" style:family="graphic" style:parent-style-name="Formula">
|
||||
<style:graphic-properties style:vertical-pos="middle" style:vertical-rel="text" draw:ole-draw-aspect="1"/>
|
||||
</style:style>
|
||||
|
||||
<style:style style:name="OrgDisplayFormula" style:family="graphic" style:parent-style-name="OrgFormula">
|
||||
<style:graphic-properties style:vertical-pos="middle" style:vertical-rel="text" style:horizontal-pos="from-left" style:horizontal-rel="paragraph-content" draw:ole-draw-aspect="1"/>
|
||||
</style:style>
|
||||
|
||||
<style:style style:name="OrgFormulaCaptionFrame" style:family="graphic" style:parent-style-name="Frame">
|
||||
<style:graphic-properties fo:margin-top="0cm" fo:margin-bottom="0cm" style:vertical-pos="middle" style:vertical-rel="text" style:horizontal-pos="from-left" style:horizontal-rel="paragraph-content" fo:padding="0cm" fo:border="none"/>
|
||||
</style:style>
|
||||
|
||||
<style:style style:name="OrgCaptionedFormula" style:family="graphic" style:parent-style-name="OrgFormula">
|
||||
<style:graphic-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-top="0cm" fo:margin-bottom="0cm" style:run-through="foreground" style:wrap="none" style:vertical-pos="from-top" style:vertical-rel="paragraph-content" style:horizontal-pos="center" style:horizontal-rel="paragraph-content" fo:padding="0cm" fo:border="none" style:shadow="none" draw:ole-draw-aspect="1"/>
|
||||
</style:style>
|
||||
|
||||
<!-- Inline Tasks -->
|
||||
<style:style style:name="OrgInlineTaskHeading" style:family="paragraph" style:parent-style-name="Caption" style:next-style-name="Text_20_body">
|
||||
<style:text-properties style:font-name="Arial1" fo:font-style="normal" fo:font-weight="bold"/>
|
||||
</style:style>
|
||||
<style:style style:name="OrgInlineTaskFrame" style:family="graphic" style:parent-style-name="Frame">
|
||||
<style:graphic-properties svg:x="0cm" svg:y="0cm" style:wrap="none" style:vertical-pos="top" style:vertical-rel="paragraph-content" style:horizontal-pos="center" style:horizontal-rel="paragraph-content" fo:background-color="#ffffcc" style:background-transparency="0%" fo:padding="0.15cm" fo:border="0.26pt solid #000000" style:shadow="none">
|
||||
<style:background-image/>
|
||||
</style:graphic-properties>
|
||||
</style:style>
|
||||
|
||||
<text:list-style style:name="Numbering_20_1" style:display-name="Numbering 1">
|
||||
<text:list-level-style-number text:level="1" text:style-name="Numbering_20_Symbols" style:num-suffix="." style:num-format="1">
|
||||
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
|
||||
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.499cm" fo:text-indent="-0.499cm" fo:margin-left="0.499cm"/>
|
||||
</style:list-level-properties>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="2" text:style-name="Numbering_20_Symbols" style:num-suffix="." style:num-format="1">
|
||||
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
|
||||
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1cm" fo:text-indent="-0.499cm" fo:margin-left="1cm"/>
|
||||
</style:list-level-properties>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="3" text:style-name="Numbering_20_Symbols" style:num-suffix="." style:num-format="1">
|
||||
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
|
||||
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.499cm" fo:text-indent="-0.499cm" fo:margin-left="1.499cm"/>
|
||||
</style:list-level-properties>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="4" text:style-name="Numbering_20_Symbols" style:num-suffix="." style:num-format="1">
|
||||
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
|
||||
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2cm" fo:text-indent="-0.499cm" fo:margin-left="2cm"/>
|
||||
</style:list-level-properties>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="5" text:style-name="Numbering_20_Symbols" style:num-suffix="." style:num-format="1">
|
||||
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
|
||||
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.499cm" fo:text-indent="-0.499cm" fo:margin-left="2.499cm"/>
|
||||
</style:list-level-properties>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="6" text:style-name="Numbering_20_Symbols" style:num-suffix="." style:num-format="1">
|
||||
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
|
||||
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="3cm" fo:text-indent="-0.499cm" fo:margin-left="3cm"/>
|
||||
</style:list-level-properties>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="7" text:style-name="Numbering_20_Symbols" style:num-suffix="." style:num-format="1">
|
||||
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
|
||||
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="3.5cm" fo:text-indent="-0.499cm" fo:margin-left="3.5cm"/>
|
||||
</style:list-level-properties>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="8" text:style-name="Numbering_20_Symbols" style:num-suffix="." style:num-format="1">
|
||||
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
|
||||
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="4.001cm" fo:text-indent="-0.499cm" fo:margin-left="4.001cm"/>
|
||||
</style:list-level-properties>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="9" text:style-name="Numbering_20_Symbols" style:num-suffix="." style:num-format="1">
|
||||
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
|
||||
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="4.5cm" fo:text-indent="-0.499cm" fo:margin-left="4.5cm"/>
|
||||
</style:list-level-properties>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="10" text:style-name="Numbering_20_Symbols" style:num-suffix="." style:num-format="1">
|
||||
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
|
||||
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="5.001cm" fo:text-indent="-0.499cm" fo:margin-left="5.001cm"/>
|
||||
</style:list-level-properties>
|
||||
</text:list-level-style-number>
|
||||
</text:list-style>
|
||||
<text:list-style style:name="List_20_1" style:display-name="List 1">
|
||||
<text:list-level-style-bullet text:level="1" text:style-name="Numbering_20_Symbols" text:bullet-char="•">
|
||||
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
|
||||
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.4cm" fo:text-indent="-0.4cm" fo:margin-left="0.4cm"/>
|
||||
</style:list-level-properties>
|
||||
<style:text-properties style:font-name="OpenSymbol"/>
|
||||
</text:list-level-style-bullet>
|
||||
<text:list-level-style-bullet text:level="2" text:style-name="Numbering_20_Symbols" text:bullet-char="•">
|
||||
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
|
||||
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.801cm" fo:text-indent="-0.4cm" fo:margin-left="0.801cm"/>
|
||||
</style:list-level-properties>
|
||||
<style:text-properties style:font-name="OpenSymbol"/>
|
||||
</text:list-level-style-bullet>
|
||||
<text:list-level-style-bullet text:level="3" text:style-name="Numbering_20_Symbols" text:bullet-char="•">
|
||||
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
|
||||
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.199cm" fo:text-indent="-0.4cm" fo:margin-left="1.199cm"/>
|
||||
</style:list-level-properties>
|
||||
<style:text-properties style:font-name="OpenSymbol"/>
|
||||
</text:list-level-style-bullet>
|
||||
<text:list-level-style-bullet text:level="4" text:style-name="Numbering_20_Symbols" text:bullet-char="•">
|
||||
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
|
||||
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.6cm" fo:text-indent="-0.4cm" fo:margin-left="1.6cm"/>
|
||||
</style:list-level-properties>
|
||||
<style:text-properties style:font-name="OpenSymbol"/>
|
||||
</text:list-level-style-bullet>
|
||||
<text:list-level-style-bullet text:level="5" text:style-name="Numbering_20_Symbols" text:bullet-char="•">
|
||||
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
|
||||
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2cm" fo:text-indent="-0.4cm" fo:margin-left="2cm"/>
|
||||
</style:list-level-properties>
|
||||
<style:text-properties style:font-name="OpenSymbol"/>
|
||||
</text:list-level-style-bullet>
|
||||
<text:list-level-style-bullet text:level="6" text:style-name="Numbering_20_Symbols" text:bullet-char="•">
|
||||
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
|
||||
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.401cm" fo:text-indent="-0.4cm" fo:margin-left="2.401cm"/>
|
||||
</style:list-level-properties>
|
||||
<style:text-properties style:font-name="OpenSymbol"/>
|
||||
</text:list-level-style-bullet>
|
||||
<text:list-level-style-bullet text:level="7" text:style-name="Numbering_20_Symbols" text:bullet-char="•">
|
||||
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
|
||||
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.799cm" fo:text-indent="-0.4cm" fo:margin-left="2.799cm"/>
|
||||
</style:list-level-properties>
|
||||
<style:text-properties style:font-name="OpenSymbol"/>
|
||||
</text:list-level-style-bullet>
|
||||
<text:list-level-style-bullet text:level="8" text:style-name="Numbering_20_Symbols" text:bullet-char="•">
|
||||
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
|
||||
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="3.2cm" fo:text-indent="-0.4cm" fo:margin-left="3.2cm"/>
|
||||
</style:list-level-properties>
|
||||
<style:text-properties style:font-name="OpenSymbol"/>
|
||||
</text:list-level-style-bullet>
|
||||
<text:list-level-style-bullet text:level="9" text:style-name="Numbering_20_Symbols" text:bullet-char="•">
|
||||
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
|
||||
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="3.6cm" fo:text-indent="-0.4cm" fo:margin-left="3.6cm"/>
|
||||
</style:list-level-properties>
|
||||
<style:text-properties style:font-name="OpenSymbol"/>
|
||||
</text:list-level-style-bullet>
|
||||
<text:list-level-style-bullet text:level="10" text:style-name="Numbering_20_Symbols" text:bullet-char="•">
|
||||
<style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
|
||||
<style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="4.001cm" fo:text-indent="-0.4cm" fo:margin-left="4.001cm"/>
|
||||
</style:list-level-properties>
|
||||
<style:text-properties style:font-name="OpenSymbol"/>
|
||||
</text:list-level-style-bullet>
|
||||
</text:list-style>
|
||||
|
||||
<!-- Numbered List -->
|
||||
<text:list-style style:name="OrgNumberedList">
|
||||
<text:list-level-style-number text:level="1" style:num-suffix="." style:num-format="1">
|
||||
<style:list-level-properties text:space-before="0.635cm" text:min-label-width="0.635cm"/>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="2" style:num-suffix="." style:num-format="1">
|
||||
<style:list-level-properties text:space-before="1.27cm" text:min-label-width="0.635cm"/>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="3" style:num-suffix="." style:num-format="1">
|
||||
<style:list-level-properties text:space-before="1.905cm" text:min-label-width="0.635cm"/>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="4" style:num-suffix="." style:num-format="1">
|
||||
<style:list-level-properties text:space-before="2.54cm" text:min-label-width="0.635cm"/>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="5" style:num-suffix="." style:num-format="1">
|
||||
<style:list-level-properties text:space-before="3.175cm" text:min-label-width="0.635cm"/>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="6" style:num-suffix="." style:num-format="1">
|
||||
<style:list-level-properties text:space-before="3.81cm" text:min-label-width="0.635cm"/>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="7" style:num-suffix="." style:num-format="1">
|
||||
<style:list-level-properties text:space-before="4.445cm" text:min-label-width="0.635cm"/>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="8" style:num-suffix="." style:num-format="1">
|
||||
<style:list-level-properties text:space-before="5.08cm" text:min-label-width="0.635cm"/>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="9" style:num-suffix="." style:num-format="1">
|
||||
<style:list-level-properties text:space-before="5.715cm" text:min-label-width="0.635cm"/>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="10" style:num-suffix="." style:num-format="1">
|
||||
<style:list-level-properties text:space-before="6.35cm" text:min-label-width="0.635cm"/>
|
||||
</text:list-level-style-number>
|
||||
</text:list-style>
|
||||
|
||||
<!-- Bulleted List -->
|
||||
<text:list-style style:name="OrgBulletedList">
|
||||
<text:list-level-style-bullet text:level="1" text:style-name="Bullet_20_Symbols" style:num-suffix="." text:bullet-char="•">
|
||||
<style:list-level-properties text:space-before="0.635cm" text:min-label-width="0.635cm"/>
|
||||
<style:text-properties fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
|
||||
</text:list-level-style-bullet>
|
||||
<text:list-level-style-bullet text:level="2" text:style-name="Bullet_20_Symbols" style:num-suffix="." text:bullet-char="•">
|
||||
<style:list-level-properties text:space-before="1.27cm" text:min-label-width="0.635cm"/>
|
||||
<style:text-properties fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
|
||||
</text:list-level-style-bullet>
|
||||
<text:list-level-style-bullet text:level="3" text:style-name="Bullet_20_Symbols" style:num-suffix="." text:bullet-char="•">
|
||||
<style:list-level-properties text:space-before="1.905cm" text:min-label-width="0.635cm"/>
|
||||
<style:text-properties fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
|
||||
</text:list-level-style-bullet>
|
||||
<text:list-level-style-bullet text:level="4" text:style-name="Bullet_20_Symbols" style:num-suffix="." text:bullet-char="•">
|
||||
<style:list-level-properties text:space-before="2.54cm" text:min-label-width="0.635cm"/>
|
||||
<style:text-properties fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
|
||||
</text:list-level-style-bullet>
|
||||
<text:list-level-style-bullet text:level="5" text:style-name="Bullet_20_Symbols" style:num-suffix="." text:bullet-char="•">
|
||||
<style:list-level-properties text:space-before="3.175cm" text:min-label-width="0.635cm"/>
|
||||
<style:text-properties fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
|
||||
</text:list-level-style-bullet>
|
||||
<text:list-level-style-bullet text:level="6" text:style-name="Bullet_20_Symbols" style:num-suffix="." text:bullet-char="•">
|
||||
<style:list-level-properties text:space-before="3.81cm" text:min-label-width="0.635cm"/>
|
||||
<style:text-properties fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
|
||||
</text:list-level-style-bullet>
|
||||
<text:list-level-style-bullet text:level="7" text:style-name="Bullet_20_Symbols" style:num-suffix="." text:bullet-char="•">
|
||||
<style:list-level-properties text:space-before="4.445cm" text:min-label-width="0.635cm"/>
|
||||
<style:text-properties fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
|
||||
</text:list-level-style-bullet>
|
||||
<text:list-level-style-bullet text:level="8" text:style-name="Bullet_20_Symbols" style:num-suffix="." text:bullet-char="•">
|
||||
<style:list-level-properties text:space-before="5.08cm" text:min-label-width="0.635cm"/>
|
||||
<style:text-properties fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
|
||||
</text:list-level-style-bullet>
|
||||
<text:list-level-style-bullet text:level="9" text:style-name="Bullet_20_Symbols" style:num-suffix="." text:bullet-char="•">
|
||||
<style:list-level-properties text:space-before="5.715cm" text:min-label-width="0.635cm"/>
|
||||
<style:text-properties fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
|
||||
</text:list-level-style-bullet>
|
||||
<text:list-level-style-bullet text:level="10" text:style-name="Bullet_20_Symbols" style:num-suffix="." text:bullet-char="•">
|
||||
<style:list-level-properties text:space-before="6.35cm" text:min-label-width="0.635cm"/>
|
||||
<style:text-properties fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
|
||||
</text:list-level-style-bullet>
|
||||
</text:list-style>
|
||||
|
||||
<!-- Description List -->
|
||||
<text:list-style style:name="OrgDescriptionList">
|
||||
<text:list-level-style-number text:level="1" style:num-format="">
|
||||
<style:list-level-properties text:space-before="0.635cm" text:min-label-width="0.635cm"/>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="2" style:num-format="">
|
||||
<style:list-level-properties text:space-before="1.27cm" text:min-label-width="0.635cm"/>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="3" style:num-format="">
|
||||
<style:list-level-properties text:space-before="1.905cm" text:min-label-width="0.635cm"/>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="4" style:num-format="">
|
||||
<style:list-level-properties text:space-before="2.54cm" text:min-label-width="0.635cm"/>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="5" style:num-format="">
|
||||
<style:list-level-properties text:space-before="3.175cm" text:min-label-width="0.635cm"/>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="6" style:num-format="">
|
||||
<style:list-level-properties text:space-before="3.81cm" text:min-label-width="0.635cm"/>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="7" style:num-format="">
|
||||
<style:list-level-properties text:space-before="4.445cm" text:min-label-width="0.635cm"/>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="8" style:num-format="">
|
||||
<style:list-level-properties text:space-before="5.08cm" text:min-label-width="0.635cm"/>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="9" style:num-format="">
|
||||
<style:list-level-properties text:space-before="5.715cm" text:min-label-width="0.635cm"/>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="10" style:num-format="">
|
||||
<style:list-level-properties text:space-before="6.35cm" text:min-label-width="0.635cm"/>
|
||||
</text:list-level-style-number>
|
||||
</text:list-style>
|
||||
|
||||
<text:list-style style:name="OrgSrcBlockNumberedLine">
|
||||
<text:list-level-style-number text:level="1" style:num-format="1">
|
||||
<style:list-level-properties text:space-before="0.635cm" text:min-label-width="0.635cm" text:min-label-distance="0.101cm" fo:text-align="end"/>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="2" style:num-format="1">
|
||||
<style:list-level-properties text:space-before="1.27cm" text:min-label-width="0.635cm" text:min-label-distance="0.101cm" fo:text-align="end"/>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="3" style:num-format="1">
|
||||
<style:list-level-properties text:space-before="1.905cm" text:min-label-width="0.635cm" text:min-label-distance="0.101cm" fo:text-align="end"/>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="4" style:num-format="1">
|
||||
<style:list-level-properties text:space-before="2.54cm" text:min-label-width="0.635cm" text:min-label-distance="0.101cm" fo:text-align="end"/>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="5" style:num-format="1">
|
||||
<style:list-level-properties text:space-before="3.175cm" text:min-label-width="0.635cm" text:min-label-distance="0.101cm" fo:text-align="end"/>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="6" style:num-format="1">
|
||||
<style:list-level-properties text:space-before="3.81cm" text:min-label-width="0.635cm" text:min-label-distance="0.101cm" fo:text-align="end"/>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="7" style:num-format="1">
|
||||
<style:list-level-properties text:space-before="4.445cm" text:min-label-width="0.635cm" text:min-label-distance="0.101cm" fo:text-align="end"/>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="8" style:num-format="1">
|
||||
<style:list-level-properties text:space-before="5.08cm" text:min-label-width="0.635cm" text:min-label-distance="0.101cm" fo:text-align="end"/>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="9" style:num-format="1">
|
||||
<style:list-level-properties text:space-before="5.715cm" text:min-label-width="0.635cm" text:min-label-distance="0.101cm" fo:text-align="end"/>
|
||||
</text:list-level-style-number>
|
||||
<text:list-level-style-number text:level="10" style:num-format="1">
|
||||
<style:list-level-properties text:space-before="6.35cm" text:min-label-width="0.635cm" text:min-label-distance="0.101cm" fo:text-align="end"/>
|
||||
</text:list-level-style-number>
|
||||
</text:list-style>
|
||||
|
||||
<text:notes-configuration text:note-class="footnote" text:citation-style-name="Footnote_20_Symbol" text:citation-body-style-name="Footnote_20_anchor" style:num-format="1" text:start-value="0" text:footnotes-position="page" text:start-numbering-at="document"/>
|
||||
<text:notes-configuration text:note-class="endnote" style:num-format="i" text:start-value="0"/>
|
||||
<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: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:page-layout-properties>
|
||||
<style:header-style/>
|
||||
<style:footer-style/>
|
||||
</style:page-layout>
|
||||
</office:automatic-styles>
|
||||
<office:master-styles>
|
||||
<style:master-page style:name="Standard" style:page-layout-name="Mpm1"/>
|
||||
</office:master-styles>
|
||||
</office:document-styles>
|
Binary file not shown.
|
@ -1,5 +1,5 @@
|
|||
% Reference Card for Org Mode
|
||||
\def\orgversionnumber{7.7}
|
||||
\def\orgversionnumber{7.8.02}
|
||||
\def\versionyear{2011} % latest update
|
||||
\def\year{2011} % latest copyright year
|
||||
|
||||
|
@ -445,6 +445,7 @@ \section{Working with Code (Babel)}
|
|||
\key{execute code block at point}{C-c C-c}
|
||||
\key{open results of code block at point}{C-c C-o}
|
||||
\key{check code block at point for errors}{C-c C-v c}
|
||||
\key{insert a header argument with completion}{C-c C-v j}
|
||||
\key{view expanded body of code block at point}{C-c C-v v}
|
||||
\key{view information about code block at point}{C-c C-v I}
|
||||
\key{go to named code block}{C-c C-v g}
|
||||
|
@ -460,7 +461,7 @@ \section{Working with Code (Babel)}
|
|||
\key{tangle code blocks in supplied file}{C-c C-v f}
|
||||
\key{ingest all code blocks in supplied file into the Library of Babel}{C-c C-v i}
|
||||
\key{switch to the session of the current code block}{C-c C-v z}
|
||||
\key{load expanded body of the current code block into a session}{C-c C-v l}
|
||||
\key{load the current code block into a session}{C-c C-v l}
|
||||
\key{view sha1 hash of the current code block}{C-c C-v a}
|
||||
|
||||
\section{Completion}
|
||||
|
@ -525,7 +526,7 @@ \section{Properties and Column View}
|
|||
\section{Timestamps}
|
||||
|
||||
\key{prompt for date and insert timestamp}{C-c .}
|
||||
\key{like \kbd{C-c} . but insert date and time format}{C-u C-c .}
|
||||
\key{like \kbd{C-c .} but insert date and time format}{C-u C-c .}
|
||||
\key{like \kbd{C-c .} but make stamp inactive}{C-c !} % FIXME
|
||||
\key{insert DEADLINE timestamp}{C-c C-d}
|
||||
\key{insert SCHEDULED timestamp}{C-c C-s}
|
||||
|
@ -673,7 +674,7 @@ \section{Dynamic Blocks}
|
|||
|
||||
\section{Notes}
|
||||
[1] This is only a suggestion for a binding of this command. Choose
|
||||
your own key as shown under INSTALLATION.
|
||||
your own key as shown under ACTIVATION.
|
||||
|
||||
[2] Keybinding affected by {\tt org-support-shift-select} and also
|
||||
{\tt org-replace-disputed-keys}.
|
||||
|
@ -686,4 +687,3 @@ \section{Notes}
|
|||
% compile-command: "tex refcard"
|
||||
% End:
|
||||
|
||||
|
||||
|
|
2409
lisp/org/ChangeLog
2409
lisp/org/ChangeLog
File diff suppressed because it is too large
Load diff
|
@ -5,7 +5,6 @@
|
|||
;; Author: Eric Schulte
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
@ -180,7 +179,7 @@ of the same value."
|
|||
(format "int %S = %S;" var val))
|
||||
((floatp val)
|
||||
(format "double %S = %S;" var val))
|
||||
((or (characterp val))
|
||||
((or (integerp val))
|
||||
(format "char %S = '%S';" var val))
|
||||
((stringp val)
|
||||
(format "char %S[%d] = \"%s\";"
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
;; Dan Davison
|
||||
;; Keywords: literate programming, reproducible research, R, statistics
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
@ -80,7 +79,8 @@
|
|||
"Execute a block of R code.
|
||||
This function is called by `org-babel-execute-src-block'."
|
||||
(save-excursion
|
||||
(let* ((result-type (cdr (assoc :result-type params)))
|
||||
(let* ((result-params (cdr (assoc :result-params params)))
|
||||
(result-type (cdr (assoc :result-type params)))
|
||||
(session (org-babel-R-initiate-session
|
||||
(cdr (assoc :session params)) params))
|
||||
(colnames-p (cdr (assoc :colnames params)))
|
||||
|
@ -89,7 +89,7 @@ This function is called by `org-babel-execute-src-block'."
|
|||
(full-body (org-babel-expand-body:R body params graphics-file))
|
||||
(result
|
||||
(org-babel-R-evaluate
|
||||
session full-body result-type
|
||||
session full-body result-type result-params
|
||||
(or (equal "yes" colnames-p)
|
||||
(org-babel-pick-name
|
||||
(cdr (assoc :colname-names params)) colnames-p))
|
||||
|
@ -197,6 +197,7 @@ current code buffer."
|
|||
'((:bmp . "bmp")
|
||||
(:jpg . "jpeg")
|
||||
(:jpeg . "jpeg")
|
||||
(:tex . "tikz")
|
||||
(:tiff . "tiff")
|
||||
(:png . "png")
|
||||
(:svg . "svg")
|
||||
|
@ -214,7 +215,7 @@ current code buffer."
|
|||
(setq device (or (and device (cdr (assq (intern (concat ":" device))
|
||||
devices))) "png"))
|
||||
(setq filearg
|
||||
(if (member device '("pdf" "postscript" "svg")) "file" "filename"))
|
||||
(if (member device '("pdf" "postscript" "svg" "tikz")) "file" "filename"))
|
||||
(setq args (mapconcat
|
||||
(lambda (pair)
|
||||
(if (member (car pair) allowed-args)
|
||||
|
@ -232,16 +233,16 @@ current code buffer."
|
|||
(defvar org-babel-R-write-object-command "{function(object,transfer.file){object;invisible(if(inherits(try({tfile<-tempfile();write.table(object,file=tfile,sep=\"\\t\",na=\"nil\",row.names=%s,col.names=%s,quote=FALSE);file.rename(tfile,transfer.file)},silent=TRUE),\"try-error\")){if(!file.exists(transfer.file))file.create(transfer.file)})}}(object=%s,transfer.file=\"%s\")")
|
||||
|
||||
(defun org-babel-R-evaluate
|
||||
(session body result-type column-names-p row-names-p)
|
||||
(session body result-type result-params column-names-p row-names-p)
|
||||
"Evaluate R code in BODY."
|
||||
(if session
|
||||
(org-babel-R-evaluate-session
|
||||
session body result-type column-names-p row-names-p)
|
||||
session body result-type result-params column-names-p row-names-p)
|
||||
(org-babel-R-evaluate-external-process
|
||||
body result-type column-names-p row-names-p)))
|
||||
body result-type result-params column-names-p row-names-p)))
|
||||
|
||||
(defun org-babel-R-evaluate-external-process
|
||||
(body result-type column-names-p row-names-p)
|
||||
(body result-type result-params column-names-p row-names-p)
|
||||
"Evaluate BODY in external R process.
|
||||
If RESULT-TYPE equals 'output then return standard output as a
|
||||
string. If RESULT-TYPE equals 'value then return the value of the
|
||||
|
@ -258,11 +259,17 @@ last statement in BODY, as elisp."
|
|||
(format "{function ()\n{\n%s\n}}()" body)
|
||||
(org-babel-process-file-name tmp-file 'noquote)))
|
||||
(org-babel-R-process-value-result
|
||||
(org-babel-import-elisp-from-file tmp-file '(16)) column-names-p)))
|
||||
(if (or (member "scalar" result-params)
|
||||
(member "verbatim" result-params))
|
||||
(with-temp-buffer
|
||||
(insert-file-contents tmp-file)
|
||||
(buffer-string))
|
||||
(org-babel-import-elisp-from-file tmp-file '(16)))
|
||||
column-names-p)))
|
||||
(output (org-babel-eval org-babel-R-command body))))
|
||||
|
||||
(defun org-babel-R-evaluate-session
|
||||
(session body result-type column-names-p row-names-p)
|
||||
(session body result-type result-params column-names-p row-names-p)
|
||||
"Evaluate BODY in SESSION.
|
||||
If RESULT-TYPE equals 'output then return standard output as a
|
||||
string. If RESULT-TYPE equals 'value then return the value of the
|
||||
|
@ -284,7 +291,13 @@ last statement in BODY, as elisp."
|
|||
"FALSE")
|
||||
".Last.value" (org-babel-process-file-name tmp-file 'noquote)))
|
||||
(org-babel-R-process-value-result
|
||||
(org-babel-import-elisp-from-file tmp-file '(16)) column-names-p)))
|
||||
(if (or (member "scalar" result-params)
|
||||
(member "verbatim" result-params))
|
||||
(with-temp-buffer
|
||||
(insert-file-contents tmp-file)
|
||||
(buffer-string))
|
||||
(org-babel-import-elisp-from-file tmp-file '(16)))
|
||||
column-names-p)))
|
||||
(output
|
||||
(mapconcat
|
||||
#'org-babel-chomp
|
||||
|
@ -295,7 +308,7 @@ last statement in BODY, as elisp."
|
|||
(mapcar
|
||||
(lambda (line) ;; cleanup extra prompts left in output
|
||||
(if (string-match
|
||||
"^\\([ ]*[>+][ ]?\\)+\\([[0-9]+\\|[ ]\\)" line)
|
||||
"^\\([ ]*[>+\\.][ ]?\\)+\\([[0-9]+\\|[ ]\\)" line)
|
||||
(substring line (match-end 1))
|
||||
line))
|
||||
(org-babel-comint-with-output (session org-babel-R-eoe-output)
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Eric Schulte
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
@ -98,9 +97,8 @@ Asymptote does not support sessions"
|
|||
The elisp value PAIR is converted into Asymptote code specifying
|
||||
a variable of the same value."
|
||||
(let ((var (car pair))
|
||||
(val (if (symbolp (cdr pair))
|
||||
(symbol-name (cdr pair))
|
||||
(cdr pair))))
|
||||
(val (let ((v (cdr pair)))
|
||||
(if (symbolp v) (symbol-name v) v))))
|
||||
(cond
|
||||
((integerp val)
|
||||
(format "int %S=%S;" var val))
|
||||
|
@ -108,55 +106,42 @@ a variable of the same value."
|
|||
(format "real %S=%S;" var val))
|
||||
((stringp val)
|
||||
(format "string %S=\"%s\";" var val))
|
||||
((and (listp val) (not (listp (car val))))
|
||||
(let* ((type (org-babel-asymptote-define-type val))
|
||||
(fmt (if (eq 'string type) "\"%s\"" "%s"))
|
||||
(vect (mapconcat (lambda (e) (format fmt e)) val ", ")))
|
||||
(format "%s[] %S={%s};" type var vect)))
|
||||
((listp val)
|
||||
(let* ((dimension-2-p (not (null (cdr val))))
|
||||
(dim (if dimension-2-p "[][]" "[]"))
|
||||
(type (org-babel-asymptote-define-type val))
|
||||
(array (org-babel-asymptote-table-to-array
|
||||
val
|
||||
(if dimension-2-p '(:lstart "{" :lend "}," :llend "}")))))
|
||||
(format "%S%s %S=%s;" type dim var array))))))
|
||||
|
||||
(defun org-babel-asymptote-table-to-array (table params)
|
||||
"Convert values of an elisp table into a string of an asymptote array.
|
||||
Empty cells are ignored."
|
||||
(labels ((atom-to-string (table)
|
||||
(cond
|
||||
((null table) '())
|
||||
((not (listp (car table)))
|
||||
(cons (if (and (stringp (car table))
|
||||
(not (string= (car table) "")))
|
||||
(format "\"%s\"" (car table))
|
||||
(format "%s" (car table)))
|
||||
(atom-to-string (cdr table))))
|
||||
(t
|
||||
(cons (atom-to-string (car table))
|
||||
(atom-to-string (cdr table))))))
|
||||
;; Remove any empty row
|
||||
(fix-empty-lines (table)
|
||||
(delq nil (mapcar (lambda (l) (delq "" l)) table))))
|
||||
(orgtbl-to-generic
|
||||
(fix-empty-lines (atom-to-string table))
|
||||
(org-combine-plists '(:hline nil :sep "," :tstart "{" :tend "}") params))))
|
||||
(let* ((type (org-babel-asymptote-define-type val))
|
||||
(fmt (if (eq 'string type) "\"%s\"" "%s"))
|
||||
(array (mapconcat (lambda (row)
|
||||
(concat "{"
|
||||
(mapconcat (lambda (e) (format fmt e))
|
||||
row ", ")
|
||||
"}"))
|
||||
val ",")))
|
||||
(format "%S[][] %S={%s};" type var array))))))
|
||||
|
||||
(defun org-babel-asymptote-define-type (data)
|
||||
"Determine type of DATA.
|
||||
DATA is a list. Type symbol is returned as 'symbol. The type is
|
||||
usually the type of the first atom encountered, except for arrays
|
||||
of int, where every cell must be of int type."
|
||||
(labels ((anything-but-int (el)
|
||||
(cond
|
||||
((null el) nil)
|
||||
((not (listp (car el)))
|
||||
(cond
|
||||
((floatp (car el)) 'real)
|
||||
((stringp (car el)) 'string)
|
||||
(t
|
||||
(anything-but-int (cdr el)))))
|
||||
(t
|
||||
(or (anything-but-int (car el))
|
||||
(anything-but-int (cdr el)))))))
|
||||
(or (anything-but-int data) 'int)))
|
||||
|
||||
DATA is a list. Return type as a symbol.
|
||||
|
||||
The type is `string' if any element in DATA is
|
||||
a string. Otherwise, it is either `real', if some elements are
|
||||
floats, or `int'."
|
||||
(let* ((type 'int)
|
||||
find-type ; for byte-compiler
|
||||
(find-type
|
||||
(function
|
||||
(lambda (row)
|
||||
(catch 'exit
|
||||
(mapc (lambda (el)
|
||||
(cond ((listp el) (funcall find-type el))
|
||||
((stringp el) (throw 'exit (setq type 'string)))
|
||||
((floatp el) (setq type 'real))))
|
||||
row))))))
|
||||
(funcall find-type data) type))
|
||||
|
||||
(provide 'ob-asymptote)
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Eric Schulte
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
@ -49,7 +48,7 @@
|
|||
"Expand BODY according to PARAMS, return the expanded body."
|
||||
(dolist (pair (mapcar #'cdr (org-babel-get-header params :var)))
|
||||
(setf body (replace-regexp-in-string
|
||||
(regexp-quote (concat "$" (car pair))) (cdr pair) body)))
|
||||
(regexp-quote (format "$%s" (car pair))) (cdr pair) body)))
|
||||
body)
|
||||
|
||||
(defun org-babel-execute:awk (body params)
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Eric Schulte
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
@ -29,10 +28,15 @@
|
|||
;;; Code:
|
||||
(require 'ob)
|
||||
(require 'calc)
|
||||
(require 'calc-store)
|
||||
(unless (featurep 'xemacs) (require 'calc-trail))
|
||||
(unless (featurep 'xemacs)
|
||||
(require 'calc-trail)
|
||||
(require 'calc-store))
|
||||
(eval-when-compile (require 'ob-comint))
|
||||
|
||||
(declare-function calc-store-into "calc-store" (&optional var))
|
||||
(declare-function calc-recall "calc-store" (&optional var))
|
||||
(declare-function math-evaluate-expr "calc-ext" (x))
|
||||
|
||||
(defvar org-babel-default-header-args:calc nil
|
||||
"Default arguments for evaluating an calc source block.")
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
;; Eric Schulte
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Eric Schulte
|
||||
;; Keywords: literate programming, reproducible research, comint
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
@ -54,6 +53,7 @@ executed inside the protection of `save-excursion' and
|
|||
(error "buffer %s doesn't exist or has no process" ,buffer))
|
||||
(set-buffer ,buffer)
|
||||
,@body)))
|
||||
(def-edebug-spec org-babel-comint-in-buffer (form body))
|
||||
|
||||
(defmacro org-babel-comint-with-output (meta &rest body)
|
||||
"Evaluate BODY in BUFFER and return process output.
|
||||
|
@ -115,6 +115,7 @@ or user `keyboard-quit' during execution of body."
|
|||
string-buffer))
|
||||
(setq raw (substring string-buffer (match-end 0))))
|
||||
(split-string string-buffer comint-prompt-regexp)))))
|
||||
(def-edebug-spec org-babel-comint-with-output (form body))
|
||||
|
||||
(defun org-babel-comint-input-command (buffer cmd)
|
||||
"Pass CMD to BUFFER.
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Eric Schulte
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Eric Schulte
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Eric Schulte
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Eric Schulte
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Eric Schulte
|
||||
;; Keywords: literate programming, reproducible research, comint
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
;; Dan Davison
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
@ -37,7 +36,6 @@
|
|||
(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-hook 'org-export-blocks-postblock-hook 'org-exp-res/src-name-cleanup)
|
||||
|
||||
(org-export-blocks-add-block '(src org-babel-exp-src-block nil))
|
||||
|
||||
|
@ -74,6 +72,7 @@ process."
|
|||
(setq results ,@body))
|
||||
(set-buffer export-buffer)
|
||||
results)))
|
||||
(def-edebug-spec org-babel-exp-in-export-file (form body))
|
||||
|
||||
(defun org-babel-exp-src-block (body &rest headers)
|
||||
"Process source block for export.
|
||||
|
@ -105,7 +104,6 @@ none ----- do not display either code or results upon export"
|
|||
(org-babel-process-params
|
||||
(org-babel-merge-params
|
||||
org-babel-default-header-args
|
||||
(org-babel-params-from-buffer)
|
||||
(org-babel-params-from-properties lang)
|
||||
(if (boundp lang-headers) (eval lang-headers) nil)
|
||||
raw-params))))
|
||||
|
@ -129,10 +127,10 @@ options and are taken from `org-babel-default-inline-header-args'."
|
|||
(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)) code-replacement)
|
||||
(params (nth 2 info)))
|
||||
(save-match-data
|
||||
(goto-char (match-beginning 2))
|
||||
(when (not (org-babel-in-example-or-verbatim))
|
||||
(unless (org-babel-in-example-or-verbatim)
|
||||
;; expand noweb references in the original file
|
||||
(setf (nth 1 info)
|
||||
(if (and (cdr (assoc :noweb params))
|
||||
|
@ -140,39 +138,25 @@ options and are taken from `org-babel-default-inline-header-args'."
|
|||
(org-babel-expand-noweb-references
|
||||
info (get-file-buffer org-current-export-file))
|
||||
(nth 1 info)))
|
||||
(setq code-replacement (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))))))
|
||||
|
||||
(defun org-exp-res/src-name-cleanup ()
|
||||
"Clean up #+results and #+srcname lines for export.
|
||||
This function should only be called after all block processing
|
||||
has taken place."
|
||||
(interactive)
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(while (org-re-search-forward-unprotected
|
||||
(concat
|
||||
"\\("org-babel-src-name-regexp"\\|"org-babel-result-regexp"\\)")
|
||||
nil t)
|
||||
(delete-region
|
||||
(progn (beginning-of-line) (point))
|
||||
(progn (end-of-line) (+ 1 (point)))))))
|
||||
(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)))))))))
|
||||
|
||||
(defun org-babel-in-example-or-verbatim ()
|
||||
"Return true if point is in example or verbatim code.
|
||||
Example and verbatim code include escaped portions of
|
||||
an org-mode buffer code that should be treated as normal
|
||||
org-mode text."
|
||||
(or (org-in-indented-comment-line)
|
||||
(save-match-data
|
||||
(or (save-match-data
|
||||
(save-excursion
|
||||
(goto-char (point-at-bol))
|
||||
(looking-at "[ \t]*:[ \t]")))
|
||||
(org-in-verbatim-emphasis)
|
||||
(org-in-regexps-block-p "^[ \t]*#\\+begin_src" "^[ \t]*#\\+end_src")))
|
||||
(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)
|
||||
|
@ -183,8 +167,8 @@ options are taken from `org-babel-default-header-args'."
|
|||
(save-excursion
|
||||
(goto-char start)
|
||||
(while (and (< (point) end)
|
||||
(re-search-forward org-babel-lob-one-liner-regexp nil t))
|
||||
(unless (and (match-string 12) (org-babel-in-example-or-verbatim))
|
||||
(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))
|
||||
|
@ -196,7 +180,6 @@ options are taken from `org-babel-default-header-args'."
|
|||
(org-babel-merge-params
|
||||
org-babel-default-header-args
|
||||
org-babel-default-lob-header-args
|
||||
(org-babel-params-from-buffer)
|
||||
(org-babel-params-from-properties)
|
||||
(org-babel-parse-header-arguments
|
||||
(org-babel-clean-text-properties
|
||||
|
@ -232,7 +215,7 @@ The function respects the value of the :exports header argument."
|
|||
(defun org-babel-exp-code (info)
|
||||
"Return the original code block formatted for export."
|
||||
(org-fill-template
|
||||
"#+BEGIN_SRC %lang%flags\n%body\n#+END_SRC\n"
|
||||
"#+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)))))
|
||||
|
@ -258,7 +241,15 @@ inhibit insertion of results into the buffer."
|
|||
(nth 2 info)
|
||||
`((:results . ,(if silent "silent" "replace")))))))
|
||||
(cond
|
||||
((or (equal type 'block) (equal type 'inline))
|
||||
((equal type 'block)
|
||||
(org-babel-execute-src-block nil info))
|
||||
((equal type 'inline)
|
||||
;; position the point on the inline source block allowing
|
||||
;; `org-babel-insert-result' to check that the block is
|
||||
;; inline
|
||||
(re-search-backward "[ \f\t\n\r\v]" nil t)
|
||||
(re-search-forward org-babel-inline-src-block-regexp nil t)
|
||||
(re-search-backward "src_" nil t)
|
||||
(org-babel-execute-src-block nil info))
|
||||
((equal type 'lob)
|
||||
(save-excursion
|
||||
|
|
162
lisp/org/ob-fortran.el
Normal file
162
lisp/org/ob-fortran.el
Normal file
|
@ -0,0 +1,162 @@
|
|||
;;; ob-fortran.el --- org-babel functions for fortran
|
||||
|
||||
;; Copyright (C) 2011 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 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, 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; 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.
|
||||
|
||||
;;; Code:
|
||||
(require 'ob)
|
||||
(require 'ob-eval)
|
||||
(require 'cc-mode)
|
||||
|
||||
(declare-function org-entry-get "org"
|
||||
(pom property &optional inherit literal-nil))
|
||||
|
||||
(defvar org-babel-tangle-lang-exts)
|
||||
(add-to-list 'org-babel-tangle-lang-exts '("fortran" . "F90"))
|
||||
|
||||
(defvar org-babel-default-header-args:fortran '())
|
||||
|
||||
(defvar org-babel-fortran-compiler "gfortran"
|
||||
"fortran command used to compile a fortran source code file into an
|
||||
executable.")
|
||||
|
||||
(defun org-babel-execute:fortran (body params)
|
||||
"This function should only be called by `org-babel-execute:fortran'"
|
||||
(let* ((tmp-src-file (org-babel-temp-file "fortran-src-" ".F90"))
|
||||
(tmp-bin-file (org-babel-temp-file "fortran-bin-"))
|
||||
(cmdline (cdr (assoc :cmdline params)))
|
||||
(flags (cdr (assoc :flags params)))
|
||||
(full-body (org-babel-expand-body:fortran body params))
|
||||
(compile
|
||||
(progn
|
||||
(with-temp-file tmp-src-file (insert full-body))
|
||||
(org-babel-eval
|
||||
(format "%s -o %s %s %s"
|
||||
org-babel-fortran-compiler
|
||||
(org-babel-process-file-name tmp-bin-file)
|
||||
(mapconcat 'identity
|
||||
(if (listp flags) flags (list flags)) " ")
|
||||
(org-babel-process-file-name tmp-src-file)) ""))))
|
||||
((lambda (results)
|
||||
(org-babel-reassemble-table
|
||||
(if (member "vector" (cdr (assoc :result-params params)))
|
||||
(let ((tmp-file (org-babel-temp-file "f-")))
|
||||
(with-temp-file tmp-file (insert results))
|
||||
(org-babel-import-elisp-from-file tmp-file))
|
||||
(org-babel-read results))
|
||||
(org-babel-pick-name
|
||||
(cdr (assoc :colname-names params)) (cdr (assoc :colnames params)))
|
||||
(org-babel-pick-name
|
||||
(cdr (assoc :rowname-names params)) (cdr (assoc :rownames params)))))
|
||||
(org-babel-trim
|
||||
(org-babel-eval
|
||||
(concat tmp-bin-file (if cmdline (concat " " cmdline) "")) "")))))
|
||||
|
||||
(defun org-babel-expand-body:fortran (body params)
|
||||
"Expand a block of fortran or fortran code with org-babel according to
|
||||
it's header arguments."
|
||||
(let ((vars (mapcar #'cdr (org-babel-get-header params :var)))
|
||||
(main-p (not (string= (cdr (assoc :main params)) "no")))
|
||||
(includes (or (cdr (assoc :includes params))
|
||||
(org-babel-read (org-entry-get nil "includes" t))))
|
||||
(defines (org-babel-read
|
||||
(or (cdr (assoc :defines params))
|
||||
(org-babel-read (org-entry-get nil "defines" t))))))
|
||||
(mapconcat 'identity
|
||||
(list
|
||||
;; includes
|
||||
(mapconcat
|
||||
(lambda (inc) (format "#include %s" inc))
|
||||
(if (listp includes) includes (list includes)) "\n")
|
||||
;; defines
|
||||
(mapconcat
|
||||
(lambda (inc) (format "#define %s" inc))
|
||||
(if (listp defines) defines (list defines)) "\n")
|
||||
;; body
|
||||
(if main-p
|
||||
(org-babel-fortran-ensure-main-wrap
|
||||
(concat
|
||||
;; variables
|
||||
(mapconcat 'org-babel-fortran-var-to-fortran vars "\n")
|
||||
body) params)
|
||||
body) "\n") "\n")))
|
||||
|
||||
(defun org-babel-fortran-ensure-main-wrap (body params)
|
||||
"Wrap body in a \"program ... end program\" block if none exists."
|
||||
(if (string-match "^[ \t]*program[ \t]*.*" (capitalize body))
|
||||
(let ((vars (mapcar #'cdr (org-babel-get-header params :var))))
|
||||
(if vars (error "cannot use :vars if 'program' statment is present"))
|
||||
body)
|
||||
(format "program main\n%s\nend program main\n" body)))
|
||||
|
||||
(defun org-babel-prep-session:fortran (session params)
|
||||
"This function does nothing as fortran is a compiled language with no
|
||||
support for sessions"
|
||||
(error "fortran is a compiled languages -- no support for sessions"))
|
||||
|
||||
(defun org-babel-load-session:fortran (session body params)
|
||||
"This function does nothing as fortran is a compiled language with no
|
||||
support for sessions"
|
||||
(error "fortran is a compiled languages -- no support for sessions"))
|
||||
|
||||
;; helper functions
|
||||
|
||||
(defun org-babel-fortran-var-to-fortran (pair)
|
||||
"fortranonvert an elisp val into a string of fortran code specifying a var
|
||||
of the same value."
|
||||
;; TODO list support
|
||||
(let ((var (car pair))
|
||||
(val (cdr pair)))
|
||||
(when (symbolp val)
|
||||
(setq val (symbol-name val))
|
||||
(when (= (length val) 1)
|
||||
(setq val (string-to-char val))))
|
||||
(cond
|
||||
((integerp val)
|
||||
(format "integer, parameter :: %S = %S\n" var val))
|
||||
((floatp val)
|
||||
(format "real, parameter :: %S = %S\n" var val))
|
||||
((or (integerp val))
|
||||
(format "character, parameter :: %S = '%S'\n" var val))
|
||||
((stringp val)
|
||||
(format "character(len=%d), parameter :: %S = '%s'\n"
|
||||
(length val) var val))
|
||||
((listp val)
|
||||
(format "real, parameter :: %S(%d) = %s\n"
|
||||
var (length val) (ob-fortran-transform-list val)))
|
||||
(t
|
||||
(error (format "the type of parameter %s is not supported by ob-fortran"
|
||||
var))))))
|
||||
|
||||
(defun ob-fortran-transform-list (val)
|
||||
"Return a fortran representation of enclose syntactic lists."
|
||||
(if (listp val)
|
||||
(concat "(/" (mapconcat #'ob-fortran-transform-list val ", ") "/)")
|
||||
(format "%S" val)))
|
||||
|
||||
(provide 'ob-fortran)
|
||||
|
||||
;;; ob-fortran.el ends here
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Eric Schulte
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
@ -149,7 +148,10 @@ This function is called by `org-babel-execute-src-block'."
|
|||
(shell-command-to-string
|
||||
(format
|
||||
"gnuplot \"%s\""
|
||||
(org-babel-process-file-name script-file))))
|
||||
(org-babel-process-file-name
|
||||
script-file
|
||||
(if (member system-type '(cygwin windows-nt ms-dos))
|
||||
t nil)))))
|
||||
(message output))
|
||||
(with-temp-buffer
|
||||
(insert (concat body "\n"))
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Eric Schulte
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
@ -29,7 +28,7 @@
|
|||
;; they can be run, but haskell code can also be run through an
|
||||
;; interactive interpreter.
|
||||
;;
|
||||
;; For now let's only allow evaluation using the haskell interpreter.
|
||||
;; For now lets only allow evaluation using the haskell interpreter.
|
||||
|
||||
;;; Requirements:
|
||||
|
||||
|
@ -80,7 +79,7 @@
|
|||
(cdr (member org-babel-haskell-eoe
|
||||
(reverse (mapcar #'org-babel-trim raw)))))))
|
||||
(org-babel-reassemble-table
|
||||
(cond
|
||||
(cond
|
||||
((equal result-type 'output)
|
||||
(mapconcat #'identity (reverse (cdr results)) "\n"))
|
||||
((equal result-type 'value)
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Eric Schulte
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
@ -46,11 +45,14 @@
|
|||
"Can't compile a java block without a classname")))
|
||||
(packagename (file-name-directory classname))
|
||||
(src-file (concat classname ".java"))
|
||||
(cmpflag (or (cdr (assoc :cmpflag params)) ""))
|
||||
(cmdline (or (cdr (assoc :cmdline params)) ""))
|
||||
(full-body (org-babel-expand-body:generic body params))
|
||||
(compile
|
||||
(progn (with-temp-file src-file (insert full-body))
|
||||
(org-babel-eval
|
||||
(concat org-babel-java-compiler " " src-file) ""))))
|
||||
(concat org-babel-java-compiler
|
||||
" " cmpflag " " src-file) ""))))
|
||||
;; created package-name directories if missing
|
||||
(unless (or (not packagename) (file-exists-p packagename))
|
||||
(make-directory packagename 'parents))
|
||||
|
@ -65,7 +67,8 @@
|
|||
(cdr (assoc :colname-names params)) (cdr (assoc :colnames params)))
|
||||
(org-babel-pick-name
|
||||
(cdr (assoc :rowname-names params)) (cdr (assoc :rownames params)))))
|
||||
(org-babel-eval (concat org-babel-java-command " " classname) ""))))
|
||||
(org-babel-eval (concat org-babel-java-command
|
||||
" " cmdline " " classname) ""))))
|
||||
|
||||
(provide 'ob-java)
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Eric Schulte
|
||||
;; Keywords: literate programming, reproducible research, js
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Eric Schulte
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
@ -75,6 +74,8 @@ functions which are assigned key bindings, and see
|
|||
("f" . org-babel-tangle-file)
|
||||
("\C-c" . org-babel-check-src-block)
|
||||
("c" . org-babel-check-src-block)
|
||||
("\C-j" . org-babel-insert-header-arg)
|
||||
("j" . org-babel-insert-header-arg)
|
||||
("\C-l" . org-babel-load-in-session)
|
||||
("l" . org-babel-load-in-session)
|
||||
("\C-i" . org-babel-lob-ingest)
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Eric Schulte
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
@ -73,6 +72,10 @@ This function is called by `org-babel-execute-src-block'."
|
|||
(let* ((out-file (cdr (assoc :file params)))
|
||||
(tex-file (org-babel-temp-file "latex-" ".tex"))
|
||||
(border (cdr (assoc :border params)))
|
||||
(imagemagick (cdr (assoc :imagemagick params)))
|
||||
(im-in-options (cdr (assoc :iminoptions params)))
|
||||
(im-out-options (cdr (assoc :imoutoptions params)))
|
||||
(pdfpng (cdr (assoc :pdfpng params)))
|
||||
(fit (or (cdr (assoc :fit params)) border))
|
||||
(height (and fit (cdr (assoc :pdfheight params))))
|
||||
(width (and fit (cdr (assoc :pdfwidth params))))
|
||||
|
@ -82,10 +85,10 @@ This function is called by `org-babel-execute-src-block'."
|
|||
(append (cdr (assoc :packages params))
|
||||
org-export-latex-packages-alist)))
|
||||
(cond
|
||||
((string-match "\\.png$" out-file)
|
||||
((and (string-match "\\.png$" out-file) (not imagemagick))
|
||||
(org-create-formula-image
|
||||
body out-file org-format-latex-options in-buffer))
|
||||
((string-match "\\.pdf$" out-file)
|
||||
((or (string-match "\\.pdf$" out-file) imagemagick)
|
||||
(require 'org-latex)
|
||||
(with-temp-file tex-file
|
||||
(insert
|
||||
|
@ -119,13 +122,29 @@ This function is called by `org-babel-execute-src-block'."
|
|||
(concat "\n\\begin{document}\n" body "\n\\end{document}\n")))
|
||||
(org-export-latex-fix-inputenc))
|
||||
(when (file-exists-p out-file) (delete-file out-file))
|
||||
(rename-file (org-babel-latex-tex-to-pdf tex-file) out-file))
|
||||
(let ((transient-pdf-file (org-babel-latex-tex-to-pdf tex-file)))
|
||||
(cond
|
||||
((string-match "\\.pdf$" out-file)
|
||||
(rename-file transient-pdf-file out-file))
|
||||
(imagemagick
|
||||
(convert-pdf
|
||||
transient-pdf-file out-file im-in-options im-out-options)
|
||||
(when (file-exists-p transient-pdf-file)
|
||||
(delete-file transient-pdf-file))))))
|
||||
((string-match "\\.\\([^\\.]+\\)$" out-file)
|
||||
(error "can not create %s files, please specify a .png or .pdf file"
|
||||
(error "can not create %s files, please specify a .png or .pdf file or try the :imagemagick header arguement"
|
||||
(match-string 1 out-file))))
|
||||
nil) ;; signal that output has already been written to file
|
||||
body))
|
||||
|
||||
|
||||
(defun convert-pdf (pdffile out-file im-in-options im-out-options)
|
||||
"Generate a file from a pdf file using imagemagick."
|
||||
(let ((cmd (concat "convert " im-in-options " " pdffile " "
|
||||
im-out-options " " out-file)))
|
||||
(message (concat "Converting pdffile file " cmd "..."))
|
||||
(shell-command cmd)))
|
||||
|
||||
(defun org-babel-latex-tex-to-pdf (file)
|
||||
"Generate a pdf file according to the contents FILE.
|
||||
Extracted from `org-export-as-pdf' in org-latex.el."
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Eric S Fraga
|
||||
;; Keywords: literate programming, reproducible research, accounting
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
@ -30,7 +29,7 @@
|
|||
;;
|
||||
;; 1) there is no such thing as a "session" in ledger
|
||||
;;
|
||||
;; 2) we are generally only going to return output from the ledger program
|
||||
;; 2) we are generally only going to return output from the leger program
|
||||
;;
|
||||
;; 3) we are adding the "cmdline" header argument
|
||||
;;
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Martyn Jago
|
||||
;; Keywords: babel language, literate programming
|
||||
;; Homepage: https://github.com/mjago/ob-lilypond
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
;; David T. O'Toole <dto@gnu.org>
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
@ -79,7 +78,7 @@ current directory string."
|
|||
(if (member "output" (cdr (assoc :result-params params)))
|
||||
(car result)
|
||||
(condition-case nil
|
||||
(read (org-bable-lisp-vector-to-list (cadr result)))
|
||||
(read (org-babel-lisp-vector-to-list (cadr result)))
|
||||
(error (cadr result)))))
|
||||
(with-temp-buffer
|
||||
(insert (org-babel-expand-body:lisp body params))
|
||||
|
@ -97,7 +96,7 @@ current directory string."
|
|||
(org-babel-pick-name (cdr (assoc :rowname-names params))
|
||||
(cdr (assoc :rownames params)))))
|
||||
|
||||
(defun org-bable-lisp-vector-to-list (results)
|
||||
(defun org-babel-lisp-vector-to-list (results)
|
||||
;; TODO: better would be to replace #(...) with [...]
|
||||
(replace-regexp-in-string "#(" "(" results))
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
;; Dan Davison
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
@ -29,6 +28,8 @@
|
|||
(require 'ob)
|
||||
(require 'ob-table)
|
||||
|
||||
(declare-function org-babel-in-example-or-verbatim "ob-exp" nil)
|
||||
|
||||
(defvar org-babel-library-of-babel nil
|
||||
"Library of source-code blocks.
|
||||
This is an association list. Populate the library by adding
|
||||
|
@ -62,24 +63,15 @@ To add files to this list use the `org-babel-lob-ingest' command."
|
|||
lob-ingest-count (if (> lob-ingest-count 1) "s" ""))
|
||||
lob-ingest-count))
|
||||
|
||||
(defconst org-babel-lob-call-aliases '("lob" "call")
|
||||
"Aliases to call a source block function.
|
||||
If you change the value of this variable then your files may
|
||||
become unusable by other org-babel users, and vice versa.")
|
||||
|
||||
(defconst org-babel-block-lob-one-liner-regexp
|
||||
(concat
|
||||
"^\\([ \t]*\\)#\\+\\(?:"
|
||||
(mapconcat #'regexp-quote org-babel-lob-call-aliases "\\|")
|
||||
"\\):[ \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]*\\)\\(?:"
|
||||
(mapconcat #'regexp-quote org-babel-lob-call-aliases "\\|")
|
||||
"\\)_\\([^\(\)\n]+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)"
|
||||
"\\([^\n]*\\)call_\\([^\(\)\n]+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)"
|
||||
"\(\\([^\n]*\\)\)\\(\\[\\(.*?\\)\\]\\)?")
|
||||
"Regexp to match inline calls to predefined source block functions.")
|
||||
|
||||
|
@ -89,6 +81,7 @@ If you change the value of this variable then your files may
|
|||
"Regexp to match calls to predefined source block functions.")
|
||||
|
||||
;; functions for executing lob one-liners
|
||||
|
||||
;;;###autoload
|
||||
(defun org-babel-lob-execute-maybe ()
|
||||
"Execute a Library of Babel source block, if appropriate.
|
||||
|
@ -96,7 +89,9 @@ Detect if this is context for a Library Of Babel source block and
|
|||
if so then run the appropriate source block from the Library."
|
||||
(interactive)
|
||||
(let ((info (org-babel-lob-get-info)))
|
||||
(if (nth 0 info) (progn (org-babel-lob-execute info) t) nil)))
|
||||
(if (and (nth 0 info) (not (org-babel-in-example-or-verbatim)))
|
||||
(progn (org-babel-lob-execute info) t)
|
||||
nil)))
|
||||
|
||||
;;;###autoload
|
||||
(defun org-babel-lob-get-info ()
|
||||
|
@ -126,7 +121,6 @@ if so then run the appropriate source block from the Library."
|
|||
(let ((params (org-babel-process-params
|
||||
(org-babel-merge-params
|
||||
org-babel-default-header-args
|
||||
(org-babel-params-from-buffer)
|
||||
(org-babel-params-from-properties)
|
||||
(org-babel-parse-header-arguments
|
||||
(org-babel-clean-text-properties
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Dan Davison
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
;; Eric Schulte
|
||||
;; Keywords: literate programming, reproducible research, maxima
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
@ -31,47 +30,96 @@
|
|||
;;
|
||||
;; 1) there is no such thing as a "session" in maxima
|
||||
;;
|
||||
;; 2) we are generally only going to return output from maxima
|
||||
;;
|
||||
;; 3) we are adding the "cmdline" header argument
|
||||
;;
|
||||
;; 4) there are no variables
|
||||
;; 2) we are adding the "cmdline" header argument
|
||||
|
||||
;;; Code:
|
||||
(require 'ob)
|
||||
|
||||
(defvar org-babel-tangle-lang-exts)
|
||||
(add-to-list 'org-babel-tangle-lang-exts '("maxima" . "max"))
|
||||
|
||||
(defvar org-babel-default-header-args:maxima '())
|
||||
|
||||
(defun org-babel-maxima-expand (body params)
|
||||
"Expand a block of Maxima code according to its header arguments."
|
||||
body)
|
||||
(let ((vars (mapcar #'cdr (org-babel-get-header params :var))))
|
||||
(mapconcat 'identity
|
||||
(list
|
||||
;; graphic output
|
||||
(let ((graphic-file (org-babel-maxima-graphical-output-file params)))
|
||||
(if graphic-file
|
||||
(format
|
||||
"set_plot_option ([gnuplot_term, png]); set_plot_option ([gnuplot_out_file, %S]);"
|
||||
graphic-file)
|
||||
""))
|
||||
;; variables
|
||||
(mapconcat 'org-babel-maxima-var-to-maxima vars "\n")
|
||||
;; body
|
||||
body
|
||||
"gnuplot_close ()$")
|
||||
"\n")))
|
||||
|
||||
(defun org-babel-execute:maxima (body params)
|
||||
"Execute a block of Maxima entries with org-babel. This function is
|
||||
called by `org-babel-execute-src-block'."
|
||||
(message "executing Maxima source code block")
|
||||
(let* ((result-params (split-string (or (cdr (assoc :results params)) "")))
|
||||
(cmdline (cdr (assoc :cmdline params)))
|
||||
(in-file (org-babel-temp-file "maxima-"))
|
||||
(cmd (format "maxima --very-quiet -r 'batchload(%S)$' %s"
|
||||
in-file cmdline)))
|
||||
(with-temp-file in-file (insert body))
|
||||
(message cmd)
|
||||
((lambda (raw) ;; " | grep -v batch | grep -v 'replaced' | sed '/^$/d' "
|
||||
(mapconcat
|
||||
#'identity
|
||||
(delq nil
|
||||
(mapcar (lambda (line)
|
||||
(unless (or (string-match "batch" line)
|
||||
(string-match "^rat: replaced .*$" line)
|
||||
(= 0 (length line)))
|
||||
line))
|
||||
(split-string raw "[\r\n]"))) "\n"))
|
||||
(org-babel-eval cmd ""))))
|
||||
(let ((result
|
||||
(let* ((result-params (split-string (or (cdr (assoc :results params)) "")))
|
||||
(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)))
|
||||
(with-temp-file in-file (insert (org-babel-maxima-expand body params)))
|
||||
(message cmd)
|
||||
((lambda (raw) ;; " | grep -v batch | grep -v 'replaced' | sed '/^$/d' "
|
||||
(mapconcat
|
||||
#'identity
|
||||
(delq nil
|
||||
(mapcar (lambda (line)
|
||||
(unless (or (string-match "batch" line)
|
||||
(string-match "^rat: replaced .*$" line)
|
||||
(= 0 (length line)))
|
||||
line))
|
||||
(split-string raw "[\r\n]"))) "\n"))
|
||||
(org-babel-eval cmd "")))))
|
||||
(if (org-babel-maxima-graphical-output-file params)
|
||||
nil
|
||||
(if (or (member "scalar" result-params)
|
||||
(member "verbatim" result-params)
|
||||
(member "output" result-params))
|
||||
result
|
||||
(let ((tmp-file (org-babel-temp-file "maxima-res-")))
|
||||
(with-temp-file tmp-file (insert result))
|
||||
(org-babel-import-elisp-from-file tmp-file))))))
|
||||
|
||||
|
||||
(defun org-babel-prep-session:maxima (session params)
|
||||
(error "Maxima does not support sessions"))
|
||||
|
||||
(defun org-babel-maxima-var-to-maxima (pair)
|
||||
"Convert an elisp val into a string of maxima code specifying a var
|
||||
of the same value."
|
||||
(let ((var (car pair))
|
||||
(val (cdr pair)))
|
||||
(when (symbolp val)
|
||||
(setq val (symbol-name val))
|
||||
(when (= (length val) 1)
|
||||
(setq val (string-to-char val))))
|
||||
(format "%S: %s$" var
|
||||
(org-babel-maxima-elisp-to-maxima val))))
|
||||
|
||||
(defun org-babel-maxima-graphical-output-file (params)
|
||||
"Name of file to which maxima should send graphical output."
|
||||
(and (member "graphics" (cdr (assq :result-params params)))
|
||||
(cdr (assq :file params))))
|
||||
|
||||
(defun org-babel-maxima-elisp-to-maxima (val)
|
||||
"Return a string of maxima code which evaluates to VAL."
|
||||
(if (listp val)
|
||||
(concat "[" (mapconcat #'org-babel-maxima-elisp-to-maxima val ", ") "]")
|
||||
(format "%s" val)))
|
||||
|
||||
|
||||
(provide 'ob-maxima)
|
||||
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Juan Pechiar
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Eric Schulte
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
@ -29,7 +28,7 @@
|
|||
;; they can be run, but ocaml code can also be run through an
|
||||
;; interactive interpreter.
|
||||
;;
|
||||
;; For now let's only allow evaluation using the ocaml interpreter.
|
||||
;; For now lets only allow evaluation using the ocaml interpreter.
|
||||
|
||||
;;; Requirements:
|
||||
|
||||
|
@ -99,7 +98,7 @@
|
|||
(lambda (pair) (format "let %s = %s;;" (car pair)
|
||||
(org-babel-ocaml-elisp-to-ocaml (cdr pair))))
|
||||
(mapcar #'cdr (org-babel-get-header params :var))))
|
||||
|
||||
|
||||
(defun org-babel-ocaml-elisp-to-ocaml (val)
|
||||
"Return a string of ocaml code which evaluates to VAL."
|
||||
(if (listp val)
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Dan Davison
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
@ -87,13 +86,24 @@ end")
|
|||
(org-babel-expand-body:generic
|
||||
body params (org-babel-variable-assignments:octave params)))
|
||||
(result (org-babel-octave-evaluate
|
||||
session full-body result-type matlabp)))
|
||||
(org-babel-reassemble-table
|
||||
result
|
||||
(org-babel-pick-name
|
||||
(cdr (assoc :colname-names params)) (cdr (assoc :colnames params)))
|
||||
(org-babel-pick-name
|
||||
(cdr (assoc :rowname-names params)) (cdr (assoc :rownames params))))))
|
||||
session
|
||||
(if (org-babel-octave-graphical-output-file params)
|
||||
(mapconcat 'identity
|
||||
(list
|
||||
"set (0, \"defaultfigurevisible\", \"off\");"
|
||||
full-body
|
||||
(format "print -dpng %s" (org-babel-octave-graphical-output-file params)))
|
||||
"\n")
|
||||
full-body)
|
||||
result-type matlabp)))
|
||||
(if (org-babel-octave-graphical-output-file params)
|
||||
nil
|
||||
(org-babel-reassemble-table
|
||||
result
|
||||
(org-babel-pick-name
|
||||
(cdr (assoc :colname-names params)) (cdr (assoc :colnames params)))
|
||||
(org-babel-pick-name
|
||||
(cdr (assoc :rowname-names params)) (cdr (assoc :rownames params)))))))
|
||||
|
||||
(defun org-babel-prep-session:matlab (session params)
|
||||
"Prepare SESSION according to PARAMS."
|
||||
|
@ -118,7 +128,11 @@ specifying a variable of the same value."
|
|||
(if (listp var)
|
||||
(concat "[" (mapconcat #'org-babel-octave-var-to-octave var
|
||||
(if (listp (car var)) "; " ",")) "]")
|
||||
(format "%s" (or var "nil"))))
|
||||
(cond
|
||||
((stringp var)
|
||||
(format "\'%s\'" var))
|
||||
(t
|
||||
(format "%s" var)))))
|
||||
|
||||
(defun org-babel-prep-session:octave (session params &optional matlabp)
|
||||
"Prepare SESSION according to the header arguments specified in PARAMS."
|
||||
|
@ -256,6 +270,11 @@ This removes initial blank and comment lines and then calls
|
|||
(match-string 1 string)
|
||||
string))
|
||||
|
||||
(defun org-babel-octave-graphical-output-file (params)
|
||||
"Name of file to which maxima should send graphical output."
|
||||
(and (member "graphics" (cdr (assq :result-params params)))
|
||||
(cdr (assq :file params))))
|
||||
|
||||
(provide 'ob-octave)
|
||||
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Eric Schulte
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
;; Eric Schulte
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
|
192
lisp/org/ob-picolisp.el
Normal file
192
lisp/org/ob-picolisp.el
Normal file
|
@ -0,0 +1,192 @@
|
|||
;;; ob-picolisp.el --- org-babel functions for picolisp evaluation
|
||||
|
||||
;; Copyright (C) 2010-2011 Free Software Foundation, Inc.
|
||||
|
||||
;; Authors: Thorsten Jolitz and Eric Schulte
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs 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,
|
||||
;; 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/>.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; This library enables the use of PicoLisp in the multi-language
|
||||
;; programming framework Org-Babel. PicoLisp is a minimal yet
|
||||
;; fascinating lisp dialect and a highly productive application
|
||||
;; framework for web-based client-server applications on top of
|
||||
;; object-oriented databases. A good way to learn PicoLisp is to first
|
||||
;; read Paul Grahams essay "The hundred year language"
|
||||
;; (http://www.paulgraham.com/hundred.html) and then study the various
|
||||
;; documents and essays published in the PicoLisp wiki
|
||||
;; (http://picolisp.com/5000/-2.html). PicoLisp is included in some
|
||||
;; GNU/Linux Distributions, and can be downloaded here:
|
||||
;; http://software-lab.de/down.html. It ships with a picolisp-mode and
|
||||
;; a inferior-picolisp-mode for Emacs (to be found in the /lib/el/
|
||||
;; directory).
|
||||
|
||||
;; Although it might seem more natural to use Emacs Lisp for most
|
||||
;; Lisp-based programming tasks inside Org-Mode, an Emacs library
|
||||
;; written in Emacs Lisp, PicoLisp has at least two outstanding
|
||||
;; features that make it a valuable addition to Org-Babel:
|
||||
|
||||
;; PicoLisp _is_ an object-oriented database with a Prolog-based query
|
||||
;; language implemented in PicoLisp (Pilog). Database objects are
|
||||
;; first-class members of the language.
|
||||
|
||||
;; PicoLisp is an extremely productive framework for the development
|
||||
;; of interactive web-applications (on top of a database).
|
||||
|
||||
;;; Requirements:
|
||||
|
||||
;;; Code:
|
||||
(require 'ob)
|
||||
(require 'ob-eval)
|
||||
(require 'ob-comint)
|
||||
(require 'comint)
|
||||
(eval-when-compile (require 'cl))
|
||||
|
||||
(declare-function run-picolisp "ext:inferior-picolisp" (cmd))
|
||||
|
||||
;; optionally define a file extension for this language
|
||||
(add-to-list 'org-babel-tangle-lang-exts '("picolisp" . "l"))
|
||||
|
||||
;;; interferes with settings in org-babel buffer?
|
||||
;; optionally declare default header arguments for this language
|
||||
;; (defvar org-babel-default-header-args:picolisp
|
||||
;; '((:colnames . "no"))
|
||||
;; "Default arguments for evaluating a picolisp source block.")
|
||||
|
||||
(defvar org-babel-picolisp-eoe "org-babel-picolisp-eoe"
|
||||
"String to indicate that evaluation has completed.")
|
||||
|
||||
(defcustom org-babel-picolisp-cmd "pil"
|
||||
"Name of command used to evaluate picolisp blocks."
|
||||
:group 'org-babel
|
||||
:type 'string)
|
||||
|
||||
(defun org-babel-expand-body:picolisp (body params &optional processed-params)
|
||||
"Expand BODY according to PARAMS, return the expanded body."
|
||||
(let ((vars (mapcar #'cdr (org-babel-get-header params :var)))
|
||||
(result-params (cdr (assoc :result-params params)))
|
||||
(print-level nil) (print-length nil))
|
||||
(if (> (length vars) 0)
|
||||
(concat "(prog (let ("
|
||||
(mapconcat
|
||||
(lambda (var)
|
||||
(format "%S '%S)"
|
||||
(print (car var))
|
||||
(print (cdr var))))
|
||||
vars "\n ")
|
||||
" \n" body ") )")
|
||||
body)))
|
||||
|
||||
(defun org-babel-execute:picolisp (body params)
|
||||
"Execute a block of Picolisp code with org-babel. This function is
|
||||
called by `org-babel-execute-src-block'"
|
||||
(message "executing Picolisp source code block")
|
||||
(let* (
|
||||
;; name of the session or "none"
|
||||
(session-name (cdr (assoc :session params)))
|
||||
;; set the session if the session variable is non-nil
|
||||
(session (org-babel-picolisp-initiate-session session-name))
|
||||
;; either OUTPUT or VALUE which should behave as described above
|
||||
(result-type (cdr (assoc :result-type params)))
|
||||
(result-params (cdr (assoc :result-params params)))
|
||||
;; expand the body with `org-babel-expand-body:picolisp'
|
||||
(full-body (org-babel-expand-body:picolisp body params))
|
||||
;; wrap body appropriately for the type of evaluation and results
|
||||
(wrapped-body
|
||||
(cond
|
||||
((or (member "code" result-params)
|
||||
(member "pp" result-params))
|
||||
(format "(pretty (out \"/dev/null\" %s))" full-body))
|
||||
((and (member "value" result-params) (not session))
|
||||
(format "(print (out \"/dev/null\" %s))" full-body))
|
||||
((member "value" result-params)
|
||||
(format "(out \"/dev/null\" %s)" full-body))
|
||||
(t full-body))))
|
||||
|
||||
((lambda (result)
|
||||
(if (or (member "verbatim" result-params)
|
||||
(member "scalar" result-params)
|
||||
(member "output" result-params)
|
||||
(member "code" result-params)
|
||||
(member "pp" result-params)
|
||||
(= (length result) 0))
|
||||
result
|
||||
(read result)))
|
||||
(if (not (string= session-name "none"))
|
||||
;; session based evaluation
|
||||
(mapconcat ;; <- joins the list back together into a single string
|
||||
#'identity
|
||||
(butlast ;; <- remove the org-babel-picolisp-eoe line
|
||||
(delq nil
|
||||
(mapcar
|
||||
(lambda (line)
|
||||
(org-babel-chomp ;; remove trailing newlines
|
||||
(when (> (length line) 0) ;; remove empty lines
|
||||
(cond
|
||||
;; remove leading "-> " from return values
|
||||
((and (>= (length line) 3)
|
||||
(string= "-> " (substring line 0 3)))
|
||||
(substring line 3))
|
||||
;; remove trailing "-> <<return-value>>" on the
|
||||
;; last line of output
|
||||
((and (member "output" result-params)
|
||||
(string-match-p "->" line))
|
||||
(substring line 0 (string-match "->" line)))
|
||||
(t line)
|
||||
)
|
||||
;; (if (and (>= (length line) 3) ;; remove leading "<- "
|
||||
;; (string= "-> " (substring line 0 3)))
|
||||
;; (substring line 3)
|
||||
;; line)
|
||||
)))
|
||||
;; returns a list of the output of each evaluated expression
|
||||
(org-babel-comint-with-output (session org-babel-picolisp-eoe)
|
||||
(insert wrapped-body) (comint-send-input)
|
||||
(insert "'" org-babel-picolisp-eoe) (comint-send-input)))))
|
||||
"\n")
|
||||
;; external evaluation
|
||||
(let ((script-file (org-babel-temp-file "picolisp-script-")))
|
||||
(with-temp-file script-file
|
||||
(insert (concat wrapped-body "(bye)")))
|
||||
(org-babel-eval
|
||||
(format "%s %s"
|
||||
org-babel-picolisp-cmd
|
||||
(org-babel-process-file-name script-file))
|
||||
""))))))
|
||||
|
||||
(defun org-babel-picolisp-initiate-session (&optional session-name)
|
||||
"If there is not a current inferior-process-buffer in SESSION
|
||||
then create. Return the initialized session."
|
||||
(unless (string= session-name "none")
|
||||
(require 'inferior-picolisp)
|
||||
;; provide a reasonable default session name
|
||||
(let ((session (or session-name "*inferior-picolisp*")))
|
||||
;; check if we already have a live session by this name
|
||||
(if (org-babel-comint-buffer-livep session)
|
||||
(get-buffer session)
|
||||
(save-window-excursion
|
||||
(run-picolisp org-babel-picolisp-cmd)
|
||||
(rename-buffer session-name)
|
||||
(current-buffer))))))
|
||||
|
||||
(provide 'ob-picolisp)
|
||||
|
||||
|
||||
|
||||
;;; ob-picolisp.el ends here
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Zhang Weize
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
;; Dan Davison
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
;; Dan Davison
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
@ -61,10 +60,15 @@
|
|||
(declare-function org-narrow-to-subtree "org" ())
|
||||
(declare-function org-id-find-id-in-file "org-id" (id file &optional markerp))
|
||||
(declare-function org-show-context "org" (&optional key))
|
||||
(declare-function org-pop-to-buffer-same-window
|
||||
"org-compat" (&optional buffer-or-name norecord label))
|
||||
|
||||
(defvar org-babel-ref-split-regexp
|
||||
"[ \f\t\n\r\v]*\\(.+?\\)[ \f\t\n\r\v]*=[ \f\t\n\r\v]*\\(.+\\)[ \f\t\n\r\v]*")
|
||||
|
||||
(defvar org-babel-update-intermediate nil
|
||||
"Update the in-buffer results of code blocks executed to resolve references.")
|
||||
|
||||
(defun org-babel-ref-parse (assignment)
|
||||
"Parse a variable ASSIGNMENT in a header argument.
|
||||
If the right hand side of the assignment has a literal value
|
||||
|
@ -94,7 +98,7 @@ the variable."
|
|||
(m (when file (org-id-find-id-in-file id file 'marker))))
|
||||
(when (and file m)
|
||||
(message "file:%S" file)
|
||||
(switch-to-buffer (marker-buffer m))
|
||||
(org-pop-to-buffer-same-window (marker-buffer m))
|
||||
(goto-char m)
|
||||
(move-marker m nil)
|
||||
(org-show-context)
|
||||
|
@ -147,21 +151,19 @@ the variable."
|
|||
(save-restriction
|
||||
(widen)
|
||||
(goto-char (point-min))
|
||||
(if (let* ((rx (regexp-quote ref))
|
||||
(res-rx (concat org-babel-result-regexp rx "[ \t]*$"))
|
||||
(src-rx (concat org-babel-src-name-regexp
|
||||
rx "\\(\(.*\)\\)?" "[ \t]*$")))
|
||||
(if (let ((src-rx (org-babel-named-src-block-regexp-for-name ref))
|
||||
(res-rx (org-babel-named-data-regexp-for-name ref)))
|
||||
;; goto ref in the current buffer
|
||||
(or (and (not args)
|
||||
(or (re-search-forward res-rx nil t)
|
||||
(re-search-backward res-rx nil t)))
|
||||
(re-search-forward src-rx nil t)
|
||||
(re-search-backward src-rx nil t)
|
||||
;; check for local or global headlines by id
|
||||
(setq id (org-babel-ref-goto-headline-id ref))
|
||||
;; check the Library of Babel
|
||||
(setq lob-info (cdr (assoc (intern ref)
|
||||
org-babel-library-of-babel)))))
|
||||
(or
|
||||
;; check for code blocks
|
||||
(re-search-forward src-rx nil t)
|
||||
;; check for named data
|
||||
(re-search-forward res-rx nil t)
|
||||
;; check for local or global headlines by id
|
||||
(setq id (org-babel-ref-goto-headline-id ref))
|
||||
;; check the Library of Babel
|
||||
(setq lob-info (cdr (assoc (intern ref)
|
||||
org-babel-library-of-babel)))))
|
||||
(unless (or lob-info id) (goto-char (match-beginning 0)))
|
||||
;; ;; TODO: allow searching for names in other buffers
|
||||
;; (setq id-loc (org-id-find ref 'marker)
|
||||
|
@ -172,6 +174,12 @@ the variable."
|
|||
(cond
|
||||
(lob-info (setq type 'lob))
|
||||
(id (setq type 'id))
|
||||
((and (looking-at org-babel-src-name-regexp)
|
||||
(save-excursion
|
||||
(forward-line 1)
|
||||
(or (looking-at org-babel-src-block-regexp)
|
||||
(looking-at org-babel-multi-line-header-regexp))))
|
||||
(setq type 'source-block))
|
||||
(t (while (not (setq type (org-babel-ref-at-ref-p)))
|
||||
(forward-line 1)
|
||||
(beginning-of-line)
|
||||
|
@ -184,7 +192,9 @@ the variable."
|
|||
(table (org-babel-read-table))
|
||||
(list (org-babel-read-list))
|
||||
(file (org-babel-read-link))
|
||||
(source-block (org-babel-execute-src-block nil nil params))
|
||||
(source-block (org-babel-execute-src-block
|
||||
nil nil (if org-babel-update-intermediate
|
||||
nil params)))
|
||||
(lob (org-babel-execute-src-block
|
||||
nil lob-info params))
|
||||
(id (org-babel-ref-headline-body)))))
|
||||
|
@ -234,20 +244,7 @@ to \"0:-1\"."
|
|||
|
||||
(defun org-babel-ref-split-args (arg-string)
|
||||
"Split ARG-STRING into top-level arguments of balanced parenthesis."
|
||||
(let ((index 0) (depth 0) (buffer "") holder return)
|
||||
;; crawl along string, splitting at any ","s which are on the top level
|
||||
(while (< index (length arg-string))
|
||||
(setq holder (substring arg-string index (+ 1 index)))
|
||||
(setq buffer (concat buffer holder))
|
||||
(setq index (+ 1 index))
|
||||
(cond
|
||||
((string= holder ",")
|
||||
(when (= depth 0)
|
||||
(setq return (cons (substring buffer 0 -1) return))
|
||||
(setq buffer "")))
|
||||
((or (string= holder "(") (string= holder "[")) (setq depth (+ depth 1)))
|
||||
((or (string= holder ")") (string= holder "]")) (setq depth (- depth 1)))))
|
||||
(mapcar #'org-babel-trim (reverse (cons buffer return)))))
|
||||
(mapcar #'org-babel-trim (org-babel-balanced-split arg-string 44)))
|
||||
|
||||
(defvar org-bracket-link-regexp)
|
||||
(defun org-babel-ref-at-ref-p ()
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Eric Schulte
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
@ -129,8 +128,8 @@ Emacs-lisp table, otherwise return the results as a string."
|
|||
"Initiate a ruby session.
|
||||
If there is not a current inferior-process-buffer in SESSION
|
||||
then create one. Return the initialized session."
|
||||
(require 'inf-ruby)
|
||||
(unless (string= session "none")
|
||||
(require 'inf-ruby)
|
||||
(let ((session-buffer (save-window-excursion
|
||||
(run-ruby nil session) (current-buffer))))
|
||||
(if (org-babel-comint-buffer-livep session-buffer)
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Eric Schulte
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Eric Schulte
|
||||
;; Keywords: literate programming, reproducible research, scheme
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Benjamin Andresen
|
||||
;; Keywords: literate programming, interactive shell
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Eric Schulte
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
|
79
lisp/org/ob-shen.el
Normal file
79
lisp/org/ob-shen.el
Normal file
|
@ -0,0 +1,79 @@
|
|||
;;; ob-shen.el --- org-babel functions for Shen
|
||||
|
||||
;; Copyright (C) 2010-2011 Free Software Foundation
|
||||
|
||||
;; Author: Eric Schulte
|
||||
;; Keywords: literate programming, reproducible research, shen
|
||||
;; Homepage: http://orgmode.org
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs 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,
|
||||
;; 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/>.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; Currently this only works using session evaluation as there is no
|
||||
;; defined method for executing shen code outside of a session.
|
||||
|
||||
;;; Requirements:
|
||||
|
||||
;; - shen-mode and inf-shen will soon be available through the GNU
|
||||
;; elpa, however in the interim they are available at
|
||||
;; https://github.com/eschulte/shen-mode
|
||||
|
||||
;;; Code:
|
||||
(require 'ob)
|
||||
|
||||
(declare-function shen-eval-defun "ext:inf-shen" (&optional and-go))
|
||||
|
||||
(defvar org-babel-default-header-args:shen '()
|
||||
"Default header arguments for shen code blocks.")
|
||||
|
||||
(defun org-babel-expand-body:shen (body params)
|
||||
"Expand BODY according to PARAMS, return the expanded body."
|
||||
(let ((vars (mapcar #'cdr (org-babel-get-header params :var))))
|
||||
(if (> (length vars) 0)
|
||||
(concat "(let "
|
||||
(mapconcat (lambda (var)
|
||||
(format "%s %s" (car var)
|
||||
(org-babel-shen-var-to-shen (cdr var))))
|
||||
vars " ")
|
||||
body ")")
|
||||
body)))
|
||||
|
||||
(defun org-babel-shen-var-to-shen (var)
|
||||
"Convert VAR into a shen variable."
|
||||
(if (listp var)
|
||||
(concat "[" (mapconcat #'org-babel-ruby-var-to-ruby var " ") "]")
|
||||
(format "%S" var)))
|
||||
|
||||
(defun org-babel-execute:shen (body params)
|
||||
"Execute a block of Shen code with org-babel.
|
||||
This function is called by `org-babel-execute-src-block'"
|
||||
(require 'inf-shen)
|
||||
(let* ((result-type (cdr (assoc :result-type params)))
|
||||
(result-params (cdr (assoc :result-params params)))
|
||||
(full-body (org-babel-expand-body:shen body params)))
|
||||
((lambda (results)
|
||||
(if (or (member 'scalar result-params)
|
||||
(member 'verbatim result-params))
|
||||
results
|
||||
(condition-case nil (org-babel-script-escape results)
|
||||
(error results))))
|
||||
(with-temp-buffer
|
||||
(insert full-body)
|
||||
(call-interactively #'shen-eval-defun)))))
|
||||
|
||||
(provide 'ob-shen)
|
||||
;;; ob-shen.el ends here
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Eric Schulte
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
@ -32,7 +31,7 @@
|
|||
;;
|
||||
;; Also SQL evaluation generally takes place inside of a database.
|
||||
;;
|
||||
;; For now let's just allow a generic ':cmdline' header argument.
|
||||
;; For now lets just allow a generic ':cmdline' header argument.
|
||||
;;
|
||||
;; TODO:
|
||||
;;
|
||||
|
@ -40,7 +39,7 @@
|
|||
;; - add more useful header arguments (user, passwd, database, etc...)
|
||||
;; - support for more engines (currently only supports mysql)
|
||||
;; - what's a reasonable way to drop table data into SQL?
|
||||
;;
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
(require 'ob)
|
||||
|
@ -51,6 +50,9 @@
|
|||
|
||||
(defvar org-babel-default-header-args:sql '())
|
||||
|
||||
(defvar org-babel-header-arg-names:sql
|
||||
'(engine out-file))
|
||||
|
||||
(defun org-babel-expand-body:sql (body params)
|
||||
"Expand BODY according to the values of PARAMS."
|
||||
(org-babel-sql-expand-vars
|
||||
|
@ -85,31 +87,38 @@ This function is called by `org-babel-execute-src-block'."
|
|||
(insert (org-babel-expand-body:sql body params)))
|
||||
(message command)
|
||||
(shell-command command)
|
||||
(with-temp-buffer
|
||||
;; need to figure out what the delimiter is for the header row
|
||||
(if (or (member "scalar" result-params)
|
||||
(member "verbatim" result-params)
|
||||
(member "html" result-params)
|
||||
(member "code" result-params)
|
||||
(equal (point-min) (point-max)))
|
||||
(with-temp-buffer
|
||||
(progn (insert-file-contents-literally out-file) (buffer-string)))
|
||||
(with-temp-buffer
|
||||
(insert-file-contents out-file)
|
||||
(goto-char (point-min))
|
||||
(when (re-search-forward "^\\(-+\\)[^-]" nil t)
|
||||
(setq header-delim (match-string-no-properties 1)))
|
||||
(goto-char (point-max))
|
||||
(forward-char -1)
|
||||
(while (looking-at "\n")
|
||||
(delete-char 1)
|
||||
(goto-char (point-max))
|
||||
(forward-char -1))
|
||||
(write-file out-file))
|
||||
(org-table-import out-file '(16))
|
||||
(org-babel-reassemble-table
|
||||
(mapcar (lambda (x)
|
||||
(if (string= (car x) header-delim)
|
||||
'hline
|
||||
x))
|
||||
(org-table-to-lisp))
|
||||
(org-babel-pick-name (cdr (assoc :colname-names params))
|
||||
(cdr (assoc :colnames params)))
|
||||
(org-babel-pick-name (cdr (assoc :rowname-names params))
|
||||
(cdr (assoc :rownames params)))))))
|
||||
;; need to figure out what the delimiter is for the header row
|
||||
(with-temp-buffer
|
||||
(insert-file-contents out-file)
|
||||
(goto-char (point-min))
|
||||
(when (re-search-forward "^\\(-+\\)[^-]" nil t)
|
||||
(setq header-delim (match-string-no-properties 1)))
|
||||
(goto-char (point-max))
|
||||
(forward-char -1)
|
||||
(while (looking-at "\n")
|
||||
(delete-char 1)
|
||||
(goto-char (point-max))
|
||||
(forward-char -1))
|
||||
(write-file out-file))
|
||||
(org-table-import out-file '(16))
|
||||
(org-babel-reassemble-table
|
||||
(mapcar (lambda (x)
|
||||
(if (string= (car x) header-delim)
|
||||
'hline
|
||||
x))
|
||||
(org-table-to-lisp))
|
||||
(org-babel-pick-name (cdr (assoc :colname-names params))
|
||||
(cdr (assoc :colnames params)))
|
||||
(org-babel-pick-name (cdr (assoc :rowname-names params))
|
||||
(cdr (assoc :rownames params))))))))
|
||||
|
||||
(defun org-babel-sql-expand-vars (body vars)
|
||||
"Expand the variables held in VARS in BODY."
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Eric Schulte
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Eric Schulte
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
@ -31,7 +30,7 @@
|
|||
;; (defun fibbd (n) (if (< n 2) 1 (+ (fibbd (- n 1)) (fibbd (- n 2)))))
|
||||
;; #+end_src
|
||||
|
||||
;; #+srcname: fibbd
|
||||
;; #+name: fibbd
|
||||
;; #+begin_src emacs-lisp :var n=2 :results silent
|
||||
;; (fibbd n)
|
||||
;; #+end_src
|
||||
|
@ -78,46 +77,60 @@ 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."
|
||||
(let* (quote
|
||||
(variables
|
||||
(mapcar
|
||||
(lambda (var)
|
||||
;; ensure that all cells prefixed with $'s are strings
|
||||
(cons (car var)
|
||||
(delq nil (mapcar
|
||||
(lambda (el)
|
||||
(if (eq '$ el)
|
||||
(setq quote t)
|
||||
(prog1 (if quote
|
||||
(format "\"%s\"" el)
|
||||
(org-babel-clean-text-properties el))
|
||||
(setq quote nil))))
|
||||
(cdr var)))))
|
||||
variables)))
|
||||
(unless (stringp source-block)
|
||||
(setq source-block (symbol-name source-block)))
|
||||
((lambda (result)
|
||||
(org-babel-trim (if (stringp result) result (format "%S" result))))
|
||||
(if (and source-block (> (length source-block) 0))
|
||||
(let ((params
|
||||
(eval `(org-babel-parse-header-arguments
|
||||
(concat ":var results="
|
||||
,source-block
|
||||
"("
|
||||
(mapconcat
|
||||
(lambda (var-spec)
|
||||
(if (> (length (cdr var-spec)) 1)
|
||||
(format "%S='%S"
|
||||
(car var-spec)
|
||||
(mapcar #'read (cdr var-spec)))
|
||||
(format "%S=%s"
|
||||
(car var-spec) (cadr var-spec))))
|
||||
',variables ", ")
|
||||
")")))))
|
||||
(org-babel-execute-src-block
|
||||
nil (list "emacs-lisp" "results" params) '((:results . "silent"))))
|
||||
""))))
|
||||
example above.
|
||||
|
||||
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
|
||||
the header argument which can then be passed before all variables
|
||||
as shown in the example below.
|
||||
|
||||
| 1 | 2 | :file nothing.png | nothing.png |
|
||||
#+TBLFM: @1$4='(sbe test-sbe $3 (x $1) (y $2))"
|
||||
(let* ((header-args (if (stringp (car variables)) (car variables) ""))
|
||||
(variables (if (stringp (car variables)) (cdr variables) variables)))
|
||||
(let* (quote
|
||||
(variables
|
||||
(mapcar
|
||||
(lambda (var)
|
||||
;; ensure that all cells prefixed with $'s are strings
|
||||
(cons (car var)
|
||||
(delq nil (mapcar
|
||||
(lambda (el)
|
||||
(if (eq '$ el)
|
||||
(setq quote t)
|
||||
(prog1 (if quote
|
||||
(format "\"%s\"" el)
|
||||
(org-babel-clean-text-properties el))
|
||||
(setq quote nil))))
|
||||
(cdr var)))))
|
||||
variables)))
|
||||
(unless (stringp source-block)
|
||||
(setq source-block (symbol-name source-block)))
|
||||
((lambda (result)
|
||||
(org-babel-trim (if (stringp result) result (format "%S" result))))
|
||||
(if (and source-block (> (length source-block) 0))
|
||||
(let ((params
|
||||
(eval `(org-babel-parse-header-arguments
|
||||
(concat
|
||||
":var results="
|
||||
,source-block
|
||||
"[" ,header-args "]"
|
||||
"("
|
||||
(mapconcat
|
||||
(lambda (var-spec)
|
||||
(if (> (length (cdr var-spec)) 1)
|
||||
(format "%S='%S"
|
||||
(car var-spec)
|
||||
(mapcar #'read (cdr var-spec)))
|
||||
(format "%S=%s"
|
||||
(car var-spec) (cadr var-spec))))
|
||||
',variables ", ")
|
||||
")")))))
|
||||
(org-babel-execute-src-block
|
||||
nil (list "emacs-lisp" "results" params)
|
||||
'((:results . "silent"))))
|
||||
"")))))
|
||||
(def-edebug-spec sbe (form form))
|
||||
|
||||
(provide 'ob-table)
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Eric Schulte
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
@ -96,6 +95,14 @@ controlled by the :comments header argument."
|
|||
:group 'org-babel
|
||||
:type 'string)
|
||||
|
||||
(defcustom org-babel-process-comment-text #'org-babel-trim
|
||||
"Function called to process raw Org-mode text collected to be
|
||||
inserted as comments in tangled source-code files. The function
|
||||
should take a single string argument and return a string
|
||||
result. The default value is `org-babel-trim'."
|
||||
:group 'org-babel
|
||||
:type 'function)
|
||||
|
||||
(defun org-babel-find-file-noselect-refresh (file)
|
||||
"Find file ensuring that the latest changes on disk are
|
||||
represented in the file."
|
||||
|
@ -119,6 +126,7 @@ evaluating BODY."
|
|||
(setf ,temp-result (progn ,@body)))
|
||||
(unless ,visited-p (kill-buffer ,temp-file))
|
||||
,temp-result)))
|
||||
(def-edebug-spec org-babel-with-temp-filebuffer (form body))
|
||||
|
||||
;;;###autoload
|
||||
(defun org-babel-load-file (file)
|
||||
|
@ -345,16 +353,20 @@ code blocks by language."
|
|||
(when (or (string= "both" (cdr (assoc :comments params)))
|
||||
(string= "org" (cdr (assoc :comments params))))
|
||||
;; from the previous heading or code-block end
|
||||
(buffer-substring
|
||||
(max (condition-case nil
|
||||
(save-excursion
|
||||
(org-back-to-heading t) (point))
|
||||
(error 0))
|
||||
(save-excursion
|
||||
(re-search-backward
|
||||
org-babel-src-block-regexp nil t)
|
||||
(match-end 0)))
|
||||
(point))))
|
||||
(funcall
|
||||
org-babel-process-comment-text
|
||||
(buffer-substring
|
||||
(max (condition-case nil
|
||||
(save-excursion
|
||||
(org-back-to-heading t) ; sets match data
|
||||
(match-end 0))
|
||||
(error (point-min)))
|
||||
(save-excursion
|
||||
(if (re-search-backward
|
||||
org-babel-src-block-regexp nil t)
|
||||
(match-end 0)
|
||||
(point-min))))
|
||||
(point)))))
|
||||
by-lang)
|
||||
;; add the spec for this block to blocks under it's language
|
||||
(setq by-lang (cdr (assoc src-lang blocks)))
|
||||
|
@ -396,12 +408,11 @@ form
|
|||
(eval el))))
|
||||
'(start-line file link source-name))))
|
||||
(flet ((insert-comment (text)
|
||||
(let ((text (org-babel-trim text)))
|
||||
(when (and comments (not (string= comments "no"))
|
||||
(> (length text) 0))
|
||||
(when padline (insert "\n"))
|
||||
(comment-region (point) (progn (insert text) (point)))
|
||||
(end-of-line nil) (insert "\n")))))
|
||||
(when (and comments (not (string= comments "no"))
|
||||
(> (length text) 0))
|
||||
(when padline (insert "\n"))
|
||||
(comment-region (point) (progn (insert text) (point)))
|
||||
(end-of-line nil) (insert "\n"))))
|
||||
(when comment (insert-comment comment))
|
||||
(when link-p
|
||||
(insert-comment
|
||||
|
|
662
lisp/org/ob.el
662
lisp/org/ob.el
|
@ -6,7 +6,6 @@
|
|||
;; Dan Davison
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
@ -33,6 +32,7 @@
|
|||
(defvar org-src-lang-modes)
|
||||
(defvar org-babel-library-of-babel)
|
||||
(declare-function show-all "outline" ())
|
||||
(declare-function org-reduce "org" (CL-FUNC CL-SEQ &rest CL-KEYS))
|
||||
(declare-function tramp-compat-make-temp-file "tramp-compat"
|
||||
(filename &optional dir-flag))
|
||||
(declare-function tramp-dissect-file-name "tramp" (name &optional nodefault))
|
||||
|
@ -114,7 +114,7 @@ remove code block execution from the C-c C-c keybinding."
|
|||
:type 'boolean)
|
||||
|
||||
(defvar org-babel-src-name-regexp
|
||||
"^[ \t]*#\\+\\(srcname\\|source\\|function\\):[ \t]*"
|
||||
"^[ \t]*#\\+name:[ \t]*"
|
||||
"Regular expression used to match a source name line.")
|
||||
|
||||
(defvar org-babel-multi-line-header-regexp
|
||||
|
@ -144,7 +144,7 @@ remove code block execution from the C-c C-c keybinding."
|
|||
(defvar org-babel-inline-src-block-regexp
|
||||
(concat
|
||||
;; (1) replacement target (2) lang
|
||||
"[^-[:alnum:]]\\(src_\\([^ \f\t\n\r\v]+\\)"
|
||||
"\\(?:^\\|[^-[:alnum:]]\\)\\(src_\\([^ \f\t\n\r\v]+\\)"
|
||||
;; (3,4) (unused, headers)
|
||||
"\\(\\|\\[\\(.*?\\)\\]\\)"
|
||||
;; (5) body
|
||||
|
@ -160,6 +160,39 @@ not match KEY should be returned."
|
|||
(lambda (p) (when (funcall (if others #'not #'identity) (eq (car p) key)) p))
|
||||
params)))
|
||||
|
||||
(defun org-babel-get-inline-src-block-matches()
|
||||
"Set match data if within body of an inline source block.
|
||||
Returns non-nil if match-data set"
|
||||
(let ((src-at-0-p (save-excursion
|
||||
(beginning-of-line 1)
|
||||
(string= "src" (thing-at-point 'word))))
|
||||
(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_")))
|
||||
(lower-limit (if first-line-p
|
||||
nil
|
||||
(- (point-at-bol) 1))))
|
||||
(save-excursion
|
||||
(when (or (and src-at-0-p (bobp))
|
||||
(and (re-search-forward "}" (point-at-eol) t)
|
||||
(re-search-backward search-for lower-limit t)
|
||||
(> orig (point))))
|
||||
(when (looking-at org-babel-inline-src-block-regexp)
|
||||
t ))))))
|
||||
|
||||
(defvar org-babel-inline-lob-one-liner-regexp)
|
||||
(defun org-babel-get-lob-one-liner-matches()
|
||||
"Set match data if on line of an lob one liner.
|
||||
Returns non-nil if match-data set"
|
||||
(save-excursion
|
||||
(unless (= (point) (point-at-bol)) ;; move before inline block
|
||||
(re-search-backward "[ \f\t\n\r\v]" nil t))
|
||||
(if (looking-at org-babel-inline-lob-one-liner-regexp)
|
||||
t
|
||||
nil)))
|
||||
|
||||
(defun org-babel-get-src-block-info (&optional light)
|
||||
"Get information on the current source block.
|
||||
|
||||
|
@ -184,22 +217,30 @@ Returns a list
|
|||
(nth 2 info)
|
||||
(org-babel-parse-header-arguments (match-string 1)))))
|
||||
(when (looking-at org-babel-src-name-w-name-regexp)
|
||||
(setq name (org-babel-clean-text-properties (match-string 4)))
|
||||
(when (match-string 6)
|
||||
(setq name (org-babel-clean-text-properties (match-string 3)))
|
||||
(when (and (match-string 5) (> (length (match-string 5)) 0))
|
||||
(setf (nth 2 info) ;; merge functional-syntax vars and header-args
|
||||
(org-babel-merge-params
|
||||
(mapcar (lambda (ref) (cons :var ref))
|
||||
(org-babel-ref-split-args (match-string 6)))
|
||||
(mapcar
|
||||
(lambda (ref) (cons :var ref))
|
||||
(mapcar
|
||||
(lambda (var) ;; check that each variable is initialized
|
||||
(if (string-match ".+=.+" var)
|
||||
var
|
||||
(error
|
||||
"variable \"%s\"%s must be assigned a default value"
|
||||
var (if name (format " in block \"%s\"" name) ""))))
|
||||
(org-babel-ref-split-args (match-string 5))))
|
||||
(nth 2 info))))))
|
||||
;; inline source block
|
||||
(when (save-excursion (re-search-backward "[ \f\t\n\r\v]" nil t)
|
||||
(looking-at org-babel-inline-src-block-regexp))
|
||||
(when (org-babel-get-inline-src-block-matches)
|
||||
(setq info (org-babel-parse-inline-src-block-match))))
|
||||
;; resolve variable references and add summary parameters
|
||||
(when (and info (not light))
|
||||
(setf (nth 2 info) (org-babel-process-params (nth 2 info))))
|
||||
(when info (append info (list name indent)))))
|
||||
|
||||
(defvar org-current-export-file) ; dynamically bound
|
||||
(defun org-babel-confirm-evaluate (info)
|
||||
"Confirm evaluation of the code block INFO.
|
||||
This behavior can be suppressed by setting the value of
|
||||
|
@ -212,11 +253,15 @@ of potentially harmful code."
|
|||
(let* ((eval (or (cdr (assoc :eval (nth 2 info)))
|
||||
(when (assoc :noeval (nth 2 info)) "no")))
|
||||
(query (cond ((equal eval "query") t)
|
||||
((and org-current-export-file
|
||||
(equal eval "query-export")) t)
|
||||
((functionp org-confirm-babel-evaluate)
|
||||
(funcall org-confirm-babel-evaluate
|
||||
(nth 0 info) (nth 1 info)))
|
||||
(t org-confirm-babel-evaluate))))
|
||||
(if (or (equal eval "never") (equal eval "no")
|
||||
(and org-current-export-file (or (equal eval "no-export")
|
||||
(equal eval "never-export")))
|
||||
(and query
|
||||
(not (yes-or-no-p
|
||||
(format "Evaluate this%scode block%son your system? "
|
||||
|
@ -224,7 +269,9 @@ of potentially harmful code."
|
|||
(if (nth 4 info)
|
||||
(format " (%s) " (nth 4 info)) " "))))))
|
||||
(prog1 nil (message "Evaluation %s"
|
||||
(if (or (equal eval "never") (equal eval "no"))
|
||||
(if (or (equal eval "never") (equal eval "no")
|
||||
(equal eval "no-export")
|
||||
(equal eval "never-export"))
|
||||
"Disabled" "Aborted")))
|
||||
t)))
|
||||
|
||||
|
@ -314,10 +361,35 @@ then run `org-babel-pop-to-session'."
|
|||
|
||||
(add-hook 'org-metadown-hook 'org-babel-pop-to-session-maybe)
|
||||
|
||||
(defconst org-babel-common-header-args-w-values
|
||||
'((cache . ((no yes)))
|
||||
(cmdline . :any)
|
||||
(colnames . ((nil no yes)))
|
||||
(comments . ((no link yes org both noweb)))
|
||||
(dir . :any)
|
||||
(eval . ((never query)))
|
||||
(exports . ((code results both none)))
|
||||
(file . :any)
|
||||
(hlines . ((no yes)))
|
||||
(mkdirp . ((yes no)))
|
||||
(no-expand)
|
||||
(noeval)
|
||||
(noweb . ((yes no tangle)))
|
||||
(noweb-ref . :any)
|
||||
(padline . ((yes no)))
|
||||
(results . ((file list vector table scalar verbatim)
|
||||
(raw org html latex code pp wrap)
|
||||
(replace silent append prepend)
|
||||
(output value)))
|
||||
(rownames . ((no yes)))
|
||||
(sep . :any)
|
||||
(session . :any)
|
||||
(shebang . :any)
|
||||
(tangle . ((tangle yes no :any)))
|
||||
(var . :any)))
|
||||
|
||||
(defconst org-babel-header-arg-names
|
||||
'(cache cmdline colnames dir exports file noweb results
|
||||
session tangle var eval noeval comments no-expand shebang
|
||||
padline noweb-ref)
|
||||
(mapcar #'car org-babel-common-header-args-w-values)
|
||||
"Common header arguments used by org-babel.
|
||||
Note that individual languages may define their own language
|
||||
specific header arguments as well.")
|
||||
|
@ -332,7 +404,7 @@ specific header arguments as well.")
|
|||
'((:session . "none") (:results . "replace") (:exports . "results"))
|
||||
"Default arguments to use when evaluating an inline source block.")
|
||||
|
||||
(defvar org-babel-data-names '("TBLNAME" "RESNAME" "RESULTS" "DATA"))
|
||||
(defvar org-babel-data-names '("TBLNAME" "RESULTS" "NAME"))
|
||||
|
||||
(defvar org-babel-result-regexp
|
||||
(concat "^[ \t]*#\\+"
|
||||
|
@ -365,11 +437,17 @@ can not be resolved.")
|
|||
|
||||
(defvar org-babel-after-execute-hook nil
|
||||
"Hook for functions to be called after `org-babel-execute-src-block'")
|
||||
|
||||
(defun org-babel-named-src-block-regexp-for-name (name)
|
||||
"This generates a regexp used to match a src block named NAME."
|
||||
(concat org-babel-src-name-regexp (regexp-quote name) "[ \t\n]*"
|
||||
(concat org-babel-src-name-regexp (regexp-quote name)
|
||||
"\\([ \t]\\|$\\|(\\)" ".*[\r\n]"
|
||||
(substring org-babel-src-block-regexp 1)))
|
||||
|
||||
(defun org-babel-named-data-regexp-for-name (name)
|
||||
"This generates a regexp used to match data named NAME."
|
||||
(concat org-babel-result-regexp (regexp-quote name) "\\([ \t]\\|$\\)"))
|
||||
|
||||
;;; functions
|
||||
(defvar call-process-region)
|
||||
;;;###autoload
|
||||
|
@ -380,9 +458,8 @@ Insert the results of execution into the buffer. Source code
|
|||
execution and the collection and formatting of results can be
|
||||
controlled through a variety of header arguments.
|
||||
|
||||
With prefix argument ARG, force re-execution even if an
|
||||
existing result cached in the buffer would otherwise have been
|
||||
returned.
|
||||
With prefix argument ARG, force re-execution even if an existing
|
||||
result cached in the buffer would otherwise have been returned.
|
||||
|
||||
Optionally supply a value for INFO in the form returned by
|
||||
`org-babel-get-src-block-info'.
|
||||
|
@ -519,6 +596,7 @@ arguments and pop open the results in a preview buffer."
|
|||
(interactive)
|
||||
;; 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
|
||||
(dolist (header (mapcar (lambda (arg) (substring (symbol-name (car arg)) 1))
|
||||
(and (org-babel-where-is-src-block-head)
|
||||
|
@ -532,6 +610,41 @@ arguments and pop open the results in a preview buffer."
|
|||
header name))))
|
||||
(message "No suspicious header arguments found.")))
|
||||
|
||||
;;;###autoload
|
||||
(defun org-babel-insert-header-arg ()
|
||||
"Insert a header argument selecting from lists of common args and values."
|
||||
(interactive)
|
||||
(let* ((lang (car (org-babel-get-src-block-info 'light)))
|
||||
(lang-headers (intern (concat "org-babel-header-arg-names:" lang)))
|
||||
(headers (append (if (boundp lang-headers)
|
||||
(mapcar (lambda (h) (cons h :any))
|
||||
(eval lang-headers))
|
||||
nil)
|
||||
org-babel-common-header-args-w-values))
|
||||
(arg (org-icompleting-read
|
||||
"Header Arg: "
|
||||
(mapcar
|
||||
(lambda (header-spec) (symbol-name (car header-spec)))
|
||||
headers))))
|
||||
(insert ":" arg)
|
||||
(let ((vals (cdr (assoc (intern arg) headers))))
|
||||
(when vals
|
||||
(insert
|
||||
" "
|
||||
(cond
|
||||
((eq vals :any)
|
||||
(read-from-minibuffer "value: "))
|
||||
((listp vals)
|
||||
(mapconcat
|
||||
(lambda (group)
|
||||
(let ((arg (org-icompleting-read
|
||||
"value: "
|
||||
(cons "default" (mapcar #'symbol-name group)))))
|
||||
(if (and arg (not (string= "default" arg)))
|
||||
(concat arg " ")
|
||||
"")))
|
||||
vals ""))))))))
|
||||
|
||||
;;;###autoload
|
||||
(defun org-babel-load-in-session (&optional arg info)
|
||||
"Load the body of the current source-code block.
|
||||
|
@ -625,6 +738,7 @@ Return t if a code block was found at point, nil otherwise."
|
|||
(if (org-bound-and-true-p org-edit-src-from-org-mode)
|
||||
(org-edit-src-exit)))
|
||||
t)))
|
||||
(def-edebug-spec org-babel-do-in-edit-buffer (body))
|
||||
|
||||
(defun org-babel-do-key-sequence-in-edit-buffer (key)
|
||||
"Read key sequence and execute the command in edit buffer.
|
||||
|
@ -721,6 +835,7 @@ end-body --------- point at the end of the body"
|
|||
(goto-char end-block))))
|
||||
(unless visited-p (kill-buffer to-be-removed))
|
||||
(goto-char point))))
|
||||
(def-edebug-spec org-babel-map-src-blocks (form body))
|
||||
|
||||
;;;###autoload
|
||||
(defmacro org-babel-map-inline-src-blocks (file &rest body)
|
||||
|
@ -743,6 +858,31 @@ buffer."
|
|||
(goto-char (match-end 0))))
|
||||
(unless visited-p (kill-buffer to-be-removed))
|
||||
(goto-char point))))
|
||||
(def-edebug-spec org-babel-map-inline-src-blocks (form body))
|
||||
|
||||
(defvar org-babel-lob-one-liner-regexp)
|
||||
;;;###autoload
|
||||
(defmacro org-babel-map-call-lines (file &rest body)
|
||||
"Evaluate BODY forms on each call line in FILE.
|
||||
If FILE is nil evaluate BODY forms on source blocks in current
|
||||
buffer."
|
||||
(declare (indent 1))
|
||||
(let ((tempvar (make-symbol "file")))
|
||||
`(let* ((,tempvar ,file)
|
||||
(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 org-babel-lob-one-liner-regexp nil t)
|
||||
(goto-char (match-beginning 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-call-lines (form body))
|
||||
|
||||
;;;###autoload
|
||||
(defun org-babel-execute-buffer (&optional arg)
|
||||
|
@ -755,7 +895,9 @@ the current buffer."
|
|||
(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-execute-src-block arg))
|
||||
(org-babel-map-call-lines nil
|
||||
(org-babel-lob-execute-maybe))))
|
||||
|
||||
;;;###autoload
|
||||
(defun org-babel-execute-subtree (&optional arg)
|
||||
|
@ -784,7 +926,7 @@ the current subtree."
|
|||
lst)
|
||||
(norm (arg)
|
||||
(let ((v (if (and (listp (cdr arg)) (null (cddr arg)))
|
||||
(copy-seq (cdr arg))
|
||||
(copy-sequence (cdr arg))
|
||||
(cdr arg))))
|
||||
(when (and v (not (and (sequencep v)
|
||||
(not (consp v))
|
||||
|
@ -857,86 +999,6 @@ 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 (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.
|
||||
|
@ -944,40 +1006,21 @@ Return an association list of any source block params which
|
|||
may be specified in the properties of the current outline entry."
|
||||
(save-match-data
|
||||
(let (val sym)
|
||||
(delq nil
|
||||
(mapcar
|
||||
(lambda (header-arg)
|
||||
(and (setq val
|
||||
(or (org-entry-get (point) header-arg t)
|
||||
(org-entry-get (point) (concat ":" header-arg) t)))
|
||||
(cons (intern (concat ":" header-arg))
|
||||
(org-babel-read val))))
|
||||
(org-babel-parse-multiple-vars
|
||||
(delq nil
|
||||
(mapcar
|
||||
'symbol-name
|
||||
(append
|
||||
org-babel-header-arg-names
|
||||
(progn
|
||||
(setq sym (intern (concat "org-babel-header-arg-names:" lang)))
|
||||
(and (boundp sym) (eval sym))))))))))
|
||||
|
||||
(defun org-babel-params-from-buffer ()
|
||||
"Retrieve per-buffer parameters.
|
||||
Return an association list of any source block params which
|
||||
may be specified in the current buffer."
|
||||
(let (local-properties)
|
||||
(save-match-data
|
||||
(save-excursion
|
||||
(save-restriction
|
||||
(widen)
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward
|
||||
(org-make-options-regexp (list "BABEL" "PROPERTIES")) nil t)
|
||||
(setq local-properties
|
||||
(org-babel-merge-params
|
||||
local-properties
|
||||
(org-babel-parse-header-arguments
|
||||
(org-match-string-no-properties 2)))))
|
||||
local-properties)))))
|
||||
(lambda (header-arg)
|
||||
(and (setq val (org-entry-get (point) header-arg t))
|
||||
(cons (intern (concat ":" header-arg))
|
||||
(org-babel-read val))))
|
||||
(mapcar
|
||||
'symbol-name
|
||||
(append
|
||||
org-babel-header-arg-names
|
||||
(progn
|
||||
(setq sym (intern (concat "org-babel-header-arg-names:"
|
||||
lang)))
|
||||
(and (boundp sym) (eval sym)))))))))))
|
||||
|
||||
(defvar org-src-preserve-indentation)
|
||||
(defun org-babel-parse-src-block-match ()
|
||||
|
@ -989,9 +1032,10 @@ may be specified in the current buffer."
|
|||
(body (org-babel-clean-text-properties
|
||||
(let* ((body (match-string 5))
|
||||
(sub-length (- (length body) 1)))
|
||||
(if (string= "\n" (substring body sub-length))
|
||||
(if (and (> sub-length 0)
|
||||
(string= "\n" (substring body sub-length)))
|
||||
(substring body 0 sub-length)
|
||||
body))))
|
||||
(or body "")))))
|
||||
(preserve-indentation (or org-src-preserve-indentation
|
||||
(string-match "-i\\>" switches))))
|
||||
(list lang
|
||||
|
@ -1003,7 +1047,6 @@ may be specified in the current buffer."
|
|||
(buffer-string)))
|
||||
(org-babel-merge-params
|
||||
org-babel-default-header-args
|
||||
(org-babel-params-from-buffer)
|
||||
(org-babel-params-from-properties lang)
|
||||
(if (boundp lang-headers) (eval lang-headers) nil)
|
||||
(org-babel-parse-header-arguments
|
||||
|
@ -1020,50 +1063,105 @@ may be specified in the current buffer."
|
|||
(org-babel-clean-text-properties (match-string 5)))
|
||||
(org-babel-merge-params
|
||||
org-babel-default-inline-header-args
|
||||
(org-babel-params-from-buffer)
|
||||
(org-babel-params-from-properties lang)
|
||||
(if (boundp lang-headers) (eval lang-headers) nil)
|
||||
(org-babel-parse-header-arguments
|
||||
(org-babel-clean-text-properties (or (match-string 4) "")))))))
|
||||
|
||||
(defun org-babel-balanced-split (string alts)
|
||||
"Split STRING on instances of ALTS.
|
||||
ALTS is a cons of two character options where each option may be
|
||||
either the numeric code of a single character or a list of
|
||||
character alternatives. For example to split on balanced
|
||||
instances of \"[ \t]:\" set ALTS to '((32 9) . 58)."
|
||||
(flet ((matches (ch spec) (or (and (numberp spec) (= spec ch))
|
||||
(member ch spec)))
|
||||
(matched (ch last)
|
||||
(if (consp alts)
|
||||
(and (matches ch (cdr alts))
|
||||
(matches last (car alts)))
|
||||
(matches ch alts))))
|
||||
(let ((balance 0) (quote nil) (partial nil) (lst nil) (last 0))
|
||||
(mapc (lambda (ch) ; split on [], (), "" balanced instances of [ \t]:
|
||||
(setq balance (+ balance
|
||||
(cond ((or (equal 91 ch) (equal 40 ch)) 1)
|
||||
((or (equal 93 ch) (equal 41 ch)) -1)
|
||||
(t 0))))
|
||||
(when (and (equal 34 ch) (not (equal 92 last)))
|
||||
(setq quote (not quote)))
|
||||
(setq partial (cons ch partial))
|
||||
(when (and (= balance 0) (not quote) (matched ch last))
|
||||
(setq lst (cons (apply #'string (nreverse
|
||||
(if (consp alts)
|
||||
(cddr partial)
|
||||
(cdr partial))))
|
||||
lst))
|
||||
(setq partial nil))
|
||||
(setq last ch))
|
||||
(string-to-list string))
|
||||
(nreverse (cons (apply #'string (nreverse partial)) lst)))))
|
||||
|
||||
(defun org-babel-join-splits-near-ch (ch list)
|
||||
"Join splits where \"=\" is on either end of the split."
|
||||
(flet ((last= (str) (= ch (aref str (1- (length str)))))
|
||||
(first= (str) (= ch (aref str 0))))
|
||||
(reverse
|
||||
(org-reduce (lambda (acc el)
|
||||
(let ((head (car acc)))
|
||||
(if (and head (or (last= head) (first= el)))
|
||||
(cons (concat head el) (cdr acc))
|
||||
(cons el acc))))
|
||||
list :initial-value nil))))
|
||||
|
||||
(defun org-babel-parse-header-arguments (arg-string)
|
||||
"Parse a string of header arguments returning an alist."
|
||||
(when (> (length arg-string) 0)
|
||||
(delq nil
|
||||
(mapcar
|
||||
(lambda (arg)
|
||||
(if (string-match
|
||||
"\\([^ \f\t\n\r\v]+\\)[ \f\t\n\r\v]+\\([^ \f\t\n\r\v]+.*\\)"
|
||||
arg)
|
||||
(cons (intern (match-string 1 arg))
|
||||
(org-babel-read (org-babel-chomp (match-string 2 arg))))
|
||||
(cons (intern (org-babel-chomp arg)) nil)))
|
||||
(let ((balance 0) (partial nil) (lst nil) (last 0))
|
||||
(mapc (lambda (ch) ; split on [] balanced instances of [ \t]:
|
||||
(setq balance (+ balance
|
||||
(cond ((equal 91 ch) 1)
|
||||
((equal 93 ch) -1)
|
||||
(t 0))))
|
||||
(setq partial (cons ch partial))
|
||||
(when (and (= ch 58) (= balance 0)
|
||||
(or (= last 32) (= last 9)))
|
||||
(setq lst (cons (apply #'string (nreverse (cddr partial)))
|
||||
lst))
|
||||
(setq partial (list ch)))
|
||||
(setq last ch))
|
||||
(string-to-list arg-string))
|
||||
(nreverse (cons (apply #'string (nreverse partial)) lst)))))))
|
||||
(org-babel-parse-multiple-vars
|
||||
(delq nil
|
||||
(mapcar
|
||||
(lambda (arg)
|
||||
(if (string-match
|
||||
"\\([^ \f\t\n\r\v]+\\)[ \f\t\n\r\v]+\\([^ \f\t\n\r\v]+.*\\)"
|
||||
arg)
|
||||
(cons (intern (match-string 1 arg))
|
||||
(org-babel-read (org-babel-chomp (match-string 2 arg))))
|
||||
(cons (intern (org-babel-chomp arg)) nil)))
|
||||
((lambda (raw)
|
||||
(cons (car raw) (mapcar (lambda (r) (concat ":" r)) (cdr raw))))
|
||||
(org-babel-balanced-split arg-string '((32 9) . 58))))))))
|
||||
|
||||
(defun org-babel-parse-multiple-vars (header-arguments)
|
||||
"Expand multiple variable assignments behind a single :var keyword.
|
||||
|
||||
This allows expression of multiple variables with one :var as
|
||||
shown below.
|
||||
|
||||
#+PROPERTY: var foo=1, bar=2"
|
||||
(let (results)
|
||||
(mapc (lambda (pair)
|
||||
(if (eq (car pair) :var)
|
||||
(mapcar (lambda (v) (push (cons :var (org-babel-trim v)) results))
|
||||
(org-babel-join-splits-near-ch
|
||||
61 (org-babel-balanced-split (cdr pair) 32)))
|
||||
(push pair results)))
|
||||
header-arguments)
|
||||
(nreverse results)))
|
||||
|
||||
(defun org-babel-process-params (params)
|
||||
"Expand variables in PARAMS and add summary parameters."
|
||||
(let* ((vars-and-names (org-babel-disassemble-tables
|
||||
(mapcar (lambda (el)
|
||||
(if (consp (cdr el))
|
||||
(cdr el) (org-babel-ref-parse (cdr el))))
|
||||
(org-babel-get-header params :var))
|
||||
(cdr (assoc :hlines params))
|
||||
(cdr (assoc :colnames params))
|
||||
(cdr (assoc :rownames params))))
|
||||
(let* ((processed-vars (mapcar (lambda (el)
|
||||
(if (consp (cdr el))
|
||||
(cdr el)
|
||||
(org-babel-ref-parse (cdr el))))
|
||||
(org-babel-get-header params :var)))
|
||||
(vars-and-names (if (and (assoc :colname-names params)
|
||||
(assoc :rowname-names params))
|
||||
(list processed-vars)
|
||||
(org-babel-disassemble-tables
|
||||
processed-vars
|
||||
(cdr (assoc :hlines params))
|
||||
(cdr (assoc :colnames params))
|
||||
(cdr (assoc :rownames params)))))
|
||||
(raw-result (or (cdr (assoc :results params)) ""))
|
||||
(result-params (append
|
||||
(split-string (if (stringp raw-result)
|
||||
|
@ -1170,7 +1268,7 @@ of the vars, cnames and rnames."
|
|||
(setq var (cons (car var) (org-babel-del-hlines (cdr var))))))
|
||||
var)
|
||||
vars)
|
||||
cnames rnames)))
|
||||
(reverse cnames) (reverse rnames))))
|
||||
|
||||
(defun org-babel-reassemble-table (table colnames rownames)
|
||||
"Add column and row names to a table.
|
||||
|
@ -1245,7 +1343,7 @@ org-babel-named-src-block-regexp."
|
|||
(regexp (org-babel-named-src-block-regexp-for-name name)) msg)
|
||||
(goto-char (point-min))
|
||||
(when (or (re-search-forward regexp nil t)
|
||||
(re-search-backward regexp nil t))
|
||||
(re-search-backward regexp nil t))
|
||||
(match-beginning 0)))))
|
||||
|
||||
(defun org-babel-src-block-names (&optional file)
|
||||
|
@ -1254,7 +1352,7 @@ org-babel-named-src-block-regexp."
|
|||
(when file (find-file file)) (goto-char (point-min))
|
||||
(let (names)
|
||||
(while (re-search-forward org-babel-src-name-w-name-regexp nil t)
|
||||
(setq names (cons (match-string 4) names)))
|
||||
(setq names (cons (match-string 3) names)))
|
||||
names)))
|
||||
|
||||
;;;###autoload
|
||||
|
@ -1270,16 +1368,21 @@ org-babel-named-src-block-regexp."
|
|||
(progn (goto-char point) (org-show-context))
|
||||
(message "result '%s' not found in this buffer" name))))
|
||||
|
||||
(defun org-babel-find-named-result (name)
|
||||
(defun org-babel-find-named-result (name &optional point)
|
||||
"Find a named result.
|
||||
Return the location of the result named NAME in the current
|
||||
buffer or nil if no such result exists."
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(when (re-search-forward
|
||||
(concat org-babel-result-regexp
|
||||
"[ \t]" (regexp-quote name) "[ \t\n\f\v\r]") nil t)
|
||||
(beginning-of-line 0) (point))))
|
||||
(goto-char (or point (point-min)))
|
||||
(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)
|
||||
(when (and (string= "name" (downcase (match-string 1)))
|
||||
(or (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)))))
|
||||
|
||||
(defun org-babel-result-names (&optional file)
|
||||
"Returns the names of results in FILE or the current buffer."
|
||||
|
@ -1334,6 +1437,8 @@ is created. In both cases if the region is demarcated and if the
|
|||
region is not active then the point is demarcated."
|
||||
(interactive "P")
|
||||
(let ((info (org-babel-get-src-block-info 'light))
|
||||
(headers (progn (org-babel-where-is-src-block-head)
|
||||
(match-string 4)))
|
||||
(stars (concat (make-string (or (org-current-level) 1) ?*) " ")))
|
||||
(if info
|
||||
(mapc
|
||||
|
@ -1346,11 +1451,16 @@ region is not active then the point is demarcated."
|
|||
(buffer-substring (point-at-bol)
|
||||
(point-at-eol)))
|
||||
(delete-region (point-at-bol) (point-at-eol)))
|
||||
(insert (concat (if (looking-at "^") "" "\n")
|
||||
indent "#+end_src\n"
|
||||
(if arg stars indent) "\n"
|
||||
indent "#+begin_src " lang
|
||||
(if (looking-at "[\n\r]") "" "\n")))))
|
||||
(insert (concat
|
||||
(if (looking-at "^") "" "\n")
|
||||
indent "#+end_src\n"
|
||||
(if arg stars indent) "\n"
|
||||
indent "#+begin_src " lang
|
||||
(if (> (length headers) 1)
|
||||
(concat " " headers) headers)
|
||||
(if (looking-at "[\n\r]")
|
||||
""
|
||||
(concat "\n" (make-string (current-column) ? )))))))
|
||||
(move-end-of-line 2))
|
||||
(sort (if (region-active-p) (list (mark) (point)) (list (point))) #'>))
|
||||
(let ((start (point))
|
||||
|
@ -1369,7 +1479,6 @@ region is not active then the point is demarcated."
|
|||
(goto-char start) (move-end-of-line 1)))))
|
||||
|
||||
(defvar org-babel-lob-one-liner-regexp)
|
||||
(defvar org-babel-inline-lob-one-liner-regexp)
|
||||
(defun org-babel-where-is-src-block-result (&optional insert info hash indent)
|
||||
"Find where the current source block results begin.
|
||||
Return the point at the beginning of the result of the current
|
||||
|
@ -1380,13 +1489,11 @@ following the source block."
|
|||
(let* ((on-lob-line (save-excursion
|
||||
(beginning-of-line 1)
|
||||
(looking-at org-babel-lob-one-liner-regexp)))
|
||||
(inlinep (save-excursion
|
||||
(re-search-backward "[ \f\t\n\r\v]" nil t)
|
||||
(when (looking-at org-babel-inline-src-block-regexp)
|
||||
(match-end 0))))
|
||||
(inlinep (when (org-babel-get-inline-src-block-matches)
|
||||
(match-end 0)))
|
||||
(name (if on-lob-line
|
||||
(nth 0 (org-babel-lob-get-info))
|
||||
(nth 4 (or info (org-babel-get-src-block-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)
|
||||
(when head (goto-char head))
|
||||
|
@ -1538,6 +1645,10 @@ raw ----- results are added directly to the Org-mode file. This
|
|||
is a good option if you code block will output org-mode
|
||||
formatted text.
|
||||
|
||||
wrap ---- results are added directly to the Org-mode file as with
|
||||
\"raw\", but are wrapped in a RESULTS drawer, allowing
|
||||
them to later be replaced or removed automatically.
|
||||
|
||||
org ----- similar in effect to raw, only the results are wrapped
|
||||
in an org code block. Similar to the raw option, on
|
||||
export the results will be interpreted as org-formatted
|
||||
|
@ -1571,10 +1682,8 @@ code ---- the results are extracted in the syntax of the source
|
|||
(save-excursion
|
||||
(let* ((inlinep
|
||||
(save-excursion
|
||||
(or (= (point) (point-at-bol))
|
||||
(re-search-backward "[ \f\t\n\r\v]" nil t))
|
||||
(when (or (looking-at org-babel-inline-src-block-regexp)
|
||||
(looking-at org-babel-inline-lob-one-liner-regexp))
|
||||
(when (or (org-babel-get-inline-src-block-matches)
|
||||
(org-babel-get-lob-one-liner-matches))
|
||||
(goto-char (match-end 0))
|
||||
(insert (if (listp result) "\n" " "))
|
||||
(point))))
|
||||
|
@ -1606,41 +1715,45 @@ code ---- the results are extracted in the syntax of the source
|
|||
((member "prepend" result-params)))) ; already there
|
||||
(setq results-switches
|
||||
(if results-switches (concat " " results-switches) ""))
|
||||
;; insert results based on type
|
||||
(cond
|
||||
;; do nothing for an empty result
|
||||
((= (length result) 0))
|
||||
;; insert a list if preferred
|
||||
((member "list" result-params)
|
||||
(insert
|
||||
(org-babel-trim
|
||||
(org-list-to-generic
|
||||
(cons 'unordered
|
||||
(mapcar
|
||||
(lambda (el) (list nil (if (stringp el) el (format "%S" el))))
|
||||
(if (listp result) result (list result))))
|
||||
'(:splicep nil :istart "- " :iend "\n")))
|
||||
"\n"))
|
||||
;; assume the result is a table if it's not a string
|
||||
((not (stringp result))
|
||||
(goto-char beg)
|
||||
(insert (concat (orgtbl-to-orgtbl
|
||||
(if (or (eq 'hline (car result))
|
||||
(and (listp (car result))
|
||||
(listp (cdr (car result)))))
|
||||
result (list result))
|
||||
'(:fmt (lambda (cell) (format "%s" cell)))) "\n"))
|
||||
(goto-char beg) (when (org-at-table-p) (org-table-align)))
|
||||
((member "file" result-params)
|
||||
(insert result))
|
||||
(t (goto-char beg) (insert result)))
|
||||
(when (listp result) (goto-char (org-table-end)))
|
||||
(setq end (point-marker))
|
||||
;; possibly wrap result
|
||||
(flet ((wrap (start finish)
|
||||
(goto-char beg) (insert (concat start "\n"))
|
||||
(goto-char end) (insert (concat finish "\n"))
|
||||
(setq end (point-marker))))
|
||||
(setq end (point-marker)))
|
||||
(proper-list-p (it) (and (listp it) (null (cdr (last it))))))
|
||||
;; insert results based on type
|
||||
(cond
|
||||
;; do nothing for an empty result
|
||||
((null result))
|
||||
;; insert a list if preferred
|
||||
((member "list" result-params)
|
||||
(insert
|
||||
(org-babel-trim
|
||||
(org-list-to-generic
|
||||
(cons 'unordered
|
||||
(mapcar
|
||||
(lambda (el) (list nil (if (stringp el) el (format "%S" el))))
|
||||
(if (listp result) result (list result))))
|
||||
'(:splicep nil :istart "- " :iend "\n")))
|
||||
"\n"))
|
||||
;; assume the result is a table if it's not a string
|
||||
((proper-list-p result)
|
||||
(goto-char beg)
|
||||
(insert (concat (orgtbl-to-orgtbl
|
||||
(if (or (eq 'hline (car result))
|
||||
(and (listp (car result))
|
||||
(listp (cdr (car result)))))
|
||||
result (list result))
|
||||
'(:fmt (lambda (cell) (format "%s" cell)))) "\n"))
|
||||
(goto-char beg) (when (org-at-table-p) (org-table-align)))
|
||||
((and (listp result) (not (proper-list-p result)))
|
||||
(insert (format "%s\n" result)))
|
||||
((member "file" result-params)
|
||||
(when inlinep (goto-char inlinep))
|
||||
(insert result))
|
||||
(t (goto-char beg) (insert result)))
|
||||
(when (proper-list-p result) (goto-char (org-table-end)))
|
||||
(setq end (point-marker))
|
||||
;; possibly wrap result
|
||||
(cond
|
||||
((member "html" result-params)
|
||||
(wrap "#+BEGIN_HTML" "#+END_HTML"))
|
||||
|
@ -1654,10 +1767,9 @@ code ---- the results are extracted in the syntax of the source
|
|||
((member "raw" result-params)
|
||||
(goto-char beg) (if (org-at-table-p) (org-cycle)))
|
||||
((member "wrap" result-params)
|
||||
(when (and (stringp result) (not (member "file" result-params)))
|
||||
(org-babel-examplize-region beg end results-switches))
|
||||
(wrap "#+BEGIN_RESULT" "#+END_RESULT"))
|
||||
((and (stringp result) (not (member "file" result-params)))
|
||||
(wrap ":RESULTS:" ":END:"))
|
||||
((and (not (proper-list-p result))
|
||||
(not (member "file" result-params)))
|
||||
(org-babel-examplize-region beg end results-switches)
|
||||
(setq end (point)))))
|
||||
;; possibly indent the results to match the #+results line
|
||||
|
@ -1666,7 +1778,7 @@ code ---- the results are extracted in the syntax of the source
|
|||
(not (and (listp result)
|
||||
(member "append" result-params))))
|
||||
(indent-rigidly beg end indent))))
|
||||
(if (= (length result) 0)
|
||||
(if (null result)
|
||||
(if (member "value" result-params)
|
||||
(message "Code block returned no value.")
|
||||
(message "Code block produced no output."))
|
||||
|
@ -1677,8 +1789,9 @@ code ---- the results are extracted in the syntax of the source
|
|||
(interactive)
|
||||
(let ((location (org-babel-where-is-src-block-result nil info)) start)
|
||||
(when location
|
||||
(setq start (- location 1))
|
||||
(save-excursion
|
||||
(goto-char location) (setq start (point)) (forward-line 1)
|
||||
(goto-char location) (forward-line 1)
|
||||
(delete-region start (org-babel-result-end))))))
|
||||
|
||||
(defun org-babel-result-end ()
|
||||
|
@ -1689,6 +1802,8 @@ code ---- the results are extracted in the syntax of the source
|
|||
((org-at-item-p) (let* ((struct (org-list-struct))
|
||||
(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:")))
|
||||
(t
|
||||
(let ((case-fold-search t)
|
||||
(blocks-re (regexp-opt
|
||||
|
@ -1757,12 +1872,11 @@ Later elements of PLISTS override the values of previous elements.
|
|||
This takes into account some special considerations for certain
|
||||
parameters when merging lists."
|
||||
(let ((results-exclusive-groups
|
||||
'(("file" "list" "vector" "table" "scalar" "verbatim" "raw" "org"
|
||||
"html" "latex" "code" "pp" "wrap")
|
||||
("replace" "silent" "append" "prepend")
|
||||
("output" "value")))
|
||||
(mapcar (lambda (group) (mapcar #'symbol-name group))
|
||||
(cdr (assoc 'results org-babel-common-header-args-w-values))))
|
||||
(exports-exclusive-groups
|
||||
'(("code" "results" "both" "none")))
|
||||
(mapcar (lambda (group) (mapcar #'symbol-name group))
|
||||
(cdr (assoc 'exports org-babel-common-header-args-w-values))))
|
||||
(variable-index 0)
|
||||
params results exports tangle noweb cache vars shebang comments padline)
|
||||
(flet ((e-merge (exclusive-groups &rest result-params)
|
||||
|
@ -1806,12 +1920,16 @@ parameters when merging lists."
|
|||
vars))
|
||||
vars)
|
||||
(list (cons name pair))))
|
||||
;; if no name is given, then assign to variables in order
|
||||
(prog1 (setf (cddr (nth variable-index vars))
|
||||
(concat (symbol-name
|
||||
(car (nth variable-index vars)))
|
||||
"=" (cdr pair)))
|
||||
(incf variable-index)))))
|
||||
;; if no name is given and we already have named variables
|
||||
;; then assign to named variables in order
|
||||
(if (and vars (nth variable-index vars))
|
||||
(prog1 (setf (cddr (nth variable-index vars))
|
||||
(concat (symbol-name
|
||||
(car (nth variable-index vars)))
|
||||
"=" (cdr pair)))
|
||||
(incf variable-index))
|
||||
(error "variable \"%s\" must be assigned a default value"
|
||||
(cdr pair))))))
|
||||
(:results
|
||||
(setq results (e-merge results-exclusive-groups
|
||||
results
|
||||
|
@ -1861,6 +1979,12 @@ parameters when merging lists."
|
|||
'(results exports tangle noweb padline cache shebang comments))
|
||||
params))
|
||||
|
||||
(defvar *org-babel-use-quick-and-dirty-noweb-expansion* nil
|
||||
"Set to true to use regular expressions to expand noweb references.
|
||||
This results in much faster noweb reference expansion but does
|
||||
not properly allow code blocks to inherit the \":noweb-ref\"
|
||||
header argument from buffer or subtree wide properties.")
|
||||
|
||||
(defun org-babel-expand-noweb-references (&optional info parent-buffer)
|
||||
"Expand Noweb references in the body of the current source code block.
|
||||
|
||||
|
@ -1896,21 +2020,15 @@ block but are passed literally to the \"example-block\"."
|
|||
(lang (nth 0 info))
|
||||
(body (nth 1 info))
|
||||
(comment (string= "noweb" (cdr (assoc :comments (nth 2 info)))))
|
||||
(rx-prefix (concat "\\(" org-babel-src-name-regexp "\\|"
|
||||
":noweb-ref[ \t]+" "\\)"))
|
||||
(new-body "") index source-name evaluate prefix blocks-in-buffer)
|
||||
(flet ((nb-add (text) (setq new-body (concat new-body text)))
|
||||
(c-wrap (text)
|
||||
(with-temp-buffer
|
||||
(funcall (intern (concat lang "-mode")))
|
||||
(comment-region (point) (progn (insert text) (point)))
|
||||
(org-babel-trim (buffer-string))))
|
||||
(blocks () ;; return the info lists of all blocks in this buffer
|
||||
(let (infos)
|
||||
(save-restriction
|
||||
(widen)
|
||||
(org-babel-map-src-blocks nil
|
||||
(setq infos (cons (org-babel-get-src-block-info 'light)
|
||||
infos))))
|
||||
(reverse infos))))
|
||||
(org-babel-trim (buffer-string)))))
|
||||
(with-temp-buffer
|
||||
(insert body) (goto-char (point-min))
|
||||
(setq index (point))
|
||||
|
@ -1944,21 +2062,33 @@ 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
|
||||
(mapconcat
|
||||
(lambda (i)
|
||||
(when (string= source-name
|
||||
(or (cdr (assoc :noweb-ref (nth 2 i)))
|
||||
(nth 4 i)))
|
||||
(let ((body (org-babel-expand-noweb-references i)))
|
||||
(if comment
|
||||
((lambda (cs)
|
||||
(concat (c-wrap (car cs)) "\n"
|
||||
body "\n" (c-wrap (cadr cs))))
|
||||
(org-babel-tangle-comment-links i))
|
||||
body))))
|
||||
(or blocks-in-buffer
|
||||
(setq blocks-in-buffer (blocks)))
|
||||
"")
|
||||
(let ((rx (concat rx-prefix source-name))
|
||||
expansion)
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(if *org-babel-use-quick-and-dirty-noweb-expansion*
|
||||
(while (re-search-forward rx nil t)
|
||||
(let* ((i (org-babel-get-src-block-info 'light))
|
||||
(body (org-babel-expand-noweb-references i)))
|
||||
(if comment
|
||||
((lambda (cs)
|
||||
(concat (c-wrap (car cs)) "\n"
|
||||
body "\n" (c-wrap (cadr cs))))
|
||||
(org-babel-tangle-comment-links i))
|
||||
(setq expansion (concat expansion body)))))
|
||||
(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)))
|
||||
(if comment
|
||||
((lambda (cs)
|
||||
(concat (c-wrap (car cs)) "\n"
|
||||
body "\n" (c-wrap (cadr cs))))
|
||||
(org-babel-tangle-comment-links i))
|
||||
(setq expansion (concat expansion body)))))))))
|
||||
expansion)
|
||||
;; possibly raise an error if named block doesn't exist
|
||||
(if (member lang org-babel-noweb-error-langs)
|
||||
(error "%s" (concat
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,11 +1,10 @@
|
|||
;;; org-archive.el --- Archiving for Org-mode
|
||||
|
||||
;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Carsten Dominik <carsten at orgmode dot org>
|
||||
;; Keywords: outlines, hypermedia, calendar, wp
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
;;
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -191,158 +190,166 @@ If the cursor is not at a headline when this command is called, try all level
|
|||
1 trees. If the cursor is on a headline, only try the direct children of
|
||||
this heading."
|
||||
(interactive "P")
|
||||
(if find-done
|
||||
(org-archive-all-done)
|
||||
;; Save all relevant TODO keyword-relatex variables
|
||||
(if (and (org-region-active-p) org-loop-over-headlines-in-active-region)
|
||||
(let ((cl (if (eq org-loop-over-headlines-in-active-region 'start-level)
|
||||
'region-start-level 'region))
|
||||
org-loop-over-headlines-in-active-region)
|
||||
(org-map-entries
|
||||
`(progn (setq org-map-continue-from (progn (org-back-to-heading) (point)))
|
||||
(org-archive-subtree ,find-done))
|
||||
org-loop-over-headlines-in-active-region
|
||||
cl (if (outline-invisible-p) (org-end-of-subtree nil t))))
|
||||
(if find-done
|
||||
(org-archive-all-done)
|
||||
;; Save all relevant TODO keyword-relatex variables
|
||||
(let ((tr-org-todo-line-regexp org-todo-line-regexp) ; keep despite compiler
|
||||
(tr-org-todo-keywords-1 org-todo-keywords-1)
|
||||
(tr-org-todo-kwd-alist org-todo-kwd-alist)
|
||||
(tr-org-done-keywords org-done-keywords)
|
||||
(tr-org-todo-regexp org-todo-regexp)
|
||||
(tr-org-todo-line-regexp org-todo-line-regexp)
|
||||
(tr-org-odd-levels-only org-odd-levels-only)
|
||||
(this-buffer (current-buffer))
|
||||
;; start of variables that will be used for saving context
|
||||
;; The compiler complains about them - keep them anyway!
|
||||
(file (abbreviate-file-name
|
||||
(or (buffer-file-name (buffer-base-buffer))
|
||||
(error "No file associated to buffer"))))
|
||||
(olpath (mapconcat 'identity (org-get-outline-path) "/"))
|
||||
(time (format-time-string
|
||||
(substring (cdr org-time-stamp-formats) 1 -1)
|
||||
(current-time)))
|
||||
category todo priority ltags itags atags
|
||||
;; end of variables that will be used for saving context
|
||||
location afile heading buffer level newfile-p infile-p visiting)
|
||||
|
||||
(let ((tr-org-todo-line-regexp org-todo-line-regexp) ; keep despite compiler
|
||||
(tr-org-todo-keywords-1 org-todo-keywords-1)
|
||||
(tr-org-todo-kwd-alist org-todo-kwd-alist)
|
||||
(tr-org-done-keywords org-done-keywords)
|
||||
(tr-org-todo-regexp org-todo-regexp)
|
||||
(tr-org-todo-line-regexp org-todo-line-regexp)
|
||||
(tr-org-odd-levels-only org-odd-levels-only)
|
||||
(this-buffer (current-buffer))
|
||||
;; start of variables that will be used for saving context
|
||||
;; The compiler complains about them - keep them anyway!
|
||||
(file (abbreviate-file-name
|
||||
(or (buffer-file-name (buffer-base-buffer))
|
||||
(error "No file associated to buffer"))))
|
||||
(olpath (mapconcat 'identity (org-get-outline-path) "/"))
|
||||
(time (format-time-string
|
||||
(substring (cdr org-time-stamp-formats) 1 -1)
|
||||
(current-time)))
|
||||
category todo priority ltags itags atags
|
||||
;; end of variables that will be used for saving context
|
||||
location afile heading buffer level newfile-p infile-p visiting)
|
||||
;; Find the local archive location
|
||||
(setq location (org-get-local-archive-location)
|
||||
afile (org-extract-archive-file location)
|
||||
heading (org-extract-archive-heading location)
|
||||
infile-p (equal file (abbreviate-file-name afile)))
|
||||
(unless afile
|
||||
(error "Invalid `org-archive-location'"))
|
||||
|
||||
;; Find the local archive location
|
||||
(setq location (org-get-local-archive-location)
|
||||
afile (org-extract-archive-file location)
|
||||
heading (org-extract-archive-heading location)
|
||||
infile-p (equal file (abbreviate-file-name afile)))
|
||||
(unless afile
|
||||
(error "Invalid `org-archive-location'"))
|
||||
(if (> (length afile) 0)
|
||||
(setq newfile-p (not (file-exists-p afile))
|
||||
visiting (find-buffer-visiting afile)
|
||||
buffer (or visiting (find-file-noselect afile)))
|
||||
(setq buffer (current-buffer)))
|
||||
(unless buffer
|
||||
(error "Cannot access file \"%s\"" afile))
|
||||
(if (and (> (length heading) 0)
|
||||
(string-match "^\\*+" heading))
|
||||
(setq level (match-end 0))
|
||||
(setq heading nil level 0))
|
||||
(save-excursion
|
||||
(org-back-to-heading t)
|
||||
;; Get context information that will be lost by moving the tree
|
||||
(setq category (org-get-category nil 'force-refresh)
|
||||
todo (and (looking-at org-todo-line-regexp)
|
||||
(match-string 2))
|
||||
priority (org-get-priority
|
||||
(if (match-end 3) (match-string 3) ""))
|
||||
ltags (org-get-tags)
|
||||
itags (org-delete-all ltags (org-get-tags-at))
|
||||
atags (org-get-tags-at))
|
||||
(setq ltags (mapconcat 'identity ltags " ")
|
||||
itags (mapconcat 'identity itags " "))
|
||||
;; We first only copy, in case something goes wrong
|
||||
;; we need to protect `this-command', to avoid kill-region sets it,
|
||||
;; which would lead to duplication of subtrees
|
||||
(let (this-command) (org-copy-subtree 1 nil t))
|
||||
(set-buffer buffer)
|
||||
;; Enforce org-mode for the archive buffer
|
||||
(if (not (eq major-mode 'org-mode))
|
||||
;; Force the mode for future visits.
|
||||
(let ((org-insert-mode-line-in-empty-file t)
|
||||
(org-inhibit-startup t))
|
||||
(call-interactively 'org-mode)))
|
||||
(when newfile-p
|
||||
(goto-char (point-max))
|
||||
(insert (format "\nArchived entries from file %s\n\n"
|
||||
(buffer-file-name this-buffer))))
|
||||
;; Force the TODO keywords of the original buffer
|
||||
(let ((org-todo-line-regexp tr-org-todo-line-regexp)
|
||||
(org-todo-keywords-1 tr-org-todo-keywords-1)
|
||||
(org-todo-kwd-alist tr-org-todo-kwd-alist)
|
||||
(org-done-keywords tr-org-done-keywords)
|
||||
(org-todo-regexp tr-org-todo-regexp)
|
||||
(org-todo-line-regexp tr-org-todo-line-regexp)
|
||||
(org-odd-levels-only
|
||||
(if (local-variable-p 'org-odd-levels-only (current-buffer))
|
||||
org-odd-levels-only
|
||||
tr-org-odd-levels-only)))
|
||||
(goto-char (point-min))
|
||||
(show-all)
|
||||
(if heading
|
||||
(progn
|
||||
(if (re-search-forward
|
||||
(concat "^" (regexp-quote heading)
|
||||
(org-re "[ \t]*\\(:[[:alnum:]_@#%:]+:\\)?[ \t]*\\($\\|\r\\)"))
|
||||
nil t)
|
||||
(goto-char (match-end 0))
|
||||
;; Heading not found, just insert it at the end
|
||||
(goto-char (point-max))
|
||||
(or (bolp) (insert "\n"))
|
||||
(insert "\n" heading "\n")
|
||||
(end-of-line 0))
|
||||
;; Make the subtree visible
|
||||
(show-subtree)
|
||||
(if org-archive-reversed-order
|
||||
(progn
|
||||
(org-back-to-heading t)
|
||||
(outline-next-heading))
|
||||
(org-end-of-subtree t))
|
||||
(skip-chars-backward " \t\r\n")
|
||||
(and (looking-at "[ \t\r\n]*")
|
||||
(replace-match "\n\n")))
|
||||
;; No specific heading, just go to end of file.
|
||||
(goto-char (point-max)) (insert "\n"))
|
||||
;; Paste
|
||||
(org-paste-subtree (org-get-valid-level level (and heading 1)))
|
||||
;; Shall we append inherited tags?
|
||||
(and itags
|
||||
(or (and (eq org-archive-subtree-add-inherited-tags 'infile)
|
||||
infile-p)
|
||||
(eq org-archive-subtree-add-inherited-tags t))
|
||||
(org-set-tags-to atags))
|
||||
;; Mark the entry as done
|
||||
(when (and org-archive-mark-done
|
||||
(looking-at org-todo-line-regexp)
|
||||
(or (not (match-end 2))
|
||||
(not (member (match-string 2) org-done-keywords))))
|
||||
(let (org-log-done org-todo-log-states)
|
||||
(org-todo
|
||||
(car (or (member org-archive-mark-done org-done-keywords)
|
||||
org-done-keywords)))))
|
||||
|
||||
(if (> (length afile) 0)
|
||||
(setq newfile-p (not (file-exists-p afile))
|
||||
visiting (find-buffer-visiting afile)
|
||||
buffer (or visiting (find-file-noselect afile)))
|
||||
(setq buffer (current-buffer)))
|
||||
(unless buffer
|
||||
(error "Cannot access file \"%s\"" afile))
|
||||
(if (and (> (length heading) 0)
|
||||
(string-match "^\\*+" heading))
|
||||
(setq level (match-end 0))
|
||||
(setq heading nil level 0))
|
||||
(save-excursion
|
||||
(org-back-to-heading t)
|
||||
;; Get context information that will be lost by moving the tree
|
||||
(setq category (org-get-category nil 'force-refresh)
|
||||
todo (and (looking-at org-todo-line-regexp)
|
||||
(match-string 2))
|
||||
priority (org-get-priority
|
||||
(if (match-end 3) (match-string 3) ""))
|
||||
ltags (org-get-tags)
|
||||
itags (org-delete-all ltags (org-get-tags-at))
|
||||
atags (org-get-tags-at))
|
||||
(setq ltags (mapconcat 'identity ltags " ")
|
||||
itags (mapconcat 'identity itags " "))
|
||||
;; We first only copy, in case something goes wrong
|
||||
;; we need to protect `this-command', to avoid kill-region sets it,
|
||||
;; which would lead to duplication of subtrees
|
||||
(let (this-command) (org-copy-subtree 1 nil t))
|
||||
(set-buffer buffer)
|
||||
;; Enforce org-mode for the archive buffer
|
||||
(if (not (org-mode-p))
|
||||
;; Force the mode for future visits.
|
||||
(let ((org-insert-mode-line-in-empty-file t)
|
||||
(org-inhibit-startup t))
|
||||
(call-interactively 'org-mode)))
|
||||
(when newfile-p
|
||||
(goto-char (point-max))
|
||||
(insert (format "\nArchived entries from file %s\n\n"
|
||||
(buffer-file-name this-buffer))))
|
||||
;; Force the TODO keywords of the original buffer
|
||||
(let ((org-todo-line-regexp tr-org-todo-line-regexp)
|
||||
(org-todo-keywords-1 tr-org-todo-keywords-1)
|
||||
(org-todo-kwd-alist tr-org-todo-kwd-alist)
|
||||
(org-done-keywords tr-org-done-keywords)
|
||||
(org-todo-regexp tr-org-todo-regexp)
|
||||
(org-todo-line-regexp tr-org-todo-line-regexp)
|
||||
(org-odd-levels-only
|
||||
(if (local-variable-p 'org-odd-levels-only (current-buffer))
|
||||
org-odd-levels-only
|
||||
tr-org-odd-levels-only)))
|
||||
(goto-char (point-min))
|
||||
(show-all)
|
||||
(if heading
|
||||
(progn
|
||||
(if (re-search-forward
|
||||
(concat "^" (regexp-quote heading)
|
||||
(org-re "[ \t]*\\(:[[:alnum:]_@#%:]+:\\)?[ \t]*\\($\\|\r\\)"))
|
||||
nil t)
|
||||
(goto-char (match-end 0))
|
||||
;; Heading not found, just insert it at the end
|
||||
(goto-char (point-max))
|
||||
(or (bolp) (insert "\n"))
|
||||
(insert "\n" heading "\n")
|
||||
(end-of-line 0))
|
||||
;; Make the subtree visible
|
||||
(show-subtree)
|
||||
(if org-archive-reversed-order
|
||||
(progn
|
||||
(org-back-to-heading t)
|
||||
(outline-next-heading))
|
||||
(org-end-of-subtree t))
|
||||
(skip-chars-backward " \t\r\n")
|
||||
(and (looking-at "[ \t\r\n]*")
|
||||
(replace-match "\n\n")))
|
||||
;; No specific heading, just go to end of file.
|
||||
(goto-char (point-max)) (insert "\n"))
|
||||
;; Paste
|
||||
(org-paste-subtree (org-get-valid-level level (and heading 1)))
|
||||
;; Shall we append inherited tags?
|
||||
(and itags
|
||||
(or (and (eq org-archive-subtree-add-inherited-tags 'infile)
|
||||
infile-p)
|
||||
(eq org-archive-subtree-add-inherited-tags t))
|
||||
(org-set-tags-to atags))
|
||||
;; Mark the entry as done
|
||||
(when (and org-archive-mark-done
|
||||
(looking-at org-todo-line-regexp)
|
||||
(or (not (match-end 2))
|
||||
(not (member (match-string 2) org-done-keywords))))
|
||||
(let (org-log-done org-todo-log-states)
|
||||
(org-todo
|
||||
(car (or (member org-archive-mark-done org-done-keywords)
|
||||
org-done-keywords)))))
|
||||
;; Add the context info
|
||||
(when org-archive-save-context-info
|
||||
(let ((l org-archive-save-context-info) e n v)
|
||||
(while (setq e (pop l))
|
||||
(when (and (setq v (symbol-value e))
|
||||
(stringp v) (string-match "\\S-" v))
|
||||
(setq n (concat "ARCHIVE_" (upcase (symbol-name e))))
|
||||
(org-entry-put (point) n v)))))
|
||||
|
||||
;; Add the context info
|
||||
(when org-archive-save-context-info
|
||||
(let ((l org-archive-save-context-info) e n v)
|
||||
(while (setq e (pop l))
|
||||
(when (and (setq v (symbol-value e))
|
||||
(stringp v) (string-match "\\S-" v))
|
||||
(setq n (concat "ARCHIVE_" (upcase (symbol-name e))))
|
||||
(org-entry-put (point) n v)))))
|
||||
|
||||
;; Save and kill the buffer, if it is not the same buffer.
|
||||
(when (not (eq this-buffer buffer))
|
||||
(save-buffer))))
|
||||
;; Here we are back in the original buffer. Everything seems to have
|
||||
;; worked. So now cut the tree and finish up.
|
||||
(let (this-command) (org-cut-subtree))
|
||||
(when (featurep 'org-inlinetask)
|
||||
(org-inlinetask-remove-END-maybe))
|
||||
(setq org-markers-to-move nil)
|
||||
(message "Subtree archived %s"
|
||||
(if (eq this-buffer buffer)
|
||||
(concat "under heading: " heading)
|
||||
(concat "in file: " (abbreviate-file-name afile))))))
|
||||
(org-reveal)
|
||||
(if (looking-at "^[ \t]*$")
|
||||
(outline-next-visible-heading 1)))
|
||||
;; Save and kill the buffer, if it is not the same buffer.
|
||||
(when (not (eq this-buffer buffer))
|
||||
(save-buffer))))
|
||||
;; Here we are back in the original buffer. Everything seems to have
|
||||
;; worked. So now cut the tree and finish up.
|
||||
(let (this-command) (org-cut-subtree))
|
||||
(when (featurep 'org-inlinetask)
|
||||
(org-inlinetask-remove-END-maybe))
|
||||
(setq org-markers-to-move nil)
|
||||
(message "Subtree archived %s"
|
||||
(if (eq this-buffer buffer)
|
||||
(concat "under heading: " heading)
|
||||
(concat "in file: " (abbreviate-file-name afile))))))
|
||||
(org-reveal)
|
||||
(if (looking-at "^[ \t]*$")
|
||||
(outline-next-visible-heading 1))))
|
||||
|
||||
(defun org-archive-to-archive-sibling ()
|
||||
"Archive the current heading by moving it under the archive sibling.
|
||||
|
@ -350,69 +357,83 @@ The archive sibling is a sibling of the heading with the heading name
|
|||
`org-archive-sibling-heading' and an `org-archive-tag' tag. If this
|
||||
sibling does not exist, it will be created at the end of the subtree."
|
||||
(interactive)
|
||||
(save-restriction
|
||||
(widen)
|
||||
(let (b e pos leader level)
|
||||
(org-back-to-heading t)
|
||||
(looking-at outline-regexp)
|
||||
(setq leader (match-string 0)
|
||||
level (funcall outline-level))
|
||||
(setq pos (point))
|
||||
(condition-case nil
|
||||
(outline-up-heading 1 t)
|
||||
(error (setq e (point-max)) (goto-char (point-min))))
|
||||
(setq b (point))
|
||||
(unless e
|
||||
(if (and (org-region-active-p) org-loop-over-headlines-in-active-region)
|
||||
(let ((cl (when (eq org-loop-over-headlines-in-active-region 'start-level)
|
||||
'region-start-level 'region))
|
||||
org-loop-over-headlines-in-active-region)
|
||||
(org-map-entries
|
||||
'(progn (setq org-map-continue-from
|
||||
(progn (org-back-to-heading)
|
||||
(if (looking-at (concat "^.*:" org-archive-tag ":.*$"))
|
||||
(org-end-of-subtree t)
|
||||
(point))))
|
||||
(when (org-at-heading-p)
|
||||
(org-archive-to-archive-sibling)))
|
||||
org-loop-over-headlines-in-active-region
|
||||
cl (if (outline-invisible-p) (org-end-of-subtree nil t))))
|
||||
(save-restriction
|
||||
(widen)
|
||||
(let (b e pos leader level)
|
||||
(org-back-to-heading t)
|
||||
(looking-at org-outline-regexp)
|
||||
(setq leader (match-string 0)
|
||||
level (funcall outline-level))
|
||||
(setq pos (point))
|
||||
(condition-case nil
|
||||
(org-end-of-subtree t t)
|
||||
(error (goto-char (point-max))))
|
||||
(setq e (point)))
|
||||
(goto-char b)
|
||||
(unless (re-search-forward
|
||||
(concat "^" (regexp-quote leader)
|
||||
"[ \t]*"
|
||||
org-archive-sibling-heading
|
||||
"[ \t]*:"
|
||||
org-archive-tag ":") e t)
|
||||
(goto-char e)
|
||||
(or (bolp) (newline))
|
||||
(insert leader org-archive-sibling-heading "\n")
|
||||
(beginning-of-line 0)
|
||||
(org-toggle-tag org-archive-tag 'on))
|
||||
(beginning-of-line 1)
|
||||
(if org-archive-reversed-order
|
||||
(outline-next-heading)
|
||||
(org-end-of-subtree t t))
|
||||
(save-excursion
|
||||
(goto-char pos)
|
||||
(let ((this-command this-command)) (org-cut-subtree)))
|
||||
(org-paste-subtree (org-get-valid-level level 1))
|
||||
(org-set-property
|
||||
"ARCHIVE_TIME"
|
||||
(format-time-string
|
||||
(substring (cdr org-time-stamp-formats) 1 -1)
|
||||
(current-time)))
|
||||
(outline-up-heading 1 t)
|
||||
(hide-subtree)
|
||||
(org-cycle-show-empty-lines 'folded)
|
||||
(goto-char pos)))
|
||||
(org-reveal)
|
||||
(if (looking-at "^[ \t]*$")
|
||||
(outline-next-visible-heading 1)))
|
||||
(outline-up-heading 1 t)
|
||||
(error (setq e (point-max)) (goto-char (point-min))))
|
||||
(setq b (point))
|
||||
(unless e
|
||||
(condition-case nil
|
||||
(org-end-of-subtree t t)
|
||||
(error (goto-char (point-max))))
|
||||
(setq e (point)))
|
||||
(goto-char b)
|
||||
(unless (re-search-forward
|
||||
(concat "^" (regexp-quote leader)
|
||||
"[ \t]*"
|
||||
org-archive-sibling-heading
|
||||
"[ \t]*:"
|
||||
org-archive-tag ":") e t)
|
||||
(goto-char e)
|
||||
(or (bolp) (newline))
|
||||
(insert leader org-archive-sibling-heading "\n")
|
||||
(beginning-of-line 0)
|
||||
(org-toggle-tag org-archive-tag 'on))
|
||||
(beginning-of-line 1)
|
||||
(if org-archive-reversed-order
|
||||
(outline-next-heading)
|
||||
(org-end-of-subtree t t))
|
||||
(save-excursion
|
||||
(goto-char pos)
|
||||
(let ((this-command this-command)) (org-cut-subtree)))
|
||||
(org-paste-subtree (org-get-valid-level level 1))
|
||||
(org-set-property
|
||||
"ARCHIVE_TIME"
|
||||
(format-time-string
|
||||
(substring (cdr org-time-stamp-formats) 1 -1)
|
||||
(current-time)))
|
||||
(outline-up-heading 1 t)
|
||||
(hide-subtree)
|
||||
(org-cycle-show-empty-lines 'folded)
|
||||
(goto-char pos)))
|
||||
(org-reveal)
|
||||
(if (looking-at "^[ \t]*$")
|
||||
(outline-next-visible-heading 1))))
|
||||
|
||||
(defun org-archive-all-done (&optional tag)
|
||||
"Archive sublevels of the current tree without open TODO items.
|
||||
If the cursor is not on a headline, try all level 1 trees. If
|
||||
it is on a headline, try all direct children.
|
||||
When TAG is non-nil, don't move trees, but mark them with the ARCHIVE tag."
|
||||
(let ((re (concat org-outline-regexp-bol "+" org-not-done-regexp)) re1
|
||||
(let ((re org-not-done-heading-regexp) re1
|
||||
(rea (concat ".*:" org-archive-tag ":"))
|
||||
(begm (make-marker))
|
||||
(endm (make-marker))
|
||||
(question (if tag "Set ARCHIVE tag (no open TODO items)? "
|
||||
"Move subtree to archive (no open TODO items)? "))
|
||||
beg end (cntarch 0))
|
||||
(if (org-on-heading-p)
|
||||
(if (org-at-heading-p)
|
||||
(progn
|
||||
(setq re1 (concat "^" (regexp-quote
|
||||
(make-string
|
||||
|
@ -449,20 +470,36 @@ When TAG is non-nil, don't move trees, but mark them with the ARCHIVE tag."
|
|||
With prefix ARG, check all children of current headline and offer tagging
|
||||
the children that do not contain any open TODO items."
|
||||
(interactive "P")
|
||||
(if find-done
|
||||
(org-archive-all-done 'tag)
|
||||
(let (set)
|
||||
(save-excursion
|
||||
(org-back-to-heading t)
|
||||
(setq set (org-toggle-tag org-archive-tag))
|
||||
(when set (hide-subtree)))
|
||||
(and set (beginning-of-line 1))
|
||||
(message "Subtree %s" (if set "archived" "unarchived")))))
|
||||
(if (and (org-region-active-p) org-loop-over-headlines-in-active-region)
|
||||
(let ((cl (if (eq org-loop-over-headlines-in-active-region 'start-level)
|
||||
'region-start-level 'region))
|
||||
org-loop-over-headlines-in-active-region)
|
||||
(org-map-entries
|
||||
`(org-toggle-archive-tag ,find-done)
|
||||
org-loop-over-headlines-in-active-region
|
||||
cl (if (outline-invisible-p) (org-end-of-subtree nil t))))
|
||||
(if find-done
|
||||
(org-archive-all-done 'tag)
|
||||
(let (set)
|
||||
(save-excursion
|
||||
(org-back-to-heading t)
|
||||
(setq set (org-toggle-tag org-archive-tag))
|
||||
(when set (hide-subtree)))
|
||||
(and set (beginning-of-line 1))
|
||||
(message "Subtree %s" (if set "archived" "unarchived"))))))
|
||||
|
||||
(defun org-archive-set-tag ()
|
||||
"Set the ARCHIVE tag."
|
||||
(interactive)
|
||||
(org-toggle-tag org-archive-tag 'on))
|
||||
(if (and (org-region-active-p) org-loop-over-headlines-in-active-region)
|
||||
(let ((cl (if (eq org-loop-over-headlines-in-active-region 'start-level)
|
||||
'region-start-level 'region))
|
||||
org-loop-over-headlines-in-active-region)
|
||||
(org-map-entries
|
||||
'org-archive-set-tag
|
||||
org-loop-over-headlines-in-active-region
|
||||
cl (if (outline-invisible-p) (org-end-of-subtree nil t))))
|
||||
(org-toggle-tag org-archive-tag 'on)))
|
||||
|
||||
;;;###autoload
|
||||
(defun org-archive-subtree-default ()
|
||||
|
@ -482,6 +519,4 @@ This command is set with the variable `org-archive-default-command'."
|
|||
|
||||
(provide 'org-archive)
|
||||
|
||||
|
||||
|
||||
;;; org-archive.el ends here
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
;;; org-ascii.el --- ASCII export for Org-mode
|
||||
|
||||
;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Carsten Dominik <carsten at orgmode dot org>
|
||||
;; Keywords: outlines, hypermedia, calendar, wp
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
;;
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -145,7 +144,7 @@ command to convert it."
|
|||
(interactive "r")
|
||||
(let (reg ascii buf pop-up-frames)
|
||||
(save-window-excursion
|
||||
(if (org-mode-p)
|
||||
(if (eq major-mode 'org-mode)
|
||||
(setq ascii (org-export-region-as-ascii
|
||||
beg end t 'string))
|
||||
(setq reg (buffer-substring beg end)
|
||||
|
@ -284,7 +283,7 @@ publishing directory."
|
|||
"UNTITLED"))
|
||||
(email (plist-get opt-plist :email))
|
||||
(language (plist-get opt-plist :language))
|
||||
(quote-re0 (concat "^[ \t]*" org-quote-string "\\>"))
|
||||
(quote-re0 (concat "^\\(" org-quote-string "\\)\\( +\\|[ \t]*$\\)"))
|
||||
(todo nil)
|
||||
(lang-words nil)
|
||||
(region
|
||||
|
@ -407,7 +406,7 @@ publishing directory."
|
|||
txt))
|
||||
(setq txt (replace-match "" t t txt)))
|
||||
(if (string-match quote-re0 txt)
|
||||
(setq txt (replace-match "" t t txt)))
|
||||
(setq txt (replace-match "" t t txt 1)))
|
||||
|
||||
(if org-export-with-section-numbers
|
||||
(setq txt (concat (org-section-number level)
|
||||
|
@ -725,5 +724,4 @@ publishing directory."
|
|||
|
||||
(provide 'org-ascii)
|
||||
|
||||
|
||||
;;; org-ascii.el ends here
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
;; Author: John Wiegley <johnw@newartisans.com>
|
||||
;; Keywords: org data task
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -437,5 +436,4 @@ prefix."
|
|||
|
||||
(provide 'org-attach)
|
||||
|
||||
|
||||
;;; org-attach.el ends here
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
;;; org-bbdb.el --- Support for links to BBDB entries from within Org-mode
|
||||
|
||||
;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Carsten Dominik <carsten at orgmode dot org>,
|
||||
;; Thomas Baumann <thomas dot baumann at ch dot tum dot de>
|
||||
;; Keywords: outlines, hypermedia, calendar, wp
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
;;
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -119,6 +118,9 @@
|
|||
|
||||
(defvar date) ;; dynamically scoped from Org
|
||||
|
||||
;; Support for version 2.35
|
||||
(defvar org-bbdb-old (fboundp 'bbdb-record-get-field-internal))
|
||||
|
||||
;; Customization
|
||||
|
||||
(defgroup org-bbdb-anniversaries nil
|
||||
|
@ -196,8 +198,11 @@ date year)."
|
|||
"Store a link to a BBDB database entry."
|
||||
(when (eq major-mode 'bbdb-mode)
|
||||
;; This is BBDB, we make this link!
|
||||
(let* ((name (bbdb-record-name (bbdb-current-record)))
|
||||
(company (bbdb-record-getprop (bbdb-current-record) 'company))
|
||||
(let* ((rec (bbdb-current-record))
|
||||
(name (bbdb-record-name rec))
|
||||
(company (if org-bbdb-old
|
||||
(bbdb-record-getprop rec 'company)
|
||||
(car (bbdb-record-get-field rec 'organization))))
|
||||
(link (org-make-link "bbdb:" name)))
|
||||
(org-store-link-props :type "bbdb" :name name :company company
|
||||
:link link :description name)
|
||||
|
@ -219,24 +224,49 @@ italicized, in all other cases it is left unchanged."
|
|||
(require 'bbdb)
|
||||
(let ((inhibit-redisplay (not debug-on-error))
|
||||
(bbdb-electric-p nil))
|
||||
(catch 'exit
|
||||
;; Exact match on name
|
||||
(bbdb-name (concat "\\`" name "\\'") nil)
|
||||
(if (< 0 (buffer-size (get-buffer "*BBDB*"))) (throw 'exit nil))
|
||||
;; Exact match on name
|
||||
(bbdb-company (concat "\\`" name "\\'") nil)
|
||||
(if (< 0 (buffer-size (get-buffer "*BBDB*"))) (throw 'exit nil))
|
||||
;; Partial match on name
|
||||
(bbdb-name name nil)
|
||||
(if (< 0 (buffer-size (get-buffer "*BBDB*"))) (throw 'exit nil))
|
||||
;; Partial match on company
|
||||
(bbdb-company name nil)
|
||||
(if (< 0 (buffer-size (get-buffer "*BBDB*"))) (throw 'exit nil))
|
||||
;; General match including network address and notes
|
||||
(bbdb name nil)
|
||||
(when (= 0 (buffer-size (get-buffer "*BBDB*")))
|
||||
(delete-window (get-buffer-window "*BBDB*"))
|
||||
(error "No matching BBDB record")))))
|
||||
(if org-bbdb-old
|
||||
(org-bbdb-open-old)
|
||||
(org-bbdb-open-new))))
|
||||
|
||||
(defun org-bbdb-open-old ()
|
||||
(catch 'exit
|
||||
;; Exact match on name
|
||||
(bbdb-name (concat "\\`" name "\\'") nil)
|
||||
(if (< 0 (buffer-size (get-buffer "*BBDB*"))) (throw 'exit nil))
|
||||
;; Exact match on name
|
||||
(bbdb-company (concat "\\`" name "\\'") nil)
|
||||
(if (< 0 (buffer-size (get-buffer "*BBDB*"))) (throw 'exit nil))
|
||||
;; Partial match on name
|
||||
(bbdb-name name nil)
|
||||
(if (< 0 (buffer-size (get-buffer "*BBDB*"))) (throw 'exit nil))
|
||||
;; Partial match on company
|
||||
(bbdb-company name nil)
|
||||
(if (< 0 (buffer-size (get-buffer "*BBDB*"))) (throw 'exit nil))
|
||||
;; General match including network address and notes
|
||||
(bbdb name nil)
|
||||
(when (= 0 (buffer-size (get-buffer "*BBDB*")))
|
||||
(delete-window (get-buffer-window "*BBDB*"))
|
||||
(error "No matching BBDB record"))))
|
||||
|
||||
(defun org-bbdb-open-new ()
|
||||
(catch 'exit
|
||||
;; Exact match on name
|
||||
(bbdb-search-name (concat "\\`" name "\\'") nil)
|
||||
(if (< 0 (buffer-size (get-buffer "*BBDB*"))) (throw 'exit nil))
|
||||
;; Exact match on name
|
||||
(bbdb-search-organization (concat "\\`" name "\\'") nil)
|
||||
(if (< 0 (buffer-size (get-buffer "*BBDB*"))) (throw 'exit nil))
|
||||
;; Partial match on name
|
||||
(bbdb-search-name name nil)
|
||||
(if (< 0 (buffer-size (get-buffer "*BBDB*"))) (throw 'exit nil))
|
||||
;; Partial match on company
|
||||
(bbdb-search-organization name nil)
|
||||
(if (< 0 (buffer-size (get-buffer "*BBDB*"))) (throw 'exit nil))
|
||||
;; General match including network address and notes
|
||||
(bbdb name nil)
|
||||
(when (= 0 (buffer-size (get-buffer "*BBDB*")))
|
||||
(delete-window (get-buffer-window "*BBDB*"))
|
||||
(error "No matching BBDB record"))))
|
||||
|
||||
(defun org-bbdb-anniv-extract-date (time-str)
|
||||
"Convert YYYY-MM-DD to (month date year).
|
||||
|
@ -357,7 +387,7 @@ This is used by Org to re-create the anniversary hash table."
|
|||
(bbdb-record-name (car (bbdb-completing-read-record "Name: ")))))
|
||||
|
||||
(defun org-bbdb-anniv-export-ical ()
|
||||
"Extract anniversaries from BBDB and convert them to iCalendar format."
|
||||
"Extract anniversaries from BBDB and convert them to icalendar format."
|
||||
(require 'bbdb)
|
||||
(require 'diary-lib)
|
||||
(unless (hash-table-p org-bbdb-anniv-hash)
|
||||
|
@ -391,6 +421,4 @@ END:VEVENT\n"
|
|||
|
||||
(provide 'org-bbdb)
|
||||
|
||||
|
||||
|
||||
;;; org-bbdb.el ends here
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
;;
|
||||
;; Copyright (C) 2007-2011 Free Software Foundation, Inc.
|
||||
;;
|
||||
;; Version: 7.7
|
||||
;; Author: Carsten Dominik <carsten.dominik AT gmail DOT com>
|
||||
;; Maintainer: Carsten Dominik <carsten.dominik AT gmail DOT com>
|
||||
;; Keywords: org, wp, tex
|
||||
|
@ -400,7 +399,7 @@ the value will be inserted right after the documentclass statement."
|
|||
(insert org-beamer-header-extra)
|
||||
(or (bolp) (insert "\n"))))))
|
||||
|
||||
(defcustom org-beamer-fragile-re "^[ \t]*\\\\begin{\\(verbatim\\|lstlisting\\|minted\\)}"
|
||||
(defcustom org-beamer-fragile-re "\\\\\\(verb\\|lstinline\\)\\|^[ \t]*\\\\begin{\\(verbatim\\|lstlisting\\|minted\\)}"
|
||||
"If this regexp matches in a frame, the frame is marked as fragile."
|
||||
:group 'org-beamer
|
||||
:type 'regexp)
|
||||
|
@ -411,7 +410,7 @@ the value will be inserted right after the documentclass statement."
|
|||
|
||||
|
||||
;; Functions to initialize and post-process
|
||||
;; These functions will be hooked into various places in the export process
|
||||
;; These fuctions will be hooked into various places in the export process
|
||||
|
||||
(defun org-beamer-initialize-open-trackers ()
|
||||
"Reset variables that track if certain environments are open during export."
|
||||
|
@ -451,7 +450,7 @@ The effect is that these values will be accessible during export."
|
|||
((stringp org-beamer-frame-level-now)
|
||||
(setq org-beamer-frame-level-now
|
||||
(string-to-number org-beamer-frame-level-now))))
|
||||
;; Find the header additions, most likely theme commands
|
||||
;; Find the header additons, most likely theme commands
|
||||
(setq org-beamer-header-extra
|
||||
(or (and (org-region-active-p)
|
||||
(save-excursion
|
||||
|
@ -632,6 +631,4 @@ include square brackets."
|
|||
|
||||
(provide 'org-beamer)
|
||||
|
||||
|
||||
|
||||
;;; org-beamer.el ends here
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
;; Carsten Dominik <carsten dot dominik at gmail dot com>
|
||||
;; Eric Schulte <schulte dot eric at gmail dot com>
|
||||
;; Keywords: org, wp, remember
|
||||
;; Version: 7.7
|
||||
;;
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -204,7 +203,7 @@
|
|||
(:pages . "One or more page numbers or range of numbers, such as 42-111 or 7,41,73-97 or 43+ (the ‘+’ in this last example indicates pages following that don’t form simple range). BibTEX requires double dashes for page ranges (--).")
|
||||
(:publisher . "The publisher’s name.")
|
||||
(:school . "The name of the school where a thesis was written.")
|
||||
(:series . "The name of a series or set of books. When citing an entire book, the title field gives its title and an optional series field gives the name of a series or multi-volume set in which the book is published.")
|
||||
(:series . "The name of a series or set of books. When citing an entire book, the the title field gives its title and an optional series field gives the name of a series or multi-volume set in which the book is published.")
|
||||
(:title . "The work’s title, typed as explained in the LaTeX book.")
|
||||
(:type . "The type of a technical report for example, 'Research Note'.")
|
||||
(:volume . "The volume of a journal or multi-volume book.")
|
||||
|
@ -221,7 +220,7 @@
|
|||
|
||||
(defcustom org-bibtex-prefix nil
|
||||
"Optional prefix for all bibtex property names.
|
||||
For example setting to 'BIB_' would allow interoperability with Fireforg."
|
||||
For example setting to 'BIB_' would allow interoperability with fireforg."
|
||||
:group 'org-bibtex
|
||||
:type 'string)
|
||||
|
||||
|
@ -275,12 +274,20 @@ This variable is relevant only if `org-bibtex-export-tags-as-keywords` is t."
|
|||
:group 'org-bibtex
|
||||
:type '(repeat :tag "Tag" (string)))
|
||||
|
||||
(defcustom org-bibtex-type-property-name "btype"
|
||||
"Property in which to store bibtex entry type (e.g., article)."
|
||||
:group 'org-bibtex
|
||||
:type 'string)
|
||||
|
||||
|
||||
;;; Utility functions
|
||||
(defun org-bibtex-get (property)
|
||||
((lambda (it) (when it (org-babel-trim it)))
|
||||
(or (org-entry-get (point) (upcase property))
|
||||
(org-entry-get (point) (concat org-bibtex-prefix (upcase property))))))
|
||||
(let ((org-special-properties
|
||||
(delete "FILE" (copy-sequence org-special-properties))))
|
||||
(or
|
||||
(org-entry-get (point) (upcase property))
|
||||
(org-entry-get (point) (concat org-bibtex-prefix (upcase property)))))))
|
||||
|
||||
(defun org-bibtex-put (property value)
|
||||
(let ((prop (upcase (if (keywordp property)
|
||||
|
@ -303,7 +310,7 @@ This variable is relevant only if `org-bibtex-export-tags-as-keywords` is t."
|
|||
lsts))))
|
||||
(let ((notes (buffer-string))
|
||||
(id (org-bibtex-get org-bibtex-key-property))
|
||||
(type (org-bibtex-get "type"))
|
||||
(type (org-bibtex-get org-bibtex-type-property-name))
|
||||
(tags (when org-bibtex-tags-are-keywords
|
||||
(delq nil
|
||||
(mapcar
|
||||
|
@ -317,16 +324,20 @@ This variable is relevant only if `org-bibtex-export-tags-as-keywords` is t."
|
|||
(let ((entry (format
|
||||
"@%s{%s,\n%s\n}\n" type id
|
||||
(mapconcat
|
||||
(lambda (pair) (format " %s={%s}" (car pair) (cdr pair)))
|
||||
(lambda (pair)
|
||||
(format " %s={%s}" (car pair) (cdr pair)))
|
||||
(remove nil
|
||||
(if (and org-bibtex-export-arbitrary-fields
|
||||
org-bibtex-prefix)
|
||||
(mapcar
|
||||
(lambda (kv)
|
||||
(let ((key (car kv)) (val (cdr kv)))
|
||||
(when (and (string-match org-bibtex-prefix key)
|
||||
(not (string=
|
||||
(downcase (concat org-bibtex-prefix "TYPE")) (downcase key))))
|
||||
(when (and
|
||||
(string-match org-bibtex-prefix key)
|
||||
(not (string=
|
||||
(downcase (concat org-bibtex-prefix
|
||||
org-bibtex-type-property-name))
|
||||
(downcase key))))
|
||||
(cons (downcase (replace-regexp-in-string
|
||||
org-bibtex-prefix "" key))
|
||||
val))))
|
||||
|
@ -514,9 +525,20 @@ Headlines are exported using `org-bibtex-export-headline'."
|
|||
"Bibtex file: " nil nil nil
|
||||
(file-name-nondirectory
|
||||
(concat (file-name-sans-extension (buffer-file-name)) ".bib")))))
|
||||
(let ((bibtex-entries (remove nil (org-map-entries #'org-bibtex-headline))))
|
||||
(with-temp-file filename
|
||||
(insert (mapconcat #'identity bibtex-entries "\n")))))
|
||||
((lambda (error-point)
|
||||
(when error-point
|
||||
(goto-char error-point)
|
||||
(message "Bibtex error at %S" (nth 4 (org-heading-components)))))
|
||||
(catch 'bib
|
||||
(let ((bibtex-entries (remove nil (org-map-entries
|
||||
(lambda ()
|
||||
(condition-case foo
|
||||
(org-bibtex-headline)
|
||||
(error (throw 'bib (point)))))))))
|
||||
(with-temp-file filename
|
||||
(insert (mapconcat #'identity bibtex-entries "\n")))
|
||||
(message "Successfully exported %d bibtex entries to %s"
|
||||
(length bibtex-entries) filename) nil))))
|
||||
|
||||
(defun org-bibtex-check (&optional optional)
|
||||
"Check the current headline for required fields.
|
||||
|
@ -525,7 +547,7 @@ With prefix argument OPTIONAL also prompt for optional fields."
|
|||
(save-restriction
|
||||
(org-narrow-to-subtree)
|
||||
(let ((type ((lambda (name) (when name (intern (concat ":" name))))
|
||||
(org-bibtex-get "TYPE"))))
|
||||
(org-bibtex-get org-bibtex-type-property-name))))
|
||||
(when type (org-bibtex-fleshout type optional)))))
|
||||
|
||||
(defun org-bibtex-check-all (&optional optional)
|
||||
|
@ -542,7 +564,8 @@ If nonew is t, add data to the headline of the entry at point."
|
|||
"Type: " (mapcar (lambda (type)
|
||||
(substring (symbol-name (car type)) 1))
|
||||
org-bibtex-types)
|
||||
nil nil (when nonew (org-bibtex-get "TYPE"))))
|
||||
nil nil (when nonew
|
||||
(org-bibtex-get org-bibtex-type-property-name))))
|
||||
(type (if (keywordp type) type (intern (concat ":" type))))
|
||||
(org-bibtex-treat-headline-as-title (if nonew nil t)))
|
||||
(unless (assoc type org-bibtex-types)
|
||||
|
@ -553,7 +576,8 @@ If nonew is t, add data to the headline of the entry at point."
|
|||
(let ((title (org-bibtex-ask :title)))
|
||||
(insert title)
|
||||
(org-bibtex-put "TITLE" title)))
|
||||
(org-bibtex-put "TYPE" (substring (symbol-name type) 1))
|
||||
(org-bibtex-put org-bibtex-type-property-name
|
||||
(substring (symbol-name type) 1))
|
||||
(org-bibtex-fleshout type arg)
|
||||
(mapc (lambda (tag) (org-toggle-tag tag 'on)) org-bibtex-tags)))
|
||||
|
||||
|
@ -598,7 +622,7 @@ This uses `bibtex-parse-entry'."
|
|||
(org-insert-heading)
|
||||
(insert (val :title))
|
||||
(org-bibtex-put "TITLE" (val :title))
|
||||
(org-bibtex-put "TYPE" (downcase (val :type)))
|
||||
(org-bibtex-put org-bibtex-type-property-name (downcase (val :type)))
|
||||
(dolist (pair entry)
|
||||
(case (car pair)
|
||||
(:title nil)
|
||||
|
@ -637,11 +661,10 @@ This function relies `org-search-view' to locate results."
|
|||
(let ((org-agenda-overriding-header "Bib search results:")
|
||||
(org-agenda-search-view-always-boolean t))
|
||||
(org-search-view nil
|
||||
(format "%s +{:%sTYPE:}"
|
||||
string org-bibtex-prefix))))
|
||||
(format "%s +{:%s%s:}"
|
||||
string org-bibtex-prefix
|
||||
org-bibtex-type-property-name))))
|
||||
|
||||
(provide 'org-bibtex)
|
||||
|
||||
|
||||
|
||||
;;; org-bibtex.el ends here
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
;;; org-capture.el --- Fast note taking in Org-mode
|
||||
|
||||
;; Copyright (C) 2010-2011 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2010-2011 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Carsten Dominik <carsten at orgmode dot org>
|
||||
;; Keywords: outlines, hypermedia, calendar, wp
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
;;
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -57,6 +56,8 @@
|
|||
(date &optional keep-restriction))
|
||||
(declare-function org-table-get-specials "org-table" ())
|
||||
(declare-function org-table-goto-line "org-table" (N))
|
||||
(declare-function org-pop-to-buffer-same-window "org-compat"
|
||||
(&optional buffer-or-name norecord label))
|
||||
|
||||
(defvar org-remember-default-headline)
|
||||
(defvar org-remember-templates)
|
||||
|
@ -332,7 +333,8 @@ calendar | %:type %:date"
|
|||
|
||||
(defcustom org-capture-before-finalize-hook nil
|
||||
"Hook that is run right before a capture process is finalized.
|
||||
The capture buffer is still current when this hook runs."
|
||||
The capture buffer is still current when this hook runs and it is
|
||||
widened to the entire buffer."
|
||||
:group 'org-capture
|
||||
:type 'hook)
|
||||
|
||||
|
@ -372,7 +374,7 @@ to avoid conflicts with other active capture processes."
|
|||
(plist-get (if local org-capture-current-plist org-capture-plist) prop))
|
||||
|
||||
(defun org-capture-member (prop &optional local)
|
||||
"Is PROP a property in `org-capture-plist'.
|
||||
"Is PROP a preperty in `org-capture-plist'.
|
||||
When LOCAL is set, use the local variable `org-capture-current-plist',
|
||||
this is necessary after initialization of the capture process,
|
||||
to avoid conflicts with other active capture processes."
|
||||
|
@ -484,7 +486,7 @@ bypassed."
|
|||
(error "Capture template `%s': %s"
|
||||
(org-capture-get :key)
|
||||
(nth 1 error))))
|
||||
(if (and (org-mode-p)
|
||||
(if (and (eq major-mode 'org-mode)
|
||||
(org-capture-get :clock-in))
|
||||
(condition-case nil
|
||||
(progn
|
||||
|
@ -574,7 +576,7 @@ captured item after finalizing."
|
|||
(org-capture-empty-lines-after
|
||||
(or (org-capture-get :empty-lines 'local) 0))))
|
||||
;; Postprocessing: Update Statistics cookies, do the sorting
|
||||
(when (org-mode-p)
|
||||
(when (eq major-mode 'org-mode)
|
||||
(save-excursion
|
||||
(when (ignore-errors (org-back-to-heading))
|
||||
(org-update-parent-todo-statistics)
|
||||
|
@ -722,7 +724,7 @@ already gone. Any prefix argument will be passed to the refile command."
|
|||
(widen)
|
||||
(let ((hd (nth 2 target)))
|
||||
(goto-char (point-min))
|
||||
(unless (org-mode-p)
|
||||
(unless (eq major-mode 'org-mode)
|
||||
(error
|
||||
"Target buffer \"%s\" for file+headline should be in Org mode"
|
||||
(current-buffer)))
|
||||
|
@ -754,7 +756,7 @@ already gone. Any prefix argument will be passed to the refile command."
|
|||
(goto-char (if (org-capture-get :prepend)
|
||||
(match-beginning 0) (match-end 0)))
|
||||
(org-capture-put :exact-position (point))
|
||||
(setq target-entry-p (and (org-mode-p) (org-at-heading-p))))
|
||||
(setq target-entry-p (and (eq major-mode 'org-mode) (org-at-heading-p))))
|
||||
(error "No match for target regexp in file %s" (nth 1 target))))
|
||||
|
||||
((memq (car target) '(file+datetree file+datetree+prompt))
|
||||
|
@ -776,7 +778,8 @@ already gone. Any prefix argument will be passed to the refile command."
|
|||
(let ((prompt-time (org-read-date
|
||||
nil t nil "Date for tree entry:"
|
||||
(current-time))))
|
||||
(org-capture-put :prompt-time prompt-time)
|
||||
(org-capture-put :prompt-time prompt-time
|
||||
:default-time prompt-time)
|
||||
(time-to-days prompt-time)))
|
||||
(t
|
||||
;; current date, possible corrected for late night workers
|
||||
|
@ -788,12 +791,12 @@ already gone. Any prefix argument will be passed to the refile command."
|
|||
(widen)
|
||||
(funcall (nth 2 target))
|
||||
(org-capture-put :exact-position (point))
|
||||
(setq target-entry-p (and (org-mode-p) (org-at-heading-p))))
|
||||
(setq target-entry-p (and (eq major-mode 'org-mode) (org-at-heading-p))))
|
||||
|
||||
((eq (car target) 'function)
|
||||
(funcall (nth 1 target))
|
||||
(org-capture-put :exact-position (point))
|
||||
(setq target-entry-p (and (org-mode-p) (org-at-heading-p))))
|
||||
(setq target-entry-p (and (eq major-mode 'org-mode) (org-at-heading-p))))
|
||||
|
||||
((eq (car target) 'clock)
|
||||
(if (and (markerp org-clock-hd-marker)
|
||||
|
@ -847,6 +850,7 @@ it. When it is a variable, retrieve the value. Return whatever we get."
|
|||
(goto-char (org-capture-get :pos))
|
||||
(org-set-local 'org-capture-target-marker
|
||||
(move-marker (make-marker) (point)))
|
||||
(org-set-local 'outline-level 'org-outline-level)
|
||||
(let* ((template (org-capture-get :template))
|
||||
(type (org-capture-get :type)))
|
||||
(case type
|
||||
|
@ -1146,11 +1150,11 @@ Point will remain at the first line after the inserted text."
|
|||
(or (bolp) (newline))
|
||||
(setq beg (point))
|
||||
(cond
|
||||
((and (eq type 'entry) (org-mode-p))
|
||||
((and (eq type 'entry) (eq major-mode 'org-mode))
|
||||
(org-capture-verify-tree (org-capture-get :template))
|
||||
(org-paste-subtree nil template t))
|
||||
((and (memq type '(item checkitem))
|
||||
(org-mode-p)
|
||||
(eq major-mode 'org-mode)
|
||||
(save-excursion (skip-chars-backward " \t\n")
|
||||
(setq pp (point))
|
||||
(org-in-item-p)))
|
||||
|
@ -1199,7 +1203,7 @@ The user is queried for the template."
|
|||
(error "No capture template selected"))
|
||||
(org-capture-set-plist entry)
|
||||
(org-capture-set-target-location)
|
||||
(switch-to-buffer (org-capture-get :buffer))
|
||||
(org-pop-to-buffer-same-window (org-capture-get :buffer))
|
||||
(goto-char (org-capture-get :pos))))
|
||||
|
||||
(defun org-capture-get-indirect-buffer (&optional buffer prefix)
|
||||
|
@ -1212,8 +1216,10 @@ Use PREFIX as a prefix for the name of the indirect buffer."
|
|||
(setq bname (concat prefix "-" (number-to-string (incf n)) "-" base)))
|
||||
(condition-case nil
|
||||
(make-indirect-buffer buffer bname 'clone)
|
||||
(error (make-indirect-buffer buffer bname)))))
|
||||
|
||||
(error
|
||||
(let ((buf (make-indirect-buffer buffer bname)))
|
||||
(with-current-buffer buf (org-mode))
|
||||
buf)))))
|
||||
|
||||
(defun org-capture-verify-tree (tree)
|
||||
"Throw error if TREE is not a valid tree"
|
||||
|
@ -1309,7 +1315,7 @@ The template may still contain \"%?\" for cursor positioning."
|
|||
(sit-for 1))
|
||||
(save-window-excursion
|
||||
(delete-other-windows)
|
||||
(switch-to-buffer (get-buffer-create "*Capture*"))
|
||||
(org-pop-to-buffer-same-window (get-buffer-create "*Capture*"))
|
||||
(erase-buffer)
|
||||
(insert template)
|
||||
(goto-char (point-min))
|
||||
|
@ -1411,7 +1417,7 @@ The template may still contain \"%?\" for cursor positioning."
|
|||
(or (equal (char-before) ?:) (insert ":"))
|
||||
(insert ins)
|
||||
(or (equal (char-after) ?:) (insert ":"))
|
||||
(and (org-on-heading-p) (org-set-tags nil 'align)))))
|
||||
(and (org-at-heading-p) (org-set-tags nil 'align)))))
|
||||
((equal char "C")
|
||||
(cond ((= (length clipboards) 1) (insert (car clipboards)))
|
||||
((> (length clipboards) 1)
|
||||
|
@ -1449,7 +1455,7 @@ The template may still contain \"%?\" for cursor positioning."
|
|||
(goto-char (point-min))
|
||||
(while (looking-at "[ \t]*\n") (replace-match ""))
|
||||
(if (re-search-forward "[ \t\n]*\\'" nil t) (replace-match "\n"))
|
||||
;; Return the expanded template and kill the temporary buffer
|
||||
;; Return the expanded tempate and kill the temporary buffer
|
||||
(untabify (point-min) (point-max))
|
||||
(set-buffer-modified-p nil)
|
||||
(prog1 (buffer-string) (kill-buffer (current-buffer))))))
|
||||
|
@ -1503,6 +1509,4 @@ The template may still contain \"%?\" for cursor positioning."
|
|||
|
||||
(provide 'org-capture)
|
||||
|
||||
|
||||
|
||||
;;; org-capture.el ends here
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
;;; org-clock.el --- The time clocking code for Org-mode
|
||||
|
||||
;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Carsten Dominik <carsten at orgmode dot org>
|
||||
;; Keywords: outlines, hypermedia, calendar, wp
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
;;
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -36,6 +35,7 @@
|
|||
|
||||
(declare-function calendar-absolute-from-iso "cal-iso" (&optional date))
|
||||
(declare-function notifications-notify "notifications" (&rest params))
|
||||
(declare-function org-pop-to-buffer-same-window "org-compat" (&optional buffer-or-name norecord label))
|
||||
(defvar org-time-stamp-formats)
|
||||
(defvar org-ts-what)
|
||||
|
||||
|
@ -328,7 +328,7 @@ to add an effort property.")
|
|||
"Hook run when stopping the current clock.")
|
||||
|
||||
(defvar org-clock-cancel-hook nil
|
||||
"Hook run when canceling the current clock.")
|
||||
"Hook run when cancelling the current clock.")
|
||||
(defvar org-clock-goto-hook nil
|
||||
"Hook run when selecting the currently clocked-in entry.")
|
||||
(defvar org-clock-has-been-used nil
|
||||
|
@ -346,7 +346,7 @@ to add an effort property.")
|
|||
(defvar org-clock-start-time "")
|
||||
|
||||
(defvar org-clock-leftover-time nil
|
||||
"If non-nil, user canceled a clock; this is when leftover time started.")
|
||||
"If non-nil, user cancelled a clock; this is when leftover time started.")
|
||||
|
||||
(defvar org-clock-effort ""
|
||||
"Effort estimate of the currently clocking task.")
|
||||
|
@ -658,7 +658,7 @@ Use alsa's aplay tool if available."
|
|||
|
||||
(defun org-program-exists (program-name)
|
||||
"Checks whenever we can locate program and launch it."
|
||||
(if (eq system-type 'gnu/linux)
|
||||
(if (member system-type '(gnu/linux darwin))
|
||||
(= 0 (call-process "which" nil nil nil program-name))))
|
||||
|
||||
(defvar org-clock-mode-line-entry nil
|
||||
|
@ -691,7 +691,7 @@ Use alsa's aplay tool if available."
|
|||
(goto-char (car ,clock))
|
||||
(beginning-of-line)
|
||||
,@forms))))
|
||||
|
||||
(def-edebug-spec org-with-clock-position (form body))
|
||||
(put 'org-with-clock-position 'lisp-indent-function 1)
|
||||
|
||||
(defmacro org-with-clock (clock &rest forms)
|
||||
|
@ -707,7 +707,7 @@ This macro also protects the current active clock from being altered."
|
|||
(outline-back-to-heading t)
|
||||
(point-marker))))
|
||||
,@forms)))
|
||||
|
||||
(def-edebug-spec org-with-clock (form body))
|
||||
(put 'org-with-clock 'lisp-indent-function 1)
|
||||
|
||||
(defsubst org-clock-clock-in (clock &optional resume start-time)
|
||||
|
@ -1066,7 +1066,7 @@ the clocking selection, associated with the letter `d'."
|
|||
|
||||
;; Clock in at which position?
|
||||
(setq target-pos
|
||||
(if (and (eobp) (not (org-on-heading-p)))
|
||||
(if (and (eobp) (not (org-at-heading-p)))
|
||||
(point-at-bol 0)
|
||||
(point)))
|
||||
(run-hooks 'org-clock-in-prepare-hook)
|
||||
|
@ -1115,9 +1115,9 @@ the clocking selection, associated with the letter `d'."
|
|||
(cond
|
||||
((and org-clock-in-resume
|
||||
(looking-at
|
||||
(concat "^[ \t]* " org-clock-string
|
||||
(concat "^[ \t]*" org-clock-string
|
||||
" \\[\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}"
|
||||
" +\\sw+\.? +[012][0-9]:[0-5][0-9]\\)\\][ \t]*$")))
|
||||
" *\\sw+\.? +[012][0-9]:[0-5][0-9]\\)\\][ \t]*$")))
|
||||
(message "Matched %s" (match-string 1))
|
||||
(setq ts (concat "[" (match-string 1) "]"))
|
||||
(goto-char (match-end 1))
|
||||
|
@ -1247,9 +1247,9 @@ line and position cursor in that line."
|
|||
(goto-char beg)
|
||||
(when (and find-unclosed
|
||||
(re-search-forward
|
||||
(concat "^[ \t]* " org-clock-string
|
||||
(concat "^[ \t]*" org-clock-string
|
||||
" \\[\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}"
|
||||
" +\\sw+ +[012][0-9]:[0-5][0-9]\\)\\][ \t]*$")
|
||||
" *\\sw+ +[012][0-9]:[0-5][0-9]\\)\\][ \t]*$")
|
||||
end t))
|
||||
(beginning-of-line 1)
|
||||
(throw 'exit t))
|
||||
|
@ -1261,7 +1261,7 @@ line and position cursor in that line."
|
|||
(and (re-search-forward org-property-end-re nil t)
|
||||
(goto-char (match-beginning 0))))
|
||||
(throw 'exit t))
|
||||
;; Let's count the CLOCK lines
|
||||
;; Lets count the CLOCK lines
|
||||
(goto-char beg)
|
||||
(while (re-search-forward re end t)
|
||||
(setq first (or first (match-beginning 0))
|
||||
|
@ -1497,7 +1497,7 @@ With prefix arg SELECT, offer recently clocked tasks for selection."
|
|||
(setq recent t)
|
||||
(car org-clock-history))
|
||||
(t (error "No active or recent clock task")))))
|
||||
(switch-to-buffer (marker-buffer m))
|
||||
(org-pop-to-buffer-same-window (marker-buffer m))
|
||||
(if (or (< m (point-min)) (> m (point-max))) (widen))
|
||||
(goto-char m)
|
||||
(org-show-entry)
|
||||
|
@ -1696,7 +1696,9 @@ from the `before-change-functions' in the current buffer."
|
|||
"Clock out if the current entry contains the running clock.
|
||||
This is used to stop the clock after a TODO entry is marked DONE,
|
||||
and is only done if the variable `org-clock-out-when-done' is not nil."
|
||||
(when (and org-clock-out-when-done
|
||||
(when (and (org-clocking-p)
|
||||
org-clock-out-when-done
|
||||
(marker-buffer org-clock-marker)
|
||||
(or (and (eq t org-clock-out-when-done)
|
||||
(member state org-done-keywords))
|
||||
(and (listp org-clock-out-when-done)
|
||||
|
@ -1998,7 +2000,8 @@ the currently selected interval size."
|
|||
(encode-time 0 0 0 (+ d n) m y))))
|
||||
((and wp (string-match "w\\|W" wp) mw (> (length wp) 0))
|
||||
(require 'cal-iso)
|
||||
(setq date (calendar-gregorian-from-absolute (calendar-absolute-from-iso (list (+ mw n) 1 y))))
|
||||
(setq date (calendar-gregorian-from-absolute
|
||||
(calendar-absolute-from-iso (list (+ mw n) 1 y))))
|
||||
(setq ins (format-time-string
|
||||
"%G-W%V"
|
||||
(encode-time 0 0 0 (nth 1 date) (car date) (nth 2 date)))))
|
||||
|
@ -2014,7 +2017,8 @@ the currently selected interval size."
|
|||
(setq mw 5
|
||||
y (- y 1))
|
||||
())
|
||||
(setq date (calendar-gregorian-from-absolute (calendar-absolute-from-iso (org-quarter-to-date (+ mw n) y))))
|
||||
(setq date (calendar-gregorian-from-absolute
|
||||
(calendar-absolute-from-iso (org-quarter-to-date (+ mw n) y))))
|
||||
(setq ins (format-time-string
|
||||
(concatenate 'string (number-to-string y) "-Q" (number-to-string (+ mw n)))
|
||||
(encode-time 0 0 0 (nth 1 date) (car date) (nth 2 date)))))
|
||||
|
@ -2050,7 +2054,6 @@ the currently selected interval size."
|
|||
'org-clocktable-write-default))
|
||||
cc range-text ipos pos one-file-with-archives
|
||||
scope-is-list tbls level)
|
||||
|
||||
;; Check if we need to do steps
|
||||
(when block
|
||||
;; Get the range text for the header
|
||||
|
@ -2125,7 +2128,7 @@ the currently selected interval size."
|
|||
"Write out a clock table at position IPOS in the current buffer.
|
||||
TABLES is a list of tables with clocking data as produced by
|
||||
`org-clock-get-table-data'. PARAMS is the parameter property list obtained
|
||||
from the dynamic block definition."
|
||||
from the dynamic block defintion."
|
||||
;; This function looks quite complicated, mainly because there are a
|
||||
;; lot of options which can add or remove columns. I have massively
|
||||
;; commented this function, the I hope it is understandable. If
|
||||
|
@ -2638,6 +2641,5 @@ The details of what will be saved are regulated by the variable
|
|||
|
||||
(provide 'org-clock)
|
||||
|
||||
|
||||
|
||||
;;; org-clock.el ends here
|
||||
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
;;; org-colview.el --- Column View in Org-mode
|
||||
|
||||
;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Carsten Dominik <carsten at orgmode dot org>
|
||||
;; Keywords: outlines, hypermedia, calendar, wp
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
;;
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -187,7 +186,7 @@ This is the compiled version of the format.")
|
|||
(cons "ITEM"
|
||||
;; When in a buffer, get the whole line,
|
||||
;; we'll clean it later…
|
||||
(if (org-mode-p)
|
||||
(if (eq major-mode 'org-mode)
|
||||
(save-match-data
|
||||
(org-no-properties
|
||||
(org-remove-tabs
|
||||
|
@ -209,9 +208,9 @@ This is the compiled version of the format.")
|
|||
(funcall org-columns-modify-value-for-display-function
|
||||
title val))
|
||||
((equal property "ITEM")
|
||||
(if (org-mode-p)
|
||||
(org-columns-cleanup-item
|
||||
val org-columns-current-fmt-compiled)))
|
||||
(org-columns-cleanup-item
|
||||
val org-columns-current-fmt-compiled
|
||||
(or org-complex-heading-regexp cphr)))
|
||||
((and calc (functionp calc)
|
||||
(not (string= val ""))
|
||||
(not (get-text-property 0 'org-computed val)))
|
||||
|
@ -341,24 +340,28 @@ for the duration of the command.")
|
|||
(when (local-variable-p 'org-colview-initial-truncate-line-value)
|
||||
(setq truncate-lines org-colview-initial-truncate-line-value)))))
|
||||
|
||||
(defun org-columns-cleanup-item (item fmt)
|
||||
"Remove from ITEM what is a column in the format FMT."
|
||||
(if (not org-complex-heading-regexp)
|
||||
item
|
||||
(when (string-match org-complex-heading-regexp item)
|
||||
(setq item
|
||||
(concat
|
||||
(org-add-props (match-string 1 item) nil
|
||||
'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)))
|
||||
(and (match-end 5) (not (assoc "TAGS" fmt)) (concat " " (match-string 5 item)))))
|
||||
(add-text-properties
|
||||
0 (1+ (match-end 1))
|
||||
(list 'org-whitespace (* 2 (1- (org-reduced-level (- (match-end 1) (match-beginning 1))))))
|
||||
item)
|
||||
item)))
|
||||
(defun org-columns-cleanup-item (item fmt cphr)
|
||||
"Remove from ITEM what is a column in the format FMT.
|
||||
CPHR is the complex heading regexp to use for parsing ITEM."
|
||||
(let (fixitem)
|
||||
(if (not cphr)
|
||||
item
|
||||
(unless (string-match "^\*+ " item)
|
||||
(setq item (concat "* " item) fixitem t))
|
||||
(if (string-match cphr item)
|
||||
(setq item
|
||||
(concat
|
||||
(org-add-props (match-string 1 item) nil
|
||||
'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)))
|
||||
(and (match-end 5) (not (assoc "TAGS" fmt)) (concat " " (match-string 5 item)))))
|
||||
(add-text-properties
|
||||
0 (1+ (match-end 1))
|
||||
(list 'org-whitespace (* 2 (1- (org-reduced-level (- (match-end 1) (match-beginning 1))))))
|
||||
item))
|
||||
(if fixitem (replace-regexp-in-string "^\*+ " "" item) item))))
|
||||
|
||||
(defun org-columns-compact-links (s)
|
||||
"Replace [[link][desc]] with [desc] or [link]."
|
||||
|
@ -494,7 +497,7 @@ Where possible, use the standard interface for changing this line."
|
|||
(org-columns-eval eval))
|
||||
(org-columns-display-here)))
|
||||
(org-move-to-column col)
|
||||
(if (and (org-mode-p)
|
||||
(if (and (eq major-mode 'org-mode)
|
||||
(nth 3 (assoc key org-columns-current-fmt-compiled)))
|
||||
(org-columns-update key)))))))
|
||||
|
||||
|
@ -544,7 +547,7 @@ Where possible, use the standard interface for changing this line."
|
|||
(beginning-of-line 1)
|
||||
;; `next-line' is needed here, because it skips invisible line.
|
||||
(condition-case nil (org-no-warnings (next-line 1)) (error nil))
|
||||
(setq hidep (org-on-heading-p 1)))
|
||||
(setq hidep (org-at-heading-p 1)))
|
||||
(eval form)
|
||||
(and hidep (hide-entry))))
|
||||
|
||||
|
@ -872,7 +875,7 @@ display, or in the #+COLUMNS line of the current buffer."
|
|||
(replace-match (concat "#+COLUMNS: " fmt) t t))
|
||||
(unless (> cnt 0)
|
||||
(goto-char (point-min))
|
||||
(or (org-on-heading-p t) (outline-next-heading))
|
||||
(or (org-at-heading-p t) (outline-next-heading))
|
||||
(let ((inhibit-read-only t))
|
||||
(insert-before-markers "#+COLUMNS: " fmt "\n")))
|
||||
(org-set-local 'org-columns-default-format fmt))))))
|
||||
|
@ -1000,7 +1003,7 @@ Don't set this, this is meant for dynamic scoping.")
|
|||
(if (marker-position org-columns-begin-marker)
|
||||
(goto-char org-columns-begin-marker))
|
||||
(org-columns-remove-overlays)
|
||||
(if (org-mode-p)
|
||||
(if (eq major-mode 'org-mode)
|
||||
(call-interactively 'org-columns)
|
||||
(org-agenda-redo)
|
||||
(call-interactively 'org-agenda-columns)))
|
||||
|
@ -1139,6 +1142,8 @@ calc function to get values from base elements"
|
|||
|
||||
;;; Dynamic block for Column view
|
||||
|
||||
(defvar org-heading-regexp) ; defined in org.el
|
||||
(defvar org-heading-keyword-regexp-format) ; defined in org.el
|
||||
(defun org-columns-capture-view (&optional maxlevel skip-empty-rows)
|
||||
"Get the column view of the current buffer or subtree.
|
||||
The first optional argument MAXLEVEL sets the level limit. A
|
||||
|
@ -1149,11 +1154,12 @@ containing the title row and all other rows. Each row is a list
|
|||
of fields."
|
||||
(save-excursion
|
||||
(let* ((title (mapcar 'cadr org-columns-current-fmt-compiled))
|
||||
(re-comment (concat "\\*+[ \t]+" org-comment-string "\\>"))
|
||||
(re-comment (format org-heading-keyword-regexp-format
|
||||
org-comment-string))
|
||||
(re-archive (concat ".*:" org-archive-tag ":"))
|
||||
(n (length title)) row tbl)
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward "^\\(\\*+\\) " nil t)
|
||||
(while (re-search-forward org-heading-regexp nil t)
|
||||
(catch 'next
|
||||
(when (and (or (null maxlevel)
|
||||
(>= maxlevel
|
||||
|
@ -1525,6 +1531,4 @@ The string should be two numbers joined with a \"-\"."
|
|||
|
||||
(provide 'org-colview)
|
||||
|
||||
|
||||
|
||||
;;; org-colview.el ends here
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
;;; org-compat.el --- Compatibility code for Org-mode
|
||||
|
||||
;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Carsten Dominik <carsten at orgmode dot org>
|
||||
;; Keywords: outlines, hypermedia, calendar, wp
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
;;
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -252,8 +251,12 @@ Works on both Emacs and XEmacs."
|
|||
(defun org-activate-mark ()
|
||||
(when (mark t)
|
||||
(setq mark-active t)
|
||||
(unless transient-mark-mode
|
||||
(setq transient-mark-mode 'lambda)))))
|
||||
(when (and (boundp 'transient-mark-mode)
|
||||
(not transient-mark-mode))
|
||||
(setq transient-mark-mode 'lambda))
|
||||
(when (boundp 'zmacs-regions)
|
||||
(setq zmacs-regions t)))))
|
||||
|
||||
|
||||
;; Invisibility compatibility
|
||||
|
||||
|
@ -272,7 +275,7 @@ Works on both Emacs and XEmacs."
|
|||
nil))
|
||||
|
||||
(defmacro org-xemacs-without-invisibility (&rest body)
|
||||
"Turn off extents with invisibility while executing BODY."
|
||||
"Turn off exents with invisibility while executing BODY."
|
||||
`(let ((ext-inv (extent-list nil (point-at-bol) (point-at-eol)
|
||||
'all-extents-closed-open 'invisible))
|
||||
ext-inv-specs)
|
||||
|
@ -285,6 +288,7 @@ Works on both Emacs and XEmacs."
|
|||
(dolist (ext-inv-spec ext-inv-specs)
|
||||
(set-extent-property (car ext-inv-spec) 'invisible
|
||||
(cadr ext-inv-spec)))))
|
||||
(def-edebug-spec org-xemacs-without-invisibility (body))
|
||||
|
||||
(defun org-indent-to-column (column &optional minimum buffer)
|
||||
"Work around a bug with extents with invisibility in XEmacs."
|
||||
|
@ -432,8 +436,15 @@ With two arguments, return floor and remainder of their quotient."
|
|||
(let ((q (floor x y)))
|
||||
(list q (- x (if y (* y q) q)))))
|
||||
|
||||
;; `pop-to-buffer-same-window' has been introduced with Emacs 24.1.
|
||||
(defun org-pop-to-buffer-same-window
|
||||
(&optional buffer-or-name norecord label)
|
||||
"Pop to buffer specified by BUFFER-OR-NAME in the selected window."
|
||||
(if (fboundp 'pop-to-buffer-same-window)
|
||||
(funcall
|
||||
'pop-to-buffer-same-window buffer-or-name norecord)
|
||||
(funcall 'switch-to-buffer buffer-or-name norecord)))
|
||||
|
||||
(provide 'org-compat)
|
||||
|
||||
|
||||
|
||||
;;; org-compat.el ends here
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
;; Emacs Lisp Archive Entry
|
||||
;; Filename: org-crypt.el
|
||||
;; Version: 7.7
|
||||
;; Keywords: org-mode
|
||||
;; Author: John Wiegley <johnw@gnu.org>
|
||||
;; Maintainer: Peter Jones <pjones@pmade.com>
|
||||
|
@ -117,6 +116,35 @@ nil : Leave auto-save-mode enabled.
|
|||
(const :tag "Ask" ask)
|
||||
(const :tag "Encrypt" encrypt)))
|
||||
|
||||
(defun org-crypt-check-auto-save ()
|
||||
"Check whether auto-save-mode is enabled for the current buffer.
|
||||
|
||||
`auto-save-mode' may cause leakage when decrypting entries, so
|
||||
check whether it's enabled, and decide what to do about it.
|
||||
|
||||
See `org-crypt-disable-auto-save'."
|
||||
(when buffer-auto-save-file-name
|
||||
(cond
|
||||
((or
|
||||
(eq org-crypt-disable-auto-save t)
|
||||
(and
|
||||
(eq org-crypt-disable-auto-save 'ask)
|
||||
(y-or-n-p "org-decrypt: auto-save-mode may cause leakage. Disable it for current buffer? ")))
|
||||
(message (concat "org-decrypt: Disabling auto-save-mode for " (or (buffer-file-name) (current-buffer))))
|
||||
; The argument to auto-save-mode has to be "-1", since
|
||||
; giving a "nil" argument toggles instead of disabling.
|
||||
(auto-save-mode -1))
|
||||
((eq org-crypt-disable-auto-save nil)
|
||||
(message "org-decrypt: Decrypting entry with auto-save-mode enabled. This may cause leakage."))
|
||||
((eq org-crypt-disable-auto-save 'encrypt)
|
||||
(message "org-decrypt: Enabling re-encryption on auto-save.")
|
||||
(add-hook 'auto-save-hook
|
||||
(lambda ()
|
||||
(message "org-crypt: Re-encrypting all decrypted entries due to auto-save.")
|
||||
(org-encrypt-entries))
|
||||
nil t))
|
||||
(t nil))))
|
||||
|
||||
(defun org-crypt-key-for-heading ()
|
||||
"Return the encryption key for the current heading."
|
||||
(save-excursion
|
||||
|
@ -165,30 +193,6 @@ nil : Leave auto-save-mode enabled.
|
|||
(defun org-decrypt-entry ()
|
||||
"Decrypt the content of the current headline."
|
||||
(interactive)
|
||||
|
||||
; auto-save-mode may cause leakage, so check whether it's enabled.
|
||||
(when buffer-auto-save-file-name
|
||||
(cond
|
||||
((or
|
||||
(eq org-crypt-disable-auto-save t)
|
||||
(and
|
||||
(eq org-crypt-disable-auto-save 'ask)
|
||||
(y-or-n-p "org-decrypt: auto-save-mode may cause leakage. Disable it for current buffer? ")))
|
||||
(message (concat "org-decrypt: Disabling auto-save-mode for " (or (buffer-file-name) (current-buffer))))
|
||||
; The argument to auto-save-mode has to be "-1", since
|
||||
; giving a "nil" argument toggles instead of disabling.
|
||||
(auto-save-mode -1))
|
||||
((eq org-crypt-disable-auto-save nil)
|
||||
(message "org-decrypt: Decrypting entry with auto-save-mode enabled. This may cause leakage."))
|
||||
((eq org-crypt-disable-auto-save 'encrypt)
|
||||
(message "org-decrypt: Enabling re-encryption on auto-save.")
|
||||
(add-hook 'auto-save-hook
|
||||
(lambda ()
|
||||
(message "org-crypt: Re-encrypting all decrypted entries due to auto-save.")
|
||||
(org-encrypt-entries))
|
||||
nil t))
|
||||
(t nil)))
|
||||
|
||||
(require 'epg)
|
||||
(unless (org-before-first-heading-p)
|
||||
(save-excursion
|
||||
|
@ -200,6 +204,7 @@ nil : Leave auto-save-mode enabled.
|
|||
(outline-invisible-p))))
|
||||
(forward-line)
|
||||
(when (looking-at "-----BEGIN PGP MESSAGE-----")
|
||||
(org-crypt-check-auto-save)
|
||||
(let* ((end (save-excursion
|
||||
(search-forward "-----END PGP MESSAGE-----")
|
||||
(forward-line)
|
||||
|
@ -252,6 +257,4 @@ nil : Leave auto-save-mode enabled.
|
|||
|
||||
(provide 'org-crypt)
|
||||
|
||||
|
||||
|
||||
;;; org-crypt.el ends here
|
||||
|
|
|
@ -3,10 +3,9 @@
|
|||
;; Copyright (C) 2007-2011 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Paul Sexton <eeeickythump@gmail.com>
|
||||
;; Version: 7.7
|
||||
|
||||
|
||||
;; Keywords: org, wp
|
||||
;; Version: 7.7
|
||||
;;
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -36,7 +35,7 @@
|
|||
;; links to these 'tagged' destinations, allowing seamless navigation between
|
||||
;; multiple org-mode files. Topics can be created in any org mode file and
|
||||
;; will always be found by plain links from other files. Other file types
|
||||
;; recognized by ctags (source code files, latex files, etc) will also be
|
||||
;; recognised by ctags (source code files, latex files, etc) will also be
|
||||
;; available as destinations for plain links, and similarly, org-mode links
|
||||
;; will be available as tags from source files. Finally, the function
|
||||
;; `org-ctags-find-tag-interactive' lets you choose any known tag, using
|
||||
|
@ -64,19 +63,19 @@
|
|||
;; with the same name as the link; then, if unsuccessful, ask the user if
|
||||
;; he/she wants to rebuild the 'TAGS' database and try again; then ask if
|
||||
;; the user wishes to append 'tag' as a new toplevel heading at the end of
|
||||
;; the buffer; and finally, defer to org's default behavior which is to
|
||||
;; the buffer; and finally, defer to org's default behaviour which is to
|
||||
;; search the entire text of the current buffer for 'tag'.
|
||||
;;
|
||||
;; This behavior can be modified by changing the value of
|
||||
;; This behaviour can be modified by changing the value of
|
||||
;; ORG-CTAGS-OPEN-LINK-FUNCTIONS. For example I have the following in my
|
||||
;; .emacs, which describes the same behavior as the above paragraph with
|
||||
;; .emacs, which describes the same behaviour as the above paragraph with
|
||||
;; one difference:
|
||||
;;
|
||||
;; (setq org-ctags-open-link-functions
|
||||
;; '(org-ctags-find-tag
|
||||
;; org-ctags-ask-rebuild-tags-file-then-find-tag
|
||||
;; org-ctags-ask-append-topic
|
||||
;; org-ctags-fail-silently)) ; <-- prevents org default behavior
|
||||
;; org-ctags-fail-silently)) ; <-- prevents org default behaviour
|
||||
;;
|
||||
;;
|
||||
;; Usage
|
||||
|
@ -140,6 +139,8 @@
|
|||
|
||||
(require 'org)
|
||||
|
||||
(declare-function org-pop-to-buffer-same-window "org-compat" (&optional buffer-or-name norecord label))
|
||||
|
||||
(defgroup org-ctags nil
|
||||
"Options concerning use of ctags within org mode."
|
||||
:tag "Org-Ctags"
|
||||
|
@ -305,7 +306,7 @@ The new topic will be titled NAME (or TITLE if supplied)."
|
|||
activate compile)
|
||||
"Before trying to find a tag, save our current position on org mark ring."
|
||||
(save-excursion
|
||||
(if (and (org-mode-p) org-ctags-enabled-p)
|
||||
(if (and (eq major-mode 'org-mode) org-ctags-enabled-p)
|
||||
(org-mark-ring-push))))
|
||||
|
||||
|
||||
|
@ -385,7 +386,7 @@ the new file."
|
|||
(cond
|
||||
((get-buffer (concat name ".org"))
|
||||
;; Buffer is already open
|
||||
(switch-to-buffer (get-buffer (concat name ".org"))))
|
||||
(org-pop-to-buffer-same-window (get-buffer (concat name ".org"))))
|
||||
((file-exists-p filename)
|
||||
;; File exists but is not open --> open it
|
||||
(message "Opening existing org file `%S'..."
|
||||
|
@ -537,5 +538,4 @@ a new topic."
|
|||
|
||||
(provide 'org-ctags)
|
||||
|
||||
|
||||
;;; org-ctags.el ends here
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Carsten Dominik <carsten at orgmode dot org>
|
||||
;; Keywords: outlines, hypermedia, calendar, wp
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
;;
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -195,6 +194,4 @@ before running this command, even though the command tries to be smart."
|
|||
|
||||
(provide 'org-datetree)
|
||||
|
||||
|
||||
|
||||
;;; org-datetree.el ends here
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
;;
|
||||
;; Emacs Lisp Archive Entry
|
||||
;; Filename: org-docbook.el
|
||||
;; Version: 7.7
|
||||
;; Author: Baoqiu Cui <cbaoqiu AT yahoo DOT com>
|
||||
;; Maintainer: Baoqiu Cui <cbaoqiu AT yahoo DOT com>
|
||||
;; Keywords: org, wp, docbook
|
||||
|
@ -294,7 +293,7 @@ then use this command to convert it."
|
|||
(interactive "r")
|
||||
(let (reg docbook buf)
|
||||
(save-window-excursion
|
||||
(if (org-mode-p)
|
||||
(if (eq major-mode 'org-mode)
|
||||
(setq docbook (org-export-region-as-docbook
|
||||
beg end t 'string))
|
||||
(setq reg (buffer-substring beg end)
|
||||
|
@ -394,6 +393,8 @@ in a window. A non-interactive call will only return the buffer."
|
|||
(org-open-file pdffile)
|
||||
(error "PDF file was not produced"))))
|
||||
|
||||
(defvar org-heading-keyword-regexp-format) ; defined in org.el
|
||||
|
||||
;;;###autoload
|
||||
(defun org-export-as-docbook (&optional hidden ext-plist
|
||||
to-buffer body-only pub-dir)
|
||||
|
@ -475,9 +476,11 @@ publishing directory."
|
|||
(current-dir (if buffer-file-name
|
||||
(file-name-directory buffer-file-name)
|
||||
default-directory))
|
||||
(auto-insert nil); Avoid any auto-insert stuff for the new file
|
||||
(buffer (if to-buffer
|
||||
(cond
|
||||
((eq to-buffer 'string) (get-buffer-create "*Org DocBook Export*"))
|
||||
((eq to-buffer 'string)
|
||||
(get-buffer-create "*Org DocBook Export*"))
|
||||
(t (get-buffer-create to-buffer)))
|
||||
(find-file-noselect filename)))
|
||||
;; org-levels-open is a global variable
|
||||
|
@ -499,8 +502,9 @@ publishing directory."
|
|||
;; We will use HTML table formatter to export tables to DocBook
|
||||
;; format, so need to set html-table-tag here.
|
||||
(html-table-tag (plist-get opt-plist :html-table-tag))
|
||||
(quote-re0 (concat "^[ \t]*" org-quote-string "\\>"))
|
||||
(quote-re (concat "^\\(\\*+\\)\\([ \t]+" org-quote-string "\\>\\)"))
|
||||
(quote-re0 (concat "^ *" org-quote-string "\\( +\\|[ \t]*$\\)"))
|
||||
(quote-re (format org-heading-keyword-regexp-format
|
||||
org-quote-string))
|
||||
(inquote nil)
|
||||
(infixed nil)
|
||||
(inverse nil)
|
||||
|
@ -970,7 +974,7 @@ publishing directory."
|
|||
(push (cons num 1) footref-seen))))))
|
||||
|
||||
(cond
|
||||
((string-match "^\\(\\*+\\)[ \t]+\\(.*\\)" line)
|
||||
((string-match "^\\(\\*+\\)\\(?: +\\(.*?\\)\\)?[ \t]*$" line)
|
||||
;; This is a headline
|
||||
(setq level (org-tr-level (- (match-end 1) (match-beginning 1)
|
||||
level-offset))
|
||||
|
@ -1445,5 +1449,4 @@ the alist of previous items."
|
|||
|
||||
(provide 'org-docbook)
|
||||
|
||||
|
||||
;;; org-docbook.el ends here
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Jan Böcker <jan.boecker at jboecker dot de>
|
||||
;; Keywords: outlines, hypermedia, calendar, wp
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
;;
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -88,6 +87,4 @@ and append it."
|
|||
|
||||
(provide 'org-docview)
|
||||
|
||||
|
||||
|
||||
;;; org-docview.el ends here
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
;; Ulf Stegemann <ulf at zeitform dot de>
|
||||
;; Keywords: outlines, calendar, wp
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
;;
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -568,6 +567,4 @@ Kind can be any of `latex', `html', `ascii', `latin1', or `utf8'."
|
|||
;; coding: utf-8
|
||||
;; End:
|
||||
|
||||
|
||||
|
||||
;;; org-entities.el ends here
|
||||
|
|
64
lisp/org/org-eshell.el
Normal file
64
lisp/org/org-eshell.el
Normal file
|
@ -0,0 +1,64 @@
|
|||
;;; org-eshell.el - Support for links to working directories in eshell
|
||||
;; Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
;;
|
||||
;; Author: Konrad Hinsen <konrad.hinsen AT fastmail.net>
|
||||
;; Version: 0.1
|
||||
;;
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
;; Emacs 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, or (at your option)
|
||||
;; any later version.
|
||||
|
||||
;; GNU Emacs 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; see the file COPYING. If not, write to the
|
||||
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
;; Boston, MA 02110-1301, USA.
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(require 'org)
|
||||
(require 'eshell)
|
||||
(require 'esh-mode)
|
||||
|
||||
(org-add-link-type "eshell" 'org-eshell-open)
|
||||
(add-hook 'org-store-link-functions 'org-eshell-store-link)
|
||||
|
||||
(defun org-eshell-open (link)
|
||||
"Switch to am eshell buffer and execute a command line.
|
||||
The link can be just a command line (executed in the default
|
||||
eshell buffer) or a command line prefixed by a buffer name
|
||||
followed by a colon."
|
||||
(let* ((buffer-and-command
|
||||
(if (string-match "\\([A-Za-z0-9-+*]+\\):\\(.*\\)" link)
|
||||
(list (match-string 1 link)
|
||||
(match-string 2 link))
|
||||
(list eshell-buffer-name link)))
|
||||
(eshell-buffer-name (car buffer-and-command))
|
||||
(command (cadr buffer-and-command)))
|
||||
(if (get-buffer eshell-buffer-name)
|
||||
(org-pop-to-buffer-same-window eshell-buffer-name)
|
||||
(eshell))
|
||||
(end-of-buffer)
|
||||
(eshell-kill-input)
|
||||
(insert command)
|
||||
(eshell-send-input)))
|
||||
|
||||
(defun org-eshell-store-link ()
|
||||
"Store a link that, when opened, switches back to the current eshell buffer
|
||||
and the current working directory."
|
||||
(when (eq major-mode 'eshell-mode)
|
||||
(let* ((command (concat "cd " dired-directory))
|
||||
(link (concat (buffer-name) ":" command)))
|
||||
(org-store-link-props
|
||||
:link (org-make-link "eshell:" link)
|
||||
:description command))))
|
||||
|
||||
(provide 'org-eshell)
|
||||
|
||||
;;; org-eshell.el ends here
|
|
@ -1,9 +1,8 @@
|
|||
;;; org-exp-blocks.el --- pre-process blocks when exporting org files
|
||||
|
||||
;; Copyright (C) 2009-2011 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2009-2011 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Eric Schulte
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -176,10 +175,10 @@ which defaults to the value of `org-export-blocks-witheld'."
|
|||
(setq start (point))
|
||||
(let ((beg-re "^\\([ \t]*\\)#\\+begin_\\(\\S-+\\)[ \t]*\\(.*\\)?[\r\n]"))
|
||||
(while (re-search-forward beg-re nil t)
|
||||
(let* ((match-start (match-beginning 0))
|
||||
(body-start (match-end 0))
|
||||
(let* ((match-start (copy-marker (match-beginning 0)))
|
||||
(body-start (copy-marker (match-end 0)))
|
||||
(indentation (length (match-string 1)))
|
||||
(inner-re (format "[\r\n]*[ \t]*#\\+\\(begin\\|end\\)_%s"
|
||||
(inner-re (format "^[ \t]*#\\+\\(begin\\|end\\)_%s"
|
||||
(regexp-quote (downcase (match-string 2)))))
|
||||
(type (intern (downcase (match-string 2))))
|
||||
(headers (save-match-data
|
||||
|
@ -196,7 +195,7 @@ which defaults to the value of `org-export-blocks-witheld'."
|
|||
(when (not (zerop balanced))
|
||||
(error "unbalanced begin/end_%s blocks with %S"
|
||||
type (buffer-substring match-start (point))))
|
||||
(setq match-end (match-end 0))
|
||||
(setq match-end (copy-marker (match-end 0)))
|
||||
(unless preserve-indent
|
||||
(setq body (save-match-data (org-remove-indentation
|
||||
(buffer-substring
|
||||
|
@ -211,7 +210,11 @@ which defaults to the value of `org-export-blocks-witheld'."
|
|||
(delete-region match-start match-end)
|
||||
(goto-char match-start) (insert replacement)
|
||||
(unless preserve-indent
|
||||
(indent-code-rigidly match-start (point) indentation))))))
|
||||
(indent-code-rigidly match-start (point) indentation)))))
|
||||
;; cleanup markers
|
||||
(set-marker match-start nil)
|
||||
(set-marker body-start nil)
|
||||
(set-marker match-end nil))
|
||||
(setq start (point))))
|
||||
(interblock start (point-max))
|
||||
(run-hooks 'org-export-blocks-postblock-hook)))))
|
||||
|
@ -376,5 +379,4 @@ other backends, it converts the comment into an EXAMPLE segment."
|
|||
|
||||
(provide 'org-exp-blocks)
|
||||
|
||||
|
||||
;;; org-exp-blocks.el ends here
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
;;; org-exp.el --- ASCII, HTML, XOXO and iCalendar export for Org-mode
|
||||
|
||||
;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Carsten Dominik <carsten at orgmode dot org>
|
||||
;; Keywords: outlines, hypermedia, calendar, wp
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
;;
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -47,13 +46,15 @@
|
|||
(declare-function org-inlinetask-remove-END-maybe "org-inlinetask" ())
|
||||
(declare-function org-table-cookie-line-p "org-table" (line))
|
||||
(declare-function org-table-colgroup-line-p "org-table" (line))
|
||||
(declare-function org-pop-to-buffer-same-window "org-compat"
|
||||
(&optional buffer-or-name norecord label))
|
||||
|
||||
(autoload 'org-export-generic "org-export-generic" "Export using the generic exporter" t)
|
||||
|
||||
(autoload 'org-export-as-odt "org-odt"
|
||||
"Export the outline to a OpenDocumentText file." t)
|
||||
"Export the outline to a OpenDocument Text file." t)
|
||||
(autoload 'org-export-as-odt-and-open "org-odt"
|
||||
"Export the outline to a OpenDocumentText file and open it." t)
|
||||
"Export the outline to a OpenDocument Text file and open it." t)
|
||||
|
||||
(defgroup org-export nil
|
||||
"Options for exporting org-listings."
|
||||
|
@ -216,6 +217,11 @@ and in `org-clock-clocktable-language-setup'."
|
|||
:group 'org-export-general
|
||||
:type 'string)
|
||||
|
||||
(defcustom org-export-date-timestamp-format "%Y-%m-%d"
|
||||
"Time string format for Org timestamps in the #+DATE option."
|
||||
:group 'org-export-general
|
||||
:type 'string)
|
||||
|
||||
(defvar org-export-page-description ""
|
||||
"The page description, for the XHTML meta tag.
|
||||
This is best set with the #+DESCRIPTION line in a file, it does not make
|
||||
|
@ -725,6 +731,7 @@ must accept the property list as an argument, and must return the (possibly
|
|||
modified) list.")
|
||||
|
||||
;; FIXME: should we fold case here?
|
||||
|
||||
(defun org-infile-export-plist ()
|
||||
"Return the property list with file-local settings for export."
|
||||
(save-excursion
|
||||
|
@ -736,13 +743,13 @@ modified) list.")
|
|||
'("TITLE" "AUTHOR" "DATE" "EMAIL" "TEXT" "OPTIONS" "LANGUAGE"
|
||||
"MATHJAX"
|
||||
"LINK_UP" "LINK_HOME" "SETUPFILE" "STYLE"
|
||||
"LATEX_HEADER" "LATEX_CLASS"
|
||||
"LATEX_HEADER" "LATEX_CLASS" "LATEX_CLASS_OPTIONS"
|
||||
"EXPORT_SELECT_TAGS" "EXPORT_EXCLUDE_TAGS"
|
||||
"KEYWORDS" "DESCRIPTION" "MACRO" "BIND" "XSLT")
|
||||
(mapcar 'car org-export-inbuffer-options-extra))))
|
||||
(case-fold-search t)
|
||||
p key val text options mathjax a pr style
|
||||
latex-header latex-class macros letbind
|
||||
latex-header latex-class latex-class-options macros letbind
|
||||
ext-setup-or-nil setup-file setup-dir setup-contents (start 0))
|
||||
(while (or (and ext-setup-or-nil
|
||||
(string-match re ext-setup-or-nil start)
|
||||
|
@ -758,7 +765,15 @@ modified) list.")
|
|||
((string-equal key "TITLE") (setq p (plist-put p :title val)))
|
||||
((string-equal key "AUTHOR")(setq p (plist-put p :author val)))
|
||||
((string-equal key "EMAIL") (setq p (plist-put p :email val)))
|
||||
((string-equal key "DATE") (setq p (plist-put p :date val)))
|
||||
((string-equal key "DATE")
|
||||
;; If date is an Org timestamp, convert it to a time
|
||||
;; string using `org-export-date-timestamp-format'
|
||||
(when (string-match org-ts-regexp3 val)
|
||||
(setq val (format-time-string
|
||||
org-export-date-timestamp-format
|
||||
(apply 'encode-time (org-parse-time-string
|
||||
(match-string 0 val))))))
|
||||
(setq p (plist-put p :date val)))
|
||||
((string-equal key "KEYWORDS") (setq p (plist-put p :keywords val)))
|
||||
((string-equal key "DESCRIPTION")
|
||||
(setq p (plist-put p :description val)))
|
||||
|
@ -769,6 +784,8 @@ modified) list.")
|
|||
(setq latex-header (concat latex-header "\n" val)))
|
||||
((string-equal key "LATEX_CLASS")
|
||||
(setq latex-class val))
|
||||
((string-equal key "LATEX_CLASS_OPTIONS")
|
||||
(setq latex-class-options val))
|
||||
((string-equal key "TEXT")
|
||||
(setq text (if text (concat text "\n" val) val)))
|
||||
((string-equal key "OPTIONS")
|
||||
|
@ -812,6 +829,8 @@ modified) list.")
|
|||
(setq p (plist-put p :latex-header-extra (substring latex-header 1))))
|
||||
(when latex-class
|
||||
(setq p (plist-put p :latex-class latex-class)))
|
||||
(when latex-class-options
|
||||
(setq p (plist-put p :latex-class-options latex-class-options)))
|
||||
(when options
|
||||
(setq p (org-export-add-options-to-plist p options)))
|
||||
(when mathjax
|
||||
|
@ -947,7 +966,7 @@ Pressing `1' will switch between these two options."
|
|||
|
||||
\[D] export as DocBook [V] export as DocBook, process to PDF, and open
|
||||
|
||||
\[o] export as OpenDocumentText [O] ... and open
|
||||
\[o] export as OpenDocument Text [O] ... and open
|
||||
|
||||
\[j] export as TaskJuggler [J] ... and open
|
||||
|
||||
|
@ -1011,6 +1030,7 @@ Pressing `1' will switch between these two options."
|
|||
(message "Export buffer: "))
|
||||
((not subtree-p)
|
||||
(setq subtree-p t)
|
||||
(setq bpos (point))
|
||||
(message "Export subtree: "))))
|
||||
(when (eq r1 ?\ )
|
||||
(let ((case-fold-search t)
|
||||
|
@ -1027,7 +1047,7 @@ Pressing `1' will switch between these two options."
|
|||
(setq r1 (read-char-exclusive)))
|
||||
(error "No enclosing node with LaTeX_CLASS or EXPORT_TITLE or EXPORT_FILE_NAME")
|
||||
)))))
|
||||
(redisplay)
|
||||
(if (fboundp 'redisplay) (redisplay)) ;; XEmacs does not have/need (redisplay)
|
||||
(and bpos (goto-char bpos))
|
||||
(setq r2 (if (< r1 27) (+ r1 96) r1))
|
||||
(unless (setq ass (assq r2 cmds))
|
||||
|
@ -1277,6 +1297,9 @@ on this string to produce the exported version."
|
|||
;; Remove #+TBLFM and #+TBLNAME lines
|
||||
(org-export-handle-table-metalines)
|
||||
|
||||
;; Remove #+results and #+name lines
|
||||
(org-export-res/src-name-cleanup)
|
||||
|
||||
;; Run the final hook
|
||||
(run-hooks 'org-export-preprocess-final-hook)
|
||||
|
||||
|
@ -1407,7 +1430,7 @@ the current file."
|
|||
(setq found (condition-case nil (org-link-search link)
|
||||
(error nil)))
|
||||
(when (and found
|
||||
(or (org-on-heading-p)
|
||||
(or (org-at-heading-p)
|
||||
(not (eq found 'dedicated))))
|
||||
(or (get-text-property (point) 'target)
|
||||
(get-text-property
|
||||
|
@ -1438,7 +1461,7 @@ the current file."
|
|||
|
||||
(defvar org-export-format-drawer-function nil
|
||||
"Function to be called to format the contents of a drawer.
|
||||
The function must accept three parameters:
|
||||
The function must accept two parameters:
|
||||
NAME the drawer name, like \"PROPERTIES\"
|
||||
CONTENT the content of the drawer.
|
||||
You can check the export backend through `org-export-current-backend'.
|
||||
|
@ -1518,7 +1541,7 @@ removed as well."
|
|||
(setq beg (point))
|
||||
(put-text-property beg (point-max) :org-delete t)
|
||||
(while (re-search-forward re-sel nil t)
|
||||
(when (org-on-heading-p)
|
||||
(when (org-at-heading-p)
|
||||
(org-back-to-heading)
|
||||
(remove-text-properties
|
||||
(max (1- (point)) (point-min))
|
||||
|
@ -1588,7 +1611,7 @@ from the buffer."
|
|||
(when (not (eq export-archived-trees t))
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward re-archive nil t)
|
||||
(if (not (org-on-heading-p t))
|
||||
(if (not (org-at-heading-p t))
|
||||
(goto-char (point-at-eol))
|
||||
(beginning-of-line 1)
|
||||
(setq a (if export-archived-trees
|
||||
|
@ -1634,9 +1657,11 @@ from the buffer."
|
|||
(org-if-unprotected
|
||||
(replace-match "")))))
|
||||
|
||||
(defvar org-heading-keyword-regexp-format) ; defined in org.el
|
||||
(defun org-export-protect-quoted-subtrees ()
|
||||
"Mark quoted subtrees with the protection property."
|
||||
(let ((org-re-quote (concat "^\\*+[ \t]+" org-quote-string "\\>")))
|
||||
(let ((org-re-quote (format org-heading-keyword-regexp-format
|
||||
org-quote-string)))
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward org-re-quote nil t)
|
||||
(goto-char (match-beginning 0))
|
||||
|
@ -1737,8 +1762,14 @@ from the buffer."
|
|||
(save-excursion
|
||||
(save-match-data
|
||||
(goto-char beg-content)
|
||||
(while (re-search-forward "^[ \t]*\\(,\\)" end-content t)
|
||||
(replace-match "" nil nil nil 1))))
|
||||
(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))))))
|
||||
(delete-region (match-beginning 0) (match-end 0))
|
||||
(save-excursion
|
||||
(goto-char beg)
|
||||
|
@ -1924,7 +1955,8 @@ table line. If it is a link, add it to the line containing the link."
|
|||
|
||||
(defun org-export-remove-comment-blocks-and-subtrees ()
|
||||
"Remove the comment environment, and also commented subtrees."
|
||||
(let ((re-commented (concat "^\\*+[ \t]+" org-comment-string "\\>"))
|
||||
(let ((re-commented (format org-heading-keyword-regexp-format
|
||||
org-comment-string))
|
||||
case-fold-search)
|
||||
;; Remove comment environment
|
||||
(goto-char (point-min))
|
||||
|
@ -1977,6 +2009,18 @@ When it is nil, all comments will be removed."
|
|||
(replace-match "")
|
||||
(goto-char (max (point-min) (1- pos)))))))
|
||||
|
||||
(defun org-export-res/src-name-cleanup ()
|
||||
"Clean up #+results and #+name lines for export.
|
||||
This function should only be called after all block processing
|
||||
has taken place."
|
||||
(interactive)
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(let ((case-fold-search t))
|
||||
(while (org-re-search-forward-unprotected
|
||||
"#\\+\\(name\\|results\\(\\[[a-z0-9]+\\]\\)?\\):" nil t)
|
||||
(delete-region (match-beginning 0) (progn (forward-line) (point)))))))
|
||||
|
||||
(defun org-export-mark-radio-links ()
|
||||
"Find all matches for radio targets and turn them into internal links."
|
||||
(let ((re-radio (and org-target-link-regexp
|
||||
|
@ -1994,23 +2038,28 @@ When it is nil, all comments will be removed."
|
|||
|
||||
(defun org-store-forced-table-alignment ()
|
||||
"Find table lines which force alignment, store the results in properties."
|
||||
(let (line cnt aligns)
|
||||
(let (line cnt cookies)
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward "|[ \t]*<[lrc][0-9]*>[ \t]*|" nil t)
|
||||
(while (re-search-forward "|[ \t]*<\\([lrc]?[0-9]+\\|[lrc]\\)>[ \t]*|"
|
||||
nil t)
|
||||
;; OK, this looks like a table line with an alignment cookie
|
||||
(org-if-unprotected
|
||||
(setq line (buffer-substring (point-at-bol) (point-at-eol)))
|
||||
(when (and (org-at-table-p)
|
||||
(org-table-cookie-line-p line))
|
||||
(setq cnt 0 aligns nil)
|
||||
(setq cnt 0 cookies nil)
|
||||
(mapc
|
||||
(lambda (x)
|
||||
(setq cnt (1+ cnt))
|
||||
(if (string-match "\\`<\\([lrc]\\)" x)
|
||||
(push (cons cnt (downcase (match-string 1 x))) aligns)))
|
||||
(when (string-match "\\`<\\([lrc]\\)?\\([0-9]+\\)?>\\'" x)
|
||||
(let ((align (and (match-end 1)
|
||||
(downcase (match-string 1 x))))
|
||||
(width (and (match-end 2)
|
||||
(string-to-number (match-string 2 x)))))
|
||||
(push (cons cnt (list align width)) cookies))))
|
||||
(org-split-string line "[ \t]*|[ \t]*"))
|
||||
(add-text-properties (org-table-begin) (org-table-end)
|
||||
(list 'org-forced-aligns aligns))))
|
||||
(list 'org-col-cookies cookies))))
|
||||
(goto-char (point-at-eol)))))
|
||||
|
||||
(defun org-export-remove-special-table-lines ()
|
||||
|
@ -2048,10 +2097,11 @@ Also, store forced alignment information found in such lines."
|
|||
(re-angle-link (concat "\\([^[]\\)" org-angle-link-re))
|
||||
nodesc)
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward org-bracket-link-regexp nil t)
|
||||
(put-text-property (match-beginning 0) (match-end 0) 'org-normalized-link t))
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward re-plain-link nil t)
|
||||
(unless (org-string-match-p
|
||||
"\\[\\[\\S-+:\\S-*?\\<"
|
||||
(buffer-substring (point-at-bol) (match-beginning 0)))
|
||||
(unless (get-text-property (match-beginning 0) 'org-normalized-link)
|
||||
(goto-char (1- (match-end 0)))
|
||||
(org-if-unprotected-at (1+ (match-beginning 0))
|
||||
(let* ((s (concat (match-string 1)
|
||||
|
@ -2131,24 +2181,31 @@ can work correctly."
|
|||
(save-excursion (outline-next-heading) (point)))))
|
||||
(when (re-search-forward "^[ \t]*[^|# \t\r\n].*\n" end t)
|
||||
;; Mark the line so that it will not be exported as normal text.
|
||||
(org-unmodified
|
||||
(add-text-properties (match-beginning 0) (match-end 0)
|
||||
(list :org-license-to-kill t)))
|
||||
(unless (org-in-block-p org-list-forbidden-blocks)
|
||||
(org-unmodified
|
||||
(add-text-properties (match-beginning 0) (match-end 0)
|
||||
(list :org-license-to-kill t))))
|
||||
;; Return the title string
|
||||
(org-trim (match-string 0)))))))
|
||||
|
||||
(defun org-export-get-title-from-subtree ()
|
||||
"Return subtree title and exclude it from export."
|
||||
(let ((rbeg (region-beginning)) (rend (region-end))
|
||||
(inhibit-read-only t) title)
|
||||
(inhibit-read-only t)
|
||||
(tags (plist-get (org-infile-export-plist) :tags))
|
||||
title)
|
||||
(save-excursion
|
||||
(goto-char rbeg)
|
||||
(when (and (org-at-heading-p)
|
||||
(>= (org-end-of-subtree t t) rend))
|
||||
(when (plist-member org-export-opt-plist :tags)
|
||||
(setq tags (or (plist-get org-export-opt-plist :tags) tags)))
|
||||
;; This is a subtree, we take the title from the first heading
|
||||
(goto-char rbeg)
|
||||
(looking-at org-todo-line-regexp)
|
||||
(setq title (match-string 3))
|
||||
(looking-at org-todo-line-tags-regexp)
|
||||
(setq title (if (eq tags t)
|
||||
(format "%s\t%s" (match-string 3) (match-string 4))
|
||||
(match-string 3)))
|
||||
(org-unmodified
|
||||
(add-text-properties (point) (1+ (point-at-eol))
|
||||
(list :org-license-to-kill t)))
|
||||
|
@ -2688,11 +2745,11 @@ INDENT was the original indentation of the block."
|
|||
(format "\\begin{%s}\n%s\\end{%s}\n"
|
||||
custom-environment rtn custom-environment))
|
||||
(listings-p
|
||||
(format "\\begin{%s}\n%s\\end{%s}\n"
|
||||
(format "\\begin{%s}\n%s\\end{%s}"
|
||||
"lstlisting" rtn "lstlisting"))
|
||||
(minted-p
|
||||
(format
|
||||
"\\begin{minted}[%s]{%s}\n%s\\end{minted}\n"
|
||||
"\\begin{minted}[%s]{%s}\n%s\\end{minted}"
|
||||
(mapconcat #'make-option-string
|
||||
org-export-latex-minted-options ",")
|
||||
backend-lang rtn)))))))
|
||||
|
@ -2717,13 +2774,60 @@ INDENT was the original indentation of the block."
|
|||
"\n#+BEGIN_" backend-name "\n"
|
||||
(org-add-props rtn
|
||||
'(org-protected t org-example t org-native-text t))
|
||||
"\n#+END_" backend-name "\n\n"))
|
||||
"\n#+END_" backend-name "\n"))
|
||||
(org-add-props rtn nil 'original-indentation indent))))
|
||||
|
||||
(defun org-export-number-lines (text &optional skip1 skip2 number cont
|
||||
replace-labels label-format)
|
||||
replace-labels label-format preprocess)
|
||||
"Apply line numbers to literal examples and handle code references.
|
||||
Handle user-specified options under info node `(org)Literal
|
||||
examples' and return the modified source block.
|
||||
|
||||
TEXT contains the source or example block.
|
||||
|
||||
SKIP1 and SKIP2 are the number of lines that are to be skipped at
|
||||
the beginning and end of TEXT. Use these to skip over
|
||||
backend-specific lines pre-pended or appended to the original
|
||||
source block.
|
||||
|
||||
NUMBER is non-nil if the literal example specifies \"+n\" or
|
||||
\"-n\" switch. If NUMBER is non-nil add line numbers.
|
||||
|
||||
CONT is non-nil if the literal example specifies \"+n\" switch.
|
||||
If CONT is nil, start numbering this block from 1. Otherwise
|
||||
continue numbering from the last numbered block.
|
||||
|
||||
REPLACE-LABELS is dual-purpose.
|
||||
1. It controls the retention of labels in the exported block.
|
||||
2. It specifies in what manner the links (or references) to a
|
||||
labelled line be formatted.
|
||||
|
||||
REPLACE-LABELS is the symbol `keep' if the literal example
|
||||
specifies \"-k\" option, is numeric if the literal example
|
||||
specifies \"-r\" option and is nil otherwise.
|
||||
|
||||
Handle REPLACE-LABELS as below:
|
||||
- If nil, retain labels in the exported block and use
|
||||
user-provided labels for referencing the labelled lines.
|
||||
- If it is a number, remove labels in the exported block and use
|
||||
one of line numbers or labels for referencing labelled lines based
|
||||
on NUMBER option.
|
||||
- If it is a keep, retain labels in the exported block and use
|
||||
one of line numbers or labels for referencing labelled lines
|
||||
based on NUMBER option.
|
||||
|
||||
LABEL-FORMAT is the value of \"-l\" switch associated with
|
||||
literal example. See `org-coderef-label-format'.
|
||||
|
||||
PREPROCESS is intended for backend-agnostic handling of source
|
||||
block numbering. When non-nil do the following:
|
||||
- do not number the lines
|
||||
- always strip the labels from exported block
|
||||
- do not make the labelled line a target of an incoming link.
|
||||
Instead mark the labelled line with `org-coderef' property and
|
||||
store the label in it."
|
||||
(setq skip1 (or skip1 0) skip2 (or skip2 0))
|
||||
(if (not cont) (setq org-export-last-code-line-counter-value 0))
|
||||
(if (and number (not cont)) (setq org-export-last-code-line-counter-value 0))
|
||||
(with-temp-buffer
|
||||
(insert text)
|
||||
(goto-char (point-max))
|
||||
|
@ -2760,9 +2864,10 @@ INDENT was the original indentation of the block."
|
|||
|
||||
(org-goto-line (1+ skip1))
|
||||
(while (and (re-search-forward "^" nil t) (not (eobp)) (< n nmax))
|
||||
(if number
|
||||
(insert (format fm (incf n)))
|
||||
(forward-char 1))
|
||||
(when number (incf n))
|
||||
(if (or preprocess (not number))
|
||||
(forward-char 1)
|
||||
(insert (format fm n)))
|
||||
(when (looking-at lbl-re)
|
||||
(setq ref (match-string 3))
|
||||
(cond ((numberp replace-labels)
|
||||
|
@ -2775,7 +2880,8 @@ INDENT was the original indentation of the block."
|
|||
;; lines are numbered, use labels otherwise
|
||||
(goto-char (match-beginning 2))
|
||||
(delete-region (match-beginning 2) (match-end 2))
|
||||
(insert "(" ref ")")
|
||||
(unless preprocess
|
||||
(insert "(" ref ")"))
|
||||
(push (cons ref (if (> n 0) n (concat "(" ref ")")))
|
||||
org-export-code-refs))
|
||||
(t
|
||||
|
@ -2783,15 +2889,19 @@ INDENT was the original indentation of the block."
|
|||
;; references
|
||||
(goto-char (match-beginning 2))
|
||||
(delete-region (match-beginning 2) (match-end 2))
|
||||
(insert "(" ref ")")
|
||||
(unless preprocess
|
||||
(insert "(" ref ")"))
|
||||
(push (cons ref (concat "(" ref ")")) org-export-code-refs)))
|
||||
(when (eq org-export-current-backend 'html)
|
||||
(when (and (eq org-export-current-backend 'html) (not preprocess))
|
||||
(save-excursion
|
||||
(beginning-of-line 1)
|
||||
(insert (format "<span id=\"coderef-%s\" class=\"coderef-off\">"
|
||||
ref))
|
||||
(end-of-line 1)
|
||||
(insert "</span>")))))
|
||||
(insert "</span>")))
|
||||
(when preprocess
|
||||
(add-text-properties
|
||||
(point-at-bol) (point-at-eol) (list 'org-coderef ref)))))
|
||||
(setq org-export-last-code-line-counter-value n)
|
||||
(goto-char (point-max))
|
||||
(newline)
|
||||
|
@ -2893,17 +3003,6 @@ command."
|
|||
(switch-to-buffer-other-window buffer)
|
||||
(goto-char (point-min)))))
|
||||
|
||||
(defun org-find-visible ()
|
||||
(let ((s (point)))
|
||||
(while (and (not (= (point-max) (setq s (next-overlay-change s))))
|
||||
(get-char-property s 'invisible)))
|
||||
s))
|
||||
(defun org-find-invisible ()
|
||||
(let ((s (point)))
|
||||
(while (and (not (= (point-max) (setq s (next-overlay-change s))))
|
||||
(not (get-char-property s 'invisible))))
|
||||
s))
|
||||
|
||||
(defvar org-export-htmlized-org-css-url) ;; defined in org-html.el
|
||||
|
||||
(defun org-export-string (string fmt &optional dir)
|
||||
|
@ -2922,7 +3021,7 @@ to the value of `temporary-file-directory'."
|
|||
(org-load-modules-maybe)
|
||||
(unless org-local-vars
|
||||
(setq org-local-vars (org-get-local-variables)))
|
||||
(eval ;; convert to fmt -- mimicking `org-run-like-in-org-mode'
|
||||
(eval ;; convert to fmt -- mimicing `org-run-like-in-org-mode'
|
||||
(list 'let org-local-vars
|
||||
(list (intern (format "org-export-as-%s" fmt))
|
||||
nil nil nil ''string t))))
|
||||
|
@ -2972,7 +3071,7 @@ directory."
|
|||
(region (buffer-string))
|
||||
str-ret)
|
||||
(save-excursion
|
||||
(switch-to-buffer buffer)
|
||||
(org-pop-to-buffer-same-window buffer)
|
||||
(erase-buffer)
|
||||
(insert region)
|
||||
(let ((org-inhibit-startup t)) (org-mode))
|
||||
|
@ -3218,7 +3317,7 @@ If yes remove the column and the special lines."
|
|||
|
||||
(defun org-export-push-to-kill-ring (format)
|
||||
"Push buffer content to kill ring.
|
||||
The depends on the variable `org-export-copy-to-kill'."
|
||||
The depends on the variable `org-export-copy-to-kill-ring'."
|
||||
(when org-export-copy-to-kill-ring
|
||||
(org-kill-new (buffer-string))
|
||||
(when (fboundp 'x-set-selection)
|
||||
|
@ -3228,6 +3327,4 @@ The depends on the variable `org-export-copy-to-kill'."
|
|||
|
||||
(provide 'org-exp)
|
||||
|
||||
|
||||
|
||||
;;; org-exp.el ends here
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
;;; org-faces.el --- Face definitions for Org-mode.
|
||||
|
||||
;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Carsten Dominik <carsten at orgmode dot org>
|
||||
;; Keywords: outlines, hypermedia, calendar, wp
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
;;
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -673,6 +672,18 @@ month and 365.24 days for a year)."
|
|||
"Face for showing the agenda restriction lock."
|
||||
:group 'org-faces)
|
||||
|
||||
(defface org-agenda-filter-tags
|
||||
(org-compatible-face 'modeline
|
||||
nil)
|
||||
"Face for tag(s) in the mode-line when filtering the agenda."
|
||||
:group 'org-faces)
|
||||
|
||||
(defface org-agenda-filter-category
|
||||
(org-compatible-face 'modeline
|
||||
nil)
|
||||
"Face for tag(s) in the mode-line when filtering the agenda."
|
||||
:group 'org-faces)
|
||||
|
||||
(defface org-time-grid ;; originally copied from font-lock-variable-name-face
|
||||
(org-compatible-face nil
|
||||
'((((class color) (min-colors 16) (background light)) (:foreground "DarkGoldenrod"))
|
||||
|
@ -690,6 +701,18 @@ month and 365.24 days for a year)."
|
|||
"Face used for agenda entries that come from the Emacs diary."
|
||||
:group 'org-faces)
|
||||
|
||||
(defface org-agenda-calendar-event
|
||||
(org-compatible-face 'default
|
||||
nil)
|
||||
"Face used to show events and appointments in the agenda."
|
||||
:group 'org-faces)
|
||||
|
||||
(defface org-agenda-calendar-sexp
|
||||
(org-compatible-face 'default
|
||||
nil)
|
||||
"Face used to show events computed from a S-expression."
|
||||
:group 'org-faces)
|
||||
|
||||
(defconst org-level-faces
|
||||
'(org-level-1 org-level-2 org-level-3 org-level-4
|
||||
org-level-5 org-level-6 org-level-7 org-level-8
|
||||
|
@ -735,6 +758,4 @@ level org-n-level-faces"
|
|||
|
||||
(provide 'org-faces)
|
||||
|
||||
|
||||
|
||||
;;; org-faces.el ends here
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Carsten Dominik <carsten at orgmode dot org>
|
||||
;; Keywords: outlines, hypermedia, calendar, wp
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
;;
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -436,7 +435,7 @@ it can be a list structured like an entry in `org-feed-alist'."
|
|||
(if (stringp feed) (setq feed (assoc feed org-feed-alist)))
|
||||
(unless feed
|
||||
(error "No such feed in `org-feed-alist"))
|
||||
(switch-to-buffer
|
||||
(org-pop-to-buffer-same-window
|
||||
(org-feed-update feed 'retrieve-only))
|
||||
(goto-char (point-min)))
|
||||
|
||||
|
@ -674,5 +673,4 @@ formatted as a string, not the original XML data."
|
|||
|
||||
(provide 'org-feed)
|
||||
|
||||
|
||||
;;; org-feed.el ends here
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Carsten Dominik <carsten at orgmode dot org>
|
||||
;; Keywords: outlines, hypermedia, calendar, wp
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
;;
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -38,28 +37,33 @@
|
|||
(require 'org-macs)
|
||||
(require 'org-compat)
|
||||
|
||||
(declare-function message-point-in-header-p "message" ())
|
||||
(declare-function org-back-over-empty-lines "org" ())
|
||||
(declare-function org-back-to-heading "org" (&optional invisible-ok))
|
||||
(declare-function org-combine-plists "org" (&rest plists))
|
||||
(declare-function org-end-of-subtree "org" (&optional invisible-ok to-heading))
|
||||
(declare-function org-export-preprocess-string "org-exp"
|
||||
(string &rest parameters))
|
||||
(declare-function org-fill-paragraph "org" (&optional justify))
|
||||
(declare-function org-icompleting-read "org" (&rest args))
|
||||
(declare-function org-id-uuid "org-id" ())
|
||||
(declare-function org-in-block-p "org" (names))
|
||||
(declare-function org-in-commented-line "org" ())
|
||||
(declare-function org-in-indented-comment-line "org" ())
|
||||
(declare-function org-in-regexp "org" (re &optional nlines visually))
|
||||
(declare-function org-in-block-p "org" (names))
|
||||
(declare-function org-mark-ring-push "org" (&optional pos buffer))
|
||||
(declare-function outline-next-heading "outline")
|
||||
(declare-function org-trim "org" (s))
|
||||
(declare-function org-show-context "org" (&optional key))
|
||||
(declare-function org-back-to-heading "org" (&optional invisible-ok))
|
||||
(declare-function org-end-of-subtree "org" (&optional invisible-ok to-heading))
|
||||
(declare-function org-in-verbatim-emphasis "org" ())
|
||||
(declare-function org-inside-LaTeX-fragment-p "org" ())
|
||||
(declare-function org-inside-latex-macro-p "org" ())
|
||||
(declare-function org-id-uuid "org" ())
|
||||
(declare-function org-fill-paragraph "org" (&optional justify))
|
||||
(declare-function org-export-preprocess-string "org-exp"
|
||||
(string &rest parameters))
|
||||
(declare-function org-mark-ring-push "org" (&optional pos buffer))
|
||||
(declare-function org-show-context "org" (&optional key))
|
||||
(declare-function org-trim "org" (s))
|
||||
(declare-function outline-next-heading "outline")
|
||||
|
||||
(defvar org-outline-regexp-bol) ; defined in org.el
|
||||
(defvar org-odd-levels-only) ;; defined in org.el
|
||||
(defvar org-bracket-link-regexp) ; defined in org.el
|
||||
(defvar message-signature-separator) ;; defined in message.el
|
||||
(defvar org-outline-regexp-bol) ; defined in org.el
|
||||
(defvar org-odd-levels-only) ; defined in org.el
|
||||
(defvar org-bracket-link-regexp) ; defined in org.el
|
||||
(defvar message-cite-prefix-regexp) ; defined in message.el
|
||||
(defvar message-signature-separator) ; defined in message.el
|
||||
|
||||
(defconst org-footnote-re
|
||||
;; Only [1]-like footnotes are closed in this regexp, as footnotes
|
||||
|
@ -67,17 +71,17 @@
|
|||
;; their definition.
|
||||
;;
|
||||
;; `org-re' is used for regexp compatibility with XEmacs.
|
||||
(org-re (concat "\\[\\(?:"
|
||||
;; Match inline footnotes.
|
||||
"fn:\\([-_[:word:]]+\\)?:\\|"
|
||||
;; Match other footnotes.
|
||||
"\\(?:\\([0-9]+\\)\\]\\)\\|"
|
||||
"\\(fn:[-_[:word:]]+\\)"
|
||||
"\\)"))
|
||||
(concat "\\[\\(?:"
|
||||
;; Match inline footnotes.
|
||||
(org-re "fn:\\([-_[:word:]]+\\)?:\\|")
|
||||
;; Match other footnotes.
|
||||
"\\(?:\\([0-9]+\\)\\]\\)\\|"
|
||||
(org-re "\\(fn:[-_[:word:]]+\\)")
|
||||
"\\)")
|
||||
"Regular expression for matching footnotes.")
|
||||
|
||||
(defconst org-footnote-definition-re
|
||||
(org-re "^\\(\\[\\([0-9]+\\|fn:[-_[:word:]]+\\)\\]\\)")
|
||||
(org-re "^\\[\\([0-9]+\\|fn:[-_[:word:]]+\\)\\]")
|
||||
"Regular expression matching the definition of a footnote.")
|
||||
|
||||
(defvar org-footnote-forbidden-blocks '("example" "verse" "src" "ascii" "beamer"
|
||||
|
@ -106,13 +110,17 @@ heading will be removed after extracting footnote definitions."
|
|||
|
||||
(defcustom org-footnote-tag-for-non-org-mode-files "Footnotes:"
|
||||
"Tag marking the beginning of footnote section.
|
||||
The Org-mode footnote engine can be used in arbitrary text files as well
|
||||
as in Org-mode. Outside Org-mode, new footnotes are always placed at
|
||||
The Org footnote engine can be used in arbitrary text files as well
|
||||
as in Org-mode. Outside Org mode, new footnotes are always placed at
|
||||
the end of the file. When you normalize the notes, any line containing
|
||||
only this tag will be removed, a new one will be inserted at the end
|
||||
of the file, followed by the collected and normalized footnotes."
|
||||
of the file, followed by the collected and normalized footnotes.
|
||||
|
||||
If you don't want any tag in such buffers, set this variable to nil."
|
||||
:group 'org-footnote
|
||||
:type 'string)
|
||||
:type '(choice
|
||||
(string :tag "Collect footnotes under tag")
|
||||
(const :tag "Don't use a tag" nil)))
|
||||
|
||||
(defcustom org-footnote-define-inline nil
|
||||
"Non-nil means define footnotes inline, at reference location.
|
||||
|
@ -171,8 +179,11 @@ extracted will be filled again."
|
|||
(save-match-data
|
||||
(not (or (org-in-commented-line)
|
||||
(org-in-indented-comment-line)
|
||||
(org-in-verbatim-emphasis)
|
||||
(org-inside-LaTeX-fragment-p)
|
||||
;; Avoid protected environments (LaTeX export)
|
||||
(get-text-property (point) 'org-protected)
|
||||
;; Avoid literal example.
|
||||
(org-in-verbatim-emphasis)
|
||||
(save-excursion
|
||||
(beginning-of-line)
|
||||
(looking-at "[ \t]*:[ \t]+"))
|
||||
|
@ -194,13 +205,13 @@ positions, and the definition, when inlined."
|
|||
(or (looking-at org-footnote-re)
|
||||
(org-in-regexp org-footnote-re)
|
||||
(save-excursion (re-search-backward org-footnote-re nil t)))
|
||||
;; Only inline footnotes can start at bol.
|
||||
(or (eq (char-before (match-end 0)) 58)
|
||||
(/= (match-beginning 0) (point-at-bol))))
|
||||
(/= (match-beginning 0) (point-at-bol)))
|
||||
(let* ((beg (match-beginning 0))
|
||||
(label (or (match-string 2) (match-string 3)
|
||||
(label (or (org-match-string-no-properties 2)
|
||||
(org-match-string-no-properties 3)
|
||||
;; Anonymous footnotes don't have labels
|
||||
(and (match-string 1) (concat "fn:" (match-string 1)))))
|
||||
(and (match-string 1)
|
||||
(concat "fn:" (org-match-string-no-properties 1)))))
|
||||
;; Inline footnotes don't end at (match-end 0) as
|
||||
;; `org-footnote-re' stops just after the second colon.
|
||||
;; Find the real ending with `scan-sexps', so Org doesn't
|
||||
|
@ -223,12 +234,12 @@ positions, and the definition, when inlined."
|
|||
;; optional argument of the command. Thus, check
|
||||
;; the `org-protected' property of that command.
|
||||
(or (not (org-inside-latex-macro-p))
|
||||
(and (get-text-property (1- beg) 'org-protected)
|
||||
(not (get-text-property beg 'org-protected)))))
|
||||
(get-text-property (1- beg) 'org-protected)))
|
||||
(list label beg end
|
||||
;; Definition: ensure this is an inline footnote first.
|
||||
(and (or (not label) (match-string 1))
|
||||
(org-trim (buffer-substring (match-end 0) (1- end)))))))))
|
||||
(org-trim (buffer-substring-no-properties
|
||||
(match-end 0) (1- end)))))))))
|
||||
|
||||
(defun org-footnote-at-definition-p ()
|
||||
"Is the cursor at a footnote definition?
|
||||
|
@ -239,7 +250,7 @@ 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."
|
||||
(when (org-footnote-in-valid-context-p)
|
||||
(when (save-excursion (beginning-of-line) (org-footnote-in-valid-context-p))
|
||||
(save-excursion
|
||||
(end-of-line)
|
||||
(let ((lim (save-excursion (re-search-backward
|
||||
|
@ -247,7 +258,7 @@ label, start, end and definition of the footnote otherwise."
|
|||
"\\|^[ \t]*$") nil t))))
|
||||
(when (re-search-backward org-footnote-definition-re lim t)
|
||||
(end-of-line)
|
||||
(list (match-string 2)
|
||||
(list (org-match-string-no-properties 1)
|
||||
(match-beginning 0)
|
||||
(save-match-data
|
||||
;; In a message, limit search to signature.
|
||||
|
@ -257,15 +268,14 @@ label, start, end and definition of the footnote otherwise."
|
|||
(re-search-backward
|
||||
message-signature-separator nil t)))))
|
||||
(or (and (re-search-forward
|
||||
(org-re
|
||||
(concat "^[ \t]*$" "\\|"
|
||||
org-outline-regexp-bol
|
||||
"\\|"
|
||||
"^\\[\\([0-9]+\\|fn:[-_[:word:]]+\\)\\]"))
|
||||
(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 (match-end 0) (point)))))))))
|
||||
(org-trim (buffer-substring-no-properties
|
||||
(match-end 0) (point)))))))))
|
||||
|
||||
(defun org-footnote-get-next-reference (&optional label backward limit)
|
||||
"Return complete reference of the next footnote.
|
||||
|
@ -295,10 +305,11 @@ LIMIT is the buffer position bounding the search.
|
|||
Return value is a list like those provided by
|
||||
`org-footnote-at-reference-p' or `org-footnote-at-definition-p'.
|
||||
If no footnote is found, return nil."
|
||||
(let* (ref)
|
||||
(let* (ref (origin (point)))
|
||||
(catch 'exit
|
||||
(while t
|
||||
(unless (re-search-forward org-footnote-re limit t)
|
||||
(goto-char origin)
|
||||
(throw 'exit nil))
|
||||
;; Beware: with [1]-like footnotes point will be just after
|
||||
;; the closing square bracket.
|
||||
|
@ -320,19 +331,21 @@ If no footnote is found, return nil."
|
|||
(re (format "^\\[%s\\]\\|.\\[%s:" label label))
|
||||
pos)
|
||||
(save-excursion
|
||||
(when (or (re-search-forward re nil t)
|
||||
(and (goto-char (point-min))
|
||||
(re-search-forward re nil t))
|
||||
(and (progn (widen) t)
|
||||
(goto-char (point-min))
|
||||
(re-search-forward re nil t)))
|
||||
(let ((refp (org-footnote-at-reference-p)))
|
||||
(cond
|
||||
((and (nth 3 refp) refp))
|
||||
((org-footnote-at-definition-p))))))))
|
||||
(save-restriction
|
||||
(when (or (re-search-forward re nil t)
|
||||
(and (goto-char (point-min))
|
||||
(re-search-forward re nil t))
|
||||
(and (progn (widen) t)
|
||||
(goto-char (point-min))
|
||||
(re-search-forward re nil t)))
|
||||
(let ((refp (org-footnote-at-reference-p)))
|
||||
(cond
|
||||
((and (nth 3 refp) refp))
|
||||
((org-footnote-at-definition-p)))))))))
|
||||
|
||||
(defun org-footnote-goto-definition (label)
|
||||
"Move point to the definition of the footnote LABEL."
|
||||
"Move point to the definition of the footnote LABEL.
|
||||
Return a non-nil value when a definition has been found."
|
||||
(interactive "sLabel: ")
|
||||
(org-mark-ring-push)
|
||||
(let ((def (org-footnote-get-definition label)))
|
||||
|
@ -342,7 +355,9 @@ If no footnote is found, return nil."
|
|||
(looking-at (format "\\[%s\\]\\|\\[%s:" label label))
|
||||
(goto-char (match-end 0))
|
||||
(org-show-context 'link-search)
|
||||
(message "Edit definition and go back with `C-c &' or, if unique, with `C-c C-c'."))))
|
||||
(when (eq major-mode 'org-mode)
|
||||
(message "Edit definition and go back with `C-c &' or, if unique, with `C-c C-c'."))
|
||||
t)))
|
||||
|
||||
(defun org-footnote-goto-previous-reference (label)
|
||||
"Find the first closest (to point) reference of footnote with label LABEL."
|
||||
|
@ -406,7 +421,12 @@ and value definition."
|
|||
|
||||
(defun org-footnote-unique-label (&optional current)
|
||||
"Return a new unique footnote label.
|
||||
The returns the firsts fn:N labels that is currently not used."
|
||||
|
||||
The function returns the first \"fn:N\" or \"N\" label that is
|
||||
currently not used.
|
||||
|
||||
Optional argument CURRENT is the list of labels active in the
|
||||
buffer."
|
||||
(unless current (setq current (org-footnote-all-labels)))
|
||||
(let ((fmt (if (eq org-footnote-auto-label 'plain) "%d" "fn:%d"))
|
||||
(cnt 1))
|
||||
|
@ -414,21 +434,17 @@ The returns the firsts fn:N labels that is currently not used."
|
|||
(incf cnt))
|
||||
(format fmt cnt)))
|
||||
|
||||
(defvar org-footnote-label-history nil
|
||||
"History of footnote labels entered in current buffer.")
|
||||
(make-variable-buffer-local 'org-footnote-label-history)
|
||||
|
||||
(defun org-footnote-new ()
|
||||
"Insert a new footnote.
|
||||
This command prompts for a label. If this is a label referencing an
|
||||
existing label, only insert the label. If the footnote label is empty
|
||||
or new, let the user edit the definition of the footnote."
|
||||
(interactive)
|
||||
(unless (and (not (bolp)) (org-footnote-in-valid-context-p))
|
||||
(unless (org-footnote-in-valid-context-p)
|
||||
(error "Cannot insert a footnote here"))
|
||||
(let* ((labels (and (not (equal org-footnote-auto-label 'random))
|
||||
(org-footnote-all-labels)))
|
||||
(propose (org-footnote-unique-label labels))
|
||||
(let* ((lbls (and (not (equal org-footnote-auto-label 'random))
|
||||
(org-footnote-all-labels)))
|
||||
(propose (org-footnote-unique-label lbls))
|
||||
(label
|
||||
(org-footnote-normalize-label
|
||||
(cond
|
||||
|
@ -438,16 +454,16 @@ or new, let the user edit the definition of the footnote."
|
|||
(require 'org-id)
|
||||
(substring (org-id-uuid) 0 8))
|
||||
(t
|
||||
(completing-read
|
||||
(org-icompleting-read
|
||||
"Label (leave empty for anonymous): "
|
||||
(mapcar 'list labels) nil nil
|
||||
(if (eq org-footnote-auto-label 'confirm) propose nil)
|
||||
'org-footnote-label-history))))))
|
||||
(mapcar 'list lbls) nil nil
|
||||
(if (eq org-footnote-auto-label 'confirm) propose nil)))))))
|
||||
(cond
|
||||
((bolp) (error "Cannot create a footnote reference at left margin"))
|
||||
((not label)
|
||||
(insert "[fn:: ]")
|
||||
(backward-char 1))
|
||||
((member label labels)
|
||||
((member label lbls)
|
||||
(insert "[" label "]")
|
||||
(message "New reference to existing note"))
|
||||
(org-footnote-define-inline
|
||||
|
@ -459,51 +475,78 @@ or new, let the user edit the definition of the footnote."
|
|||
(org-footnote-create-definition label)
|
||||
(org-footnote-auto-adjust-maybe)))))
|
||||
|
||||
(defvar org-blank-before-new-entry nil) ; silence byte-compiler
|
||||
(defun org-footnote-create-definition (label)
|
||||
"Start the definition of a footnote with label LABEL."
|
||||
(interactive "sLabel: ")
|
||||
(let ((label (org-footnote-normalize-label label)))
|
||||
(cond
|
||||
((org-mode-p)
|
||||
;; No section, put footnote into the current outline node Try to
|
||||
;; find or make the special node
|
||||
;; In an Org file.
|
||||
((eq major-mode 'org-mode)
|
||||
;; If `org-footnote-section' is defined, find it, or create it
|
||||
;; at the end of the buffer.
|
||||
(when org-footnote-section
|
||||
(goto-char (point-min))
|
||||
(let ((re (concat "^\\*+[ \t]+" org-footnote-section "[ \t]*$")))
|
||||
(unless (or (re-search-forward re nil t)
|
||||
(and (progn (widen) t)
|
||||
(re-search-forward re nil t)))
|
||||
(goto-char (point-max))
|
||||
(insert "\n\n* " org-footnote-section "\n"))))
|
||||
;; Now go to the end of this entry and insert there.
|
||||
(goto-char (point-max))
|
||||
(skip-chars-backward " \t\r\n")
|
||||
(unless (bolp) (newline))
|
||||
;; Insert new section. Separate it from the previous one
|
||||
;; with a blank line, unless `org-blank-before-new-entry'
|
||||
;; explicitly says no.
|
||||
(when (and (cdr (assq 'heading org-blank-before-new-entry))
|
||||
(zerop (save-excursion (org-back-over-empty-lines))))
|
||||
(insert "\n"))
|
||||
(insert "* " org-footnote-section "\n"))))
|
||||
;; Move to the end of this entry (which may be
|
||||
;; `org-footnote-section' or the current one).
|
||||
(org-footnote-goto-local-insertion-point)
|
||||
(org-show-context 'link-search))
|
||||
(t
|
||||
;; In a non-Org file. Search for footnote tag, or create it if
|
||||
;; necessary (at the end of buffer, or before a signature if in
|
||||
;; specified (at the end of buffer, or before signature if in
|
||||
;; Message mode). Set point after any definition already there.
|
||||
(let ((tag (concat "^" org-footnote-tag-for-non-org-mode-files "[ \t]*$"))
|
||||
(max (save-excursion
|
||||
(if (and (derived-mode-p 'message-mode)
|
||||
(re-search-forward
|
||||
message-signature-separator nil t))
|
||||
(copy-marker (point-at-bol) t)
|
||||
(copy-marker (point-max) t)))))
|
||||
(let ((tag (and org-footnote-tag-for-non-org-mode-files
|
||||
(concat "^" (regexp-quote
|
||||
org-footnote-tag-for-non-org-mode-files)
|
||||
"[ \t]*$")))
|
||||
(max (if (and (derived-mode-p 'message-mode)
|
||||
(goto-char (point-max))
|
||||
(re-search-backward
|
||||
message-signature-separator nil t))
|
||||
(progn
|
||||
;; Ensure one blank line separates last
|
||||
;; footnote from signature.
|
||||
(beginning-of-line)
|
||||
(open-line 2)
|
||||
(point-marker))
|
||||
(point-max-marker))))
|
||||
(set-marker-insertion-type max t)
|
||||
(goto-char max)
|
||||
(unless (re-search-backward tag nil t)
|
||||
;; Check if the footnote tag is defined but missing. In this
|
||||
;; case, insert it, before any footnote or one blank line
|
||||
;; after any previous text.
|
||||
(when (and tag (not (re-search-backward tag nil t)))
|
||||
(skip-chars-backward " \t\r\n")
|
||||
(delete-region (point) max)
|
||||
(insert "\n\n" org-footnote-tag-for-non-org-mode-files "\n"))
|
||||
;; Skip existing footnotes.
|
||||
(while (re-search-forward org-footnote-definition-re max t))
|
||||
(let ((def (org-footnote-at-definition-p)))
|
||||
(when def (goto-char (nth 2 def))))
|
||||
(while (re-search-backward org-footnote-definition-re nil t))
|
||||
(unless (bolp) (newline 2))
|
||||
(insert org-footnote-tag-for-non-org-mode-files "\n\n"))
|
||||
;; Remove superfluous white space and clear marker.
|
||||
(goto-char max)
|
||||
(skip-chars-backward " \t\r\n")
|
||||
(delete-region (point) max)
|
||||
(unless (bolp) (newline))
|
||||
(set-marker max nil))))
|
||||
;; Insert footnote label, position point and notify user.
|
||||
(unless (bolp) (insert "\n"))
|
||||
(insert "\n[" label "] \n")
|
||||
(backward-char)
|
||||
(message "Edit definition and go back with `C-c &' or, if unique, with `C-c C-c'.")))
|
||||
;; Insert footnote label.
|
||||
(insert "\n[" label "] ")
|
||||
;; 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)
|
||||
(message
|
||||
"Edit definition and go back with `C-c &' or, if unique, with `C-c C-c'."))))
|
||||
|
||||
;;;###autoload
|
||||
(defun org-footnote-action (&optional special)
|
||||
|
@ -570,11 +613,11 @@ If Org is amidst an export process, EXPORT-PROPS will hold the
|
|||
export properties of the buffer.
|
||||
|
||||
When EXPORT-PROPS is non-nil, the default action is to insert
|
||||
normalized footnotes towards the end of the pre-processing buffer.
|
||||
Some exporters like docbook, odt, etc. expect that footnote
|
||||
definitions be available before any references to them. Such
|
||||
exporters can let bind `org-footnote-insert-pos-for-preprocessor' to
|
||||
symbol 'point-min to achieve the desired behavior.
|
||||
normalized footnotes towards the end of the pre-processing
|
||||
buffer. Some exporters (docbook, odt...) expect footnote
|
||||
definitions to be available before any references to them. Such
|
||||
exporters can let bind `org-footnote-insert-pos-for-preprocessor'
|
||||
to symbol `point-min' to achieve the desired behaviour.
|
||||
|
||||
Additional note on `org-footnote-insert-pos-for-preprocessor':
|
||||
1. This variable has not effect when FOR-PREPROCESSOR is nil.
|
||||
|
@ -634,8 +677,8 @@ Additional note on `org-footnote-insert-pos-for-preprocessor':
|
|||
(and inlinep
|
||||
org-footnote-fill-after-inline-note-extraction
|
||||
(org-fill-paragraph)))
|
||||
;; Add label (REF), identifier (MARKER) and definition (DEF)
|
||||
;; to REF-TABLE if data was unknown.
|
||||
;; Add label (REF), identifier (MARKER), definition (DEF)
|
||||
;; and type (INLINEP) to REF-TABLE if data was unknown.
|
||||
(unless a
|
||||
(let ((def (or (nth 3 ref) ; inline
|
||||
(and export-props
|
||||
|
@ -646,52 +689,52 @@ Additional note on `org-footnote-insert-pos-for-preprocessor':
|
|||
;; through `org-export-preprocess-string' so
|
||||
;; it is ready to insert in the
|
||||
;; backend-specific buffer.
|
||||
(if export-props
|
||||
(if (and export-props def)
|
||||
(let ((parameters
|
||||
(org-combine-plists
|
||||
export-props
|
||||
'(:todo-keywords t :tags t :priority t))))
|
||||
(org-export-preprocess-string def parameters))
|
||||
def)
|
||||
inlinep) ref-table)))
|
||||
;; Remove definition of non-inlined footnotes.
|
||||
(unless inlinep (org-footnote-delete-definitions lbl))))
|
||||
inlinep) 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
|
||||
((org-mode-p)
|
||||
(if (and org-footnote-section
|
||||
(re-search-forward
|
||||
(concat "^\\*[ \t]+" (regexp-quote org-footnote-section)
|
||||
"[ \t]*$")
|
||||
nil t))
|
||||
(progn
|
||||
(setq ins-point (match-beginning 0))
|
||||
(delete-region (match-beginning 0) (org-end-of-subtree t)))
|
||||
(setq ins-point (point-max))))
|
||||
((and org-footnote-section
|
||||
(eq major-mode 'org-mode)
|
||||
(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)
|
||||
(goto-char (point-max))
|
||||
(unless (bolp) (newline)))
|
||||
(t
|
||||
(when (re-search-forward
|
||||
(concat "^"
|
||||
(regexp-quote org-footnote-tag-for-non-org-mode-files)
|
||||
"[ \t]*$")
|
||||
nil t)
|
||||
(replace-match ""))
|
||||
;; In message-mode, ensure footnotes are inserted before the
|
||||
;; 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]*$")))
|
||||
(while (re-search-forward tag nil t)
|
||||
(replace-match "")
|
||||
(delete-region (point) (progn (forward-line) (point))))))
|
||||
;; In Message mode, ensure footnotes are inserted before the
|
||||
;; signature.
|
||||
(let ((pt-max
|
||||
(or (and (derived-mode-p 'message-mode)
|
||||
(save-excursion
|
||||
(goto-char (point-max))
|
||||
(re-search-backward
|
||||
message-signature-separator nil t)
|
||||
(1- (point))))
|
||||
(point-max))))
|
||||
(goto-char pt-max)
|
||||
(skip-chars-backward " \t\n\r")
|
||||
(forward-line)
|
||||
(delete-region (point) pt-max))
|
||||
(setq ins-point (point))))
|
||||
(if (and (derived-mode-p 'message-mode)
|
||||
(goto-char (point-max))
|
||||
(re-search-backward message-signature-separator nil t))
|
||||
(beginning-of-line)
|
||||
(goto-char (point-max)))))
|
||||
;; During export, `org-footnote-insert-pos-for-preprocessor' has
|
||||
;; precedence over previously found position.
|
||||
(setq ins-point
|
||||
(copy-marker
|
||||
(if (and export-props
|
||||
(eq org-footnote-insert-pos-for-preprocessor 'point-min))
|
||||
(point-min)
|
||||
(point))))
|
||||
;; 3. Clean-up REF-TABLE.
|
||||
(setq ref-table
|
||||
(delq nil
|
||||
|
@ -708,34 +751,48 @@ Additional note on `org-footnote-insert-pos-for-preprocessor':
|
|||
(t x)))
|
||||
ref-table)))
|
||||
(setq ref-table (nreverse ref-table))
|
||||
;; 4. Insert the footnotes again in the buffer, at the
|
||||
;; 4. Remove left-over definitions in the buffer.
|
||||
(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.
|
||||
(goto-char (or
|
||||
(and export-props
|
||||
(eq org-footnote-insert-pos-for-preprocessor 'point-min)
|
||||
(point-min))
|
||||
ins-point
|
||||
(point-max)))
|
||||
(goto-char ins-point)
|
||||
(cond
|
||||
;; No footnote: exit.
|
||||
((not ref-table))
|
||||
;; Cases when footnotes should be inserted in one place.
|
||||
((or (not (org-mode-p))
|
||||
((or (not (eq major-mode 'org-mode))
|
||||
org-footnote-section
|
||||
(not sort-only))
|
||||
;; Insert again the section title.
|
||||
;; 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,
|
||||
;; separate section with a blank line, unless explicitly
|
||||
;; stated in `org-blank-before-new-entry'.
|
||||
(cond
|
||||
((not (org-mode-p))
|
||||
(insert "\n\n" org-footnote-tag-for-non-org-mode-files "\n"))
|
||||
((not (eq major-mode 'org-mode))
|
||||
(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))
|
||||
(or (bolp) (insert "\n"))
|
||||
(when (and (cdr (assq 'heading org-blank-before-new-entry))
|
||||
(zerop (save-excursion (org-back-over-empty-lines))))
|
||||
(insert "\n"))
|
||||
(insert "* " org-footnote-section "\n")))
|
||||
;; Insert the footnotes.
|
||||
(insert "\n"
|
||||
(mapconcat (lambda (x) (format "[%s] %s"
|
||||
(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\n")
|
||||
"\n\n")
|
||||
ref-table "\n"))
|
||||
(unless (eobp) (insert "\n"))
|
||||
;; When exporting, add newly inserted markers along with their
|
||||
;; associated definition to `org-export-footnotes-seen'.
|
||||
(when export-props
|
||||
|
@ -831,20 +888,21 @@ If LABEL is non-nil, delete that footnote instead."
|
|||
(defun org-footnote-renumber-fn:N ()
|
||||
"Renumber the simple footnotes like fn:17 into a sequence in the document."
|
||||
(interactive)
|
||||
(let (map i (n 0))
|
||||
(save-excursion
|
||||
(save-restriction
|
||||
(widen)
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward "\\[fn:\\([0-9]+\\)[]:]" nil t)
|
||||
(setq i (string-to-number (match-string 1)))
|
||||
(when (and (string-match "\\S-" (buffer-substring
|
||||
(point-at-bol) (match-beginning 0)))
|
||||
(not (assq i map)))
|
||||
(push (cons i (number-to-string (incf n))) map)))
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward "\\(\\[fn:\\)\\([0-9]+\\)\\([]:]\\)" nil t)
|
||||
(replace-match (concat "\\1" (cdr (assq (string-to-number (match-string 2)) map)) "\\3")))))))
|
||||
(let (map (n 0))
|
||||
(org-with-wide-buffer
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward "\\[fn:\\([0-9]+\\)[]:]" nil t)
|
||||
(save-excursion
|
||||
(goto-char (match-beginning 0))
|
||||
;; Ensure match is a footnote reference or definition.
|
||||
(when (save-match-data (if (bolp)
|
||||
(org-footnote-at-definition-p)
|
||||
(org-footnote-at-reference-p)))
|
||||
(let ((new-val (or (cdr (assoc (match-string 1) map))
|
||||
(number-to-string (incf n)))))
|
||||
(unless (assoc (match-string 1) map)
|
||||
(push (cons (match-string 1) new-val) map))
|
||||
(replace-match new-val nil nil nil 1))))))))
|
||||
|
||||
(defun org-footnote-auto-adjust-maybe ()
|
||||
"Renumber and/or sort footnotes according to user settings."
|
||||
|
@ -862,6 +920,4 @@ If LABEL is non-nil, delete that footnote instead."
|
|||
|
||||
(provide 'org-footnote)
|
||||
|
||||
|
||||
|
||||
;;; org-footnote.el ends here
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Lennart Borgman (lennart O borgman A gmail O com)
|
||||
;; Keywords: outlines, hypermedia, calendar, wp
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
;;
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -1220,4 +1219,5 @@ PATH should be a list of steps, where each step has the form
|
|||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;;; org-freemind.el ends here
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
;;; org-gnus.el --- Support for links to Gnus groups and messages from within Org-mode
|
||||
|
||||
;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Carsten Dominik <carsten at orgmode dot org>
|
||||
;; Tassilo Horn <tassilo at member dot fsf dot org>
|
||||
;; Keywords: outlines, hypermedia, calendar, wp
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
;;
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -291,5 +290,4 @@ If `org-store-link' was called with a prefix arg the meaning of
|
|||
(provide 'org-gnus)
|
||||
|
||||
|
||||
|
||||
;;; org-gnus.el ends here
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: John Wiegley <johnw at gnu dot org>
|
||||
;; Keywords: outlines, hypermedia, calendar, wp
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
;;
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -68,6 +67,16 @@ relative to the current effective date."
|
|||
:group 'org-habit
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom org-habit-today-glyph ?!
|
||||
"Glyph character used to identify today."
|
||||
:group 'org-habit
|
||||
:type 'character)
|
||||
|
||||
(defcustom org-habit-completed-glyph ?*
|
||||
"Glyph character used to show completed days on which a task was done."
|
||||
:group 'org-habit
|
||||
:type 'character)
|
||||
|
||||
(defface org-habit-clear-face
|
||||
'((((background light)) (:background "#8270f9"))
|
||||
(((background dark)) (:background "blue")))
|
||||
|
@ -297,7 +306,7 @@ current time."
|
|||
(days-to-time
|
||||
(- start (time-to-days starting))))))
|
||||
|
||||
(aset graph index ?*)
|
||||
(aset graph index org-habit-completed-glyph)
|
||||
(setq markedp t)
|
||||
(put-text-property
|
||||
index (1+ index) 'help-echo
|
||||
|
@ -307,7 +316,7 @@ current time."
|
|||
(setq last-done-date (car done-dates)
|
||||
done-dates (cdr done-dates))))
|
||||
(if todayp
|
||||
(aset graph index ?!)))
|
||||
(aset graph index org-habit-today-glyph)))
|
||||
(setq face (if (or in-the-past-p todayp)
|
||||
(car faces)
|
||||
(cdr faces)))
|
||||
|
@ -358,6 +367,4 @@ current time."
|
|||
|
||||
(provide 'org-habit)
|
||||
|
||||
|
||||
|
||||
;;; org-habit.el ends here
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
;;; org-html.el --- HTML export for Org-mode
|
||||
|
||||
;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Carsten Dominik <carsten at orgmode dot org>
|
||||
;; Keywords: outlines, hypermedia, calendar, wp
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
;;
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -34,6 +33,8 @@
|
|||
|
||||
(declare-function org-id-find-id-file "org-id" (id))
|
||||
(declare-function htmlize-region "ext:htmlize" (beg end))
|
||||
(declare-function org-pop-to-buffer-same-window
|
||||
"org-compat" (&optional buffer-or-name norecord label))
|
||||
|
||||
(defgroup org-export-html nil
|
||||
"Options specific for HTML export of Org-mode files."
|
||||
|
@ -155,6 +156,12 @@ not be modified."
|
|||
dt { font-weight: bold; }
|
||||
div.figure { padding: 0.5em; }
|
||||
div.figure p { text-align: center; }
|
||||
div.inlinetask {
|
||||
padding:10px;
|
||||
border:2px solid gray;
|
||||
margin:10px;
|
||||
background: #ffffcc;
|
||||
}
|
||||
textarea { overflow-x: auto; }
|
||||
.linenr { font-size:smaller }
|
||||
.code-highlighted {background-color:#ffff00;}
|
||||
|
@ -348,6 +355,14 @@ CSS classes, then this prefix can be very useful."
|
|||
:group 'org-export-html
|
||||
:type 'string)
|
||||
|
||||
(defcustom org-export-html-headline-anchor-format "<a name=\"%s\" id=\"%s\"></a>"
|
||||
"Format for anchors in HTML headlines.
|
||||
It requires to %s: both will be replaced by the anchor referring
|
||||
to the headline (e.g. \"sec-2\"). When set to `nil', don't insert
|
||||
HTML anchors in headlines."
|
||||
:group 'org-export-html
|
||||
:type 'string)
|
||||
|
||||
(defcustom org-export-html-preamble t
|
||||
"Non-nil means insert a preamble in HTML export.
|
||||
|
||||
|
@ -355,8 +370,8 @@ When `t', insert a string as defined by one of the formatting
|
|||
strings in `org-export-html-preamble-format'. When set to a
|
||||
string, this string overrides `org-export-html-preamble-format'.
|
||||
When set to a function, apply this function and insert the
|
||||
returned string. The function takes the property list of export
|
||||
options as its only argument.
|
||||
returned string. The function takes no argument, but you can
|
||||
use `opt-plist' to access the current export options.
|
||||
|
||||
Setting :html-preamble in publishing projects will take
|
||||
precedence over this variable."
|
||||
|
@ -388,8 +403,8 @@ string overrides `org-export-html-postamble-format'. When set to
|
|||
'auto, discard `org-export-html-postamble-format' and honor
|
||||
`org-export-author/email/creator-info' variables. When set to a
|
||||
function, apply this function and insert the returned string.
|
||||
The function takes the property list of export options as its
|
||||
only argument.
|
||||
The function takes no argument, but you can use `opt-plist' to
|
||||
access the current export options.
|
||||
|
||||
Setting :html-postamble in publishing projects will take
|
||||
precedence over this variable."
|
||||
|
@ -619,7 +634,10 @@ This variable is obsolete since Org version 7.7.
|
|||
Please set `org-export-html-divs' instead.")
|
||||
|
||||
(defcustom org-export-html-divs '("preamble" "content" "postamble")
|
||||
"The name of the main divs for HTML export."
|
||||
"The name of the main divs for HTML export.
|
||||
This is a list of three strings, the first one for the preamble
|
||||
DIV, the second one for the content DIV and the third one for the
|
||||
postamble DIV."
|
||||
:group 'org-export-html
|
||||
:type '(list
|
||||
(string :tag " Div for the preamble:")
|
||||
|
@ -703,7 +721,7 @@ command to convert it."
|
|||
(interactive "r")
|
||||
(let (reg html buf pop-up-frames)
|
||||
(save-window-excursion
|
||||
(if (org-mode-p)
|
||||
(if (eq major-mode 'org-mode)
|
||||
(setq html (org-export-region-as-html
|
||||
beg end t 'string))
|
||||
(setq reg (buffer-substring beg end)
|
||||
|
@ -801,11 +819,11 @@ description. See variables `org-export-html-inline-images' and
|
|||
may-inline-p)
|
||||
"Make an HTML link.
|
||||
OPT-PLIST is an options list.
|
||||
TYPE is the device-type of the link (THIS://foo.html)
|
||||
PATH is the path of the link (http://THIS#locationx)
|
||||
FRAGMENT is the fragment part of the link, if any (foo.html#THIS)
|
||||
TYPE is the device-type of the link (THIS://foo.html).
|
||||
PATH is the path of the link (http://THIS#location).
|
||||
FRAGMENT is the fragment part of the link, if any (foo.html#THIS).
|
||||
DESC is the link description, if any.
|
||||
ATTR is a string of other attributes of the a element.
|
||||
ATTR is a string of other attributes of the \"a\" element.
|
||||
MAY-INLINE-P allows inlining it as an image."
|
||||
|
||||
(declare (special org-par-open))
|
||||
|
@ -896,7 +914,7 @@ OPT-PLIST is the export options list."
|
|||
(string-match "^\\.\\.?/" path)))
|
||||
"file")
|
||||
(t "internal")))
|
||||
(setq path (org-extract-attributes (org-link-unescape path)))
|
||||
(setq path (org-extract-attributes path))
|
||||
(setq attr (get-text-property 0 'org-attributes path))
|
||||
(setq desc1 (if (match-end 5) (match-string 5 line))
|
||||
desc2 (if (match-end 2) (concat type ":" path) path)
|
||||
|
@ -909,7 +927,7 @@ OPT-PLIST is the export options list."
|
|||
(if (string-match "^file:" desc)
|
||||
(setq desc (substring desc (match-end 0)))))
|
||||
(setq desc (org-add-props
|
||||
(concat "<img src=\"" desc "\" alt=\""
|
||||
(concat "<img src=\"" desc "\" alt=\""
|
||||
(file-name-nondirectory desc) "\"/>")
|
||||
'(org-protected t))))
|
||||
(cond
|
||||
|
@ -1036,14 +1054,17 @@ OPT-PLIST is the export options list."
|
|||
|
||||
(t
|
||||
;; just publish the path, as default
|
||||
(setq rpl (concat "@<i><" type ":"
|
||||
(setq rpl (concat "<i><" type ":"
|
||||
(save-match-data (org-link-unescape path))
|
||||
">@</i>"))))
|
||||
"></i>"))))
|
||||
(setq line (replace-match rpl t t line)
|
||||
start (+ start (length rpl))))
|
||||
line))
|
||||
|
||||
;;; org-export-as-html
|
||||
|
||||
(defvar org-heading-keyword-regexp-format) ; defined in org.el
|
||||
|
||||
;;;###autoload
|
||||
(defun org-export-as-html (arg &optional hidden ext-plist
|
||||
to-buffer body-only pub-dir)
|
||||
|
@ -1137,14 +1158,15 @@ PUB-DIR is set, use this as the publishing directory."
|
|||
(current-dir (if buffer-file-name
|
||||
(file-name-directory buffer-file-name)
|
||||
default-directory))
|
||||
(auto-insert nil); Avoid any auto-insert stuff for the new file
|
||||
(buffer (if to-buffer
|
||||
(cond
|
||||
((eq to-buffer 'string) (get-buffer-create "*Org HTML Export*"))
|
||||
(t (get-buffer-create to-buffer)))
|
||||
(find-file-noselect filename)))
|
||||
(org-levels-open (make-vector org-level-max nil))
|
||||
(date (plist-get opt-plist :date))
|
||||
(author (plist-get opt-plist :author))
|
||||
(date (org-html-expand (plist-get opt-plist :date)))
|
||||
(author (org-html-expand (plist-get opt-plist :author)))
|
||||
(html-validation-link (or org-export-html-validation-link ""))
|
||||
(title (org-html-expand
|
||||
(or (and subtree-p (org-export-get-title-from-subtree))
|
||||
|
@ -1165,15 +1187,16 @@ PUB-DIR is set, use this as the publishing directory."
|
|||
(plist-get opt-plist :link-home)))
|
||||
(dummy (setq opt-plist (plist-put opt-plist :title title)))
|
||||
(html-table-tag (plist-get opt-plist :html-table-tag))
|
||||
(quote-re0 (concat "^[ \t]*" org-quote-string "\\>"))
|
||||
(quote-re (concat "^\\(\\*+\\)\\([ \t]+" org-quote-string "\\>\\)"))
|
||||
(quote-re0 (concat "^ *" org-quote-string "\\( +\\|[ \t]*$\\)"))
|
||||
(quote-re (format org-heading-keyword-regexp-format
|
||||
org-quote-string))
|
||||
(inquote nil)
|
||||
(infixed nil)
|
||||
(inverse nil)
|
||||
(email (plist-get opt-plist :email))
|
||||
(language (plist-get opt-plist :language))
|
||||
(keywords (plist-get opt-plist :keywords))
|
||||
(description (plist-get opt-plist :description))
|
||||
(keywords (org-html-expand (plist-get opt-plist :keywords)))
|
||||
(description (org-html-expand (plist-get opt-plist :description)))
|
||||
(num (plist-get opt-plist :section-numbers))
|
||||
(lang-words nil)
|
||||
(head-count 0) cnt
|
||||
|
@ -1287,11 +1310,11 @@ PUB-DIR is set, use this as the publishing directory."
|
|||
"%s
|
||||
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
|
||||
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">
|
||||
<html xmlns=\"http://www.w3.org/1999/xhtml\"
|
||||
lang=\"%s\" xml:lang=\"%s\">
|
||||
<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"%s\" xml:lang=\"%s\">
|
||||
<head>
|
||||
<title>%s</title>
|
||||
<meta http-equiv=\"Content-Type\" content=\"text/html;charset=%s\"/>
|
||||
<meta name=\"title\" content=\"%s\"/>
|
||||
<meta name=\"generator\" content=\"Org-mode\"/>
|
||||
<meta name=\"generated\" content=\"%s\"/>
|
||||
<meta name=\"author\" content=\"%s\"/>
|
||||
|
@ -1314,7 +1337,7 @@ lang=\"%s\" xml:lang=\"%s\">
|
|||
language language
|
||||
title
|
||||
(or charset "iso-8859-1")
|
||||
date author description keywords
|
||||
title date author description keywords
|
||||
style
|
||||
mathjax
|
||||
(if (or link-up link-home)
|
||||
|
@ -1327,28 +1350,35 @@ lang=\"%s\" xml:lang=\"%s\">
|
|||
|
||||
;; insert html preamble
|
||||
(when (plist-get opt-plist :html-preamble)
|
||||
(let ((html-pre (plist-get opt-plist :html-preamble)))
|
||||
(insert "<div id=\"" (nth 0 org-export-html-divs) "\">\n")
|
||||
(let ((html-pre (plist-get opt-plist :html-preamble))
|
||||
html-pre-real-contents)
|
||||
(cond ((stringp html-pre)
|
||||
(insert
|
||||
(format-spec html-pre `((?t . ,title) (?a . ,author)
|
||||
(?d . ,date) (?e . ,email)))))
|
||||
(setq html-pre-real-contents
|
||||
(format-spec html-pre `((?t . ,title) (?a . ,author)
|
||||
(?d . ,date) (?e . ,email)))))
|
||||
((functionp html-pre)
|
||||
(funcall html-pre))
|
||||
(insert "<div id=\"" (nth 0 org-export-html-divs) "\">\n")
|
||||
(if (stringp (funcall html-pre)) (insert (funcall html-pre)))
|
||||
(insert "\n</div>\n"))
|
||||
(t
|
||||
(insert
|
||||
(setq html-pre-real-contents
|
||||
(format-spec
|
||||
(or (cadr (assoc (nth 0 lang-words)
|
||||
org-export-html-preamble-format))
|
||||
(cadr (assoc "en" org-export-html-preamble-format)))
|
||||
`((?t . ,title) (?a . ,author)
|
||||
(?d . ,date) (?e . ,email))))))
|
||||
(insert "\n</div>\n")))
|
||||
;; don't output an empty preamble DIV
|
||||
(unless (and (functionp html-pre)
|
||||
(equal html-pre-real-contents ""))
|
||||
(insert "<div id=\"" (nth 0 org-export-html-divs) "\">\n")
|
||||
(insert html-pre-real-contents)
|
||||
(insert "\n</div>\n"))))
|
||||
|
||||
;; begin wrap around body
|
||||
(insert (format "\n<div id=\"%s\">"
|
||||
(insert (format "\n<div id=\"%s\">"
|
||||
;; FIXME org-export-html-content-div is obsolete since 7.7
|
||||
(or org-export-html-content-div
|
||||
(or org-export-html-content-div
|
||||
(nth 1 org-export-html-divs)))
|
||||
;; FIXME this should go in the preamble but is here so
|
||||
;; that org-infojs can still find it
|
||||
|
@ -1365,7 +1395,7 @@ lang=\"%s\" xml:lang=\"%s\">
|
|||
(push "<div id=\"text-table-of-contents\">\n" thetoc)
|
||||
(push "<ul>\n<li>" thetoc)
|
||||
(setq lines
|
||||
(mapcar
|
||||
(mapcar
|
||||
#'(lambda (line)
|
||||
(if (and (string-match org-todo-line-regexp line)
|
||||
(not (get-text-property 0 'org-protected line)))
|
||||
|
@ -1391,7 +1421,7 @@ lang=\"%s\" xml:lang=\"%s\">
|
|||
line lines level))))
|
||||
(if (string-match
|
||||
(org-re "[ \t]+:\\([[:alnum:]_@:]+\\):[ \t]*$") txt)
|
||||
(setq txt (replace-match
|
||||
(setq txt (replace-match
|
||||
" <span class=\"tag\"> \\1</span>" t nil txt)))
|
||||
(if (string-match quote-re0 txt)
|
||||
(setq txt (replace-match "" t t txt)))
|
||||
|
@ -1419,7 +1449,7 @@ lang=\"%s\" xml:lang=\"%s\">
|
|||
;; Check for targets
|
||||
(while (string-match org-any-target-regexp line)
|
||||
(setq line (replace-match
|
||||
(concat "@<span class=\"target\">"
|
||||
(concat "@<span class=\"target\">"
|
||||
(match-string 1 line) "@</span> ")
|
||||
t t line)))
|
||||
(while (string-match "<\\(<\\)+\\|>\\(>\\)+" txt)
|
||||
|
@ -1427,8 +1457,8 @@ lang=\"%s\" xml:lang=\"%s\">
|
|||
(setq href
|
||||
(replace-regexp-in-string
|
||||
"\\." "-" (format "sec-%s" snumber)))
|
||||
(setq href (org-solidify-link-text
|
||||
(or (cdr (assoc href
|
||||
(setq href (org-solidify-link-text
|
||||
(or (cdr (assoc href
|
||||
org-export-preferred-target-alist)) href)))
|
||||
(push
|
||||
(format
|
||||
|
@ -1436,7 +1466,7 @@ lang=\"%s\" xml:lang=\"%s\">
|
|||
"</li>\n<li><a href=\"#%s\"><span class=\"todo\">%s</span></a>"
|
||||
"</li>\n<li><a href=\"#%s\">%s</a>")
|
||||
href txt) thetoc)
|
||||
|
||||
|
||||
(setq org-last-level level)))))
|
||||
line)
|
||||
lines))
|
||||
|
@ -1445,15 +1475,15 @@ lang=\"%s\" xml:lang=\"%s\">
|
|||
(push "</li>\n</ul>\n" thetoc))
|
||||
(push "</div>\n" thetoc)
|
||||
(setq thetoc (if have-headings (nreverse thetoc) nil))))
|
||||
|
||||
|
||||
(setq head-count 0)
|
||||
(org-init-section-numbers)
|
||||
|
||||
|
||||
(org-open-par)
|
||||
|
||||
|
||||
(while (setq line (pop lines) origline line)
|
||||
(catch 'nextline
|
||||
|
||||
|
||||
;; end of quote section?
|
||||
(when (and inquote (string-match org-outline-regexp-bol line))
|
||||
(insert "</pre>\n")
|
||||
|
@ -1588,7 +1618,8 @@ lang=\"%s\" xml:lang=\"%s\">
|
|||
(setq line (org-html-handle-links line opt-plist))
|
||||
|
||||
;; TODO items
|
||||
(if (and (string-match org-todo-line-regexp line)
|
||||
(if (and org-todo-line-regexp
|
||||
(string-match org-todo-line-regexp line)
|
||||
(match-beginning 2))
|
||||
|
||||
(setq line
|
||||
|
@ -1597,9 +1628,9 @@ lang=\"%s\" xml:lang=\"%s\">
|
|||
(if (member (match-string 2 line)
|
||||
org-done-keywords)
|
||||
"done" "todo")
|
||||
" " (match-string 2 line)
|
||||
"\"> " (org-export-html-get-todo-kwd-class-name
|
||||
(match-string 2 line))
|
||||
" " (org-export-html-get-todo-kwd-class-name
|
||||
(match-string 2 line))
|
||||
"\"> " (match-string 2 line)
|
||||
"</span>" (substring line (match-end 2)))))
|
||||
|
||||
;; Does this contain a reference to a footnote?
|
||||
|
@ -1636,7 +1667,7 @@ lang=\"%s\" xml:lang=\"%s\">
|
|||
t t line))))))
|
||||
|
||||
(cond
|
||||
((string-match "^\\(\\*+\\)[ \t]+\\(.*\\)" line)
|
||||
((string-match "^\\(\\*+\\)\\(?: +\\(.*?\\)\\)?[ \t]*$" line)
|
||||
;; This is a headline
|
||||
(setq level (org-tr-level (- (match-end 1) (match-beginning 1)
|
||||
level-offset))
|
||||
|
@ -1785,7 +1816,7 @@ lang=\"%s\" xml:lang=\"%s\">
|
|||
(?d . ,date) (?c . ,creator-info)
|
||||
(?v . ,html-validation-link)))))
|
||||
((functionp html-post)
|
||||
(funcall html-post))
|
||||
(if (stringp (funcall html-post)) (insert (funcall html-post))))
|
||||
((eq html-post 'auto)
|
||||
;; fall back on default postamble
|
||||
(when (plist-get opt-plist :time-stamp-file)
|
||||
|
@ -1808,7 +1839,7 @@ lang=\"%s\" xml:lang=\"%s\">
|
|||
(?d . ,date) (?c . ,creator-info)
|
||||
(?v . ,html-validation-link))))))
|
||||
(insert "\n</div>"))))
|
||||
|
||||
|
||||
;; FIXME `org-export-html-with-timestamp' has been declared
|
||||
;; obsolete since Org 7.7 -- don't forget to remove this.
|
||||
(if org-export-html-with-timestamp
|
||||
|
@ -1941,7 +1972,7 @@ NO-CSS is passed to the exporter."
|
|||
(if (string-match "^[ \t]*|" (car lines))
|
||||
;; A normal org table
|
||||
(org-format-org-table-html lines nil no-css)
|
||||
;; Table made by table.el
|
||||
;; Table made by table.el
|
||||
(or (org-format-table-table-html-using-table-generate-source
|
||||
olines (not org-export-prefer-native-exporter-for-tables))
|
||||
;; We are here only when table.el table has NO col or row
|
||||
|
@ -1969,8 +2000,8 @@ for formatting. This is required for the DocBook exporter."
|
|||
|
||||
(let* ((caption (org-find-text-property-in-string 'org-caption (car lines)))
|
||||
(label (org-find-text-property-in-string 'org-label (car lines)))
|
||||
(forced-aligns (org-find-text-property-in-string 'org-forced-aligns
|
||||
(car lines)))
|
||||
(col-cookies (org-find-text-property-in-string 'org-col-cookies
|
||||
(car lines)))
|
||||
(attributes (org-find-text-property-in-string 'org-attributes
|
||||
(car lines)))
|
||||
(html-table-tag (org-export-splice-attributes
|
||||
|
@ -1983,9 +2014,9 @@ for formatting. This is required for the DocBook exporter."
|
|||
tbopen line fields html gr colgropen rowstart rowend
|
||||
ali align aligns n)
|
||||
(setq caption (and caption (org-html-do-expand caption)))
|
||||
(when (and forced-aligns org-table-clean-did-remove-column)
|
||||
(setq forced-aligns
|
||||
(mapcar (lambda (x) (cons (1- (car x)) (cdr x))) forced-aligns)))
|
||||
(when (and col-cookies org-table-clean-did-remove-column)
|
||||
(setq col-cookies
|
||||
(mapcar (lambda (x) (cons (1- (car x)) (cdr x))) col-cookies)))
|
||||
(if splice (setq head nil))
|
||||
(unless splice (push (if head "<thead>" "<tbody>") html))
|
||||
(setq tbopen t)
|
||||
|
@ -2046,8 +2077,8 @@ for formatting. This is required for the DocBook exporter."
|
|||
(lambda (x)
|
||||
(setq gr (pop org-table-colgroup-info)
|
||||
i (1+ i)
|
||||
align (if (assoc i forced-aligns)
|
||||
(cdr (assoc (cdr (assoc i forced-aligns))
|
||||
align (if (nth 1 (assoc i col-cookies))
|
||||
(cdr (assoc (nth 1 (assoc i col-cookies))
|
||||
'(("l" . "left") ("r" . "right")
|
||||
("c" . "center"))))
|
||||
(if (> (/ (float x) nline)
|
||||
|
@ -2203,19 +2234,20 @@ for further information."
|
|||
"Format time stamps in string S, or remove them."
|
||||
(catch 'exit
|
||||
(let (r b)
|
||||
(while (string-match org-maybe-keyword-time-regexp s)
|
||||
(or b (setq b (substring s 0 (match-beginning 0))))
|
||||
(setq r (concat
|
||||
r (substring s 0 (match-beginning 0))
|
||||
" @<span class=\"timestamp-wrapper\">"
|
||||
(if (match-end 1)
|
||||
(format "@<span class=\"timestamp-kwd\">%s @</span>"
|
||||
(match-string 1 s)))
|
||||
(format " @<span class=\"timestamp\">%s@</span>"
|
||||
(substring
|
||||
(org-translate-time (match-string 3 s)) 1 -1))
|
||||
"@</span>")
|
||||
s (substring s (match-end 0))))
|
||||
(when org-maybe-keyword-time-regexp
|
||||
(while (string-match org-maybe-keyword-time-regexp s)
|
||||
(or b (setq b (substring s 0 (match-beginning 0))))
|
||||
(setq r (concat
|
||||
r (substring s 0 (match-beginning 0))
|
||||
" @<span class=\"timestamp-wrapper\">"
|
||||
(if (match-end 1)
|
||||
(format "@<span class=\"timestamp-kwd\">%s @</span>"
|
||||
(match-string 1 s)))
|
||||
(format " @<span class=\"timestamp\">%s@</span>"
|
||||
(substring
|
||||
(org-translate-time (match-string 3 s)) 1 -1))
|
||||
"@</span>")
|
||||
s (substring s (match-end 0)))))
|
||||
;; Line break if line started and ended with time stamp stuff
|
||||
(if (not r)
|
||||
s
|
||||
|
@ -2263,7 +2295,7 @@ that uses these same face definitions."
|
|||
(when (and (symbolp f) (or (not i) (not (listp i))))
|
||||
(insert (org-add-props (copy-sequence "1") nil 'face f))))
|
||||
(htmlize-region (point-min) (point-max))))
|
||||
(switch-to-buffer "*html*")
|
||||
(org-pop-to-buffer-same-window "*html*")
|
||||
(goto-char (point-min))
|
||||
(if (re-search-forward "<style" nil t)
|
||||
(delete-region (point-min) (match-beginning 0)))
|
||||
|
@ -2286,18 +2318,20 @@ Possible conversions are set in `org-export-html-protect-char-alist'."
|
|||
|
||||
(defun org-html-expand (string)
|
||||
"Prepare STRING for HTML export. Apply all active conversions.
|
||||
If there are links in the string, don't modify these."
|
||||
(let* ((re (concat org-bracket-link-regexp "\\|"
|
||||
(org-re "[ \t]+\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$")))
|
||||
m s l res)
|
||||
(while (setq m (string-match re string))
|
||||
(setq s (substring string 0 m)
|
||||
l (match-string 0 string)
|
||||
string (substring string (match-end 0)))
|
||||
(push (org-html-do-expand s) res)
|
||||
If there are links in the string, don't modify these. If STRING
|
||||
is nil, return nil."
|
||||
(when string
|
||||
(let* ((re (concat org-bracket-link-regexp "\\|"
|
||||
(org-re "[ \t]+\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$")))
|
||||
m s l res)
|
||||
(while (setq m (string-match re string))
|
||||
(setq s (substring string 0 m)
|
||||
l (match-string 0 string)
|
||||
string (substring string (match-end 0)))
|
||||
(push (org-html-do-expand s) res)
|
||||
(push l res))
|
||||
(push (org-html-do-expand string) res)
|
||||
(apply 'concat (nreverse res))))
|
||||
(push (org-html-do-expand string) res)
|
||||
(apply 'concat (nreverse res)))))
|
||||
|
||||
(defun org-html-do-expand (s)
|
||||
"Apply all active conversions to translate special ASCII to HTML."
|
||||
|
@ -2412,8 +2446,9 @@ When TITLE is nil, just close all open levels."
|
|||
(mapconcat (lambda (x)
|
||||
(setq x (org-solidify-link-text
|
||||
(if (org-uuidgen-p x) (concat "ID-" x) x)))
|
||||
(format "<a name=\"%s\" id=\"%s\"></a>"
|
||||
x x))
|
||||
(if (stringp org-export-html-headline-anchor-format)
|
||||
(format org-export-html-headline-anchor-format x x)
|
||||
""))
|
||||
extra-targets
|
||||
""))
|
||||
(while (>= l level)
|
||||
|
@ -2604,5 +2639,4 @@ the alist of previous items."
|
|||
|
||||
(provide 'org-html)
|
||||
|
||||
|
||||
;;; org-html.el ends here
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
;;; org-icalendar.el --- iCalendar export for Org-mode
|
||||
|
||||
;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Carsten Dominik <carsten at orgmode dot org>
|
||||
;; Keywords: outlines, hypermedia, calendar, wp
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
;;
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -204,7 +203,7 @@ When nil of the empty string, use the abbreviation retrieved from Emacs."
|
|||
(if org-icalendar-use-UTC-date-time
|
||||
":%Y%m%dT%H%M%SZ"
|
||||
":%Y%m%dT%H%M%S")
|
||||
"Format-string for exporting iCalendar DATE-TIME.
|
||||
"Format-string for exporting icalendar DATE-TIME.
|
||||
See `format-time-string' for a full documentation. The only
|
||||
difference is that `org-icalendar-timezone' is used for %Z.
|
||||
|
||||
|
@ -418,7 +417,7 @@ When COMBINE is non nil, add the category to each line."
|
|||
(let ((t1 (ignore-errors (org-parse-time-string ts 'nodefault))))
|
||||
(if (and (> org-icalendar-alarm-time 0)
|
||||
(car t1) (nth 1 t1) (nth 2 t1))
|
||||
(setq alarm (format "\nBEGIN:VALARM\nACTION:DISPLAY\nDESCRIPTION:%s\nTRIGGER:-P0D0H%dM0S\nEND:VALARM" summary org-icalendar-alarm-time))
|
||||
(setq alarm (format "\nBEGIN:VALARM\nACTION:DISPLAY\nDESCRIPTION:%s\nTRIGGER:-P0DT0H%dM0S\nEND:VALARM" summary org-icalendar-alarm-time))
|
||||
(setq alarm ""))
|
||||
)
|
||||
(if (string-match org-bracket-link-regexp summary)
|
||||
|
@ -684,5 +683,4 @@ a time), or the day by one (if it does not contain a time)."
|
|||
|
||||
(provide 'org-icalendar)
|
||||
|
||||
|
||||
;;; org-icalendar.el ends here
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Carsten Dominik <carsten at orgmode dot org>
|
||||
;; Keywords: outlines, hypermedia, calendar, wp
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
;;
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -74,6 +73,8 @@
|
|||
(require 'org)
|
||||
|
||||
(declare-function message-make-fqdn "message" ())
|
||||
(declare-function org-pop-to-buffer-same-window
|
||||
"org-compat" (&optional buffer-or-name norecord label))
|
||||
|
||||
;;; Customization
|
||||
|
||||
|
@ -253,7 +254,7 @@ Move the cursor to that entry in that buffer."
|
|||
(let ((m (org-id-find id 'marker)))
|
||||
(unless m
|
||||
(error "Cannot find entry with ID \"%s\"" id))
|
||||
(switch-to-buffer (marker-buffer m))
|
||||
(org-pop-to-buffer-same-window (marker-buffer m))
|
||||
(goto-char m)
|
||||
(move-marker m nil)
|
||||
(org-show-context)))
|
||||
|
@ -430,7 +431,7 @@ When CHECK is given, prepare detailed information about duplicate IDs."
|
|||
(delq nil
|
||||
(mapcar (lambda (b)
|
||||
(with-current-buffer b
|
||||
(and (org-mode-p) (buffer-file-name))))
|
||||
(and (eq major-mode 'org-mode) (buffer-file-name))))
|
||||
(buffer-list)))
|
||||
;; All files known to have IDs
|
||||
org-id-files)))
|
||||
|
@ -599,7 +600,7 @@ optional argument MARKERP, return the position as a new marker."
|
|||
(defun org-id-store-link ()
|
||||
"Store a link to the current entry, using its ID."
|
||||
(interactive)
|
||||
(when (and (buffer-file-name (buffer-base-buffer)) (org-mode-p))
|
||||
(when (and (buffer-file-name (buffer-base-buffer)) (eq major-mode 'org-mode))
|
||||
(let* ((link (org-make-link "id:" (org-id-get-create)))
|
||||
(case-fold-search nil)
|
||||
(desc (save-excursion
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
;; Author: Carsten Dominik <carsten at orgmode dot org>
|
||||
;; Keywords: outlines, hypermedia, calendar, wp
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
;;
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -28,7 +27,12 @@
|
|||
;; This is an implementation of dynamic virtual indentation. It works
|
||||
;; by adding text properties to a buffer to make sure lines are
|
||||
;; indented according to outline structure.
|
||||
|
||||
;;
|
||||
;; The process is synchronous, toggled at every buffer modification.
|
||||
;; Though, the initialization (indentation of text already in the
|
||||
;; buffer), which can take a few seconds in large buffers, happens on
|
||||
;; idle time.
|
||||
;;
|
||||
;;; Code:
|
||||
|
||||
(require 'org-macs)
|
||||
|
@ -38,9 +42,9 @@
|
|||
(eval-when-compile
|
||||
(require 'cl))
|
||||
|
||||
(defvar org-inlinetask-min-level)
|
||||
(declare-function org-inlinetask-get-task-level "org-inlinetask" ())
|
||||
(declare-function org-inlinetask-in-task-p "org-inlinetask" ())
|
||||
(declare-function org-list-item-body-column "org-list" (item))
|
||||
|
||||
(defgroup org-indent nil
|
||||
"Options concerning dynamic virtual outline indentation."
|
||||
|
@ -49,8 +53,11 @@
|
|||
|
||||
(defconst org-indent-max 40
|
||||
"Maximum indentation in characters.")
|
||||
(defconst org-indent-max-levels 40
|
||||
"Maximum indentation in characters.")
|
||||
(defconst org-indent-max-levels 20
|
||||
"Maximum added level through virtual indentation, in characters.
|
||||
|
||||
It is computed by multiplying `org-indent-indentation-per-level'
|
||||
minus one by actual level of the headline minus one.")
|
||||
|
||||
(defvar org-indent-strings nil
|
||||
"Vector with all indentation strings.
|
||||
|
@ -58,8 +65,31 @@ It will be set in `org-indent-initialize'.")
|
|||
(defvar org-indent-stars nil
|
||||
"Vector with all indentation star strings.
|
||||
It will be set in `org-indent-initialize'.")
|
||||
(defvar org-indent-inlinetask-first-star (org-add-props "*" '(face org-warning))
|
||||
"First star of inline tasks, with correct face.")
|
||||
(defvar org-indent-agent-timer nil
|
||||
"Timer running the initialize agent.")
|
||||
(defvar org-indent-agentized-buffers nil
|
||||
"List of buffers watched by the initialize agent.")
|
||||
(defvar org-indent-agent-resume-timer nil
|
||||
"Timer to reschedule agent after switching to other idle processes.")
|
||||
(defvar org-indent-agent-active-delay '(0 2 0)
|
||||
"Time to run agent before switching to other idle processes.
|
||||
Delay used when the buffer to initialize is current.")
|
||||
(defvar org-indent-agent-passive-delay '(0 0 400000)
|
||||
"Time to run agent before switching to other idle processes.
|
||||
Delay used when the buffer to initialize isn't current.")
|
||||
(defvar org-indent-agent-resume-delay '(0 0 100000)
|
||||
"Minimal time for other idle processes before switching back to agent.")
|
||||
(defvar org-indent-initial-marker nil
|
||||
"Position of initialization before interrupt.
|
||||
This is used locally in each buffer being initialized.")
|
||||
(defvar org-hide-leading-stars-before-indent-mode nil
|
||||
"Used locally.")
|
||||
(defvar org-indent-modified-headline-flag nil
|
||||
"Non-nil means the last deletion operated on an headline.
|
||||
It is modified by `org-indent-notify-modified-headline'.")
|
||||
|
||||
|
||||
(defcustom org-indent-boundary-char ?\ ; comment to protect space char
|
||||
"The end of the virtual indentation strings, a single-character string.
|
||||
|
@ -90,28 +120,15 @@ turn on `org-hide-leading-stars'."
|
|||
:group 'org-indent
|
||||
:type 'integer)
|
||||
|
||||
(defcustom org-indent-fix-section-after-idle-time 0.2
|
||||
"Seconds of idle time before fixing virtual indentation of section.
|
||||
The hooking-in of virtual indentation is not yet perfect. Occasionally,
|
||||
a change does not trigger to proper change of indentation. For this we
|
||||
have a timer action that fixes indentation in the current section after
|
||||
a short amount idle time. If we ever get the integration to work perfectly,
|
||||
this variable can be set to nil to get rid of the timer."
|
||||
:group 'org-indent
|
||||
:type '(choice
|
||||
(const "Do not install idle timer" nil)
|
||||
(number :tag "Idle time")))
|
||||
(defface org-indent
|
||||
(org-compatible-face nil nil)
|
||||
"Face for outline indentation.
|
||||
The default is to make it look like whitespace. But you may find it
|
||||
useful to make it ever so slightly different."
|
||||
:group 'org-faces)
|
||||
|
||||
(defun org-indent-initialize ()
|
||||
"Initialize the indentation strings and set the idle timer."
|
||||
;; We use an idle timer to "repair" the current section, because the
|
||||
;; redisplay seems to have some problems.
|
||||
(unless org-indent-strings
|
||||
(when org-indent-fix-section-after-idle-time
|
||||
(run-with-idle-timer
|
||||
org-indent-fix-section-after-idle-time
|
||||
t 'org-indent-refresh-section)))
|
||||
;; Initialize the indentation and star vectors
|
||||
"Initialize the indentation strings."
|
||||
(setq org-indent-strings (make-vector (1+ org-indent-max) nil))
|
||||
(setq org-indent-stars (make-vector (1+ org-indent-max) nil))
|
||||
(aset org-indent-strings 0 nil)
|
||||
|
@ -127,14 +144,21 @@ this variable can be set to nil to get rid of the timer."
|
|||
(org-add-props (make-string i ?*)
|
||||
nil 'face 'org-hide))))
|
||||
|
||||
(defsubst org-indent-remove-properties (beg end)
|
||||
"Remove indentations between BEG and END."
|
||||
(with-silent-modifications
|
||||
(remove-text-properties beg end '(line-prefix nil wrap-prefix nil))))
|
||||
|
||||
;;;###autoload
|
||||
(define-minor-mode org-indent-mode
|
||||
"When active, indent text according to outline structure.
|
||||
|
||||
Internally this works by adding `line-prefix' properties to all non-headlines.
|
||||
These properties are updated locally in idle time.
|
||||
FIXME: How to update when broken?"
|
||||
nil " Ind" nil
|
||||
Internally this works by adding `line-prefix' and `wrap-prefix'
|
||||
properties, after each buffer modification, on the modified zone.
|
||||
|
||||
The process is synchronous. Though, initial indentation of
|
||||
buffer, which can take a few seconds on large buffers, is done
|
||||
during idle time." nil " Ind" nil
|
||||
(cond
|
||||
((org-bound-and-true-p org-inhibit-startup)
|
||||
(setq org-indent-mode nil))
|
||||
|
@ -151,6 +175,7 @@ FIXME: How to update when broken?"
|
|||
;; mode was turned on.
|
||||
(org-set-local 'indent-tabs-mode nil)
|
||||
(or org-indent-strings (org-indent-initialize))
|
||||
(org-set-local 'org-indent-initial-marker (copy-marker 1))
|
||||
(when org-indent-mode-turns-off-org-adapt-indentation
|
||||
(org-set-local 'org-adapt-indentation nil))
|
||||
(when org-indent-mode-turns-on-hiding-stars
|
||||
|
@ -160,56 +185,49 @@ FIXME: How to update when broken?"
|
|||
(make-local-variable 'buffer-substring-filters)
|
||||
(add-to-list 'buffer-substring-filters
|
||||
'org-indent-remove-properties-from-string)
|
||||
(org-add-hook 'org-after-demote-entry-hook
|
||||
'org-indent-refresh-section nil 'local)
|
||||
(org-add-hook 'org-after-promote-entry-hook
|
||||
'org-indent-refresh-section nil 'local)
|
||||
(org-add-hook 'org-font-lock-hook
|
||||
'org-indent-refresh-to nil 'local)
|
||||
(org-add-hook 'after-change-functions 'org-indent-refresh-maybe nil 'local)
|
||||
(org-add-hook 'before-change-functions
|
||||
'org-indent-notify-modified-headline nil 'local)
|
||||
(and font-lock-mode (org-restart-font-lock))
|
||||
)
|
||||
(org-indent-remove-properties (point-min) (point-max))
|
||||
;; Submit current buffer to initialize agent. If it's the first
|
||||
;; buffer submitted, also start the agent. Current buffer is
|
||||
;; pushed in both cases to avoid a race condition.
|
||||
(if org-indent-agentized-buffers
|
||||
(push (current-buffer) org-indent-agentized-buffers)
|
||||
(push (current-buffer) org-indent-agentized-buffers)
|
||||
(setq org-indent-agent-timer
|
||||
(run-with-idle-timer 0.2 t #'org-indent-initialize-agent))))
|
||||
(t
|
||||
;; mode was turned off (or we refused to turn it on)
|
||||
(save-excursion
|
||||
(save-restriction
|
||||
(org-indent-remove-properties (point-min) (point-max))
|
||||
(kill-local-variable 'org-adapt-indentation)
|
||||
(when (boundp 'org-hide-leading-stars-before-indent-mode)
|
||||
(org-set-local 'org-hide-leading-stars
|
||||
org-hide-leading-stars-before-indent-mode))
|
||||
(setq buffer-substring-filters
|
||||
(delq 'org-indent-remove-properties-from-string
|
||||
buffer-substring-filters))
|
||||
(remove-hook 'org-after-promote-entry-hook
|
||||
'org-indent-refresh-section 'local)
|
||||
(remove-hook 'org-after-demote-entry-hook
|
||||
'org-indent-refresh-section 'local)
|
||||
(and font-lock-mode (org-restart-font-lock))
|
||||
(redraw-display))))))
|
||||
|
||||
|
||||
(defface org-indent
|
||||
(org-compatible-face nil nil)
|
||||
"Face for outline indentation.
|
||||
The default is to make it look like whitespace. But you may find it
|
||||
useful to make it ever so slightly different."
|
||||
:group 'org-faces)
|
||||
(kill-local-variable 'org-adapt-indentation)
|
||||
(setq org-indent-agentized-buffers
|
||||
(delq (current-buffer) org-indent-agentized-buffers))
|
||||
(when (markerp org-indent-initial-marker)
|
||||
(set-marker org-indent-initial-marker nil))
|
||||
(when (boundp 'org-hide-leading-stars-before-indent-mode)
|
||||
(org-set-local 'org-hide-leading-stars
|
||||
org-hide-leading-stars-before-indent-mode))
|
||||
(setq buffer-substring-filters
|
||||
(delq 'org-indent-remove-properties-from-string
|
||||
buffer-substring-filters))
|
||||
(remove-hook 'after-change-functions 'org-indent-refresh-maybe 'local)
|
||||
(remove-hook 'before-change-functions
|
||||
'org-indent-notify-modified-headline 'local)
|
||||
(org-with-wide-buffer
|
||||
(org-indent-remove-properties (point-min) (point-max)))
|
||||
(and font-lock-mode (org-restart-font-lock))
|
||||
(redraw-display))))
|
||||
|
||||
(defun org-indent-indent-buffer ()
|
||||
"Add indentation properties for the whole buffer."
|
||||
"Add indentation properties to the accessible part of the buffer."
|
||||
(interactive)
|
||||
(when org-indent-mode
|
||||
(save-excursion
|
||||
(save-restriction
|
||||
(widen)
|
||||
(org-indent-remove-properties (point-min) (point-max))
|
||||
(org-indent-add-properties (point-min) (point-max))))))
|
||||
|
||||
(defun org-indent-remove-properties (beg end)
|
||||
"Remove indentations between BEG and END."
|
||||
(let ((inhibit-modification-hooks t))
|
||||
(with-silent-modifications
|
||||
(remove-text-properties beg end '(line-prefix nil wrap-prefix nil)))))
|
||||
(if (not (eq major-mode 'org-mode))
|
||||
(error "Not in Org mode")
|
||||
(message "Setting buffer indentation. It may take a few seconds...")
|
||||
(org-indent-remove-properties (point-min) (point-max))
|
||||
(org-indent-add-properties (point-min) (point-max))
|
||||
(message "Indentation of buffer set.")))
|
||||
|
||||
(defun org-indent-remove-properties-from-string (string)
|
||||
"Remove indentation properties from STRING."
|
||||
|
@ -217,110 +235,193 @@ useful to make it ever so slightly different."
|
|||
'(line-prefix nil wrap-prefix nil) string)
|
||||
string)
|
||||
|
||||
(defvar org-indent-outline-re org-outline-regexp-bol
|
||||
"Outline heading regexp.")
|
||||
(defun org-indent-initialize-agent ()
|
||||
"Start or resume current buffer initialization.
|
||||
Only buffers in `org-indent-agentized-buffers' trigger an action.
|
||||
When no more buffer is being watched, the agent suppress itself."
|
||||
(when org-indent-agent-resume-timer
|
||||
(cancel-timer org-indent-agent-resume-timer))
|
||||
(setq org-indent-agentized-buffers
|
||||
(org-remove-if-not #'buffer-live-p org-indent-agentized-buffers))
|
||||
(cond
|
||||
;; Job done: kill agent.
|
||||
((not org-indent-agentized-buffers) (cancel-timer org-indent-agent-timer))
|
||||
;; Current buffer is agentized: start/resume initialization
|
||||
;; somewhat aggressively.
|
||||
((memq (current-buffer) org-indent-agentized-buffers)
|
||||
(org-indent-initialize-buffer (current-buffer)
|
||||
org-indent-agent-active-delay))
|
||||
;; Else, start/resume initialization of the last agentized buffer,
|
||||
;; softly.
|
||||
(t (org-indent-initialize-buffer (car org-indent-agentized-buffers)
|
||||
org-indent-agent-passive-delay))))
|
||||
|
||||
(defun org-indent-add-properties (beg end)
|
||||
(defun org-indent-initialize-buffer (buffer delay)
|
||||
"Set virtual indentation for the buffer BUFFER, asynchronously.
|
||||
Give hand to other idle processes if it takes longer than DELAY,
|
||||
a time value."
|
||||
(with-current-buffer buffer
|
||||
(when org-indent-mode
|
||||
(org-with-wide-buffer
|
||||
(let ((interruptp
|
||||
;; Always nil unless interrupted.
|
||||
(catch 'interrupt
|
||||
(and org-indent-initial-marker
|
||||
(marker-position org-indent-initial-marker)
|
||||
(org-indent-add-properties org-indent-initial-marker
|
||||
(point-max)
|
||||
delay)
|
||||
nil))))
|
||||
(move-marker org-indent-initial-marker interruptp)
|
||||
;; Job is complete: un-agentize buffer.
|
||||
(unless interruptp
|
||||
(setq org-indent-agentized-buffers
|
||||
(delq buffer org-indent-agentized-buffers))))))))
|
||||
|
||||
(defsubst org-indent-set-line-properties (l w h)
|
||||
"Set prefix properties on current line an move to next one.
|
||||
|
||||
Prefix properties `line-prefix' and `wrap-prefix' in current line
|
||||
are set to, respectively, length L and W.
|
||||
|
||||
If H is non-nil, `line-prefix' will be starred. If H is
|
||||
`inline', the first star will have `org-warning' face.
|
||||
|
||||
Assume point is at beginning of line."
|
||||
(let ((line (cond
|
||||
((eq 'inline h)
|
||||
(let ((stars (aref org-indent-stars
|
||||
(min l org-indent-max-levels))))
|
||||
(and stars
|
||||
(concat org-indent-inlinetask-first-star
|
||||
(substring stars 1)))))
|
||||
(h (aref org-indent-stars
|
||||
(min l org-indent-max-levels)))
|
||||
(t (aref org-indent-strings
|
||||
(min l org-indent-max)))))
|
||||
(wrap (aref org-indent-strings (min w org-indent-max))))
|
||||
;; Add properties down to the next line to indent empty lines.
|
||||
(add-text-properties (point) (min (1+ (point-at-eol)) (point-max))
|
||||
`(line-prefix ,line wrap-prefix ,wrap)))
|
||||
(forward-line 1))
|
||||
|
||||
(defun org-indent-add-properties (beg end &optional delay)
|
||||
"Add indentation properties between BEG and END.
|
||||
Assumes that BEG is at the beginning of a line."
|
||||
(let* ((inhibit-modification-hooks t)
|
||||
(inlinetaskp (featurep 'org-inlinetask))
|
||||
(get-real-level (lambda (pos lvl)
|
||||
(save-excursion
|
||||
(goto-char pos)
|
||||
(if (and inlinetaskp (org-inlinetask-in-task-p))
|
||||
(org-inlinetask-get-task-level)
|
||||
lvl))))
|
||||
(b beg)
|
||||
(e end)
|
||||
(level 0)
|
||||
(n 0)
|
||||
exit nstars)
|
||||
(with-silent-modifications
|
||||
(save-excursion
|
||||
(goto-char beg)
|
||||
(while (not exit)
|
||||
(setq e end)
|
||||
(if (not (re-search-forward org-indent-outline-re nil t))
|
||||
(setq e (point-max) exit t)
|
||||
(setq e (match-beginning 0))
|
||||
(if (>= e end) (setq exit t))
|
||||
(unless (and inlinetaskp (org-inlinetask-in-task-p))
|
||||
(setq level (- (match-end 0) (match-beginning 0) 1)))
|
||||
(setq nstars (* (1- (funcall get-real-level e level))
|
||||
(1- org-indent-indentation-per-level)))
|
||||
(add-text-properties
|
||||
(point-at-bol) (point-at-eol)
|
||||
(list 'line-prefix
|
||||
(aref org-indent-stars nstars)
|
||||
'wrap-prefix
|
||||
(aref org-indent-strings
|
||||
(* (funcall get-real-level e level)
|
||||
org-indent-indentation-per-level)))))
|
||||
(when (> e b)
|
||||
(add-text-properties
|
||||
b e (list 'line-prefix (aref org-indent-strings n)
|
||||
'wrap-prefix (aref org-indent-strings n))))
|
||||
(setq b (1+ (point-at-eol))
|
||||
n (* (funcall get-real-level b level)
|
||||
org-indent-indentation-per-level)))))))
|
||||
|
||||
(defvar org-inlinetask-min-level)
|
||||
(defun org-indent-refresh-section ()
|
||||
"Refresh indentation properties in the current outline section.
|
||||
Point is assumed to be at the beginning of a headline."
|
||||
(interactive)
|
||||
(when org-indent-mode
|
||||
(let (beg end)
|
||||
(save-excursion
|
||||
(when (ignore-errors (let ((org-outline-regexp (format "\\*\\{1,%s\\}[ \t]+"
|
||||
(if (featurep 'org-inlinetask)
|
||||
(1- org-inlinetask-min-level)
|
||||
""))))
|
||||
(org-back-to-heading)))
|
||||
(setq beg (point))
|
||||
(setq end (or (save-excursion (or (outline-next-heading) (point)))))
|
||||
(org-indent-remove-properties beg end)
|
||||
(org-indent-add-properties beg end))))))
|
||||
When DELAY is non-nil, it must be a time value. In that case,
|
||||
the process is asynchronous and can be interrupted, either by
|
||||
user request, or after DELAY. This is done by throwing the
|
||||
`interrupt' tag along with the buffer position where the process
|
||||
stopped."
|
||||
(save-match-data
|
||||
(org-with-wide-buffer
|
||||
(goto-char beg)
|
||||
(beginning-of-line)
|
||||
;; 1. Initialize prefix at BEG. This is done by storing two
|
||||
;; variables: INLINE-PF and PF, representing respectively
|
||||
;; length of current `line-prefix' when line is inside an
|
||||
;; inline task or not.
|
||||
(let* ((case-fold-search t)
|
||||
(limited-re (org-get-limited-outline-regexp))
|
||||
(added-ind-per-lvl (1- org-indent-indentation-per-level))
|
||||
(pf (save-excursion
|
||||
(and (ignore-errors (let ((outline-regexp limited-re))
|
||||
(org-back-to-heading t)))
|
||||
(+ (* org-indent-indentation-per-level
|
||||
(- (match-end 0) (match-beginning 0) 2)) 2))))
|
||||
(pf-inline (and (featurep 'org-inlinetask)
|
||||
(org-inlinetask-in-task-p)
|
||||
(+ (* org-indent-indentation-per-level
|
||||
(1- (org-inlinetask-get-task-level))) 2)))
|
||||
(time-limit (and delay (time-add (current-time) delay))))
|
||||
;; 2. For each line, set `line-prefix' and `wrap-prefix'
|
||||
;; properties depending on the type of line (headline,
|
||||
;; inline task, item or other).
|
||||
(with-silent-modifications
|
||||
(while (and (<= (point) end) (not (eobp)))
|
||||
(cond
|
||||
;; When in asynchronous mode, check if interrupt is
|
||||
;; required.
|
||||
((and delay (input-pending-p)) (throw 'interrupt (point)))
|
||||
;; In asynchronous mode, take a break of
|
||||
;; `org-indent-agent-resume-delay' every DELAY to avoid
|
||||
;; blocking any other idle timer or process output.
|
||||
((and delay (time-less-p time-limit (current-time)))
|
||||
(setq org-indent-agent-resume-timer
|
||||
(run-with-idle-timer
|
||||
(time-add (current-idle-time)
|
||||
org-indent-agent-resume-delay)
|
||||
nil #'org-indent-initialize-agent))
|
||||
(throw 'interrupt (point)))
|
||||
;; Headline or inline task.
|
||||
((looking-at org-outline-regexp)
|
||||
(let* ((nstars (- (match-end 0) (match-beginning 0) 1))
|
||||
(line (* added-ind-per-lvl (1- nstars)))
|
||||
(wrap (+ line (1+ nstars))))
|
||||
(cond
|
||||
;; Headline: new value for PF.
|
||||
((looking-at limited-re)
|
||||
(org-indent-set-line-properties line wrap t)
|
||||
(setq pf wrap))
|
||||
;; End of inline task: PF-INLINE is now nil.
|
||||
((looking-at "\\*+ end[ \t]*$")
|
||||
(org-indent-set-line-properties line wrap 'inline)
|
||||
(setq pf-inline nil))
|
||||
;; Start of inline task. Determine if it contains
|
||||
;; text, or if it is only one line long. Set
|
||||
;; PF-INLINE accordingly.
|
||||
(t (org-indent-set-line-properties line wrap 'inline)
|
||||
(setq pf-inline (and (org-inlinetask-in-task-p) wrap))))))
|
||||
;; List item: `wrap-prefix' is set where body starts.
|
||||
((org-at-item-p)
|
||||
(let* ((line (or pf-inline pf 0))
|
||||
(wrap (+ (org-list-item-body-column (point)) line)))
|
||||
(org-indent-set-line-properties line wrap nil)))
|
||||
;; Normal line: use PF-INLINE, PF or nil as prefixes.
|
||||
(t (let* ((line (or pf-inline pf 0))
|
||||
(wrap (+ line (org-get-indentation))))
|
||||
(org-indent-set-line-properties line wrap nil))))))))))
|
||||
|
||||
(defun org-indent-refresh-to (limit)
|
||||
"Refresh indentation properties in the current outline section.
|
||||
Point is assumed to be at the beginning of a headline."
|
||||
(interactive)
|
||||
(when org-indent-mode
|
||||
(let ((beg (point)) (end limit))
|
||||
(save-excursion
|
||||
(and (ignore-errors (let ((org-outline-regexp (format "\\*\\{1,%s\\}[ \t]+"
|
||||
(if (featurep 'org-inlinetask)
|
||||
(1- org-inlinetask-min-level)
|
||||
""))))
|
||||
(org-back-to-heading)))
|
||||
(setq beg (point))))
|
||||
(org-indent-remove-properties beg end)
|
||||
(org-indent-add-properties beg end)))
|
||||
(goto-char limit))
|
||||
(defun org-indent-notify-modified-headline (beg end)
|
||||
"Set `org-indent-modified-headline-flag' depending on context.
|
||||
|
||||
(defun org-indent-refresh-subtree ()
|
||||
"Refresh indentation properties in the current outline subtree.
|
||||
Point is assumed to be at the beginning of a headline."
|
||||
(interactive)
|
||||
BEG and END are the positions of the beginning and end of the
|
||||
range of deleted text.
|
||||
|
||||
This function is meant to be called by `before-change-functions'.
|
||||
Flag will be non-nil if command is going to modify or delete an
|
||||
headline."
|
||||
(when org-indent-mode
|
||||
(save-excursion
|
||||
(let (beg end)
|
||||
(setq beg (point))
|
||||
(setq end (save-excursion (org-end-of-subtree t t)))
|
||||
(org-indent-remove-properties beg end)
|
||||
(setq org-indent-modified-headline-flag
|
||||
(save-excursion
|
||||
(goto-char beg)
|
||||
(save-match-data
|
||||
(or (and (org-at-heading-p) (< beg (match-end 0)))
|
||||
(re-search-forward org-outline-regexp-bol end t)))))))
|
||||
|
||||
(defun org-indent-refresh-maybe (beg end dummy)
|
||||
"Refresh indentation properties in an adequate portion of buffer.
|
||||
BEG and END are the positions of the beginning and end of the
|
||||
range of inserted text. DUMMY is an unused argument.
|
||||
|
||||
This function is meant to be called by `after-change-functions'."
|
||||
(when org-indent-mode
|
||||
(save-match-data
|
||||
;; If an headline was modified or inserted, set properties until
|
||||
;; next headline.
|
||||
(if (or org-indent-modified-headline-flag
|
||||
(save-excursion
|
||||
(goto-char beg)
|
||||
(re-search-forward org-outline-regexp-bol end t)))
|
||||
(let ((end (save-excursion
|
||||
(goto-char end)
|
||||
(org-with-limited-levels (outline-next-heading))
|
||||
(point))))
|
||||
(setq org-indent-modified-headline-flag nil)
|
||||
(org-indent-add-properties beg end))
|
||||
;; Otherwise, only set properties on modified area.
|
||||
(org-indent-add-properties beg end)))))
|
||||
|
||||
(defun org-indent-refresh-buffer ()
|
||||
"Refresh indentation properties in the current outline subtree.
|
||||
Point is assumed to be at the beginning of a headline."
|
||||
(interactive)
|
||||
(when org-indent-mode
|
||||
(org-indent-mode -1)
|
||||
(org-indent-mode 1)))
|
||||
|
||||
(provide 'org-indent)
|
||||
|
||||
|
||||
;;; org-indent.el ends here
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
;;; org-info.el --- Support for links to Info nodes from within Org-Mode
|
||||
|
||||
;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Carsten Dominik <carsten at orgmode dot org>
|
||||
;; Keywords: outlines, hypermedia, calendar, wp
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
;;
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -77,6 +76,4 @@
|
|||
|
||||
(provide 'org-info)
|
||||
|
||||
|
||||
|
||||
;;; org-info.el ends here
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Carsten Dominik <carsten at orgmode dot org>
|
||||
;; Keywords: outlines, hypermedia, calendar, wp
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
@ -107,11 +106,14 @@ When nil, they will not be exported."
|
|||
:type 'boolean)
|
||||
|
||||
(defvar org-inlinetask-export-templates
|
||||
'((html "<pre class=\"inlinetask\"><b>%s%s</b><br />%s</pre>"
|
||||
'((html "<div class=\"inlinetask\"><b>%s%s</b><br />%s</div>"
|
||||
'((unless (eq todo "")
|
||||
(format "<span class=\"%s %s\">%s%s</span> "
|
||||
class todo todo priority))
|
||||
heading content))
|
||||
(odt "%s" '((org-odt-format-inlinetask heading content
|
||||
todo priority tags)))
|
||||
|
||||
(latex "\\begin\{description\}\n\\item[%s%s]~%s\\end\{description\}"
|
||||
'((unless (eq todo "") (format "\\textsc\{%s%s\} " todo priority))
|
||||
heading content))
|
||||
|
@ -132,9 +134,9 @@ When nil, they will not be exported."
|
|||
heading content)))
|
||||
"Templates for inline tasks in various exporters.
|
||||
|
||||
This variable is an alist in the shape of (BACKEND STRING OBJECTS).
|
||||
This variable is an alist in the shape of \(BACKEND STRING OBJECTS\).
|
||||
|
||||
BACKEND is the name of the backend for the template (ascii, html...).
|
||||
BACKEND is the name of the backend for the template \(ascii, html...\).
|
||||
|
||||
STRING is a format control string.
|
||||
|
||||
|
@ -151,14 +153,14 @@ defined in an inline task, their value is the empty string.
|
|||
|
||||
As an example, valid associations are:
|
||||
|
||||
(html \"<ul><li>%s <p>%s</p></li></ul>\" (heading content))
|
||||
\(html \"<ul><li>%s <p>%s</p></li></ul>\" \(heading content\)\)
|
||||
|
||||
or, with the additional package \"todonotes\" for LaTeX,
|
||||
|
||||
(latex \"\\todo[inline]{\\textbf{\\textsf{%s %s}}\\linebreak{} %s}\"
|
||||
'((unless (eq todo \"\")
|
||||
(format \"\\textsc{%s%s}\" todo priority))
|
||||
heading content)))")
|
||||
\(latex \"\\todo[inline]{\\textbf{\\textsf{%s %s}}\\linebreak{} %s}\"
|
||||
'\(\(unless \(eq todo \"\"\)
|
||||
\(format \"\\textsc{%s%s}\" todo priority\)\)
|
||||
heading content\)\)\)")
|
||||
|
||||
(defvar org-odd-levels-only)
|
||||
(defvar org-keyword-time-regexp)
|
||||
|
@ -179,15 +181,22 @@ default, or nil of no state should be assigned."
|
|||
"Insert an inline task.
|
||||
If prefix arg NO-STATE is set, ignore `org-inlinetask-default-state'."
|
||||
(interactive "P")
|
||||
;; Error when inside an inline task, except if point was at its very
|
||||
;; beginning, in which case the new inline task will be inserted
|
||||
;; before this one.
|
||||
(when (and (org-inlinetask-in-task-p)
|
||||
(not (and (org-inlinetask-at-task-p) (bolp))))
|
||||
(error "Cannot nest inline tasks"))
|
||||
(or (bolp) (newline))
|
||||
(let ((indent org-inlinetask-min-level))
|
||||
(if org-odd-levels-only
|
||||
(setq indent (- (* 2 indent) 1)))
|
||||
(insert (make-string indent ?*)
|
||||
(if (or no-state (not org-inlinetask-default-state))
|
||||
" \n"
|
||||
(concat " " org-inlinetask-default-state " \n"))
|
||||
(make-string indent ?*) " END\n"))
|
||||
(let* ((indent (if org-odd-levels-only
|
||||
(1- (* 2 org-inlinetask-min-level))
|
||||
org-inlinetask-min-level))
|
||||
(indent-string (concat (make-string indent ?*) " ")))
|
||||
(insert indent-string
|
||||
(if (or no-state (not org-inlinetask-default-state))
|
||||
"\n"
|
||||
(concat org-inlinetask-default-state " \n"))
|
||||
indent-string "END\n"))
|
||||
(end-of-line -1))
|
||||
(define-key org-mode-map "\C-c\C-xt" 'org-inlinetask-insert-task)
|
||||
|
||||
|
@ -228,21 +237,26 @@ The number of levels is controlled by `org-inlinetask-min-level'."
|
|||
(re-search-backward inlinetask-re nil t))))
|
||||
|
||||
(defun org-inlinetask-goto-end ()
|
||||
"Go to the end of the inline task at point."
|
||||
(beginning-of-line)
|
||||
(let ((case-fold-search t)
|
||||
(inlinetask-re (org-inlinetask-outline-regexp)))
|
||||
(cond
|
||||
((org-looking-at-p (concat inlinetask-re "END[ \t]*$"))
|
||||
(forward-line 1))
|
||||
((org-looking-at-p inlinetask-re)
|
||||
(forward-line 1)
|
||||
(when (org-inlinetask-in-task-p)
|
||||
(re-search-forward inlinetask-re nil t)
|
||||
(forward-line 1)))
|
||||
(t
|
||||
(re-search-forward inlinetask-re nil t)
|
||||
(forward-line 1)))))
|
||||
"Go to the end of the inline task at point.
|
||||
Return point."
|
||||
(save-match-data
|
||||
(beginning-of-line)
|
||||
(let* ((case-fold-search t)
|
||||
(inlinetask-re (org-inlinetask-outline-regexp))
|
||||
(task-end-re (concat inlinetask-re "END[ \t]*$")))
|
||||
(cond
|
||||
((looking-at task-end-re) (forward-line))
|
||||
((looking-at inlinetask-re)
|
||||
(forward-line)
|
||||
(cond
|
||||
((looking-at task-end-re) (forward-line))
|
||||
((looking-at inlinetask-re))
|
||||
((org-inlinetask-in-task-p)
|
||||
(re-search-forward inlinetask-re nil t)
|
||||
(forward-line))))
|
||||
(t (re-search-forward inlinetask-re nil t)
|
||||
(forward-line)))
|
||||
(point))))
|
||||
|
||||
(defun org-inlinetask-get-task-level ()
|
||||
"Get the level of the inline task around.
|
||||
|
@ -333,7 +347,9 @@ Either remove headline and meta data, or do special formatting."
|
|||
;; Remove the task.
|
||||
(goto-char beg)
|
||||
(delete-region beg end)
|
||||
(when org-inlinetask-export
|
||||
(when (and org-inlinetask-export
|
||||
(assq org-export-current-backend
|
||||
org-inlinetask-export-templates))
|
||||
;; Format CONTENT, if appropriate.
|
||||
(setq content
|
||||
(if (not (and content (string-match "\\S-" content)))
|
||||
|
@ -341,12 +357,14 @@ Either remove headline and meta data, or do special formatting."
|
|||
;; Ensure CONTENT has minimal indentation, a single
|
||||
;; newline character at its boundaries, and isn't
|
||||
;; protected.
|
||||
(when (string-match "`\\([ \t]*\n\\)+" content)
|
||||
(when (string-match "\\`\\([ \t]*\n\\)+" content)
|
||||
(setq content (substring content (match-end 0))))
|
||||
(when (string-match "[ \t\n]+\\'" content)
|
||||
(setq content (substring content 0 (match-beginning 0))))
|
||||
(org-add-props (concat "\n" (org-remove-indentation content) "\n")
|
||||
'(org-protected nil))))
|
||||
(org-add-props
|
||||
(concat "\n\n" (org-remove-indentation content) "\n\n")
|
||||
'(org-protected nil org-native-text nil))))
|
||||
|
||||
(when (string-match org-complex-heading-regexp headline)
|
||||
(let* ((nil-to-str
|
||||
(function
|
||||
|
@ -363,7 +381,7 @@ Either remove headline and meta data, or do special formatting."
|
|||
(backend-spec (assq org-export-current-backend
|
||||
org-inlinetask-export-templates))
|
||||
(format-str (org-add-props (nth 1 backend-spec)
|
||||
'(org-protected t)))
|
||||
'(org-protected t org-native-text t)))
|
||||
(tokens (cadr (nth 2 backend-spec)))
|
||||
;; Build export string. Ensure it won't break
|
||||
;; surrounding lists by giving it arbitrary high
|
||||
|
@ -372,6 +390,11 @@ Either remove headline and meta data, or do special formatting."
|
|||
(eval (append '(format format-str)
|
||||
(mapcar nil-to-str tokens)))
|
||||
'(original-indentation 1000))))
|
||||
;; Ensure task starts a new paragraph.
|
||||
(unless (or (bobp)
|
||||
(save-excursion (forward-line -1)
|
||||
(looking-at "[ \t]*$")))
|
||||
(insert "\n"))
|
||||
(insert export-str)
|
||||
(unless (bolp) (insert "\n")))))))))
|
||||
|
||||
|
@ -386,21 +409,34 @@ Either remove headline and meta data, or do special formatting."
|
|||
(goto-char (match-end 0))
|
||||
(current-column)))
|
||||
|
||||
(defvar org-indent-indentation-per-level) ; defined in org-indent.el
|
||||
|
||||
(defface org-inlinetask
|
||||
(org-compatible-face 'shadow '((t (:bold t))))
|
||||
"Face for inlinetask headlines."
|
||||
:group 'org-faces)
|
||||
|
||||
(defun org-inlinetask-fontify (limit)
|
||||
"Fontify the inline tasks."
|
||||
"Fontify the inline tasks down to LIMIT."
|
||||
(let* ((nstars (if org-odd-levels-only
|
||||
(1- (* 2 (or org-inlinetask-min-level 200)))
|
||||
(or org-inlinetask-min-level 200)))
|
||||
(re (concat "^\\(\\*\\)\\(\\*\\{"
|
||||
(format "%d" (- nstars 3))
|
||||
",\\}\\)\\(\\*\\* .*\\)")))
|
||||
",\\}\\)\\(\\*\\* .*\\)"))
|
||||
;; Virtual indentation will add the warning face on the first
|
||||
;; star. Thus, in that case, only hide it.
|
||||
(start-face (if (and (org-bound-and-true-p org-indent-mode)
|
||||
(> org-indent-indentation-per-level 1))
|
||||
'org-hide
|
||||
'org-warning)))
|
||||
(while (re-search-forward re limit t)
|
||||
(add-text-properties (match-beginning 1) (match-end 1)
|
||||
'(face org-warning font-lock-fontified t))
|
||||
`(face ,start-face font-lock-fontified t))
|
||||
(add-text-properties (match-beginning 2) (match-end 2)
|
||||
'(face org-hide font-lock-fontified t))
|
||||
(add-text-properties (match-beginning 3) (match-end 3)
|
||||
'(face shadow font-lock-fontified t)))))
|
||||
'(face org-inlinetask font-lock-fontified t)))))
|
||||
|
||||
(defun org-inlinetask-toggle-visibility ()
|
||||
"Toggle visibility of inline task at point."
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
;;
|
||||
;; Author: Philip Jackson <emacs@shellarchive.co.uk>
|
||||
;; Keywords: erc, irc, link, org
|
||||
;; Version: 7.7
|
||||
;;
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -60,6 +59,8 @@
|
|||
(declare-function erc-server-buffer "erc" ())
|
||||
(declare-function erc-get-server-nickname-list "erc" ())
|
||||
(declare-function erc-cmd-JOIN "erc" (channel &optional key))
|
||||
(declare-function org-pop-to-buffer-same-window
|
||||
"org-compat" (&optional buffer-or-name norecord label))
|
||||
|
||||
(defvar org-irc-client 'erc
|
||||
"The IRC client to act on.")
|
||||
|
@ -232,7 +233,7 @@ default."
|
|||
(throw 'found x))))))
|
||||
(if chan-buf
|
||||
(progn
|
||||
(switch-to-buffer chan-buf)
|
||||
(org-pop-to-buffer-same-window chan-buf)
|
||||
;; if we got a nick, and they're in the chan,
|
||||
;; then start a chat with them
|
||||
(let ((nick (pop link)))
|
||||
|
@ -243,14 +244,12 @@ default."
|
|||
(insert (concat nick ": ")))
|
||||
(error "%s not found in %s" nick chan-name)))))
|
||||
(progn
|
||||
(switch-to-buffer server-buffer)
|
||||
(org-pop-to-buffer-same-window server-buffer)
|
||||
(erc-cmd-JOIN chan-name))))
|
||||
(switch-to-buffer server-buffer)))
|
||||
(org-pop-to-buffer-same-window server-buffer)))
|
||||
;; no server match, make new connection
|
||||
(erc-select :server server :port port))))
|
||||
|
||||
(provide 'org-irc)
|
||||
|
||||
|
||||
|
||||
;;; org-irc.el ends here
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
;;; org-jsinfo.el --- Support for org-info.js Javascript in Org HTML export
|
||||
|
||||
;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Carsten Dominik <carsten at orgmode dot org>
|
||||
;; Keywords: outlines, hypermedia, calendar, wp
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
;;
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -204,6 +203,4 @@ Option settings will replace the %MANAGER-OPTIONS cookie."
|
|||
(provide 'org-infojs)
|
||||
(provide 'org-jsinfo)
|
||||
|
||||
|
||||
|
||||
;;; org-jsinfo.el ends here
|
||||
|
|
|
@ -4,8 +4,7 @@
|
|||
;;
|
||||
;; Emacs Lisp Archive Entry
|
||||
;; Filename: org-latex.el
|
||||
;; Version: 7.7
|
||||
;; Author: Bastien Guerry <bzg AT altern DOT org>
|
||||
;; Author: Bastien Guerry <bzg AT gnu DOT org>
|
||||
;; Maintainer: Carsten Dominik <carsten.dominik AT gmail DOT com>
|
||||
;; Keywords: org, wp, tex
|
||||
;; Description: Converts an org-mode buffer into LaTeX
|
||||
|
@ -74,7 +73,6 @@
|
|||
org-deadline-string "\\|"
|
||||
org-closed-string"\\)")
|
||||
"Regexp matching special time planning keywords plus the time after it.")
|
||||
|
||||
(defvar org-re-quote) ; dynamically scoped from org.el
|
||||
(defvar org-commentsp) ; dynamically scoped from org.el
|
||||
|
||||
|
@ -304,8 +302,8 @@ markup defined, the first one in the association list will be used."
|
|||
|
||||
(defcustom org-export-latex-href-format "\\href{%s}{%s}"
|
||||
"A printf format string to be applied to href links.
|
||||
The format must contain either two %s instances or just one.
|
||||
If it contains two %s instances, the first will be filled with
|
||||
The format must contain either two %s instances or just one.
|
||||
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
|
||||
|
@ -359,6 +357,12 @@ string defines the replacement string for this quote."
|
|||
:group 'org-export-latex
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom org-export-latex-table-caption-above t
|
||||
"When non-nil, the caption is set above the table. When nil,
|
||||
the caption is set below the table."
|
||||
:group 'org-export-latex
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom org-export-latex-tables-column-borders nil
|
||||
"When non-nil, grouping columns can cause outer vertical lines in tables.
|
||||
When nil, grouping causes only separation lines between groups."
|
||||
|
@ -402,7 +406,7 @@ will pass them (combined with the LaTeX default list parameters) to
|
|||
:type 'plist)
|
||||
|
||||
(defcustom org-export-latex-verbatim-wrap
|
||||
'("\\begin{verbatim}\n" . "\\end{verbatim}\n")
|
||||
'("\\begin{verbatim}\n" . "\\end{verbatim}")
|
||||
"Environment to be wrapped around a fixed-width section in LaTeX export.
|
||||
This is a cons with two strings, to be added before and after the
|
||||
fixed-with text.
|
||||
|
@ -594,7 +598,7 @@ and `org-export-with-tags' instead."
|
|||
"Extensions of image files that can be inlined into LaTeX.
|
||||
Note that the image extension *actually* allowed depend on the way the
|
||||
LaTeX file is processed. When used with pdflatex, pdf, jpg and png images
|
||||
are OK. When processing through dvi to PostScript, only ps and eps are
|
||||
are OK. When processing through dvi to Postscript, only ps and eps are
|
||||
allowed. The default we use here encompasses both."
|
||||
:group 'org-export-latex
|
||||
:type '(repeat (string :tag "Extension")))
|
||||
|
@ -719,7 +723,7 @@ then use this command to convert it."
|
|||
(interactive "r")
|
||||
(let (reg latex buf)
|
||||
(save-window-excursion
|
||||
(if (org-mode-p)
|
||||
(if (eq major-mode 'org-mode)
|
||||
(setq latex (org-export-region-as-latex
|
||||
beg end t 'string))
|
||||
(setq reg (buffer-substring beg end)
|
||||
|
@ -865,6 +869,8 @@ when PUB-DIR is set, use this as the publishing directory."
|
|||
(file-truename (or buffer-file-name "dummy.org")))
|
||||
(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
|
||||
(buffer (if to-buffer
|
||||
(cond
|
||||
((eq to-buffer 'string) (get-buffer-create
|
||||
|
@ -1340,7 +1346,7 @@ LEVEL indicates the default depth for export."
|
|||
(save-restriction
|
||||
(widen)
|
||||
(goto-char (point-min))
|
||||
(and (re-search-forward "^#\\+LaTeX_CLASS:[ \t]*\\(-[a-zA-Z]+\\)" nil t)
|
||||
(and (re-search-forward "^#\\+LaTeX_CLASS:[ \t]*\\([-/a-zA-Z]+\\)" nil t)
|
||||
(match-string 1))))
|
||||
(plist-get org-export-latex-options-plist :latex-class)
|
||||
org-export-latex-default-class)
|
||||
|
@ -1395,7 +1401,11 @@ OPT-PLIST is the options plist for current buffer."
|
|||
(email (replace-regexp-in-string
|
||||
"_" "\\\\_"
|
||||
(org-export-apply-macros-in-string
|
||||
(plist-get opt-plist :email)))))
|
||||
(plist-get opt-plist :email))))
|
||||
(description (org-export-apply-macros-in-string
|
||||
(plist-get opt-plist :description)))
|
||||
(keywords (org-export-apply-macros-in-string
|
||||
(plist-get opt-plist :keywords))))
|
||||
(concat
|
||||
(if (plist-get opt-plist :time-stamp-file)
|
||||
(format-time-string "%% Created %Y-%m-%d %a %H:%M\n"))
|
||||
|
@ -1429,6 +1439,12 @@ OPT-PLIST is the options plist for current buffer."
|
|||
(format-time-string
|
||||
(or (plist-get opt-plist :date)
|
||||
org-export-latex-date-format)))
|
||||
;; add some hyperref options
|
||||
;; FIXME: let's have a defcustom for this?
|
||||
(format "\\hypersetup{\n pdfkeywords={%s},\n pdfsubject={%s},\n pdfcreator={%s}}\n"
|
||||
(org-export-latex-fontify-headline keywords)
|
||||
(org-export-latex-fontify-headline description)
|
||||
(concat "Emacs Org-mode version " org-version))
|
||||
;; beginning of the document
|
||||
"\n\\begin{document}\n\n"
|
||||
;; insert the title command
|
||||
|
@ -1837,7 +1853,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
|
|||
(replace-match (concat (match-string 1)
|
||||
(match-string 2)) t t)
|
||||
(forward-line))
|
||||
(insert "\\end{verbatim}\n\n"))
|
||||
(insert "\\end{verbatim}\n"))
|
||||
(progn (goto-char (match-beginning 0))
|
||||
(while (looking-at "^\\([ \t]*\\):\\(\\([ \t]\\|$\\).*\\)$")
|
||||
(replace-match (concat "%" (match-string 1)
|
||||
|
@ -1966,13 +1982,13 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
|
|||
(concat "\\begin{longtable}{" align "}\n")
|
||||
(if floatp
|
||||
(format "\\begin{%s}%s\n" tblenv placement)))
|
||||
(if floatp
|
||||
(if (and floatp org-export-latex-table-caption-above)
|
||||
(format
|
||||
"\\caption%s{%s} %s"
|
||||
(if shortn (concat "[" shortn "]") "")
|
||||
(or caption "")
|
||||
(if label (format "\\label{%s}" label) "")))
|
||||
(if (and longtblp caption) "\\\\\n" "\n")
|
||||
(if (and longtblp caption) "\\\\\n" "\n")
|
||||
(if (and org-export-latex-tables-centered (not longtblp))
|
||||
"\\begin{center}\n")
|
||||
(if (not longtblp)
|
||||
|
@ -1994,6 +2010,12 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
|
|||
(if (not longtblp) (format "\n\\end{%s}" tabular-env))
|
||||
(if longtblp "\n" (if org-export-latex-tables-centered
|
||||
"\n\\end{center}\n" "\n"))
|
||||
(if (and floatp (not org-export-latex-table-caption-above))
|
||||
(format
|
||||
"\\caption%s{%s} %s"
|
||||
(if shortn (concat "[" shortn "]") "")
|
||||
(or caption "")
|
||||
(if label (format "\\label{%s}" label) "")))
|
||||
(if longtblp
|
||||
"\\end{longtable}"
|
||||
(if floatp (format "\\end{%s}" tblenv)))))
|
||||
|
@ -2043,11 +2065,12 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
|
|||
(setq tbl (concat "\\begin{center}\n" tbl "\\end{center}")))
|
||||
(when floatp
|
||||
(setq tbl (concat "\\begin{table}\n"
|
||||
(if (not org-export-latex-table-caption-above) tbl)
|
||||
(format "\\caption%s{%s%s}\n"
|
||||
(if shortn (format "[%s]" shortn) "")
|
||||
(if label (format "\\label{%s}" label) "")
|
||||
(or caption ""))
|
||||
tbl
|
||||
(if org-export-latex-table-caption-above tbl)
|
||||
"\n\\end{table}\n")))
|
||||
(insert (org-export-latex-protect-string tbl))))
|
||||
|
||||
|
@ -2203,7 +2226,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
|
|||
;; a LaTeX issue, but we here implement a work-around anyway.
|
||||
(setq path (org-export-latex-protect-amp path)
|
||||
desc (org-export-latex-protect-amp desc)))
|
||||
(insert
|
||||
(insert
|
||||
(if (string-match "%s.*%s" org-export-latex-href-format)
|
||||
(format org-export-latex-href-format path desc)
|
||||
(format org-export-latex-href-format path))))
|
||||
|
@ -2338,7 +2361,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
|
|||
(let ((next (org-footnote-get-next-reference)))
|
||||
(and next (= (nth 1 next) (nth 2 ref)))))
|
||||
org-export-latex-footnote-separator ""))))
|
||||
(when (org-on-heading-p)
|
||||
(when (org-at-heading-p)
|
||||
(setq fnote (concat (org-export-latex-protect-string "\\protect")
|
||||
fnote)))
|
||||
;; Ensure a footnote at column 0 cannot end a list
|
||||
|
@ -2769,6 +2792,4 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
|
|||
(provide 'org-export-latex)
|
||||
(provide 'org-latex)
|
||||
|
||||
|
||||
|
||||
;;; org-latex.el ends here
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
;;; org-list.el --- Plain lists for Org-mode
|
||||
;;
|
||||
;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
|
||||
;;
|
||||
;; Author: Carsten Dominik <carsten at orgmode dot org>
|
||||
;; Bastien Guerry <bzg AT altern DOT org>
|
||||
;; Bastien Guerry <bzg AT gnu DOT org>
|
||||
;; Keywords: outlines, hypermedia, calendar, wp
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
;;
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -28,30 +27,31 @@
|
|||
|
||||
;; This file contains the code dealing with plain lists in Org-mode.
|
||||
|
||||
;; The fundamental idea behind lists work is to use structures.
|
||||
;; A structure is a snapshot of the list, in the shape of data tree
|
||||
;; (see `org-list-struct').
|
||||
;; The core concept behind lists is their structure. A structure is
|
||||
;; a snapshot of the list, in the shape of a data tree (see
|
||||
;; `org-list-struct').
|
||||
|
||||
;; Once the list structure is stored, it is possible to make changes
|
||||
;; directly on it or get useful information about the list, with the
|
||||
;; two helper functions, namely `org-list-parents-alist' and
|
||||
;; `org-list-prevs-alist', and using accessors or methods.
|
||||
;; on it that will be mirrored to the real list or to get information
|
||||
;; about the list, using accessors and methods provided in the
|
||||
;; library. Most of them require the use of one or two helper
|
||||
;; functions, namely `org-list-parents-alist' and
|
||||
;; `org-list-prevs-alist'.
|
||||
|
||||
;; Structure is eventually applied to the buffer with
|
||||
;; `org-list-write-struct'. This function repairs (bullets,
|
||||
;; indentation, checkboxes) the structure before applying it. It
|
||||
;; should be called near the end of any function working on
|
||||
;; structures.
|
||||
;; indentation, checkboxes) the list in the process. It should be
|
||||
;; called near the end of any function working on structures.
|
||||
|
||||
;; Thus, a function applying to lists should usually follow this
|
||||
;; template:
|
||||
|
||||
;; 1. Verify point is in a list and grab item beginning (with the same
|
||||
;; function `org-in-item-p'). If the function requires the cursor
|
||||
;; to be at item's bullet, `org-at-item-p' is more selective. If
|
||||
;; the cursor is amidst the buffer, it is possible to find the
|
||||
;; closest item with `org-list-search-backward', or
|
||||
;; `org-list-search-forward', applied to `org-item-beginning-re'.
|
||||
;; to be at item's bullet, `org-at-item-p' is more selective. It
|
||||
;; is also possible to move point to the closest item with
|
||||
;; `org-list-search-backward', or `org-list-search-forward',
|
||||
;; applied to the function `org-item-beginning-re'.
|
||||
|
||||
;; 2. Get list structure with `org-list-struct'.
|
||||
|
||||
|
@ -62,15 +62,16 @@
|
|||
;; 4. Proceed with the modifications, using methods and accessors.
|
||||
|
||||
;; 5. Verify and apply structure to buffer, using
|
||||
;; `org-list-write-struct'. Possibly use
|
||||
;; `org-update-checkbox-count-maybe' if checkboxes might have been
|
||||
;; modified.
|
||||
;; `org-list-write-struct'.
|
||||
|
||||
;; Computing a list structure can be a costly operation on huge lists
|
||||
;; (a few thousand lines long). Thus, code should follow the rule :
|
||||
;; 6. If changes made to the list might have modified check-boxes,
|
||||
;; call `org-update-checkbox-count-maybe'.
|
||||
|
||||
;; Computing a structure can be a costly operation on huge lists (a
|
||||
;; few thousand lines long). Thus, code should follow the rule:
|
||||
;; "collect once, use many". As a corollary, it is usually a bad idea
|
||||
;; to use directly an interactive function inside the code, as those,
|
||||
;; being independent entities, read the whole list structure another
|
||||
;; being independant entities, read the whole list structure another
|
||||
;; time.
|
||||
|
||||
;;; Code:
|
||||
|
@ -95,7 +96,6 @@
|
|||
|
||||
(declare-function org-at-heading-p "org" (&optional ignored))
|
||||
(declare-function org-before-first-heading-p "org" ())
|
||||
(declare-function org-back-over-empty-lines "org" ())
|
||||
(declare-function org-back-to-heading "org" (&optional invisible-ok))
|
||||
(declare-function org-combine-plists "org" (&rest plists))
|
||||
(declare-function org-count "org" (cl-item cl-seq))
|
||||
|
@ -113,7 +113,7 @@
|
|||
(declare-function org-inlinetask-outline-regexp "org-inlinetask" ())
|
||||
(declare-function org-level-increment "org" ())
|
||||
(declare-function org-narrow-to-subtree "org" ())
|
||||
(declare-function org-on-heading-p "org" (&optional invisible-ok))
|
||||
(declare-function org-at-heading-p "org" (&optional invisible-ok))
|
||||
(declare-function org-previous-line-empty-p "org" ())
|
||||
(declare-function org-remove-if "org" (predicate seq))
|
||||
(declare-function org-reduced-level "org" (L))
|
||||
|
@ -128,6 +128,8 @@
|
|||
(declare-function outline-next-heading "outline" ())
|
||||
(declare-function outline-previous-heading "outline" ())
|
||||
|
||||
|
||||
|
||||
;;; Configuration variables
|
||||
|
||||
(defgroup org-plain-lists nil
|
||||
|
@ -271,7 +273,7 @@ By default, automatic actions are taken when using
|
|||
\\[org-meta-return], \\[org-metaright], \\[org-metaleft],
|
||||
\\[org-shiftmetaright], \\[org-shiftmetaleft],
|
||||
\\[org-ctrl-c-minus], \\[org-toggle-checkbox] or
|
||||
\\[org-insert-todo-heading]. You can disable individually these
|
||||
\\[org-insert-todo-heading]. You can disable individually these
|
||||
rules by setting them to nil. Valid rules are:
|
||||
|
||||
bullet when non-nil, cycling bullet do not allow lists at
|
||||
|
@ -376,6 +378,7 @@ specifically, type `block' is determined by the variable
|
|||
`org-list-forbidden-blocks'.")
|
||||
|
||||
|
||||
|
||||
;;; Predicates and regexps
|
||||
|
||||
(defconst org-list-end-re (if org-empty-line-terminates-plain-lists
|
||||
|
@ -385,9 +388,9 @@ specifically, type `block' is determined by the variable
|
|||
It depends on `org-empty-line-terminates-plain-lists'.")
|
||||
|
||||
(defconst org-list-full-item-re
|
||||
(concat "^[ \t]*\\(\\(?:[-+*]\\|\\(?:[0-9]+\\|[A-Za-z]\\)[.)]\\)[ \t]+\\)"
|
||||
(concat "^[ \t]*\\(\\(?:[-+*]\\|\\(?:[0-9]+\\|[A-Za-z]\\)[.)]\\)\\(?:[ \t]+\\|$\\)\\)"
|
||||
"\\(?:\\[@\\(?:start:\\)?\\([0-9]+\\|[A-Za-z]\\)\\][ \t]*\\)?"
|
||||
"\\(?:\\(\\[[ X-]\\]\\)[ \t]+\\)?"
|
||||
"\\(?:\\(\\[[ X-]\\]\\)\\(?:[ \t]+\\|$\\)\\)?"
|
||||
"\\(?:\\(.*\\)[ \t]+::\\(?:[ \t]+\\|$\\)\\)?")
|
||||
"Matches a list item and puts everything into groups:
|
||||
group 1: bullet
|
||||
|
@ -535,6 +538,7 @@ This checks `org-list-ending-method'."
|
|||
(match-string 2)))
|
||||
|
||||
|
||||
|
||||
;;; Structures and helper functions
|
||||
|
||||
(defun org-list-context ()
|
||||
|
@ -681,7 +685,7 @@ Assume point is at an item."
|
|||
(cond
|
||||
((<= (point) lim-up)
|
||||
;; At upward limit: if we ended at an item, store it,
|
||||
;; else dismiss useless data recorded above BEG-CELL.
|
||||
;; else dimiss useless data recorded above BEG-CELL.
|
||||
;; Jump to part 2.
|
||||
(throw 'exit
|
||||
(setq itm-lst
|
||||
|
@ -803,21 +807,9 @@ Assume point is at an item."
|
|||
(forward-line 1))))))
|
||||
(setq struct (append itm-lst (cdr (nreverse itm-lst-2)))
|
||||
end-lst (append end-lst (cdr (nreverse end-lst-2))))
|
||||
;; 3. Correct ill-formed lists by ensuring top item is the least
|
||||
;; indented.
|
||||
(let ((min-ind (nth 1 (car struct))))
|
||||
(mapc (lambda (item)
|
||||
(let ((ind (nth 1 item))
|
||||
(bul (nth 2 item)))
|
||||
(when (< ind min-ind)
|
||||
(setcar (cdr item) min-ind)
|
||||
;; Trim bullet so item will be seen as different
|
||||
;; when compared with repaired version.
|
||||
(setcar (nthcdr 2 item) (org-trim bul)))))
|
||||
struct))
|
||||
;; 4. Associate each item to its end pos.
|
||||
;; 3. Associate each item to its end position.
|
||||
(org-list-struct-assoc-end struct end-lst)
|
||||
;; 5. Return STRUCT
|
||||
;; 4. Return STRUCT
|
||||
struct)))
|
||||
|
||||
(defun org-list-struct-assoc-end (struct end-list)
|
||||
|
@ -854,8 +846,9 @@ This function modifies STRUCT."
|
|||
|
||||
(defun org-list-parents-alist (struct)
|
||||
"Return alist between item and parent in STRUCT."
|
||||
(let ((ind-to-ori (list (list (nth 1 (car struct)))))
|
||||
(prev-pos (list (caar struct))))
|
||||
(let* ((ind-to-ori (list (list (nth 1 (car struct)))))
|
||||
(top-item (org-list-get-top-point struct))
|
||||
(prev-pos (list top-item)))
|
||||
(cons prev-pos
|
||||
(mapcar (lambda (item)
|
||||
(let ((pos (car item))
|
||||
|
@ -864,17 +857,34 @@ This function modifies STRUCT."
|
|||
(push pos prev-pos)
|
||||
(cond
|
||||
((> prev-ind ind)
|
||||
;; A sub-list is over. Find the associated
|
||||
;; origin in IND-TO-ORI. If it cannot be
|
||||
;; found (ill-formed list), set its parent as
|
||||
;; the first item less indented. If there is
|
||||
;; none, make it a top-level item.
|
||||
(setq ind-to-ori
|
||||
(member (assq ind ind-to-ori) ind-to-ori))
|
||||
(or (member (assq ind ind-to-ori) ind-to-ori)
|
||||
(catch 'exit
|
||||
(mapc
|
||||
(lambda (e)
|
||||
(when (< (car e) ind)
|
||||
(throw 'exit (member e ind-to-ori))))
|
||||
ind-to-ori)
|
||||
(list (list ind)))))
|
||||
(cons pos (cdar ind-to-ori)))
|
||||
;; A sub-list starts. Every item at IND will
|
||||
;; have previous item as its parent.
|
||||
((< prev-ind ind)
|
||||
(let ((origin (nth 1 prev-pos)))
|
||||
(push (cons ind origin) ind-to-ori)
|
||||
(cons pos origin)))
|
||||
;; Another item in the same sub-list: it shares
|
||||
;; the same parent as the previous item.
|
||||
(t (cons pos (cdar ind-to-ori))))))
|
||||
(cdr struct)))))
|
||||
|
||||
|
||||
|
||||
;;; Accessors
|
||||
|
||||
(defsubst org-list-get-nth (n key struct)
|
||||
|
@ -992,8 +1002,8 @@ items, as returned by `org-list-prevs-alist'."
|
|||
|
||||
(defun org-list-get-children (item struct parents)
|
||||
"List all children of ITEM, or nil.
|
||||
STRUCT is the list structure. PARENTS is the alist of parents, as
|
||||
returned by `org-list-parents-alist'."
|
||||
STRUCT is the list structure. PARENTS is the alist of parents,
|
||||
as returned by `org-list-parents-alist'."
|
||||
(let (all child)
|
||||
(while (setq child (car (rassq item parents)))
|
||||
(setq parents (cdr (member (assq child parents) parents)))
|
||||
|
@ -1052,6 +1062,7 @@ type is determined by the first item of the list."
|
|||
(t 'unordered))))
|
||||
|
||||
|
||||
|
||||
;;; Searching
|
||||
|
||||
(defun org-list-search-generic (search re bound noerr)
|
||||
|
@ -1084,6 +1095,7 @@ Arguments REGEXP, BOUND and NOERROR are similar to those used in
|
|||
regexp (or bound (point-max)) noerror))
|
||||
|
||||
|
||||
|
||||
;;; Methods on structures
|
||||
|
||||
(defsubst org-list-bullet-string (bullet)
|
||||
|
@ -1168,7 +1180,16 @@ some heuristics to guess the result."
|
|||
(let ((item (point))
|
||||
(insert-blank-p
|
||||
(cdr (assq 'plain-list-item org-blank-before-new-entry)))
|
||||
usr-blank)
|
||||
usr-blank
|
||||
(count-blanks
|
||||
(function
|
||||
(lambda ()
|
||||
;; Count blank lines above beginning of line.
|
||||
(save-excursion
|
||||
(count-lines (goto-char (point-at-bol))
|
||||
(progn (skip-chars-backward " \r\t\n")
|
||||
(forward-line)
|
||||
(point))))))))
|
||||
(cond
|
||||
;; Trivial cases where there should be none.
|
||||
((or (and (not (eq org-list-ending-method 'indent))
|
||||
|
@ -1177,21 +1198,20 @@ some heuristics to guess the result."
|
|||
;; 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
|
||||
;; neighboring items in list.
|
||||
;; neighbours items in list.
|
||||
(t (let ((next-p (org-list-get-next-item item struct prevs)))
|
||||
(cond
|
||||
;; Is there a next item?
|
||||
(next-p (goto-char next-p)
|
||||
(org-back-over-empty-lines))
|
||||
(funcall count-blanks))
|
||||
;; Is there a previous item?
|
||||
((org-list-get-prev-item item struct prevs)
|
||||
(org-back-over-empty-lines))
|
||||
(funcall count-blanks))
|
||||
;; User inserted blank lines, trust him.
|
||||
((and (> pos (org-list-get-item-end-before-blank item struct))
|
||||
(> (save-excursion
|
||||
(goto-char pos)
|
||||
(skip-chars-backward " \t")
|
||||
(setq usr-blank (org-back-over-empty-lines))) 0))
|
||||
(> (save-excursion (goto-char pos)
|
||||
(setq usr-blank (funcall count-blanks)))
|
||||
0))
|
||||
usr-blank)
|
||||
;; Are there blank lines inside the list so far?
|
||||
((save-excursion
|
||||
|
@ -1207,7 +1227,7 @@ some heuristics to guess the result."
|
|||
If POS is before first character after bullet of the item, the
|
||||
new item will be created before the current one.
|
||||
|
||||
STRUCT is the list structure. PREVS is the alist of previous
|
||||
STRUCT is the list structure. PREVS is the the alist of previous
|
||||
items, as returned by `org-list-prevs-alist'.
|
||||
|
||||
Insert a checkbox if CHECKBOX is non-nil, and string AFTER-BULLET
|
||||
|
@ -1364,8 +1384,8 @@ If DEST is a buffer position, the function will assume it points
|
|||
to another item in the same list as ITEM, and will move the
|
||||
latter just before the former.
|
||||
|
||||
If DEST is `begin' \(resp. `end'\), ITEM will be moved at the
|
||||
beginning \(resp. end\) of the list it belongs to.
|
||||
If DEST is `begin' \(respectively `end'\), ITEM will be moved at
|
||||
the beginning \(respectively end\) of the list it belongs to.
|
||||
|
||||
If DEST is a string like \"N\", where N is an integer, ITEM will
|
||||
be moved at the Nth position in the list.
|
||||
|
@ -1543,12 +1563,13 @@ bullets between START and END."
|
|||
(mapcar ind parents)))
|
||||
|
||||
|
||||
|
||||
;;; Repairing structures
|
||||
|
||||
(defun org-list-use-alpha-bul-p (first struct prevs)
|
||||
"Non-nil if list starting at FIRST can have alphabetical bullets.
|
||||
|
||||
STRUCT is list structure. PREVS is the alist of previous items,
|
||||
STRUCT is list structure. PREVS is the alist of previous items,
|
||||
as returned by `org-list-prevs-alist'."
|
||||
(and org-alphabetical-lists
|
||||
(catch 'exit
|
||||
|
@ -1746,15 +1767,41 @@ This function modifies STRUCT."
|
|||
;; Return blocking item.
|
||||
(nth index all-items)))))))
|
||||
|
||||
(defun org-list-struct-fix-item-end (struct)
|
||||
"Verify and correct each item end position in STRUCT.
|
||||
|
||||
This function modifies STRUCT."
|
||||
(let (end-list acc-end)
|
||||
(mapc (lambda (e)
|
||||
(let* ((pos (car e))
|
||||
(ind-pos (org-list-get-ind pos struct))
|
||||
(end-pos (org-list-get-item-end pos struct)))
|
||||
(unless (assq end-pos struct)
|
||||
;; To determine real ind of an ending position that is
|
||||
;; not at an item, we have to find the item it belongs
|
||||
;; to: it is the last item (ITEM-UP), whose ending is
|
||||
;; further than the position we're interested in.
|
||||
(let ((item-up (assoc-default end-pos acc-end '>)))
|
||||
(push (cons
|
||||
;; Else part is for the bottom point.
|
||||
(if item-up (+ (org-list-get-ind item-up struct) 2) 0)
|
||||
end-pos)
|
||||
end-list)))
|
||||
(push (cons ind-pos pos) end-list)
|
||||
(push (cons end-pos pos) acc-end)))
|
||||
struct)
|
||||
(setq end-list (sort end-list (lambda (e1 e2) (< (cdr e1) (cdr e2)))))
|
||||
(org-list-struct-assoc-end struct end-list)))
|
||||
|
||||
(defun org-list-struct-apply-struct (struct old-struct)
|
||||
"Apply set-difference between STRUCT and OLD-STRUCT to the buffer.
|
||||
"Apply set difference between STRUCT and OLD-STRUCT to the buffer.
|
||||
|
||||
OLD-STRUCT is the structure before any modifications, and STRUCT
|
||||
the structure to be applied. The function will only modify parts
|
||||
of the list which have changed.
|
||||
|
||||
Initial position of cursor is restored after the changes."
|
||||
(let* ((origin (copy-marker (point)))
|
||||
(let* ((origin (point-marker))
|
||||
(inlinetask-re (and (featurep 'org-inlinetask)
|
||||
(org-inlinetask-outline-regexp)))
|
||||
(item-re (org-item-re))
|
||||
|
@ -1804,13 +1851,11 @@ Initial position of cursor is restored after the changes."
|
|||
((and (match-string 3) new-box)
|
||||
(replace-match new-box nil nil nil 3))
|
||||
((match-string 3)
|
||||
;; (goto-char (or (match-end 2) (match-end 1)))
|
||||
;; (skip-chars-backward " \t")
|
||||
(looking-at ".*?\\([ \t]*\\[[ X-]\\]\\)")
|
||||
(replace-match "" nil nil nil 1))
|
||||
(t (let ((counterp (match-end 2)))
|
||||
(goto-char (if counterp (1+ counterp) (match-end 1)))
|
||||
(insert (concat new-box (unless counterp " "))))))
|
||||
(insert (concat new-box (unless counterp " "))))))
|
||||
;; c. Indent item to appropriate column.
|
||||
(unless (= new-ind old-ind)
|
||||
(delete-region (goto-char (point-at-bol))
|
||||
|
@ -1869,53 +1914,38 @@ Initial position of cursor is restored after the changes."
|
|||
(goto-char origin)
|
||||
(move-marker origin nil)))
|
||||
|
||||
(defun org-list-write-struct (struct parents)
|
||||
(defun org-list-write-struct (struct parents &optional old-struct)
|
||||
"Correct bullets, checkboxes and indentation in list at point.
|
||||
|
||||
STRUCT is the list structure. PARENTS is the alist of parents,
|
||||
as returned by `org-list-parents-alist'."
|
||||
as returned by `org-list-parents-alist'.
|
||||
|
||||
When non-nil, optional argument OLD-STRUCT is the reference
|
||||
structure of the list. It should be provided whenever STRUCT
|
||||
doesn't correspond anymore to the real list in buffer."
|
||||
;; Order of functions matters here: checkboxes and endings need
|
||||
;; correct indentation to be set, and indentation needs correct
|
||||
;; bullets.
|
||||
;;
|
||||
;; 0. Save a copy of structure before modifications
|
||||
(let ((old-struct (copy-tree struct)))
|
||||
(let ((old-struct (or old-struct (copy-tree struct))))
|
||||
;; 1. Set a temporary, but coherent with PARENTS, indentation in
|
||||
;; order to get items endings and bullets properly
|
||||
(org-list-struct-fix-ind struct parents 2)
|
||||
;; 2. Get pseudo-alist of ending positions and sort it by position.
|
||||
;; Then associate them to the structure.
|
||||
(let (end-list acc-end)
|
||||
(mapc (lambda (e)
|
||||
(let* ((pos (car e))
|
||||
(ind-pos (org-list-get-ind pos struct))
|
||||
(end-pos (org-list-get-item-end pos struct)))
|
||||
(unless (assq end-pos struct)
|
||||
;; To determine real ind of an ending position that is
|
||||
;; not at an item, we have to find the item it belongs
|
||||
;; to: it is the last item (ITEM-UP), whose ending is
|
||||
;; further than the position we're interested in.
|
||||
(let ((item-up (assoc-default end-pos acc-end '>)))
|
||||
(push (cons
|
||||
;; Else part is for the bottom point.
|
||||
(if item-up (+ (org-list-get-ind item-up struct) 2) 0)
|
||||
end-pos)
|
||||
end-list)))
|
||||
(push (cons ind-pos pos) end-list)
|
||||
(push (cons end-pos pos) acc-end)))
|
||||
struct)
|
||||
(setq end-list (sort end-list (lambda (e1 e2) (< (cdr e1) (cdr e2)))))
|
||||
(org-list-struct-assoc-end struct end-list))
|
||||
;; 3. Get bullets right.
|
||||
(let ((prevs (org-list-prevs-alist struct)))
|
||||
(org-list-struct-fix-bul struct prevs)
|
||||
;; 4. Now get real indentation.
|
||||
(org-list-struct-fix-ind struct parents)
|
||||
;; 5. Eventually fix checkboxes.
|
||||
(org-list-struct-fix-box struct parents prevs))
|
||||
;; 6. Apply structure modifications to buffer.
|
||||
(org-list-struct-apply-struct struct old-struct)))
|
||||
;; 2. Fix each item end to get correct prevs alist.
|
||||
(org-list-struct-fix-item-end struct)
|
||||
;; 3. Get bullets right.
|
||||
(let ((prevs (org-list-prevs-alist struct)))
|
||||
(org-list-struct-fix-bul struct prevs)
|
||||
;; 4. Now get real indentation.
|
||||
(org-list-struct-fix-ind struct parents)
|
||||
;; 5. Eventually fix checkboxes.
|
||||
(org-list-struct-fix-box struct parents prevs))
|
||||
;; 6. Apply structure modifications to buffer.
|
||||
(org-list-struct-apply-struct struct old-struct)))
|
||||
|
||||
|
||||
|
||||
;;; Misc Tools
|
||||
|
||||
(defun org-apply-on-list (function init-value &rest args)
|
||||
|
@ -1947,7 +1977,7 @@ beginning of the item."
|
|||
(defun org-list-set-item-visibility (item struct view)
|
||||
"Set visibility of ITEM in STRUCT to VIEW.
|
||||
|
||||
Possible values are: `folded', `children' or `subtree'. See
|
||||
Possible values are: `folded', `children' or `subtree'. See
|
||||
`org-cycle' for more information."
|
||||
(cond
|
||||
((eq view 'folded)
|
||||
|
@ -1983,6 +2013,7 @@ Possible values are: `folded', `children' or `subtree'. See
|
|||
tcol))
|
||||
|
||||
|
||||
|
||||
;;; Interactive functions
|
||||
|
||||
(defalias 'org-list-get-item-begin 'org-in-item-p)
|
||||
|
@ -2257,7 +2288,7 @@ in subtree, ignoring drawers."
|
|||
(setq lim-up (point-at-bol))
|
||||
(error "No item in region"))
|
||||
(setq lim-down (copy-marker limit))))
|
||||
((org-on-heading-p)
|
||||
((org-at-heading-p)
|
||||
;; On an heading, start at first item after drawers and
|
||||
;; time-stamps (scheduled, etc.).
|
||||
(let ((limit (save-excursion (outline-next-heading) (point))))
|
||||
|
@ -2274,7 +2305,7 @@ in subtree, ignoring drawers."
|
|||
((org-at-item-p)
|
||||
(setq singlep t)
|
||||
(setq lim-up (point-at-bol)
|
||||
lim-down (point-at-eol)))
|
||||
lim-down (copy-marker (point-at-eol))))
|
||||
(t (error "Not at an item or heading, and no active region"))))
|
||||
;; Determine the checkbox going to be applied to all items
|
||||
;; within bounds.
|
||||
|
@ -2328,9 +2359,9 @@ in subtree, ignoring drawers."
|
|||
"Checkboxes were removed due to unchecked box at line %d"
|
||||
(org-current-line block-item))))
|
||||
(goto-char bottom)
|
||||
(move-marker lim-down nil)
|
||||
(move-marker bottom nil)
|
||||
(org-list-struct-apply-struct struct struct-copy)))))
|
||||
(org-list-struct-apply-struct struct struct-copy)))
|
||||
(move-marker lim-down nil)))
|
||||
(org-update-checkbox-count-maybe))
|
||||
|
||||
(defun org-reset-checkbox-state-subtree ()
|
||||
|
@ -2416,7 +2447,7 @@ With optional prefix argument ALL, do this for the whole buffer."
|
|||
(cond ; boxes count
|
||||
;; Cookie is at an heading, but specifically for todo,
|
||||
;; not for checkboxes: skip it.
|
||||
((and (org-on-heading-p)
|
||||
((and (org-at-heading-p)
|
||||
(string-match "\\<todo\\>"
|
||||
(downcase
|
||||
(or (org-entry-get nil "COOKIE_DATA") ""))))
|
||||
|
@ -2425,14 +2456,14 @@ With optional prefix argument ALL, do this for the whole buffer."
|
|||
;; heading already have been read. Use data collected
|
||||
;; in STRUCTS-BAK. This should only happen when
|
||||
;; heading has more than one cookie on it.
|
||||
((and (org-on-heading-p)
|
||||
((and (org-at-heading-p)
|
||||
(<= (save-excursion (outline-next-heading) (point))
|
||||
backup-end))
|
||||
(funcall count-boxes nil structs-bak recursivep))
|
||||
;; Cookie is at a fresh heading. Grab structure of
|
||||
;; every list containing a checkbox between point and
|
||||
;; next headline, and save them in STRUCTS-BAK.
|
||||
((org-on-heading-p)
|
||||
((org-at-heading-p)
|
||||
(setq backup-end (save-excursion
|
||||
(outline-next-heading) (point))
|
||||
structs-bak nil)
|
||||
|
@ -2491,7 +2522,8 @@ Otherwise it will be `org-todo'."
|
|||
'org-checkbox-statistics-todo)))
|
||||
|
||||
(defun org-update-checkbox-count-maybe (&optional all)
|
||||
"Update checkbox statistics unless turned off by user."
|
||||
"Update checkbox statistics unless turned off by user.
|
||||
With an optional argument ALL, update them in the whole buffer."
|
||||
(when (cdr (assq 'checkbox org-list-automatic-rules))
|
||||
(org-update-checkbox-count all))
|
||||
(run-hooks 'org-checkbox-statistics-hook))
|
||||
|
@ -2642,7 +2674,7 @@ If a region is active, all items inside will be moved."
|
|||
(defvar org-tab-ind-state)
|
||||
(defun org-cycle-item-indentation ()
|
||||
"Cycle levels of indentation of an empty item.
|
||||
The first run indents the item, if applicable. Subsequent runs
|
||||
The first run indents the item, if applicable. Subsequents runs
|
||||
outdent it at meaningful levels in the list. When done, item is
|
||||
put back at its original position with its original bullet.
|
||||
|
||||
|
@ -2711,7 +2743,7 @@ Capital letters will reverse the sort order.
|
|||
If the SORTING-TYPE is ?f or ?F, then GETKEY-FUNC specifies
|
||||
a function to be called with point at the beginning of the
|
||||
record. It must return either a string or a number that should
|
||||
serve as the sorting key for that record. It will then use
|
||||
serve as the sorting key for that record. It will then use
|
||||
COMPARE-FUNC to compare entries."
|
||||
(interactive "P")
|
||||
(let* ((case-func (if with-case 'identity 'downcase))
|
||||
|
@ -2786,6 +2818,7 @@ COMPARE-FUNC to compare entries."
|
|||
(message "Sorting items...done")))))
|
||||
|
||||
|
||||
|
||||
;;; Send and receive lists
|
||||
|
||||
(defun org-list-parse-list (&optional delete)
|
||||
|
@ -2975,6 +3008,10 @@ for this list."
|
|||
(insert txt "\n")))
|
||||
(message "List converted and installed at receiver location"))))
|
||||
|
||||
(defsubst org-list-item-trim-br (item)
|
||||
"Trim line breaks in a list ITEM."
|
||||
(setq item (replace-regexp-in-string "\n +" " " item)))
|
||||
|
||||
(defun org-list-to-generic (list params)
|
||||
"Convert a LIST parsed through `org-list-parse-list' to other formats.
|
||||
Valid parameters PARAMS are:
|
||||
|
@ -3006,9 +3043,11 @@ Valid parameters PARAMS are:
|
|||
:cbon String to insert for a checked check-box
|
||||
:cbtrans String to insert for a check-box in transitional state
|
||||
|
||||
:nobr Non-nil means remove line breaks in lists items.
|
||||
|
||||
Alternatively, each parameter can also be a form returning
|
||||
a string. These sexp can use keywords `counter' and `depth',
|
||||
representing respectively counter associated to the current
|
||||
reprensenting respectively counter associated to the current
|
||||
item, and depth of the current sub-list, starting at 0.
|
||||
Obviously, `counter' is only available for parameters applying to
|
||||
items."
|
||||
|
@ -3034,6 +3073,7 @@ items."
|
|||
(cbon (plist-get p :cbon))
|
||||
(cboff (plist-get p :cboff))
|
||||
(cbtrans (plist-get p :cbtrans))
|
||||
(nobr (plist-get p :nobr))
|
||||
export-sublist ; for byte-compiler
|
||||
(export-item
|
||||
(function
|
||||
|
@ -3065,6 +3105,8 @@ items."
|
|||
(setq first (replace-match cboff t t first)))
|
||||
((string-match "\\[CBTRANS\\]" first)
|
||||
(setq first (replace-match cbtrans t t first))))
|
||||
;; Replace line breaks if required
|
||||
(when nobr (setq first (org-list-item-trim-br first)))
|
||||
;; Insert descriptive term if TYPE is `descriptive'.
|
||||
(when (eq type 'descriptive)
|
||||
(let* ((complete (string-match "^\\(.*\\)[ \t]+::" first))
|
||||
|
@ -3200,5 +3242,4 @@ with overruling parameters for `org-list-to-generic'."
|
|||
|
||||
(provide 'org-list)
|
||||
|
||||
|
||||
;;; org-list.el ends here
|
||||
|
|
2339
lisp/org/org-lparse.el
Normal file
2339
lisp/org/org-lparse.el
Normal file
File diff suppressed because it is too large
Load diff
|
@ -5,7 +5,6 @@
|
|||
;; Author: John Wiegley <johnw@gnu.org>
|
||||
;; Christopher Suckling <suckling at gmail dot com>
|
||||
|
||||
;; Version: 7.7
|
||||
;; Keywords: outlines, hypermedia, calendar, wp
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
@ -214,6 +213,4 @@ list of message:// links to flagged mail after heading."
|
|||
|
||||
(provide 'org-mac-message)
|
||||
|
||||
|
||||
|
||||
;;; org-mac-message.el ends here
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
;;; org-macs.el --- Top-level definitions for Org-mode
|
||||
|
||||
;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Carsten Dominik <carsten at orgmode dot org>
|
||||
;; Keywords: outlines, hypermedia, calendar, wp
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
;;
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -46,6 +45,13 @@
|
|||
(declare-function org-add-props "org-compat" (string plist &rest props))
|
||||
(declare-function org-string-match-p "org-compat" (&rest args))
|
||||
|
||||
(defmacro org-with-gensyms (symbols &rest body)
|
||||
`(let ,(mapcar (lambda (s)
|
||||
`(,s (make-symbol (concat "--" (symbol-name ',s))))) symbols)
|
||||
,@body))
|
||||
(def-edebug-spec org-with-gensyms (sexp body))
|
||||
(put 'org-with-gensyms 'lisp-indent-function 1)
|
||||
|
||||
(defmacro org-called-interactively-p (&optional kind)
|
||||
(if (featurep 'xemacs)
|
||||
`(interactive-p)
|
||||
|
@ -54,17 +60,20 @@
|
|||
(>= emacs-minor-version 2)))
|
||||
`(with-no-warnings (called-interactively-p ,kind)) ;; defined with no argument in <=23.1
|
||||
`(interactive-p))))
|
||||
(def-edebug-spec org-called-interactively-p (&optional ("quote" symbolp)))
|
||||
|
||||
(if (and (not (fboundp 'with-silent-modifications))
|
||||
(when (and (not (fboundp 'with-silent-modifications))
|
||||
(or (< emacs-major-version 23)
|
||||
(and (= emacs-major-version 23)
|
||||
(< emacs-minor-version 2))))
|
||||
(defmacro with-silent-modifications (&rest body)
|
||||
`(org-unmodified ,@body)))
|
||||
`(org-unmodified ,@body))
|
||||
(def-edebug-spec with-silent-modifications (body)))
|
||||
|
||||
(defmacro org-bound-and-true-p (var)
|
||||
"Return the value of symbol VAR if it is bound, else nil."
|
||||
`(and (boundp (quote ,var)) ,var))
|
||||
(def-edebug-spec org-bound-and-true-p (symbolp))
|
||||
|
||||
(defun org-string-nw-p (s)
|
||||
"Is S a string with a non-white character?"
|
||||
|
@ -85,30 +94,36 @@ Also, do not record undo information."
|
|||
(let ((buffer-undo-list t)
|
||||
before-change-functions after-change-functions)
|
||||
,@body))))
|
||||
(def-edebug-spec org-unmodified (body))
|
||||
|
||||
(defun org-substitute-posix-classes (re)
|
||||
"Substitute posix classes in regular expression RE."
|
||||
(let ((ss re))
|
||||
(save-match-data
|
||||
(while (string-match "\\[:alnum:\\]" ss)
|
||||
(setq ss (replace-match "a-zA-Z0-9" t t ss)))
|
||||
(while (string-match "\\[:word:\\]" ss)
|
||||
(setq ss (replace-match "a-zA-Z0-9" t t ss)))
|
||||
(while (string-match "\\[:alpha:\\]" ss)
|
||||
(setq ss (replace-match "a-zA-Z" t t ss)))
|
||||
(while (string-match "\\[:punct:\\]" ss)
|
||||
(setq ss (replace-match "\001-@[-`{-~" t t ss)))
|
||||
ss)))
|
||||
|
||||
(defmacro org-re (s)
|
||||
"Replace posix classes in regular expression."
|
||||
(if (featurep 'xemacs)
|
||||
(let ((ss s))
|
||||
(save-match-data
|
||||
(while (string-match "\\[:alnum:\\]" ss)
|
||||
(setq ss (replace-match "a-zA-Z0-9" t t ss)))
|
||||
(while (string-match "\\[:word:\\]" ss)
|
||||
(setq ss (replace-match "a-zA-Z0-9" t t ss)))
|
||||
(while (string-match "\\[:alpha:\\]" ss)
|
||||
(setq ss (replace-match "a-zA-Z" t t ss)))
|
||||
(while (string-match "\\[:punct:\\]" ss)
|
||||
(setq ss (replace-match "\001-@[-`{-~" t t ss)))
|
||||
ss))
|
||||
s))
|
||||
(if (featurep 'xemacs) `(org-substitute-posix-classes ,s) s))
|
||||
(def-edebug-spec org-re (form))
|
||||
|
||||
(defmacro org-preserve-lc (&rest body)
|
||||
`(let ((_line (org-current-line))
|
||||
(_col (current-column)))
|
||||
(unwind-protect
|
||||
(progn ,@body)
|
||||
(org-goto-line _line)
|
||||
(org-move-to-column _col))))
|
||||
(org-with-gensyms (line col)
|
||||
`(let ((,line (org-current-line))
|
||||
(,col (current-column)))
|
||||
(unwind-protect
|
||||
(progn ,@body)
|
||||
(org-goto-line ,line)
|
||||
(org-move-to-column ,col)))))
|
||||
(def-edebug-spec org-preserve-lc (body))
|
||||
|
||||
(defmacro org-without-partial-completion (&rest body)
|
||||
`(if (and (boundp 'partial-completion-mode)
|
||||
|
@ -120,7 +135,9 @@ Also, do not record undo information."
|
|||
,@body)
|
||||
(partial-completion-mode 1))
|
||||
,@body))
|
||||
(def-edebug-spec org-without-partial-completion (body))
|
||||
|
||||
;; FIXME: Slated for removal. Current Org mode does not support Emacs < 22
|
||||
(defmacro org-maybe-intangible (props)
|
||||
"Add '(intangible t) to PROPS if Emacs version is earlier than Emacs 22.
|
||||
In Emacs 21, invisible text is not avoided by the command loop, so the
|
||||
|
@ -135,31 +152,37 @@ We use a macro so that the test can happen at compilation time."
|
|||
|
||||
(defmacro org-with-point-at (pom &rest body)
|
||||
"Move to buffer and point of point-or-marker POM for the duration of BODY."
|
||||
`(let ((pom ,pom))
|
||||
(save-excursion
|
||||
(if (markerp pom) (set-buffer (marker-buffer pom)))
|
||||
(org-with-gensyms (mpom)
|
||||
`(let ((,mpom ,pom))
|
||||
(save-excursion
|
||||
(goto-char (or pom (point)))
|
||||
,@body))))
|
||||
(if (markerp ,mpom) (set-buffer (marker-buffer ,mpom)))
|
||||
(save-excursion
|
||||
(goto-char (or ,mpom (point)))
|
||||
,@body)))))
|
||||
(def-edebug-spec org-with-point-at (form body))
|
||||
(put 'org-with-point-at 'lisp-indent-function 1)
|
||||
|
||||
(defmacro org-no-warnings (&rest body)
|
||||
(cons (if (fboundp 'with-no-warnings) 'with-no-warnings 'progn) body))
|
||||
(def-edebug-spec org-no-warnings (body))
|
||||
|
||||
(defmacro org-if-unprotected (&rest body)
|
||||
"Execute BODY if there is no `org-protected' text property at point."
|
||||
`(unless (get-text-property (point) 'org-protected)
|
||||
,@body))
|
||||
(def-edebug-spec org-if-unprotected (body))
|
||||
|
||||
(defmacro org-if-unprotected-1 (&rest body)
|
||||
"Execute BODY if there is no `org-protected' text property at point-1."
|
||||
`(unless (get-text-property (1- (point)) 'org-protected)
|
||||
,@body))
|
||||
(def-edebug-spec org-if-unprotected-1 (body))
|
||||
|
||||
(defmacro org-if-unprotected-at (pos &rest body)
|
||||
"Execute BODY if there is no `org-protected' text property at POS."
|
||||
`(unless (get-text-property ,pos 'org-protected)
|
||||
,@body))
|
||||
(def-edebug-spec org-if-unprotected-at (form body))
|
||||
(put 'org-if-unprotected-at 'lisp-indent-function 1)
|
||||
|
||||
(defun org-re-search-forward-unprotected (&rest args)
|
||||
|
@ -171,33 +194,37 @@ We use a macro so that the test can happen at compilation time."
|
|||
(unless (get-text-property (match-beginning 0) 'org-protected)
|
||||
(throw 'exit (point))))))
|
||||
|
||||
;; FIXME: Normalize argument names
|
||||
(defmacro org-with-remote-undo (_buffer &rest _body)
|
||||
"Execute BODY while recording undo information in two buffers."
|
||||
`(let ((_cline (org-current-line))
|
||||
(_cmd this-command)
|
||||
(_buf1 (current-buffer))
|
||||
(_buf2 ,_buffer)
|
||||
(_undo1 buffer-undo-list)
|
||||
(_undo2 (with-current-buffer ,_buffer buffer-undo-list))
|
||||
_c1 _c2)
|
||||
,@_body
|
||||
(when org-agenda-allow-remote-undo
|
||||
(setq _c1 (org-verify-change-for-undo
|
||||
_undo1 (with-current-buffer _buf1 buffer-undo-list))
|
||||
_c2 (org-verify-change-for-undo
|
||||
_undo2 (with-current-buffer _buf2 buffer-undo-list)))
|
||||
(when (or _c1 _c2)
|
||||
;; make sure there are undo boundaries
|
||||
(and _c1 (with-current-buffer _buf1 (undo-boundary)))
|
||||
(and _c2 (with-current-buffer _buf2 (undo-boundary)))
|
||||
;; remember which buffer to undo
|
||||
(push (list _cmd _cline _buf1 _c1 _buf2 _c2)
|
||||
org-agenda-undo-list)))))
|
||||
(org-with-gensyms (cline cmd buf1 buf2 undo1 undo2 c1 c2)
|
||||
`(let ((,cline (org-current-line))
|
||||
(,cmd this-command)
|
||||
(,buf1 (current-buffer))
|
||||
(,buf2 ,_buffer)
|
||||
(,undo1 buffer-undo-list)
|
||||
(,undo2 (with-current-buffer ,_buffer buffer-undo-list))
|
||||
,c1 ,c2)
|
||||
,@_body
|
||||
(when org-agenda-allow-remote-undo
|
||||
(setq ,c1 (org-verify-change-for-undo
|
||||
,undo1 (with-current-buffer ,buf1 buffer-undo-list))
|
||||
,c2 (org-verify-change-for-undo
|
||||
,undo2 (with-current-buffer ,buf2 buffer-undo-list)))
|
||||
(when (or ,c1 ,c2)
|
||||
;; make sure there are undo boundaries
|
||||
(and ,c1 (with-current-buffer ,buf1 (undo-boundary)))
|
||||
(and ,c2 (with-current-buffer ,buf2 (undo-boundary)))
|
||||
;; remember which buffer to undo
|
||||
(push (list ,cmd ,cline ,buf1 ,c1 ,buf2 ,c2)
|
||||
org-agenda-undo-list))))))
|
||||
(def-edebug-spec org-with-remote-undo (form body))
|
||||
(put 'org-with-remote-undo 'lisp-indent-function 1)
|
||||
|
||||
(defmacro org-no-read-only (&rest body)
|
||||
"Inhibit read-only for BODY."
|
||||
`(let ((inhibit-read-only t)) ,@body))
|
||||
(def-edebug-spec org-no-read-only (body))
|
||||
|
||||
(defconst org-rm-props '(invisible t face t keymap t intangible t mouse-face t
|
||||
rear-nonsticky t mouse-map t fontified t
|
||||
|
@ -245,10 +272,6 @@ we turn off invisibility temporarily. Use this in a `let' form."
|
|||
"Make VAR local in current buffer and set it to VALUE."
|
||||
(set (make-local-variable var) value))
|
||||
|
||||
(defsubst org-mode-p ()
|
||||
"Check if the current buffer is in Org-mode."
|
||||
(eq major-mode 'org-mode))
|
||||
|
||||
(defsubst org-last (list)
|
||||
"Return the last element of LIST."
|
||||
(car (last list)))
|
||||
|
@ -324,18 +347,20 @@ but it also means that the buffer should stay alive
|
|||
during the operation, because otherwise all these markers will
|
||||
point nowhere."
|
||||
(declare (indent 1))
|
||||
`(let ((data (org-outline-overlay-data ,use-markers))
|
||||
rtn)
|
||||
(unwind-protect
|
||||
(progn
|
||||
(setq rtn (progn ,@body))
|
||||
(org-set-outline-overlay-data data))
|
||||
(when ,use-markers
|
||||
(mapc (lambda (c)
|
||||
(and (markerp (car c)) (move-marker (car c) nil))
|
||||
(and (markerp (cdr c)) (move-marker (cdr c) nil)))
|
||||
data)))
|
||||
rtn))
|
||||
(org-with-gensyms (data rtn)
|
||||
`(let ((,data (org-outline-overlay-data ,use-markers))
|
||||
,rtn)
|
||||
(unwind-protect
|
||||
(progn
|
||||
(setq ,rtn (progn ,@body))
|
||||
(org-set-outline-overlay-data ,data))
|
||||
(when ,use-markers
|
||||
(mapc (lambda (c)
|
||||
(and (markerp (car c)) (move-marker (car c) nil))
|
||||
(and (markerp (cdr c)) (move-marker (cdr c) nil)))
|
||||
,data)))
|
||||
,rtn)))
|
||||
(def-edebug-spec org-save-outline-visibility (form body))
|
||||
|
||||
(defmacro org-with-wide-buffer (&rest body)
|
||||
"Execute body while temporarily widening the buffer."
|
||||
|
@ -343,6 +368,7 @@ point nowhere."
|
|||
(save-restriction
|
||||
(widen)
|
||||
,@body)))
|
||||
(def-edebug-spec org-with-wide-buffer (body))
|
||||
|
||||
(defmacro org-with-limited-levels (&rest body)
|
||||
"Execute BODY with limited number of outline levels."
|
||||
|
@ -350,6 +376,7 @@ point nowhere."
|
|||
(outline-regexp org-outline-regexp)
|
||||
(org-outline-regexp-at-bol (concat "^" org-outline-regexp)))
|
||||
,@body))
|
||||
(def-edebug-spec org-with-limited-levels (body))
|
||||
|
||||
(defvar org-outline-regexp) ; defined in org.el
|
||||
(defvar org-odd-levels-only) ; defined in org.el
|
||||
|
@ -357,7 +384,7 @@ point nowhere."
|
|||
(defun org-get-limited-outline-regexp ()
|
||||
"Return outline-regexp with limited number of levels.
|
||||
The number of levels is controlled by `org-inlinetask-min-level'"
|
||||
(if (or (not (org-mode-p)) (not (featurep 'org-inlinetask)))
|
||||
(if (or (not (eq major-mode 'org-mode)) (not (featurep 'org-inlinetask)))
|
||||
org-outline-regexp
|
||||
(let* ((limit-level (1- org-inlinetask-min-level))
|
||||
(nstars (if org-odd-levels-only (1- (* limit-level 2)) limit-level)))
|
||||
|
@ -369,8 +396,20 @@ The number of levels is controlled by `org-inlinetask-min-level'"
|
|||
(format-seconds string seconds)
|
||||
(format-time-string string (seconds-to-time seconds))))
|
||||
|
||||
(defmacro org-eval-in-environment (environment form)
|
||||
`(eval (list 'let ,environment ',form)))
|
||||
(def-edebug-spec org-eval-in-environment (form form))
|
||||
(put 'org-eval-in-environment 'lisp-indent-function 1)
|
||||
|
||||
(defun org-make-parameter-alist (flat)
|
||||
"Return alist based on FLAT.
|
||||
FLAT is a list with alternating symbol names and values. The
|
||||
returned alist is a list of lists with the symbol name in car and
|
||||
the value in cdr."
|
||||
(when flat
|
||||
(cons (list (car flat) (cadr flat))
|
||||
(org-make-parameter-alist (cddr flat)))))
|
||||
|
||||
(provide 'org-macs)
|
||||
|
||||
|
||||
|
||||
;;; org-macs.el ends here
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp>
|
||||
;; Keywords: outlines, hypermedia, calendar, wp
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
@ -135,6 +134,4 @@
|
|||
|
||||
(provide 'org-mew)
|
||||
|
||||
|
||||
|
||||
;;; org-mew.el ends here
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
;;; org-mhe.el --- Support for links to MH-E messages from within Org-mode
|
||||
|
||||
;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2004-2011 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Thomas Baumann <thomas dot baumann at ch dot tum dot de>
|
||||
;; Keywords: outlines, hypermedia, calendar, wp
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
;;
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -225,6 +224,4 @@ folders."
|
|||
|
||||
(provide 'org-mhe)
|
||||
|
||||
|
||||
|
||||
;;; org-mhe.el ends here
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
;; Author: Carsten Dominik <carsten at orgmode dot org>
|
||||
;; Keywords: outlines, hypermedia, calendar, wp
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
;;
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -132,6 +131,4 @@ only the bare key is returned."
|
|||
|
||||
(provide 'org-mks)
|
||||
|
||||
|
||||
|
||||
;;; org-mks.el ends here
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
;; Author: Carsten Dominik <carsten at orgmode dot org>
|
||||
;; Keywords: outlines, hypermedia, calendar, wp
|
||||
;; Homepage: http://orgmode.org
|
||||
;; Version: 7.7
|
||||
;;
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -38,6 +37,9 @@
|
|||
|
||||
(eval-when-compile (require 'cl))
|
||||
|
||||
(declare-function org-pop-to-buffer-same-window
|
||||
"org-compat" (&optional buffer-or-name norecord label))
|
||||
|
||||
(defgroup org-mobile nil
|
||||
"Options concerning support for a viewer/editor on a mobile device."
|
||||
:tag "Org Mobile"
|
||||
|
@ -909,7 +911,7 @@ If BEG and END are given, only do this in that region."
|
|||
(buffer-file-name (current-buffer))))))
|
||||
(error (setq org-mobile-error msg))))
|
||||
(when org-mobile-error
|
||||
(switch-to-buffer (marker-buffer marker))
|
||||
(org-pop-to-buffer-same-window (marker-buffer marker))
|
||||
(goto-char marker)
|
||||
(incf cnt-error)
|
||||
(insert (if (stringp (nth 1 org-mobile-error))
|
||||
|
@ -1096,7 +1098,5 @@ A and B must be strings or nil."
|
|||
|
||||
(provide 'org-mobile)
|
||||
|
||||
|
||||
|
||||
;;; org-mobile.el ends here
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
;;
|
||||
;; Author: Piotr Zielinski <piotr dot zielinski at gmail dot com>
|
||||
;; Maintainer: Carsten Dominik <carsten at orgmode dot org>
|
||||
;; Version: 7.7
|
||||
|
||||
;;
|
||||
;; This file is part of GNU Emacs.
|
||||
;;
|
||||
|
@ -70,8 +70,7 @@
|
|||
;;
|
||||
;; Since version 5.10: Changes are listed in the general org-mode docs.
|
||||
;;
|
||||
;; Version 5.09
|
||||
;; + Version number synchronization with Org-mode.
|
||||
;; Version 5.09;; + Version number synchronization with Org-mode.
|
||||
;;
|
||||
;; Version 0.25
|
||||
;; + made compatible with org-mode 4.70 (thanks to Carsten for the patch)
|
||||
|
@ -329,7 +328,6 @@ nor a function, elements of KEYWORDS are used directly."
|
|||
(goto-char (match-end (or subexp 0)))
|
||||
(just-one-space)))
|
||||
|
||||
|
||||
(defun org-mouse-keyword-replace-menu (keywords &optional group itemformat
|
||||
nosurround)
|
||||
"A helper function.
|
||||
|
@ -395,15 +393,6 @@ DEFAULT is returned if no priority is given in the headline."
|
|||
(match-string 1)
|
||||
(when default (char-to-string org-default-priority)))))
|
||||
|
||||
;; (defun org-mouse-at-link ()
|
||||
;; (and (eq (get-text-property (point) 'face) 'org-link)
|
||||
;; (save-excursion
|
||||
;; (goto-char (previous-single-property-change (point) 'face))
|
||||
;; (or (looking-at org-bracket-link-regexp)
|
||||
;; (looking-at org-angle-link-re)
|
||||
;; (looking-at org-plain-link-re)))))
|
||||
|
||||
|
||||
(defun org-mouse-delete-timestamp ()
|
||||
"Deletes the current timestamp as well as the preceding keyword.
|
||||
SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:"
|
||||
|
@ -454,7 +443,6 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:"
|
|||
["Align Tags in Buffer" (org-set-tags t t) t]
|
||||
["Set Tags ..." (org-set-tags) t])))
|
||||
|
||||
|
||||
(defun org-mouse-set-tags (tags)
|
||||
(save-excursion
|
||||
;; remove existing tags first
|
||||
|
@ -485,7 +473,6 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:"
|
|||
('occur-tree "Occur tree: ")
|
||||
(t "Agenda command ???")))
|
||||
|
||||
|
||||
(defun org-mouse-list-options-menu (alloptions &optional function)
|
||||
(let ((options (save-match-data
|
||||
(split-string (match-string-no-properties 1)))))
|
||||
|
@ -571,7 +558,6 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:"
|
|||
["Plain List to Outline" org-mouse-transform-to-outline
|
||||
:visible (org-at-item-p)])))
|
||||
|
||||
|
||||
(defun org-mouse-get-context (contextlist context)
|
||||
(let ((contextdata (assq context contextlist)))
|
||||
(when contextdata
|
||||
|
@ -599,29 +585,26 @@ This means, between the beginning of line and the point."
|
|||
(open-line 1)
|
||||
(org-indent-to-column (- (match-end 0) (match-beginning 0)))
|
||||
(insert "+ "))
|
||||
|
||||
(:middle ; insert after
|
||||
(end-of-line)
|
||||
(newline t)
|
||||
(indent-relative)
|
||||
(insert "+ "))
|
||||
|
||||
(:end ; insert text here
|
||||
(skip-chars-backward " \t")
|
||||
(kill-region (point) (point-at-eol))
|
||||
(unless (org-looking-back org-mouse-punctuation)
|
||||
(insert (concat org-mouse-punctuation " ")))))
|
||||
|
||||
(insert text)
|
||||
(beginning-of-line))
|
||||
|
||||
(defadvice dnd-insert-text (around org-mouse-dnd-insert-text activate)
|
||||
(if (org-mode-p)
|
||||
(if (eq major-mode 'org-mode)
|
||||
(org-mouse-insert-item text)
|
||||
ad-do-it))
|
||||
|
||||
(defadvice dnd-open-file (around org-mouse-dnd-open-file activate)
|
||||
(if (org-mode-p)
|
||||
(if (eq major-mode 'org-mode)
|
||||
(org-mouse-insert-item uri)
|
||||
ad-do-it))
|
||||
|
||||
|
@ -632,13 +615,6 @@ This means, between the beginning of line and the point."
|
|||
(set-match-data ',match)
|
||||
(apply ',function rest)))))
|
||||
|
||||
(defun org-mouse-match-todo-keyword ()
|
||||
(save-excursion
|
||||
(org-back-to-heading)
|
||||
(if (looking-at org-outline-regexp) (goto-char (match-end 0)))
|
||||
(or (looking-at (concat " +" org-todo-regexp " *"))
|
||||
(looking-at " \\( *\\)"))))
|
||||
|
||||
(defun org-mouse-yank-link (click)
|
||||
(interactive "e")
|
||||
;; Give temporary modes such as isearch a chance to turn off.
|
||||
|
@ -668,7 +644,6 @@ This means, between the beginning of line and the point."
|
|||
(progn (save-excursion (goto-char (region-beginning)) (insert "[["))
|
||||
(save-excursion (goto-char (region-end)) (insert "]]")))]
|
||||
["Insert Link Here" (org-mouse-yank-link ',event)]))))
|
||||
|
||||
((save-excursion (beginning-of-line) (looking-at "#\\+STARTUP: \\(.*\\)"))
|
||||
(popup-menu
|
||||
`(nil
|
||||
|
@ -879,18 +854,6 @@ This means, between the beginning of line and the point."
|
|||
(t
|
||||
(org-mouse-popup-global-menu))))))
|
||||
|
||||
;; (defun org-mouse-at-regexp (regexp)
|
||||
;; (save-excursion
|
||||
;; (let ((point (point))
|
||||
;; (bol (progn (beginning-of-line) (point)))
|
||||
;; (eol (progn (end-of-line) (point))))
|
||||
;; (goto-char point)
|
||||
;; (re-search-backward regexp bol 1)
|
||||
;; (and (not (eolp))
|
||||
;; (progn (forward-char)
|
||||
;; (re-search-forward regexp eol t))
|
||||
;; (<= (match-beginning 0) point)))))
|
||||
|
||||
(defun org-mouse-mark-active ()
|
||||
(and mark-active transient-mark-mode))
|
||||
|
||||
|
@ -1146,6 +1109,4 @@ This means, between the beginning of line and the point."
|
|||
|
||||
(provide 'org-mouse)
|
||||
|
||||
|
||||
|
||||
;;; org-mouse.el ends here
|
||||
|
|
2626
lisp/org/org-odt.el
Normal file
2626
lisp/org/org-odt.el
Normal file
File diff suppressed because it is too large
Load diff
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue