Commit Graph

8938 Commits

Author SHA1 Message Date
Nicolas Goaziou 4e2aaadda9 contrib/org-export: Generic Export Engine For Org
* contrib/lisp/org-export.el (org-export-collect-options,
  org-export-parse-option-keyword, org-export-get-subtree-options,
  org-export-get-inbuffer-options, org-export-get-global-options,
  org-export-initial-options, org-export-confirm-letbind,
  org-export-install-letbind-maybe,
  org-export-initialize-persistent-properties,
  org-export-use-select-tags-p, org-export-get-min-level,
  org-export-get-point-max, org-export-update-info,
  org-export-set-property, org-export-data,
  org-export-secondary-string, org-export-skip-p,
  org-export-interpret-p, org-export-filter-apply-functions,
  org-export-as, org-export-to-buffer, org-export-get-relative-level,
  org-export-get-headline-number, org-export-number-to-roman,
  org-export-first-sibling-p, org-export-last-sibling-p,
  org-export-included-file, org-export-get-file-contents,
  org-export-parse-included-file, org-export-solidify-link-text,
  org-export-get-coderef-format, org-export-inline-image-p,
  org-export-resolve-fuzzy-link, org-export-expand-macro,
  org-export-handle-code, org-export-table-format-info,
  org-export-clean-table, org-export-get-headlines,
  org-export-collect-elements, org-export-collect-tables,
  org-export-get-figures, org-export-collect-listings): New functions.
(org-export-max-depth, org-export-option-alist,
  org-export-special-keywords, org-export-persistent-properties-list,
  org-export-persistent-properties, org-export-with-archived-trees,
  org-export-with-author, org-export-with-creator,
  org-export-creator-string, org-export-with-drawers,
  org-export-with-email, org-export-with-emphasize,
  org-export-exclude-tags, org-export-with-fixed-width,
  org-export-with-footnotes, org-export-headline-levels,
  org-export-default-language, org-export-preserve-breaks,
  org-export-with-entities, org-export-with-priority,
  org-export-with-section-numbers, org-export-select-tags,
  org-export-with-special-strings, org-export-with-sub-superscripts,
  org-export-with-toc, org-export-with-tables, org-export-with-tags,
  org-export-with-tasks, org-export-time-stamp-file,
  org-export-with-timestamps, org-export-with-todo-keywords,
  org-export-allow-BIND, org-export-snippet-translation-alist,
  org-export-filter-parse-tree-functions,
  org-export-filter-final-output-functions,
  org-export-filter-plain-text-functions,
  org-export-filter-center-block-functions,
  org-export-filter-drawer-functions,
  org-export-filter-dynamic-block-functions,
  org-export-filter-headline-functions,
  org-export-filter-inlinetask-functions,
  org-export-filter-plain-list-functions,
  org-export-filter-item-functions,
  org-export-filter-comment-functions,
  org-export-filter-comment-block-functions,
  org-export-filter-example-block-functions,
  org-export-filter-export-block-functions,
  org-export-filter-fixed-width-functions,
  org-export-filter-footnote-definition-functions,
  org-export-filter-horizontal-rule-functions,
  org-export-filter-keyword-functions,
  org-export-filter-latex-environment-functions,
  org-export-filter-babel-call-functions,
  org-export-filter-paragraph-functions,
  org-export-filter-property-drawer-functions,
  org-export-filter-quote-block-functions,
  org-export-filter-quote-section-functions,
  org-export-filter-special-block-functions,
  org-export-filter-src-block-functions,
  org-export-filter-table-functions,
  org-export-filter-verse-block-functions,
  org-export-filter-emphasis-functions,
  org-export-filter-entity-functions,
  org-export-filter-export-snippet-functions,
  org-export-filter-footnote-reference-functions,
  org-export-filter-inline-babel-call-functions,
  org-export-filter-inline-src-block-functions,
  org-export-filter-latex-fragment-functions,
  org-export-filter-line-break-functions,
  org-export-filter-link-functions,
  org-export-filter-macro-functions,
  org-export-filter-radio-target-functions,
  org-export-filter-statistics-cookie-functions,
  org-export-filter-subscript-functions,
  org-export-filter-superscript-functions,
  org-export-filter-target-functions,
  org-export-filter-time-stamp-functions,
  org-export-filter-verbatim-functions): New variables.
2011-11-25 16:02:42 +01:00
Jeremy Compostella bafffdc5f6 org-odt.el: Export TOC max-level information.
The TOC max level which could be specified by user is lost during the
export operation. However, this information could be useful in particular
with the ODT exporter. So if another script work on the ODT afterward and
ask to re-compute the TOC, the new TOC will keep this max level.

TINYCHANGE.
2011-11-25 00:27:49 +05:30
Jambunathan K 2ded8ccb85 org-odt.el: Fix performance issue on manifest file writing
* contrib/lisp/org-odt.el (org-odt-write-manifest-file): Don't
use write-region.

The org-odt-write-manifest-file function take too much time -
several seconds for 164 files. This patch provides a cheaper
implementation (hundredths of a seconds for 164 files).

Original patch by Jérémy Compostella
<jeremy.compostella@gmail.com>.  Rewritten by Jambunathan K to
minimize the actual number of lines changed.

TINYCHANGE.

From http://www.mail-archive.com/emacs-orgmode@gnu.org/msg49248.html
I'm currently generating a road book for a trip from different
Org-Mode file and other data. It results in a 13 thousands
lines Org-Mode file and I have some performance issues. Using
the ELP package, I isolated the two main bottlenecks.

One is in org-odt : the org-odt-write-manifest-file function
is called once and takes 5.546672 seconds to write a 167 lines
file. I rewrote this function and now it takes 0.01606 seconds
to write the same file.
2011-11-24 23:46:57 +05:30
Nicolas Goaziou 5a24ffe004 org-element: Fix parsing of src-block switches when there is more than one
* contrib/lisp/org-element.el (org-element-src-block-parser): Previous
  regexp would only get the last switch if more than one were
  provided.
2011-11-24 14:29:53 +01:00
David Maus e401ec09ec Merge branch 'master' of orgmode.org:org-mode 2011-11-23 21:35:47 +01:00
David Maus 4d312a07f5 Remove clocking information when preparing a clone
* org.el (org-clone-subtree-with-time-shift): Remove clocking
information and empty drawers when preparing a clone.

Fixes a regression introduced by
516b2fbb87, reported by Bernt Hansen in
http://article.gmane.org/gmane.emacs.orgmode/49385
2011-11-23 21:35:35 +01:00
Thomas Dye 38f70b7e25 * doc/org.texi: Augmented discussion of babel property inheritance. Put footnote outside sentence ending period. 2011-11-23 12:39:44 -07:00
Carsten Dominik c52c23fdfd Merge branch 'master' of orgmode.org:org-mode 2011-11-23 07:36:23 +01:00
Carsten Dominik 6107173c78 Require parse-time for `org-read-date-get-relative' 2011-11-23 07:36:07 +01:00
Jambunathan K e10722c9cd org-odt.el: Fix a bug wrt label references
* contrib/lisp/org-odt.el (org-odt-fixup-label-references)
(org-export-odt-preprocess-label-references): Modified.

Workaround for issue reported here:
http://lists.gnu.org/archive/html/emacs-orgmode/2011-11/msg00773.html
2011-11-23 06:01:33 +05:30
Eric Schulte 25a0a02121 no longer strip code and result names during block preprocessing
* lisp/ob-exp.el: Don't add `org-exp-res/src-name-cleanup' to
  `org-export-blocks-postblock-hook'.
2011-11-22 08:18:26 -07:00
Eric Schulte 1234afcc54 correctly toggle visibility of named code blocks
* lisp/ob.el (org-babel-hide-result-toggle): Skip over header argument
  lines when toggling named code block visibility.
2011-11-22 08:05:34 -07:00
Eric Schulte 0bd9981e0d Don't license to kill text inside blocks when getting a title
* lisp/org-exp.el (org-export-grab-title-from-buffer): Don't license
  to kill text inside blocks when getting a title.
2011-11-22 07:56:00 -07:00
Eric Schulte a998cae722 the :eval header argument now takes 4(6) possible values
* doc/org.texi (eval): Documenting the full range of :eval header
  argument values.
* lisp/ob.el (org-babel-confirm-evaluate): Adding support for new
  range of :eval header arguments.
* testing/lisp/test-ob.el (test-ob/eval-header-argument): Testing the
  :eval header argument.
2011-11-22 07:32:39 -07:00
Eric Schulte c166760fcc Revert "Revert "new babel latex feature :imagemagick -- By Andreas Leha""
This reverts commit c6f6b3421e.

Andreas has now signed the FSF copyright assignment papers.
2011-11-22 06:59:58 -07:00
Eric Schulte edef1fa5ca ":eval non-export" inhibits evaluation during export
* doc/org.texi (eval): Documentation of the new :eval option.
* lisp/ob.el (org-babel-confirm-evaluate): Inhibit evaluation during
  export when eval is set to "non-export".
2011-11-21 18:19:45 -07:00
Eric Schulte 3693952e3b New option to update intermediate in-buffer results
* lisp/ob-ref.el (org-babel-update-intermediate): New custom variable.
  (org-babel-ref-resolve): Optionally update the in-buffer results of
  code blocks which are evaluated to resolve references.
2011-11-21 10:02:39 -07:00
Eric Schulte f312e9a6b3 More documentation of accumulated properties 2011-11-21 10:02:38 -07:00
Thomas Dye 6bab435cb2 * doc/org.texi: Add accumulated properties 2011-11-21 10:02:38 -07:00
Nicolas Goaziou 45587af37b org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
  org-element-center-block-interpreter, org-element-drawer-parser,
  org-element-drawer-interpreter, org-element-dynamic-block-parser,
  org-element-dynamic-block-interpreter,
  org-element-footnote-definition-parser,
  org-element-headline-parser, org-element-headline-interpreter,
  org-element-inlinetask-parser, org-element-inlinetask-interpreter,
  org-element-item-parser, org-element-item-interpreter,
  org-element-plain-list-parser, org-element-plain-list-interpreter,
  org-element-quote-block-parser,
  org-element-quote-block-interpreter,
  org-element-special-block-parser,
  org-element-special-block-interpreter,
  org-element-babel-call-parser, org-element-babel-call-interpreter,
  org-element-comment-parser, org-element-comment-interpreter,
  org-element-comment-block-parser,
  org-element-comment-block-interpreter,
  org-element-example-block-parser,
  org-element-example-block-interpreter,
  org-element-export-block-parser,
  org-element-export-block-interpreter,
  org-element-fixed-width-parser,
  org-element-fixed-width-interpreter,
  org-element-horizontal-rule-parser,
  org-element-horizontal-rule-interpreter,
  org-element-keyword-parser, org-element-keyword-interpreter,
  org-element-latex-environment-parser,
  org-element-latex-environment-interpreter,
  org-element-paragraph-parser, org-element-paragraph-interpreter,
  org-element-property-drawer-parser,
  org-element-property-drawer-interpreter,
  org-element-quote-section-parser,
  org-element-quote-section-interpreter,
  org-element-src-block-parser, org-element-src-block-interpreter,
  org-element-table-parser, org-element-table-interpreter,
  org-element-verse-block-parser,
  org-element-verse-block-interpreter, org-element-emphasis-parser,
  org-element-emphasis-interpreter,
  org-element-text-markup-successor, org-element-entity-parser,
  org-element-entity-interpreter,
  org-element-latex-or-entity-successor,
  org-element-export-snippet-parser,
  org-element-export-snippet-interpreter,
  org-element-export-snippet-successor,
  org-element-footnote-reference-parser,
  org-element-footnote-definition-interpreter,
  org-element-footnote-reference-interpreter,
  org-element-footnote-reference-successor,
  org-element-inline-babel-call-parser,
  org-element-inline-babel-call-interpreter,
  org-element-inline-babel-call-successor,
  org-element-inline-src-block-parser,
  org-element-inline-src-block-successor,
  org-element-latex-fragment-parser,
  org-element-latex-fragment-interpreter,
  org-element-line-break-parser, org-element-line-break-interpreter,
  org-element-line-break-successor, org-element-link-parser,
  org-element-link-interpreter, org-element-link-successor,
  org-element-macro-parser, org-element-macro-interpreter,
  org-element-macro-successor, org-element-radio-target-parser,
  org-element-radio-target-interpreter,
  org-element-radio-target-successor,
  org-element-statistics-cookie-parser,
  org-element-statistics-cookie-interpreter,
  org-element-statistics-cookie-successor,
  org-element-subscript-parser, org-element-subscript-interpreter,
  org-element-sub/superscript-successor,
  org-element-superscript-parser,
  org-element-superscript-interpreter, org-element-target-parser,
  org-element-target-interpreter, org-element-target-successor,
  org-element-time-stamp-parser, org-element-time-stamp-interpreter,
  org-element-time-stamp-successor, org-element-verbatim-parser,
  org-element-verbatim-interpreter, org-element-get-property,
  org-element-get-contents, org-element-at-point,
  org-element-guess-type, org-element-collect-affiliated-keywords,
  org-element-parse-buffer, org-element-parse-secondary-string,
  org-element-map, org-element-parse-elements,
  org-element-parse-objects, org-element-get-next-object-candidates,
  org-element-interpret-data, org-element-interpret-secondary,
  org-element-interpret--affiliated-keywords,
  org-element-normalize-string, org-element-normalize-contents,
  org-element-swap-A-B, org-element-backward,
  org-element-drag-backward, org-element-drag-forward,
  org-element-forward, org-element-mark-element,
  org-narrow-to-element, org-transpose-elements,
  org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
  org-element-greater-elements, org-element-all-successors,
  org-element-object-successor-alist, org-element-recursive-objects,
  org-element-non-recursive-block-alist,
  org-element-affiliated-keywords,
  org-element-keyword-translation-alist,
  org-element-multiple-keywords, org-element-parsed-keywords,
  org-element-dual-keywords, org-element-object-restrictions,
  org-element-string-restrictions, org-element--affiliated-re,
  org-element--element-block-types): New variables.
2011-11-21 08:12:25 +01:00
Eric Schulte e3ec968fc7 changing documentation to reflect changing source code -- spaces around "=" 2011-11-20 10:09:18 -07:00
Thomas Dye a12e99aefc * doc/org.texi: Documented no spaces in name=assign, another correction to :var table 2011-11-20 10:08:33 -07:00
Eric Schulte 1b014d1cb2 Merge branch 'master' of orgmode.org:org-mode 2011-11-20 09:40:52 -07:00
Eric Schulte 82c0f9bf69 Allow spaces around "=" in code block variable specifications
* lisp/ob.el (org-babel-join-splits-near-ch): Rejoins a list of a
  split string when a character appears on either side of the split.
  (org-babel-parse-multiple-vars): Rejoin splits around "=" signs.
2011-11-20 09:40:08 -07:00
Eric Schulte 41387f4675 marked test as expected to pass, because it is now passing 2011-11-20 09:39:09 -07:00
Eric Schulte 15417f67c4 Added a less functional Org-mode copy of the cl reduce function.
* lisp/org.el (org-reduce): Added a less functional Org-mode copy of
  the cl reduce function.
2011-11-20 09:38:54 -07:00
Nicolas Goaziou b5935f777e Fontify src blocks following a "name" keyword
* lisp/org.el (org-fontify-meta-lines-and-blocks-1): Recognize "name"
  as a valid keyword that can preceed a block.
2011-11-20 10:40:25 +01:00
Eric Schulte f55810593e don't try to evaluate #+call lines in verbatim blocks
* lisp/ob-exp.el (org-babel-exp-lob-one-liners): Don't limit
  in-verbatim check to inline code blocks, do lob code blocks as well.
* testing/lisp/test-ob-lob.el (test-ob-lob/do-not-eval-lob-lines-in-example-blocks-on-export):
  Test ensuring that #+call lines in verbatim blocks are not evaluated
2011-11-18 11:30:59 -07:00
Eric Schulte 1f206ed477 new testing macro for in-file execution with temp text
* testing/org-test.el (org-test-with-temp-text-in-file): A new testing
  macros for temp-text tests which require a file name (e.g., for
  export).
2011-11-18 11:30:59 -07:00
Jambunathan K e28e1038c4 org-odt.el: Rescale a large images so that it fits in text area
* contrib/lisp/org-odt.el (org-export-odt-max-image-size): New
variable.
(org-odt-image-size-from-file): Honor above variable.

Ivars Finvers <ifinvers@shaw.ca> says -
   One minor issue that I came across in using the ODT
exporter relates to the size of embedded images.  I often need
to include plots of simulation results in my documents.  These
plots can be larger than a normal page, which causes problems
in the text flow.  In LaTeX, I've grown used to being able to
automatically rescale a plot to match the maximum text width
of the document.  It would be useful to have such a feature
for the ODT exporter.
2011-11-17 23:58:42 +05:30
Carsten Dominik 78f7382879 Merge branch 'master' of orgmode.org:org-mode 2011-11-17 18:06:20 +01:00
Carsten Dominik 773596e347 Use prefix arg 0 to inhibit note taking for TODO change
* lisp/org.el (org-todo): Interpret 0 prefix arg as note inhibitor.

Sometimes I want to quickly make a few TODOs done in the agenda and I
want to bypass the note taking I have normally set up.  With this
change, I can press `0 t d' in the agenda to do this.
2011-11-17 08:56:11 +01:00
Eric Schulte 7c21098323 Don't match partial names when resolving code or data references
* lisp/ob.el (org-babel-named-src-block-regexp-for-name): Ensure that
  partial names are not matched.
  (org-babel-named-data-regexp-for-name): Ensure that partial names
  are not matched.
* testing/lisp/test-ob.el (test-ob/do-not-resolve-to-partial-names-data):
  Test to ensure that partial names are not matched.
2011-11-16 06:15:31 -07:00
Eric Schulte 19884ab280 resolve named code blocks before named data
* lisp/ob-ref.el (org-babel-ref-resolve): Search for named code blocks
  before named data.
* lisp/ob.el (org-babel-named-data-regexp-for-name): New function for
  finding named data.
* testing/lisp/test-ob.el (test-ob/resolve-code-blocks-before-data-blocks):
  Test to ensure that named references are resolved in the correct
  order.
2011-11-15 20:13:41 -07:00
Eric Schulte 8114cf2bc4 Gracefully handle results which are neither lists nor strings.
* lisp/ob.el (org-babel-insert-result): Gracefully handle results
  which are neither lists nor strings.
2011-11-15 15:30:35 -07:00
Thomas Dye f8d8f81e79 * doc/org.texi: Changed DATA to NAME in Working With Source Code section 2011-11-15 11:21:04 -07:00
Eric Schulte 1b6de8fad5 ignore org-id file generated during testing 2011-11-15 11:19:39 -07:00
Eric Schulte c21692506d fix bug missing references to example blocks
* lisp/ob-ref.el (org-babel-ref-resolve): Don't change location when
  looking at the contents.
* testing/lisp/test-ob.el (test-ob/catches-all-references): Test
  enforcing the correct behavior.
2011-11-15 11:18:26 -07:00
Milan Zamazal a5ed98e452 Create visibility overlays properly
* org.el (org-set-outline-overlay-data): Use outline-flag-region to make a
region invisible.  This ensures all necessary actions, especially adding
isearch-open-invisible property, are applied.
2011-11-15 18:39:57 +01:00
Eric Schulte 4f7e1fb108 fix compilation warning
* lisp/ob-lob.el (org-babel-in-example-or-verbatim): Fix compilation
  warning.
2011-11-15 08:56:26 -07:00
Eric Schulte 9702f5520e revert changes to interactive function `org-test-run-all-tests' 2011-11-15 08:56:25 -07:00
Martyn Jago 0440b83ac5 Changes to fix sandboxed tests to suit the standard code block syntax, and some changes to reduce ID testing scope and improve result gathering. * testing/org-test.el: Add org as an executable language for sand-boxed testing to suit the standard code block syntax. Use .org-test-id-locations as ID file temporarily whilst testing. Add `org-test-update-id-locations' to do just that. Clear *Messages* buffer and temporarily set `message-log-max to t to ensure capturing entire test backtrace.
* testing/.gitignore: ignore testing/.org-test-id-locations
2011-11-15 08:56:25 -07:00
Eric Schulte 83dfaa5c8f named code blocks are replaced with their results
* lisp/ob.el (org-babel-find-named-result): Downcase "name" before comparison.
* testing/lisp/test-ob.el (test-ob/does-not-replace-a-block-with-the-results):
  Test that named code blocks are replaced with their results.
2011-11-15 08:56:25 -07:00
Eric Schulte 16e4e9b5cc fix typo
* lisp/ob-lisp.el (org-babel-execute:lisp): Fixed typo.
  (org-babel-lisp-vector-to-list): Fixed typo.
2011-11-15 08:56:25 -07:00
Tom Dye 015e41fa2a * doc/org.texi: Minor change to :var table 2011-11-15 08:56:25 -07:00
Tom Dye 3c832c9e81 * doc/org.texi: More changes to :var table (some examples were wrong) 2011-11-15 08:56:25 -07:00
Tom Dye 90aa84ffc1 * doc/org.texi: Cleaned up :var table 2011-11-15 08:56:25 -07:00
Eric Schulte 630b9c80ca Indicate tests with missing dependencies by adding a expected failing test
* testing/lisp/test-ob-R.el (featurep): Signal missing dependencies
  with an error rather than a throw.
* testing/org-test.el (missing-test-dependency): Define the error
  signal for missing dependencies.
  (org-test-for-executable): Signal missing dependencies with an error
  rather than a throw.
  (org-test-load): Define an expected failing test for each file with
  missing dependencies.
2011-11-15 08:56:25 -07:00
Martyn Jago 49d6951caa Fix don't load symlinks (Emacs interlocking files) * testing/org-test.el: During test development various interlocking files may be present in testing/lisp directory (since they are being edited by emacs). Currently org-test-load will attempt to load these 2011-11-15 08:56:25 -07:00
Martyn Jago 0cc18ed120 Avoid loading (and failing) symbolic links (interlocking files) * testing/org-test.el: During test development various interlocking files may be present in testing/lisp directory (since they are being edited by emacs). Currently org-test-load will attempt to load these and fail. 2011-11-15 08:56:25 -07:00