Commit Graph

595 Commits

Author SHA1 Message Date
Nicolas Goaziou 10b06ae53c org-export: Fix bug with false-positive inline tasks
* contrib/lisp/org-export.el (org-export-with-current-buffer-copy):
  Fix bug with false-positive inline tasks.
2012-01-23 22:41:00 +01:00
Nicolas Goaziou a47713717b org-export: Add function to retrieve next element/object in parse tree
* contrib/lisp/org-export.el (org-export-get-next-element): New function.
2012-01-23 22:15:39 +01:00
Nicolas Goaziou 711d2ef0e0 org-element: Syntax change for caption
* contrib/lisp/org-element.el (org-element-dual-keywords): Move
  caption in the dual keywords category.
(org-element--affiliated-re): Change regexp matching a dual keyword.
(org-element-collect-affiliated-keywords): Dual parsed keywords also
  get their optional value parsed as a secondary string.
* EXPERIMENTAL/org-e-latex.el (org-e-latex--caption/label-string,
  org-e-latex-src-block): Apply caption status change.
* EXPERIMENTAL/org-e-ascii.el (org-e-ascii--build-caption): Apply
  caption status change.
(org-e-ascii--list-listings, org-e-ascii--list-tables): Apply caption
  status change.  Also use short caption name when available.

The status change implies a syntax change.  Captions can now share
#+results: syntax, which mean that they can have a secondary
value. Thus, the following Org snippets are valid, the first two being
equivalent.

#+caption: long name
#+caption[]: long name
#+caption[short name]: long name
2012-01-22 21:34:00 +01:00
Nicolas Goaziou 0f29f23b06 org-element: Fix code typo
* contrib/lisp/org-element.el (org-element-string-restrictions):
  Correct name for both verbatim and emphasis successor is
  text-markup.
2012-01-22 14:30:03 +01:00
Nicolas Goaziou d41b9803e2 org-export: Do not export subtree titles as-is
* contrib/lisp/org-export.el (org-export-get-subtree-options):
  Interpret subtree title as a secondary string, not as a simple string.
2012-01-22 14:27:51 +01:00
Nicolas Goaziou f694c3d996 org-export: Fix some errors and corner cases with macros
* contrib/lisp/org-export.el (org-export-get-inbuffer-options):
  Replace macro with an empty string when no value is provided.
  Ignore macros with an ill-formed key.
2012-01-22 10:37:28 +01:00
Nicolas Goaziou fc93b6f340 org-export: Ask user for a file name when exporting from temporary buffer
* contrib/lisp/org-export.el (org-export-output-file-name): Ask user
  for a file name when exporting from temporary buffer.
2012-01-21 22:58:23 +01:00
Nicolas Goaziou 58b509c091 ASCII back-end for new export engine
* EXPERIMENTAL/org-e-ascii.el: New file.
* contrib/lisp/org-export.el (org-export-dispatch): Reference E-ASCII
  back-end in dispatcher.
2012-01-21 20:40:15 +01:00
Nicolas Goaziou 588a7c261b org-element: Correctly parse inlinetasks before first headline
* contrib/lisp/org-element.el (org-element-section-parser): Correctly
  parse inlinetasks before first headline.
2012-01-21 20:38:22 +01:00
Nicolas Goaziou f86de3d233 org-export: Export standard drawers by default
* contrib/lisp/org-export.el (org-export-with-drawers): Export
  standard drawers by default.
2012-01-21 20:16:33 +01:00
Nicolas Goaziou a5766a98d5 org-export: Fix option item for drawers
* contrib/lisp/org-export.el (org-export-option-alist): Use "d"
  instead of "drawer".
2012-01-21 20:04:51 +01:00
Nicolas Goaziou 76f249b4f3 org-export: Filters can only be list of functions
* contrib/lisp/org-export.el
  (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-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): Only allow list of functions.
2012-01-21 15:29:25 +01:00
Nicolas Goaziou 5f81b563e0 org-export: Implement access to filters through communication channel
* contrib/lisp/org-export.el (org-export-option-alist): Add filters as
  properties in the communication channel.  This allows back-end
  developers to install their own filters at run time instead of
  making them reside in a global variable.
(org-export-data, org-export-as): Read filters from communication
  channel instead of global variables.
(org-export-filter-apply-functions): Only accept list of functions.
  Also change order of calling: it is now LIFO.
2012-01-21 15:23:49 +01:00
Nicolas Goaziou e760c0c1f2 org-export: Fix code typos 2012-01-20 20:27:04 +01:00
Nicolas Goaziou b6610f8609 org-export: Change signature of collect functions
* contrib/lisp/org-export.el (org-export-collect-elements): Change
  output to list of elements instead of their beginning position.
  Also add an optional predicate argument for fine grain control.
  Remove back-end argument.
(org-export-collect-tables, org-export-collect-listings): Apply
  changes from previous function.
(org-export-collect-figures): Apply changes from previous function.
  Also require a predicate to correctly define the concept of figure.
2012-01-20 20:12:30 +01:00
Nicolas Goaziou 3dc734eaf2 org-export: Correctly handle predicate in `org-export-get-ordinal'
* contrib/lisp/org-export.el (org-export-get-ordinal): Correctly
  handle predicate in `org-export-get-ordinal'. Also allow to count
  more than one element type in the same sequence with optional
  argument TYPES.
2012-01-20 20:12:30 +01:00
Nicolas Goaziou 95744ce7f8 org-element: Fix docstrings 2012-01-19 19:14:41 +01:00
Nicolas Goaziou 3bace4b335 org-element: Use correct regexp to identify comments at column 0
* contrib/lisp/org-element.el (org-element-guess-type,
org-element-current-element): Use correct regexp to identify comments
at column 0.
2012-01-19 19:14:41 +01:00
Nicolas Goaziou c2fd307df3 org-element: Fix `quote-section' detection and parsing
* contrib/lisp/org-element.el (org-element-quote-section-parser):
  Assume point is at quote-section beginning.
(org-element-guess-type): Move point to section beginning before
  calling for quote-section parser.
(org-element-parse-elements, org-element-current-element): Correctly
  detect and parse quote section.
2012-01-19 18:09:10 +01:00
Nicolas Goaziou 6c9c6eff05 org-export: Fix docstrings 2012-01-19 17:14:22 +01:00
Nicolas Goaziou c12246931f org-export: Add a function to resolve id or custom-id links
* contrib/lisp/org-export.el (org-export-resolve-id-link): New function.
2012-01-19 17:07:18 +01:00
Nicolas Goaziou 46ff3b7a56 org-export: Remove :point-max property
* contrib/lisp/org-export.el (org-export-last-sibling-p): Make use
  of :genealogy property instead.
(org-export-get-point-max): Removed function.
(org-export-collect-tree-properties): Remove :point-max property.
2012-01-18 23:45:02 +01:00
Nicolas Goaziou 0bd090379b org-element: Fix block parsing
* contrib/lisp/org-element.el (org-element-parse-elements): Fix
  erroneous block parsing introduced by recent speed improvements.
  Also refactor code a bit.
2012-01-18 22:12:36 +01:00
Nicolas Goaziou 3c4a0795df Fix some docstrings 2012-01-17 21:06:30 +01:00
Nicolas Goaziou ecfb12de19 New interactive export functions for 'e-latex back-end
* EXPERIMENTAL/org-e-latex.el (org-e-latex-export-to-latex,
  org-e-latex-export-to-pdf): New functions.
* contrib/lisp/org-export.el (org-export-dispatch): Make use of new
  functions.
2012-01-17 20:27:38 +01:00
Nicolas Goaziou 418f63c8b1 org-export: Externalize output file name retrieval
* contrib/lisp/org-export.el (org-export-output-file-name): New function.
(org-export-to-file): Remove post-process and pub-dir arguments. Add
a file argument to specify an output file.
2012-01-17 19:14:14 +01:00
Nicolas Goaziou e270792bd8 org-export: Fix regression in headline numbering
* contrib/lisp/org-export.el (org-export-collect-tree-properties):
  Ensure `:headline-offset' is filled before `:headline-numbering'
  since the latter depends on the former.
(org-export-collect-headline-numbering): Use headline elements as keys
  in the returned alist, instead of just beginning numbers.
(org-export-get-headline-number): Apply key change.
2012-01-16 00:36:26 +01:00
Nicolas Goaziou 5e970e407a org-export: Add a new predicate to test if an headline is low level
* contrib/lisp/org-export.el (org-export-low-level-p): New function.
* EXPERIMENTAL/org-e-latex.el (org-e-latex-headline): Make use of new function.
2012-01-15 18:40:40 +01:00
Nicolas Goaziou b03ec00a0e org-export: Change output from org-export-resolve-fuzzy-link
* contrib/lisp/org-export.el (org-export-resolve-fuzzy-link): Now
  return the full object (for a target) or element (for an headline)
  when a match is found.  Also rewrite internals so it doesn't rely
  on :headline-alist.
(org-export-collect-tree-properties): Remove :headline-alist property
  from communication channel, since `org-export-resolve-fuzzy-link'
  doesn't use it anymore. Also store full target objects
  in :target-list property, not only raw names. Fix an argument name
  mismatch, too.

Previous version of org-export-resolve-fuzzy-link returned beginning
position as the identifier for the headline found, which is pretty
weak when files are included in the parsed buffer.
2012-01-14 01:02:07 +01:00
Nicolas Goaziou 117ee610e5 org-element: Fix small bug
* contrib/lisp/org-element.el (org-element-non-recursive-block-alist):
  Fix small bug.
2012-01-13 18:00:27 +01:00
Nicolas Goaziou fb046f5b59 org-element: Speed optimizations
* contrib/lisp/org-element.el (org-element--element-block-re): New
  variable.
(org-element-current-element): New function.
(org-element-parse-elements): Make use of the new specialized function
  instead of `org-element-at-point'.  Also narrow buffer to current
  container (greater element or recursive object) being parsed to
  improve search speed.
(org-element-comment-parser): Speed-up parsing for comments at column 0.
(org-element-guess-type): Make comment regexp less restrictive, due to
  comment optimizations.
2012-01-13 17:56:56 +01:00
Nicolas Goaziou 5b407eaabf org-export: Add another way to handle source code
* contrib/lisp/org-export.el (org-export-handle-code): Allow to delay
  processing of source code by storing line numbers and references in
  text properties attached it.
2012-01-12 20:29:25 +01:00
Nicolas Goaziou 57f51dce5d org-export: Default title doesn't overwrite a blank #+title keyword
* contrib/lisp/org-export.el (org-export-collect-options): Default
  title is retrieved before in-buffer settings are read.  Also, be
  more careful about indirect buffers.
2012-01-12 17:53:47 +01:00
Nicolas Goaziou 64b554cedc org-element: Minor fix
* contrib/lisp/org-element.el (org-element-line-break-interpreter):
  Add forgotten characters from previous commit.
2012-01-12 15:35:28 +01:00
Nicolas Goaziou a566f810e2 org-element: Fix line-break object
* contrib/lisp/org-element.el (org-element-line-break-parser,
org-element-line-break-interpreter): Fix line-break object.
2012-01-12 15:25:12 +01:00
Nicolas Goaziou 886154898c org-export: Prevent footnotes definitons from being enclosed with a section
* contrib/lisp/org-export.el (org-export-initial-options): Prevent
  footnotes definitons from being enclosed with a section.
2012-01-12 12:43:30 +01:00
Nicolas Goaziou a3e4459bee org-export: Properly reset LOC count when encountering a "-n" switch
* contrib/lisp/org-export.el (org-export-get-loc): Properly reset LOC
  count when encountering a "-n" switch
2012-01-11 18:05:51 +01:00
Nicolas Goaziou cd1e356da2 org-element: Rename :options property from example to :switches
* contrib/lisp/org-element.el (org-element-example-block-parser):
  Rename :options property from example to :switches.
2012-01-11 17:30:00 +01:00
Nicolas Goaziou 4725d00f84 org-element: Untabify strings without semantics during parsing
* contrib/lisp/org-element.el (org-element-parse-objects): Untabify
  strings between objects to avoid any `tab-width' mismatch.
* contrib/lisp/org-element.el (org-element-normalize-contents): No
  longer need to handle tabs.
2012-01-11 16:52:08 +01:00
Nicolas Goaziou 3fc0afb5ee org-element: Add missing inline-src-block interpreter
* contrib/lisp/org-element.el
  (org-element-inline-src-block-interpreter): New function.
2012-01-11 16:52:08 +01:00
Nicolas Goaziou 096ffd571c org-element: White space fixing and trivial refactoring 2012-01-11 16:52:08 +01:00
Nicolas Goaziou 6951f9af15 org-export: Remove useless test
* contrib/lisp/org-export.el (org-export-get-previous-element): Remove
  useless test.
2012-01-11 16:52:08 +01:00
Nicolas Goaziou b73a8d6d82 Removal of persistent properties (:total-loc, :code-refs) in export engine
* contrib/lisp/org-element.el (org-element-map): Remove use of
  `org-export-update-info'.
* contrib/lisp/org-export.el (org-export-persistent-properties,
org-export-persistent-properties-list): Remove variables
(org-export-collect-tree-properties): Rename from
  `org-export-initialize-persistent-properties'.
(org-export-data): Get rid of `org-export-update-info' calls.
(org-export-as): Use new `org-export-collect-tree-properties' name.
(org-export-resolve-coderef, org-export-get-loc): New functions.
(org-export-handle-code): Use new functions instead of removed
  properties.  Reformat code.  Change signature.
2012-01-11 16:52:08 +01:00
Nicolas Goaziou acc6fa3a44 org-export: New function to retrieve previous element and object
* contrib/lisp/org-export.el (org-export-first-sibling-p,
  org-export-data): Apply changes.
(org-export-get-previous-element): New function.
2012-01-11 16:52:08 +01:00
Nicolas Goaziou bc22518812 org-export: Remove :previous-element :previous-object properties
* contrib/lisp/org-export.el (org-export-set-property):
2012-01-11 16:52:07 +01:00
Nicolas Goaziou aae20190a3 org-element: Remove empty strings between objects in parse tree
* contrib/lisp/org-element.el (org-element-parse-objects): Remove
  empty strings between objects in parse tree.
2012-01-11 16:52:07 +01:00
Nicolas Goaziou 27f3a7cb05 org-element: Fix infloop when an heading is the first line of a buffer
* contrib/lisp/org-element.el (org-element-section-parser): Fix
  infloop when an heading is the first line of a buffer.
2012-01-08 20:38:28 +01:00
Nicolas Goaziou bb39f7ea20 org-element: Small fix
* contrib/lisp/org-element.el (org-element-radio-target-interpreter):
  Correct interpreter for radio targets.
2012-01-08 19:34:15 +01:00
Nicolas Goaziou e09f92bf7e org-element: Correctly get section beginning
* contrib/lisp/org-element.el (org-element-section-parser): Fix
  `:begin' property, which was preventing correct parsing of text
  before first headline.
2012-01-08 19:33:50 +01:00
Nicolas Goaziou 3638097e5a org-element: Fix small bug when parsing visible headlines only
* contrib/lisp/org-element.el (org-element-parse-elements): Fix bug
  when restricting parsing to visible headlines only.
2012-01-08 12:50:29 +01:00
Nicolas Goaziou 25ab746fc9 org-export: Add a filter for new section element
* contrib/lisp/org-export.el (org-export-filter-section-functions):
  New variable.
2012-01-08 12:50:29 +01:00
Nicolas Goaziou daef88b0a8 org-element: Add a new greater element (section)
* contrib/lisp/org-element.el (org-element-section-parser,
  org-element-section-interpreter): New functions
(org-element-greater-elements): Add new element to the list.
(org-element-at-point): Change arguments to handle a new section mode.
(org-element-guess-type): Accept an optional argument to look for
  sections in priority.
(org-element-parse-buffer): Start in section mode by default.  Thus
  any text before the first headline is still in a section of his
  own.
(org-element-parse-elements): Handle new section mode.
2012-01-08 12:50:29 +01:00
Nicolas Goaziou ced1878fe4 org-export: Remove `:footnote-seen-labels' persistent property altogether
* contrib/lisp/org-export.el (org-export-update-info): No longer need
to keep it updated.
(org-export-collect-footnote-definitions,
org-export-footnote-first-reference-p): Get rid of dependency on the
removed property.
2012-01-08 02:06:34 +01:00
Nicolas Goaziou f4d8a55282 org-export: Code typo
* contrib/lisp/org-export.el (org-export-get-parent-headline): Code typo.
2012-01-08 00:22:37 +01:00
Nicolas Goaziou 5ef692030f org-export: Fix small bug
* contrib/lisp/org-export.el (org-export-table-format-info): Fix
  confusion between "\" which means nothing in special columns, and
  "/".
2012-01-07 18:33:06 +01:00
Nicolas Goaziou a9f9db68c1 org-export: Fix information returned from table analysis
* contrib/lisp/org-export.el (org-export-table-format-info): Now
  `:width' is properly retrieved with cookies where alignement is
  missing (i.e. "<6>").  Also `:row-groups' contains groups of
  standard lines only (colgroups and width lines are skipped).
2012-01-07 18:12:07 +01:00
Nicolas Goaziou 50213d28cb org-export: Improve `:genealogy' property in communication channel
* contrib/lisp/org-export.el (org-export-update-info): `:genealogy' is
  now a full flat list of objects and elements containing current
  object or element.  Thus, `:parent-properties' and
  `:inherited-properties' are now obsolete, and removed.
(org-export-data): Apply change to `:genealogy' property.
(org-export-get-parent-headline): New function to fullfil one common
  need.
(org-export-last-sibling-p, org-export-included-file): Make use of the
  new function.
2012-01-07 14:33:48 +01:00
Nicolas Goaziou aeb1ee1c66 contrib/lisp/org-export: Add a dispatcher for new export engine
* contrib/lisp/org-export.el (org-export-initial-scope,
  org-export-show-temporary-export-buffer,
  org-export-dispatch-use-expert-ui): New variables.
(org-export-dispatch, org-export-dispatch-ui): New functions.
2012-01-06 16:04:13 +01:00
Nicolas Goaziou 427327a94e contrib/lisp/org-export: Possibly add transcoded string to kill ring
* contrib/lisp/org-export.el (org-export-copy-to-kill-ring): New
  variable.
(org-export-as): Make use of new variable.
2012-01-05 22:21:57 +01:00
Nicolas Goaziou 9d47c4f23d contrib/lisp/org-export: Customize coding system for export to file
* contrib/lisp/org-export.el (org-export-coding-system): New variable.
(org-export-to-file): Use new variable.
2012-01-05 20:15:05 +01:00
Nicolas Goaziou a496c3af47 contrib/lisp/org-export: Fix subtree export
* contrib/lisp/org-export.el (org-export-get-subtree-options):
  Correctly get `:title: from headline when no "EXPORT_TITLE" property
  is defined.  Also assume point is at subtree beginning.
(org-export-as): Fix subtree parsing.  The subtree starts at point or
  at first heading above.  Contents do not include the first headline.
2012-01-05 20:15:05 +01:00
Nicolas Goaziou 3ada986ba3 contrib/lisp/org-export: Make export to file compatible with org-publish
* contrib/lisp/org-export.el (org-export-to-file): Automatically
  retrieve output file name.  Also add a PUB-DIR optional argument.
2012-01-05 20:15:05 +01:00
Bastien Guerry 346ee30e42 Fix trailing whitespaces for *.el files in contrib/. 2012-01-04 16:21:56 +01:00
Bastien Guerry 681914f32b Copyright year fixes for contrib/. 2012-01-04 15:48:18 +01:00
Bastien Guerry 575ecebcac More copyright year fixes. 2012-01-04 15:11:23 +01:00
Bastien Guerry e44d2975ff Fix copyright (to 2012) year and Org version (to 7.8.03). 2012-01-03 18:47:01 +01:00
Bastien Guerry b73075a8d2 Code cleanup up: rename org-on-*-p to org-at-*-p.
Rename `org-on-heading-p' and `org-on-target-p' to
`org-at-heading-p' and `org-at-target-p' to be more
consistent with the org-at-*-p family.

Also define two aliases.
2012-01-02 19:52:35 +01:00
Nicolas Goaziou 44bd38556c contrib/lisp/org-element.el: Fix docstrings 2011-12-29 19:41:16 +01:00
Bastien Guerry 371b0cf9aa org-drill.el: fix a few wrong :type spec.
* org-drill.el (org-drill-leech-method, org-drill-scope)
(org-drill-spaced-repetition-algorithm): Fix wrong :type spec.

Thanks to Joost Kremers for spotting this.
2011-12-26 15:40:02 +01:00
Bastien Guerry 80dd8f47f0 org-element.el: Added "This file is not part of GNU Emacs". 2011-12-26 15:34:36 +01:00
Nicolas Goaziou 732725a79b contrib/lisp/org-element: Translate "data" affiliated keyword into "name"
* contrib/lisp/org-element.el (org-element-keyword-translation-alist):
  Make "data" an alternate from "name" according to code blocks standardization.
2011-12-26 12:33:58 +01:00
Nicolas Goaziou 5136d2ee41 contrib/lisp/org-export: Add footnote number to footnotes definitions collection
* contrib/lisp/org-export.el
  (org-export-collect-footnote-definitions): Change key to footnote
  number, retrieved with `org-export-get-footnote-number'.  Also, do
  not use beginning position as label for inline footnotes, as those
  are weak identifiers.
2011-12-26 09:59:53 +01:00
Nicolas Goaziou a7afc47572 contrib/lisp/org-export: Extend footnote numbering to definitions
* contrib/lisp/org-export.el (org-export-get-footnote-number): Also
  retrieve ordinal associated to a footnote definition.
2011-12-25 16:46:38 +01:00
Nicolas Goaziou 639810cb54 contrib/lisp/org-element: Add attributes to inlinetask element
* contrib/lisp/org-element.el (org-element-headline-parser): Update
  list of attributes in the docstring.
(org-element-inlinetask-parser): Complete attributes with properties
  inherited from any property drawer within the inlinetask and with
  time properties (i.e. scheduled, clock...).
2011-12-25 10:15:36 +01:00
Nicolas Goaziou 64d9cd2b06 contrib/lisp/org-element.el (org-element-inlinetask-parser): Fix attributes names 2011-12-24 18:00:02 +01:00
Nicolas Goaziou d140374fc9 contrib/lisp/org-export.el (org-export-collect-headline-numbering): Small fix 2011-12-24 14:57:57 +01:00
Nicolas Goaziou b78800f05a contrib/lisp/org-element: Hygienize org-element-map
* contrib/lisp/org-element.el (org-element-map): Change name of local
  variables to prevent variable name collisions with the function
  around org-element-map.
2011-12-24 14:57:57 +01:00
Nicolas Goaziou 27480a2ee7 contrib/lisp/org-export: Improve footnote API
* contrib/lisp/org-export.el (org-export-initial-options): Rename
  `:footnotes-labels-alist' property into `:footnote-definition-alist'
  for consistency.  Add comments to code.
(org-export-persistent-properties-list): Apply previous renaming.
(org-export-update-info): Rename `:seen-footnote-labels' into
  `footnote-seen-labels'.
(org-export-collect-footnote-definitions,
org-export-footnote-first-reference-p,
org-export-get-footnote-definition,
org-export-get-footnote-number): New functions.
2011-12-23 16:24:13 +01:00
Bastien Guerry a0f2396f8f Move org-eshell.el by Konrad Hinsen to Org's core.
* org-eshell.el: New file.
2011-12-21 09:43:48 +01:00
Nicolas Goaziou e6ab3158e1 org-export: Add a function associating an ordinal to an element or object
* contrib/lisp/org-export.el (org-export-get-ordinal): New function.
2011-12-20 20:09:03 +01:00
Nicolas Goaziou 10ea126b36 contrib/lisp/org-export: Add omitted persistent properties
* contrib/lisp/org-export.el (org-export-persistent-properties-list):
  Add omitted persistent properties.

This patch also updates documentation with regards to persistent properties.
2011-12-20 19:58:24 +01:00
Nicolas Goaziou 4aace47474 contrib/lisp/org-export: Normalize collecting functions names
* contrib/lisp/org-export.el (org-export-collect-figures): Renamed
  from `org-export-get-figures'.
2011-12-20 19:18:11 +01:00
Nicolas Goaziou 3210994bc4 contrib/lisp/org-export.el: Simplify headlines collection
* contrib/lisp/org-export.el (org-export-collect-headlines): Simplify
  function, in order to allow greater flexibility to build a proper
  table of contents.
2011-12-20 19:16:19 +01:00
Nicolas Goaziou c3972265bb Modification to the type signature of `org-export-inline-image-p'
EXPERIMENTAL/org-e-latex.el (org-e-latex-link): Apply changes.
contrib/lisp/org-export.el (org-export-inline-image-p): Remove
description of the link as a required argument, since this function is
called with link contents anyway.
2011-12-20 18:50:59 +01:00
Nicolas Goaziou 69505ed062 contrib/lisp/org-export: New function to export to a file
* contrib/lisp/org-export.el (org-export-to-buffer): Slight change to
  doc-string.
(org-export-to-file): New function.
2011-12-20 13:49:06 +01:00
Paul M. Rodriguez bf25b68915 Rewrite of contrib/lisp/org-velocity.el.
From the author: "This is a rewrite of Org-Velocity for speed. Delays due
to file size should no longer be perceptible. I have also added in-line
previews of entry contents and dropped support for Org-Remember."
2011-12-11 17:14:09 +01:00
Nicolas Goaziou 4e36b533e0 Code indentation fix (tabify) 2011-12-11 11:20:11 +01:00
Jambunathan K 6aef72be12 Move org-lparse.el and org-odt.el to the main lisp dir 2011-12-10 18:12:53 +01:00
Nicolas Goaziou b377e54c6a contrib/lisp/org-export: Extract more properties from tables
* contrib/lisp/org-export.el (org-export-table-format-info): Extract
column width and and row groups.
2011-12-07 20:49:10 +01:00
Nicolas Goaziou 816f60b0c7 contrib/lisp/org-element: Re-order a function within the file 2011-12-01 15:42:06 +01:00
Nicolas Goaziou b1f2903392 contrib/lisp/org-element: Do not map function to ignored elements or objects
* contrib/lisp/org-element.el (org-element-map): In an export
  situation, only map function on included elements or objects.
2011-12-01 15:04:38 +01:00
Nicolas Goaziou 9ee429ca1d contrib/lisp/org-export: Fix headline numbering
* contrib/lisp/org-export.el (org-export-persistent-properties-list):
  Remove unused persistent properties.
(org-export-initialize-persistent-properties): Delegate headline
  numbering alist to `org-export-collect-headline-numbering'.
(org-export-collect-headline-numbering): New function.
(org-export-update-info): Remove part relative to headline numbering.
(org-export-get-headline-number): Use new `:headline-numbering' to get
  current headline number.

Headline numbering is not done on demand anymore, but built once and
for all at the beginning of the export process, and stored in an
alist, accessible through the `:headline-numbering' property in the
communication channel.
2011-12-01 14:35:43 +01:00
Nicolas Goaziou 21758c30c9 contrib/lisp/org-export: Fix visibility influence on list parsing
* contrib/lisp/org-export.el (org-export-with-current-buffer-copy):
  Full invisibility prevents `current-column' from returning useful
  values.  Thus, keep visibility related text-properties and set
  `buffer-invisibility-spec' to nil.
2011-11-28 20:14:20 +01:00
Nicolas Goaziou 55e4d0e695 contrib/lisp/org-export: Fix a docstring.
* contrib/lisp/org-export.el (org-export-option-alist): Fix docstring.
2011-11-25 19:33:23 +01:00
Nicolas Goaziou c84192e567 contrib/lisp/org-export.el: Fix misleading comments about transcoders
* contrib/lisp/org-export.el: Fix misleading comments about transcoders.
2011-11-25 19:06:19 +01:00
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
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
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
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
Jambunathan K 9edb523bdd org-xhtml.el: Merge commit 2f50b1 2011-11-14 02:00:56 +05:30
Jambunathan K 457375be28 org-xhtml.el: Bring over few commits (contd.)
Bring over following commits:
-22ed1906
-2f1fbc58
-8d25fdc7
-236642dc
-d85e0e35
2011-11-14 01:05:48 +05:30
Jambunathan K 7e31ecdb22 org-lparse.el & co: Bring over few commits (contd.)
Bring over following commits:
- dfcb6fae
- 767f5188
- ca49e893
- 728611fa
- b2408c00
- 97d107d9
2011-11-13 15:25:20 +05:30
Jambunathan K c5081b8f14 org-lparse.el & co: Bring over few commits
Bring over following commits:
- 97538eb9
- 5c53026d
- 3482284b
- 58f1dbcc
- 8b16fae4
- 106993d3
2011-11-13 13:55:22 +05:30
Jambunathan K 22b9e68782 org-lparse.el: Fix issues with formatting of custom links
* contrib/lisp/org-lparse.el (org-lparse-format-org-link): Fix
issues with formatting of custom links - pass the right
backend to the custom formatter.

Fix for bug reported by Christian Moe here:
http://lists.gnu.org/archive/html/emacs-orgmode/2011-11/msg00474.html

TODO: Modify `org-bbdb-export' to support odt backend.  Review contrib
modules for odt compatibility.
2011-11-13 02:45:57 +05:30
Jambunathan K 25eefa57e4 org-xhtml.el: Minor fix
* contrib/lisp/org-xhtml.el (org-xhtml-begin-environment)
(org-xhtml-end-environment): Fix param list.

Continue commit 2e0e462d14.

Support for annotation blocks for xhtml backend still needs to
be ported.  See org-exp-blocks.el for more information.
2011-11-13 02:45:33 +05:30
Jambunathan K 311146aa21 Add support for embedding an equation via a link to its *.odf file
* contrib/lisp/org-odt.el (org-odt-is-formula-link-p):
Recognize *.mml and *.mathml as mathml files.  Recognize *.odf
files as OpenDocument formula file.
(org-odt-copy-formula-file): Use `org-odt-zip-extract-one' to
handle ODF formula files.
(org-export-odt-format-formula): If a ODF formula link has no
caption or label, embed it inline.  Otherwise embed it as
displayed.
2011-11-08 05:08:26 +05:30
Jambunathan K a69547c61c Add command to export LaTeX fragments to OpenDocument formula file
* contrib/lisp/org-lparse.el (org-lparse-and-open): Add a new
param `file-or-buf' to accommodate
`org-export-as-odf-and-open'.
* contrib/lisp/org-odt.el (org-export-as-odf)
(org-export-as-odf-and-open): New interactive commands.
(org-export-odt-convert): Add autoload cookie.
2011-11-08 03:08:55 +05:30
Jambunathan K fe19f7a637 org-odt.el: Preparing for introducing `org-export-as-odf'
* contrib/lisp/org-odt.el (org-odt-update-styles-file)
(org-odt-write-mimetype-file): New.  Extracted out of
`org-odt-save-as-outfile'.
(org-odt-save-as-outfile): Use above routines.
(org-export-odt-tmpdir-prefix)
(org-odt-init-outfile): Misc changes.

Preparing for introducing `org-export-as-odf'.  The new
command will create OpenDocument Formula files out of LaTeX
fragments.  Dynamic variable `org-lparse-backend' will be set
to 'odf during this command.
2011-11-08 03:08:48 +05:30
Jambunathan K f8168144a9 Annotate Dvipng images/Math formula and strengthen error handling
* contrib/lisp/org-odt.el (org-odt-encode-plain-text): New.
(org-odt-format-line)
(org-odt-format-source-code-or-example-plain): Use it.
(org-odt-format-object-description): New.  Format svg:title
and svg:desc elements out of plain text.
(org-export-odt-format-formula, org-export-odt-format-image):
Check whether the incoming formula or image is generated out
of a latex fragment.  If yes, pass the latex fragment for
downstream processing.
(org-odt-format-frame): Check if the object that is enclosed
in the frame has metadata associated with it.  If yes, dump it
as part of svg:title and svg:desc elements.
(org-odt-protect-latex-fragment): New after advice for
`org-format-latex-as-mathml'.  Fixes the following bug
http://lists.gnu.org/archive/html/emacs-orgmode/2011-11/msg00176.html
2011-11-07 00:32:27 +05:30
Jambunathan K 00cb82c266 org-odt.el: Minor modifications to reflect change in package layout
* contrib/lisp/org-odt.el (org-odt-data-dir): Modified to
reflect change in ELPA package layout.
2011-11-03 00:01:58 +05:30
Jambunathan K e856d1cfe7 org-odt.el: Protect label references against downstream expansion
* contrib/lisp/org-odt.el
(org-export-odt-preprocess-label-references): Mark label as
protected text and protect it from being expanded downstream.

Fixes bug reported by Myles English here:
http://lists.gnu.org/archive/html/emacs-orgmode/2011-11/msg00069.html
2011-11-02 23:33:10 +05:30
Jambunathan K 8559a91be8 org-odt.el: Fix a regression in export of src blocks
* contrib/lisp/org-odt.el
(org-odt-format-source-line-with-line-number-and-label): When
numbering was turned off, src blocks were getting stripped
from export.  Fixed this regression.
2011-10-31 14:09:36 +05:30
Jambunathan K a62818d561 org-odt.el: Put label generation and reference under user control
* contrib/lisp/org-odt.el (org-odt-begin-table)
(org-export-odt-format-formula, org-export-odt-format-image)
(org-odt-entity-frame-styles, org-odt-format-entity): Use
"__Table__", "__Figure__", "__MathFormula__",
"__DvipngImage__" as internal category handles.
(org-export-odt-user-categories)
(org-export-odt-get-category-from-label)
(org-odt-label-styles, org-odt-category-map-alist): New
variables.
(org-odt-entity-labels-alist): Add label style as an
additional entry.  Update docstring.
(org-odt-get-label-category-and-style): New defun.
(org-odt-add-label-definition)
(org-odt-format-label-definition)
(org-odt-format-label-reference)
(org-odt-fixup-label-references)
(org-odt-format-entity-caption, org-odt-init-outfile):
Modified.
(org-odt-label-def-ref-spec): Removed.  Superceded by
`org-odt-label-styles'.
(org-odt-get-label-definition): Removed

Give user more control over how labels are generated and
referenced.  This is accomplished by mapping each label to a
category-handle which in turn is used to locate the category,
counter and style to be associated with label.
2011-10-31 03:41:59 +05:30
Eric Schulte 884ec24c07 replace missing copyright year 2011-10-30 10:09:11 -06:00
Jonathan Bisson 7e56bb070f Adding :colnames and :noquote parameters 2011-10-30 10:07:30 -06:00
Jambunathan K 2e0e462d14 org-odt.el: Add support for annotation blocks
* contrib/lisp/org-lparse.el (org-lparse-special-blocks): New
variable.  Add "annotation" blocks in addition to the already
existing "list-table" blocks.
(org-lparse-get-block-params): New helper routine to read
params passed to a special block.  Used in conjunction with
OpenDocument annotations and with parsing of "#+ATTR_ODT:..."
lines attached to images.
(org-lparse-par-open-stashed): New let-bound variable.
(org-do-lparse): Bind `org-lparse-par-open-stashed'.  Treat
all blocks listed in `org-lparse-special-blocks' as special
environments.  Honor options passed as part of
"#+begin_<block-name>[options]".
(org-lparse-preprocess-after-blockquote-hook): Handle all
blocks listed in `org-lparse-special-blocks' specially.
(org-lparse-strip-experimental-blocks-maybe-hook): New hook
that hooks up to `org-export-preprocess-hook'.  Removes blocks
listed under `org-lparse-special-blocks' while exporting to
formats other than "odt" or "xhtml".
(org-lparse-begin-environment, org-lparse-end-environment):
Modified signature to accomodate block params.
(org-lparse-stash-save-paragraph-state)
(org-lparse-stash-pop-paragraph-state): New helper routines
for use with emitting of OpenDocument annotations.
(org-lparse-list-table-enable): Removed.  "list tables" are
now always enabled.

* contrib/lisp/org-odt.el (org-odt-begin-annotation)
(org-odt-end-annotation): New routines.
(org-odt-begin-environment, org-odt-end-environment): Handle
block params.  Handle the new "annotation" block.
(org-odt-format-author, org-odt-iso-date-from-org-timestamp):
New helper routnes for emitting author and comment timestamps
with annotation blocks.
(org-odt-update-meta-file): Use above routines.
(org-export-odt-format-image): Use
`org-lparse-get-block-params' to parse inline image attributes.
(org-odt-format-date): Removed.  Superceded by
`org-odt-iso-date-from-org-timestamp'.

See http://lists.gnu.org/archive/html/emacs-orgmode/2011-10/msg01251.html
2011-10-29 04:13:44 +05:30
Jambunathan K 614c15744c Move cmds and user vars in lparse namespace to odt namespace
* contrib/lisp/org-odt.el
(org-export-odt-preferred-output-format): Use
`org-lparse-reachable-format'.  Update docstring.
(org-export-odt-convert-processes)
(org-export-odt-convert-process)
(org-export-odt-convert-capabilities): New customizable
variables.  Migrated from org-lparse.el.
(org-export-odt-convert): New.  Replaces `org-lparse-convert'.
(org-odt-get): Handle options - `CONVERT-METHOD' and
`CONVERT-CAPABILITIES'.

* contrib/lisp/org-lparse.el (org-lparse-and-open)
(org-lparse-to-buffer)
(org-replace-region-by, org-lparse-region, org-lparse): Made
these functions non-interactive.
(org-lparse-convert): Removed.  Splitted it in to
`org-lparse-convert-read-params' and `org-lparse-do-convert'.
(org-lparse-convert-read-params, org-lparse-do-convert): New
helper routines.
(org-lparse-convert-processes, org-lparse-convert-process)
(org-lparse-convert-capabilities): Removed.  Migrated to
org-odt.el.
(org-lparse-get-other-backends, org-lparse-get-converter)
(org-lparse-all-backends): Removed these helper routines.
(org-lparse-do-reachable-formats)
(org-lparse-reachable-formats, org-lparse-reachable-p): New
helper routines.
(org-do-lparse): Misc changes.

org-lparse.el is likely to be replaced by Nicolas Goazious's
backend.  So, with future-proofing in view, hide org-lparse.el
from direct user contact.  This amounts to retiring all
interactive functions and customizable variables that have
org-lparse as prefix and migrating their existing functinality
to the odt namespace.  This set of changes does precisely
that.
2011-10-25 00:28:49 +05:30
Robert P. Goldman 821b854a0e Fix header prefixes for trac wiki.
trac wiki has hard limit on number of headers.  Need space before
macro characters in trac wiki.

Add a couple of TODO comments.
2011-10-24 18:40:28 +02:00
Robert P. Goldman 7c1c2bfe10 Fixed section-header-prefix for trac wiki. 2011-10-24 18:40:26 +02:00
Robert P. Goldman e377588de1 Kill the HTML exporter.
This is done better in core org-mode.
2011-10-24 18:40:24 +02:00
Jambunathan K b83e532174 Define customizable group org-export-odt
* contrib/lisp/org-odt.el (org-export-odt): Define the missing
customizable group and hook it up with `org-export'
customizable group.
(org-export-odt-preferred-output-format): Fix the `:group'
property.
2011-10-23 15:26:45 +05:30
Jambunathan K 5082f2bbd4 org-odt.el: Rename some variables that affect inline images
* contrib/lisp/org-odt.el (org-export-odt-inline-images):
Renamed from `org-odt-export-inline-images'.  Also removed
customizability.
(org-export-odt-inline-image-extensions): Renamed from
`org-odt-export-inline-image-extensions'.  Also fixed the
`:group' property.
(org-odt-format-org-link): Propagate above changes.
2011-10-23 15:26:37 +05:30
Jambunathan K 2c74df762b Make org-export-odt-embed-images internal
* contrib/lisp/org-odt.el (org-export-odt-embed-images):
Removed customizability of this variable.
2011-10-23 15:26:29 +05:30
Jambunathan K 08ac9121f5 Rename org-export-odt-use-htmlfontify to org-export-odt-fontify-srcblocks
* contrib/lisp/org-odt.el (org-export-odt-use-htmlfontify):
Replaced with `org-export-odt-fontify-srcblocks'.
(org-export-odt-fontify-srcblocks): Renamed from
`org-export-odt-use-htmlfontify'.
(org-odt-format-source-code-or-example-plain)
(org-export-odt-create-custom-styles-for-srcblocks)
(org-odt-format-source-code-or-example-colored)
(org-odt-format-source-code-or-example): Rename above
variable.
2011-10-23 15:26:21 +05:30
Jambunathan K 49f18ef5be Remove org-export-odt-use-bookmarks-for-internal-link
* contrib/lisp/org-odt.el
(org-export-odt-use-bookmarks-for-internal-links): Removed
unused variable.
2011-10-23 15:26:14 +05:30
Robert P. Goldman 3133b92fec Added trac-wiki and tikiwiki export settings. 2011-10-22 11:39:32 +02:00
Robert P. Goldman 22ad7e845a bind org-export-current-backend in generic exporter.
This is needed for org-export-preprocess-string to function correctly.
2011-10-22 11:38:48 +02:00
Tassilo Horn 4bbdfd229d Replace org-mode-p with usual (eq major-mode 'org-mode) check
Additionally, replace one

  (or (org-mode-p) (derived-mode-p 'org-mode))

with

  (derived-mode-p 'org-mode)

cause that is reflexive anyway (returns true, if the current mode is
org-mode).

Delete one check testing for org-mode or org derived mode
2011-10-22 11:29:24 +02:00
Jambunathan K a17ceed1cc Update default value of org-export-odt-table-styles
* contrib/lisp/org-odt.el (org-export-odt-table-styles): Add
the required table style "OrgEquation".

Continues the following commit:
,----
| commit 861ecb85ba
| Author: Jambunathan K <kjambunathan@gmail.com>
| Date:   Sun Sep 18 00:09:06 2011 +0530
|
| contrib/lisp/org-odt.el: Typeset display equations using tables
`----
2011-10-20 14:27:42 +05:30
Eric Schulte 0da82db252 org-mime: use dvipng for inline images when export to html mail
* contrib/lisp/org-mime.el (org-mime-htmlize): Use dvipng for inline
  images when export to html mail.
2011-10-19 12:07:48 -06:00
Jambunathan K 757453b98e Add a new option #+ODT_STYLES_FILE:...
* contrib/lisp/org-odt.el: Introduce a new option
"#+ODT_STYLES_FILE: ..." for per-file setting of
`org-export-odt-styles-file'.
(org-export-odt-styles-file): Mention above option in
docstring.
(org-odt-save-as-outfile): Honor above option.
2011-10-19 23:12:43 +05:30
Jambunathan K ce6f67c1ef Fix a crash in org-odt-is-formula-link-p
* contrib/lisp/org-odt.el (org-odt-is-formula-link-p): Trivial
change to avoid a crash.
2011-10-19 22:19:38 +05:30
Jambunathan K 9e90239a70 org-odt.el: Don't corrupt styles.xml while applying outline numbering
* contrib/lisp/org-odt.el
(org-odt-configure-outline-numbering): Tighten the regular
expression that matches "<text:outline-level-style ...>"
element.

Fixes bug reported here
http://lists.gnu.org/archive/html/emacs-orgmode/2011-10/msg00594.html
2011-10-18 16:55:27 +05:30
Tassilo Horn 8caad532c3 Fix Emacs 24 compatibility issue with Emacs 24
* contrib/lisp/org-contacts.el (completion-table-case-fold): Make
completion compatible with Emacs 24Fix org-contacts completion at point (was: org-contacts completion stopped working)

julien Barnier <julien@nozav.org> writes:

Hi Julien,

>> I use a very recent emacs 24 bzr checkout and org master from git.
>> Not sure who's the culprit.
>
> Same problem here. After a quick look it seems that there has been a
> recent change in the arguments taken by the completion-table-case-fold
> function in minibuffer.el :
>
> http://bzr.savannah.gnu.org/lh/emacs/trunk/revision/105991

Thanks for the pointer!

> But I don't think I could be able to find a fix by myself.

But I was able, so good teamwork, mate. :-)

--8<---------------cut here---------------start------------->8---
>From d89ca3ce39cd7436e5205744adcf468d9619180f Mon Sep 17 00:00:00 2001
From: Tassilo Horn <tassilo@member.fsf.org>
Date: Thu, 13 Oct 2011 17:02:07 +0200
Subject: [PATCH 2/2] Fix org-contacts completion at point.
2011-10-17 15:59:47 +02:00
Carsten Dominik 872aec78d6 Put table style and col sizes under direct user control
* contrib/lisp/org-lparse.el
(org-lparse-table-get-colalign-info): Renamed
`org-forced-aligns' to `org-col-cookies'.  Renamed local
variable `forced-aligns' to `col-cookies'.
(org-lparse-format-table-row): With the introduction of
`org-col-cookies' property the internal structure of
`org-lparse-table-colalign-info' has changed.  Do the right
thing while setting up col alignment.  Pass on the colwidth
property as horiz-span arg of `TABLE-CELL' callback.

* contrib/lisp/org-odt.el (org-odt-begin-table): Let the table
style be settable throught #+ATTR_ODT line.  By default tables
are configured to occupy 90% of paper width.  This is too big
for smaller tables.  For aesthetic reasons, a user might
prefer that such tables of shorter width and thus specify a
different style.
(org-odt-end-table, org-odt-format-table-cell): Honor colwidth
specification.

* contrib/lisp/org-xhtml.el (org-xhtml-format-table-cell): Fix
signature as mandated by changes in TABLE-CELL callback.

See comments in the earlier patch. See also
http://lists.gnu.org/archive/html/emacs-orgmode/2011-08/msg01053.html
2011-10-16 10:55:28 +02:00
Jambunathan K 968313f113 org-odt.el: Treat label resolution failures as soft error
* contrib/lisp/org-odt.el (org-odt-get-label-definition): If a
label cannot be resolved, issue a warning and return nil.
(org-odt-fixup-label-references): Nothing to fixup if a
referenced label is not seen by the odt exporter.
2011-10-10 16:26:16 +05:30
Jambunathan K 78a1d2919c org-odt.el: Abort export if the label referenced is not defined
* contrib/lisp/org-odt.el (org-odt-get-label-definition):
Throw an error if the label that is being referenced is not
defined elsewhere.
2011-10-10 14:27:14 +05:30
Jambunathan K bbf836730a Revert "org-odt.el: Remove dependency on a pending patch"
This reverts commit 13b4f6b2e0.
2011-10-09 22:23:11 +05:30
David Maus 6f69fbca0c org-lparse.el: Remove unecessary link unescape
* contrib/lisp/org-lparse.el (org-lparse-format-org-link): Remove unecessary
link unescape.
2011-10-09 13:31:02 +05:30
Jambunathan K fec067a405 org-odt.el: Add bottom margin to source or example blocks
* contrib/odt/styles/OrgOdtStyles.xml
(OrgFixedWidthBlockLastLine, OrgSrcBlockLastLine): New styles
to be applied to the last line of the source or example
blocks.

* contrib/lisp/org-odt.el
(org-odt-format-source-code-or-example-plain)
(org-odt-format-source-code-or-example-colored): Use above
styles.
2011-10-07 19:02:04 +05:30
Jambunathan K 13b4f6b2e0 org-odt.el: Remove dependency on a pending patch
Revert this commmit once the patch referenced below is accepted.
https://lists.gnu.org/archive/html/emacs-orgmode/2011-10/msg00097.html
2011-10-07 16:30:16 +05:30
Jambunathan K 8aedd359bb org-odt.el: Add support for native numbering of src and example lines
* contrib/lisp/org-lparse.el (org-lparse-format-org-link):
Push the responsibility of calling
`org-export-get-coderef-format' to the backends.

* contrib/lisp/org-xhtml.el (org-xhtml-format-org-link): Take
up the above responsibility.

* contrib/lisp/org-odt.el (org-odt-format-link): Handle links whose
descriptions are actually line-numbers.
(org-odt-format-source-line-with-line-number-and-label): New.
Generate line numbers and link targets for lines that are part of
source or example blocks.
(org-odt-format-source-code-or-example-plain)
(org-odt-format-source-code-or-example-colored): Use
`org-odt-format-source-line-with-line-number-and-label'.
(org-odt-format-source-code-or-example): Pre-process input lines with
`org-export-number-lines'.  Also handle numbering of src lines.
(org-odt-format-org-link): Rework handling of coderef links.  Generate
ODF-specific markup for line-number based coderef links.
(org-xml-encode-plain-text-lines): Removed.  Not used any more.

contrib/odt/styles/OrgOdtStyles.xml (OrgSrcBlockNumberedLine): New
style for automatic numbering of src and example lines.
2011-10-07 16:17:07 +05:30
David Maus 384c502385 contrib/lisp/org-elisp-symbol: Set type if symbol is defuned but not fbound
Another small patch for org-elisp-symbol: Set the symbol type to
"Function or command" if it is defuned but not fbound when
`org-elisp-symbol-store-link' is called.

Best,
  -- David
2011-10-06 10:14:19 +02:00
Carsten Dominik c18896841e Allow dashes and underscores in bibtex citation keys
* contrib/lisp/org-exp-bibtex.el (org-export-bibtex-preprocess): Allow
dashes and underscores in bibtex citation keys.

TINYCHANGE

Patch by Nik Putnam
2011-10-06 10:10:47 +02:00
Jambunathan K 32cf8bf731 org-odt.el: When zip command fails, log its output as a message
* contrib/lisp/org-odt.el (org-odt-save-as-outfile): When the
zip command fails, spit out the output it generates to
"*Messages*" buffer.
2011-09-26 00:15:53 +05:30
Jambunathan K 861ecb85ba org-odt.el: Typeset display equations using tables
* contrib/odt/styles/OrgOdtContentTemplate.xml: Add bottom
margin to "OrgTable".  Modify border properties of
"OrgTblCell*"s.  Add "OrgEquation" table styles for
typesetting of display equations.

* contrib/odt/styles/OrgOdtStyles.xml: Added various "graphic"
styles for formatting of inline and display equations.
Modified names of some "graphic" styles for images for reasons
of consistency.

* contrib/lisp/org-odt.el (org-export-odt-do-format-image):
Removed.  This is now folded in to
`org-export-odt-format-image'.  A part of this is extracted in
to `org-odt-format-entity'.
(org-odt-entity-frame-styles): New variable.
(org-odt-format-entity): New function.  See previous entries.
(org-export-odt-format-image): Modified.  See previous
entries.
(org-export-odt-do-format-numbered-formula)
(org-export-odt-do-format-formula): Removed.  These functions
are now folded within `org-export-odt-format-formula'.
(org-export-odt-format-formula): Modified as noted above.
Also use `org-odt-format-entity'.
(org-odt-format-frame, org-odt-format-textbox): Modified
signature to facilitate elegant introduction of
`org-odt-format-entity'.
(org-odt-format-inlinetask): Honor change in signature.
(org-odt-label-def-ref-spec): Added an entry for "Equation".

Only MathML equations are typeset using tables.  Dvipng equations are still
typeset as regular images.
2011-09-18 00:14:20 +05:30
Jambunathan K bf3e9aa9a2 org-odt.el: Improve how labels are applied and generated.
* contrib/lisp/org-odt.el
(org-odt-entity-labels-alist, org-odt-entity-counts-plist)
(org-odt-label-def-ref-spec): New variables.
(org-odt-init-outfile): Reset above variables.
(org-odt-add-label-definition, org-odt-get-label-definition)
(org-odt-format-label-definition)
(org-odt-format-label-reference)
(org-odt-fixup-label-references): New functions.
(org-export-odt-preprocess-label-references): Modified.
(org-odt-end-export): Call `org-odt-fixup-label-references'.
(org-odt-parse-label): Removed
(org-odt-default-entity): Removed.
(org-odt-format-entity-caption): Fixed signature so that
category param is no longer optional.  Use
`org-odt-format-label-definition'.
(org-export-odt-do-format-formula)
(org-export-odt-do-format-image): Pass the mandatory category
param to `org-odt-format-entity-caption'.

* contrib/odt/styles/OrgOdtContentTemplate.xml: Add Figure and
Equation as sequence declarations.

Most of these changes can be pushed to org-exp.el.  For now park the
changes locally to org-odt.el.
2011-09-17 00:17:22 +05:30
Jambunathan K e73bca63cf org-odt.el: Support for styling of tables using table templates
* contrib/lisp/org-odt.el (org-odt-table-style)
(org-odt-table-style-spec): New variables.
(org-export-odt-table-styles): New user-customizable variable.
(org-odt-begin-table): Init `org-odt-table-style' from the
attributes.
(org-odt-get-table-cell-styles): New function.
(org-odt-end-table): Use the above function.
(org-odt-get-style-name-for-table-cell): Removed.  Now folded
in to `org-odt-get-table-cell-styles'.
(org-odt-get-style-name-cookie-for-table-cell): Modified to
accommodate new user-defined styles.

Users now have the option of choosing Org's own way of styling or
using custom styling.
2011-09-14 14:56:30 +05:30
Jambunathan K 488a2e378c Replace OrgOdtAutomaticStyles.xml with OrgOdtContentTemplate.xml
* contrib/odt/styles/OrgOdtAutomaticStyles.xml: Removed

* contrib/odt/styles/OrgOdtContentTemplate.xml: Added. This
file is now a fully-formed "content.xml" file but with "empty"
content. Note that the original "OrgOdtAutomaticStyles.xml"
was just an xml fragment.

* contrib/lisp/org-odt.el
(org-odt-document-content-header): Removed.
(org-export-odt-automatic-styles-file): Removed.
(org-export-odt-content-template-file): Renamed from
`org-export-odt-automatic-styles-file'.
(org-odt-data-dir): Update docstring.
(org-odt-begin-office-body, org-odt-begin-document-content):
Modified to accomodate changes introduced by the new
"OrgOdtContentTemplate.xml" file.
2011-09-12 17:19:14 +05:30
Jambunathan K 16333d4a53 org-lparse.el: Rename table routines
* contrib/lisp/org-lparse.el (org-lparse-insert-org-table):
Renamed from `org-lparse-do-format-org-table'.
(org-lparse-insert-list-table): Renamed from
`org-lparse-do-format-list-table.
(org-lparse-insert-table-table): Renamed from
`org-lparse-do-format-table-table'.
(org-lparse-insert-org-table, org-lparse-format-org-table)
(org-lparse-format-list-table, org-lparse-format-table-table):
Propagate above renamings.

* contrib/lisp/org-odt.el
(org-export-odt-do-format-numbered-formula): Propagate above
renamings.

Maintain a clear distinction between format and insert behaviours.
2011-09-09 00:38:31 +05:30
Jambunathan K ab757f9a24 org-odt.el: Set mathml option
* contrib/lisp/org-odt.el
(org-export-odt-do-preprocess-latex-fragments): Pass 'mathml
option to `org-format-latex'.
2011-09-09 00:26:19 +05:30
Jambunathan K be69dd2d50 org-odt.el: Embed links to mathml files as ODF formula
* contrib/lisp/org-odt.el
(org-odt-embedded-formulas-count):New variable.
(org-odt-init-outfile): Reset above variable.
(org-odt-is-formula-link-p, org-odt-format-inline-formula)
(org-odt-copy-formula-file, org-export-odt-format-formula)
(org-export-odt-do-format-formula)
(org-export-odt-do-format-numbered-formula): New functions for
formatting mathml file links as embedded ODF formulae.
(org-odt-format-org-link): Add check for links to mathml files
and call `org-odt-format-inline-formula'.
(org-export-odt-format-image): Update function signature.  Use
`org-latex-src' property to identify latex dvipng images.  Use
the (to be committed) `org-latex-src-embed-type' to identify
whether the equation image should be inlined or displayed.
(org-odt-format-textbox): Modified to accomodate correct
formatting of captioned formula.
(org-odt-format-inlinetask): Modified to accomodate changes to
the previous function.
(org-export-odt-do-format-image): Minor change.
(org-export-odt-do-preprocess-latex-fragments): When LaTeX
fragment option is set to `t' or `mathjax' check for
availability of latex to mathml converter using (to be
committed) `org-format-latex-mathml-available-p'.  If such a
converter is available and configured, use it.  Otherwise
default to the earlier behaviour.

Refer the following post for more information:
http://article.gmane.org/gmane.emacs.orgmode/46712
2011-09-08 21:14:11 +05:30
Jambunathan K 86409e89c0 org-odt.el: Sanitize formatting of Images
* contrib/lisp/org-odt.el (org-odt-format-frame): New.
(org-odt-format-textbox): Use the above function.
(org-export-odt-do-format-image): Use the above two functions.
Use the new custom styles for the Frame and Graphics elements.
(org-odt-image-attrs-from-size): Remove this.

* contrib/odt/styles/OrgOdtAutomaticStyles.xml: Removed all
Frame and Graphics entries.

* contrib/odt/styles/OrgOdtStyles.xml: Added following custom
styles - OrgSimpleGraphics, OrgCaptionedGraphics,
OrgCaptionFrame, OrgInlineGraphics and OrgInlineFormula.
2011-09-08 18:56:08 +05:30
Jambunathan K 0dd10f5d97 org-odt.el: Format date strings in meta.xml using portable means
* contrib/lisp/org-odt.el (org-odt-format-date): %:z format
specifier of `format-time-string' is not portable.  Replace it
with an equivalent implementation using %z specifier.

Thanks to Anton Tarasenko for reporting this bug and verifying
this fix.  See
http://lists.gnu.org/archive/html/emacs-orgmode/2011-09/msg00099.html
2011-09-06 23:45:25 +05:30
Jambunathan K 6b955077dc org-odt.el: Rework embedding of images
* contrib/lisp/org-odt.el (org-odt-embedded-images-count): New
variable.
(org-odt-copy-image-file): Use the above variable to name the
embedded image files. Remove some cruft as well.
(org-export-odt-file-list, org-export-odt-save-list): Removed.
(org-odt-init-outfile, org-odt-save-as-outfile): Related changes.
2011-09-06 23:09:08 +05:30
David Maus fe77c66741 Use `string=' to compare strings
* org-elisp-symbol.el (org-elisp-symbol-store-link): Use `string=' to
compare strings.

(let ((foo "foo"))
  (eq foo "foo")) => nil
2011-09-06 18:11:55 +02:00
Jambunathan K 933e508e05 org-odt.el: Create and update manifest.xml towards end of export
* contrib/lisp/org-odt.el (org-export-odt-manifest-lines):
Removed.
(org-odt-update-manifest-file): Removed.
(org-odt-create-manifest-file-entry)
(org-odt-write-manifest-file): New function.
(org-odt-manifest-file-entries): New variable.
(org-odt-manifest-file-entry-tag): Updated.
(org-odt-init-outfile): Don't create manifest.xml here.  Don't
create Pictures directory so early in the export.  Reset
`org-odt-manifest-file-entries'.
(org-odt-save-as-outfile): Modified.  Use
`org-odt-create-manifest-file-entry' and
`org-odt-write-manifest-file'.
(org-odt-copy-image-file, org-odt-update-meta-file)
(org-odt-copy-styles-file): Use
`org-odt-create-manifest-file-entry'.

Rationalized creation of Manifest file entries.  New entries are
created right at the point where new files are added to the odt file.
2011-09-05 23:30:14 +05:30
Jambunathan K 0c48918be5 org-odt.el: Trivial cleanup
* contrib/lisp/org-odt.el (org-export-odt-nosave-list): Remove
a useless variable.
(org-odt-init-outfile): Propagate above change.
2011-09-05 12:04:06 +05:30
Jambunathan K 82cf5d59e7 org-odt.el: Create mimetype file towards the end of export
* contrib/lisp/org-odt.el (org-odt-init-outfile): Don't create
mimetype file here.
(org-odt-save-as-outfile): Create mimetype file here.  Note
that this routine gets called towards the end of the export
just before files are zipped.
2011-09-05 12:03:55 +05:30
Jambunathan K c08183d043 org-odt.el: Create and update meta.xml towards end of the export
* contrib/lisp/org-odt.el
(org-odt-init-outfile): Don't create meta.xml here.
(org-odt-update-meta-file): Create and update meta.xml here
instead.  Note that this routine gets called just before the
component files are zipped.
(org-export-odt-meta-lines): Remove it. Not needed any longer.
(org-odt-save-as-outfile): No need to create backup files
while saving xml buffers.
2011-09-05 12:03:10 +05:30
David Maus 235e993ae6 Provide edebug spec for with-org-lparse-preserve-paragraph-state
* contrib/lisp/org-lparse.el (with-org-lparse-preserve-paragraph-state):
Provide edebug spec.
2011-09-03 14:55:41 +05:30
Jambunathan K d85635306b org-lparse.el: Abort export if list-tables are malformed
* contrib/lisp/org-lparse.el (org-lparse-format-table-row): In
list-tables, require that the header row be a row with max
number of columns. Abort export if this condition is not met.
2011-09-02 14:34:56 +05:30
Jambunathan K c51b7cfd40 org-xhtml.el: Fix a crash during export of list-tables
* contrib/lisp/org-xhtml.el (org-xhtml-end-table): During
export of list-tables, `org-xhtml-format-table-no-css' is not
bound.  In such cases pretend that it's value is nil.
2011-09-02 00:18:43 +05:30
Jambunathan K 74e78a1456 org-lparse.el: Support for list-tables (first cut)
* contrib/lisp/org-lparse.el
(org-lparse-list-table:table-cell-open): New variable.
(org-lparse-begin-list-table:table-cell)
(org-lparse-end-list-table:table-cell): New routines.  Use
`org-lparse-begin-collect' and `org-lparse-end-collect' to get
a string representation of a multi-line table cell.
(org-lparse-list-table-p, org-lparse-list-level)
(org-lparse-list-item-count, org-lparse-list-stack)
(org-lparse-list-table:table-cell-open)
(org-lparse-list-table:table-row)
(org-lparse-list-table:lines): New variables to keep track of
the state of the list at a point in time during export.
(org-do-lparse): Init above variables.
(org-lparse-begin-list, org-lparse-end-list)
(org-lparse-begin-list-item, org-lparse-end-list-item):
Modified so that list marked as list-table are exported as a
table.  Refer notes in the file for more information.
(org-lparse-do-format-list-table): Make sure that `org-table'
is loaded.

* contrib/lisp/org-odt.el (org-odt-format-table-cell): Table
cells are list-tables are already paragraphs.  No need to
enclose them in paragraphs again.
2011-09-01 23:44:17 +05:30
Jambunathan K 30aa8f61da Revert "Introduce org-odt-begin-table-cell and org-odt-end-table-cell"
This reverts commit e887881e13.  Keep things
simple for now.
2011-09-01 23:44:04 +05:30
Jambunathan K e887881e13 Introduce org-odt-begin-table-cell and org-odt-end-table-cell
* contrib/lisp/org-odt.el
(org-odt-entity-control-callbacks-alist): Added an entry for
TABLE-CELL.
(org-odt-begin-paragraph, org-odt-format-stylized-paragraph):
Honour `org-lparse-current-paragraph-style'.
(org-odt-begin-table-cell, org-odt-end-table-cell): Factored
out from the earlier `org-odt-format-table-cell'. Note that
these functions set and reset
`org-lparse-current-paragraph-style'.
(org-odt-format-table-cell): Use the above functions.
* contrib/lisp/org-lparse.el
(org-lparse-current-paragraph-style): New variable.
(org-do-lparse): Init the above variable at the beginning of
export.
2011-09-01 19:36:34 +05:30
Jambunathan K ad3419180f Refactor org-odt-format-table-cell
* contrib/lisp/org-odt.el
(org-odt-get-paragraph-style-cookie-for-table-cell)
(org-odt-get-style-name-cookie-for-table-cell): Factored out
from `org-odt-format-table-cell'.
(org-odt-format-table-cell): Simplified using above functions.
2011-09-01 18:32:13 +05:30
Jambunathan K 219e7d60db Introduced org-lparse-begin-collect and org-lparse-end-collect
* contrib/lisp/org-lparse.el (org-lparse-footnote-buffer):
Deleted.  Genericized as `org-lparse-collect-buffer'.
(org-lparse-output-buffer): Added docstring.
(org-lparse-collect-buffer): New variable.  Was
`org-lparse-footnote-buffer' till now.
(org-lparse-collect-count): New variable to aid in asserting
implicit assumptions made by the export engine.
(org-lparse-begin-collect): New function.  Factored out from
`org-lparse-begin-footnote-definition'.
(org-lparse-end-collect): New function.  Factored out from
`org-lparse-end-footnote-definition'.
(org-lparse-begin-footnote-definition)
(org-lparse-end-footnote-definition): Use above functions.
(org-do-lparse): Reset `org-lparse-collect-buffer' and
`org-lparse-collect-count' at the beginning of export.
Cleanup `org-lparse-collect-buffer'.

* contrib/lisp/org-xhtml.el (org-xhtml-end-export): Removed
references to `org-lparse-footnote-buffer'.
2011-09-01 16:32:06 +05:30
Jambunathan K 0e1f11e730 org-lparse.el: Recognize #+begin_list-table...#+end_list-table blocks
* contrib/lisp/org-lparse.el (org-lparse-list-table-enable):
New customizable variable.
(org-lparse-preprocess-after-blockquote-hook): New hook to
treat #+begin_list-table...#+end_list-table blocks specially.
Add this hook to
`org-export-preprocess-after-blockquote-hook'.
(org-lparse-list-table-p): New variable. Bound during
`org-do-lparse'.
(org-lparse-begin-environment, org-lparse-end-environment):
Set `org-lparse-list-table-p' as the engine moves in and out
of list-table blocks.
(org-do-lparse): Bind `org-lparse-list-table-p' to nil on
start of export.  Honor
ORG_LIST-TABLE-START...ORG-LIST-TABLE-END environment.

Actual export of list as table is not implemented yet.
2011-09-01 15:06:12 +05:30
Jambunathan K ac4b117bcc org-lparse.el: Fix earlier checkin
* contrib/lisp/org-lparse.el (org-lparse-do-format-org-table):
Modified.  Delete some local variables and move it to
`org-lparse-do-format-list-table'
(org-lparse-do-format-list-table): Modified as above.
2011-09-01 01:12:15 +05:30
Jambunathan K fdb8395886 Introduced org-lparse-do-format-list-table
* contrib/lisp/org-lparse.el
(org-lparse-do-format-list-table): New. Factored out from
`org-lparse-do-format-org-table'.
(org-lparse-do-format-org-table): Use above function.
(org-lparse-format-list-table): New.  Wrapper for
`org-lparse-do-format-list-table'. For future use.
2011-08-31 23:35:29 +05:30
Jambunathan K 098ed2d03f Introduced org-lparse-org-table-to-list-table
* contrib/lisp/org-lparse.el
(org-lparse-org-table-to-list-table): New. Factored out from
`org-lparse-do-format-org-table'.
(org-lparse-do-format-org-table): Use
`org-lparse-org-table-to-list-table'.
2011-08-31 23:23:03 +05:30
Jambunathan K a0769aaebb Introduce org-lparse-begin/end-list-item
* contrib/lisp/org-lparse.el (org-lparse-end-list-item):
Renamed to `org-lparse-end-list-item-1'.
(org-lparse-begin-list-item, org-lparse-end-list-item): New
functions.  Use these instead of doing (org-lparse-begin
'LIST-ITEM ...) or (org-lparse-end 'LIST-ITEM ...).
(org-lparse-export-list-line, org-lparse-begin-level)
(org-lparse-end-level): Propagate above changes.
* contrib/lisp/org-odt.el
(org-odt-begin-list-item, org-odt-end-list-item): ditto.
* contrib/lisp/org-xhtml.el (org-xhtml-format-toc-item)
(org-xhtml-begin-toc, org-xhtml-end-toc): ditto.
2011-08-31 22:28:14 +05:30
Jambunathan K 590ad72f59 org-xhtml.el: Support for captioning and labelling of equation images
* contrib/lisp/org-xhtml.el
(org-export-xhtml-do-preprocess-latex-fragments): Factored out
from the earlier org-export-xhtml-preprocess.
(org-export-xhtml-preprocess-latex-fragments): Check if
backend is xhtml. If yes, delegate to
org-export-xhtml-do-preprocess-latex-fragments. This is hooked
to org-export-preprocess-after-blockquote-hook.
(org-export-xhtml-preprocess-label-references): Factored out
from the earlier org-export-xhtml-preprocess.
(org-export-xhtml-preprocess): Call
org-export-xhtml-preprocess-label-references. Note that
processing of latex fragments is no longer done here.
(org-xhtml-format-image): Honor captions, label and attributes
even for images that are created by latex fragment processing.
(org-xhtml-unload-function): Unhook from
org-export-preprocess-after-blockquote-hook.

Thanks to Myles English for registering this requirement.
http://lists.gnu.org/archive/html/emacs-orgmode/2011-08/msg01116.html
2011-08-28 02:51:38 +05:30
Jambunathan K fec6440a49 Fix some issues with org-xhtml export
* contrib/lisp/org-xhtml.el: require html (temporarily). This
makes sure that variables such as org-export-html-extension
etc referenced in org-exp.el and made available through
opt-plist are properly inited. Can be removed once the
org-export-xhtml namespace is annihilated.

* contrib/lisp/org-lparse.el (org-lparse-format-table): Export
of table.el tables were broken. Fix it. Can be removed once
the xhtml backend is annihilated.
2011-08-28 02:01:40 +05:30
Jambunathan K 2adfdac23b Run org-export-odt-preprocess-latex-fragments only if backend is odt
* contrib/lisp/org-odt.el
(org-export-odt-do-preprocess-latex-fragments): Renamed from
org-export-odt-preprocess-latex-fragments.
(org-export-odt-preprocess-latex-fragments): Check that
backend is odt. If yes, delegate to
org-export-odt-do-preprocess-latex-fragments.
2011-08-28 01:48:25 +05:30
Jambunathan K 3688deeb3f org-odt.el: Support for captioning and labelling of equation images
* contrib/lisp/org-lparse.el (org-do-lparse): let-bind
org-lparse-opt-plist to current export options.
* contrib/lisp/org-odt.el
(org-odt-begin-office-body): Add a directive so that Equations
can be sequentially numbered.
(org-export-odt-preprocess): Removed call to
org-export-odt-preprocess-latex-fragments.
(org-export-odt-preprocess-latex-fragments): Fix signature and
hook it to org-export-preprocess-after-blockquote-hook. Use
org-lparse-opt-plist.
(org-odt-unload-function): Leave no trace in
org-export-preprocess-after-blockquote-hook.

Thanks to Myles English for registering this requirement.
http://lists.gnu.org/archive/html/emacs-orgmode/2011-08/msg01116.html
2011-08-27 20:31:43 +05:30
Jambunathan K 09618ba25a org-odt.el: Honor caption, label and attributes for latex png images
* contrib/lisp/org-odt.el (org-export-odt-format-image): Honor
captions, label and attributes for all images including those
generated from latex fragments.
2011-08-27 20:31:33 +05:30
Jambunathan K 457af1b109 Refactor org-export-odt-preprocess
* contrib/lisp/org-odt.el
(org-export-odt-preprocess-latex-fragments)
(org-export-odt-preprocess-label-references): New
routines. Factored out of the earlier
org-export-odt-preprocess.
(org-export-odt-preprocess): Use above functions.

Preparing for enabling of captions and labels for latex fragments
embedded as images.
2011-08-27 20:31:23 +05:30
Jambunathan K cfe467c01d org-odt.el: Fix byte-compiler warnings 2011-08-27 20:31:13 +05:30
Jambunathan K ce02a1b986 org-odt: Force columns of tables to have the same width
* contrib/lisp/org-odt.el (org-odt-end-table): Associate table
columns with `OrgTableColumn' style.
(org-odt-format-source-code-or-example): Delete trailing
whitespace.

* contrib/odt/styles/OrgOdtAutomaticStyles.xml: Modify
`OrgTable' style to use a relative width of 90%. Effective
table width is now increased so that tables are not
congested. There could be a reverse problem of they being too
big. This is OK. Introduced `OrgTableColumn' style and force
the columns to use the same width.

Fixes the following symptoms - congested table and uneven
columns - seen with the below report..

http://lists.gnu.org/archive/html/emacs-orgmode/2011-08/msg01053.html

Table cookies can specify default column width. These could be
used for finer control of column widths on per-table
basis. However this introduces the need to create automatic
column styles for each and every column that is explicitly
sized. The exporter has so far avoided creating of automatic
styles `on the go' and instead relied on a custom styles for
formatting. If column-widths are made user-controllable then
this has to change and the exporter could become a bit
inelegant. Is the overhead worth it?
2011-08-26 03:12:51 +05:30
Jambunathan K f131417f7d org-odt.el: Fix a bug in outline numbering
* contrib/lisp/org-odt.el
(org-odt-configure-outline-numbering): Fixed a bug with
outline numbering. Also removed the check for
org-export-odt-factory-settings (for now).
2011-08-24 04:41:43 +05:30
Jambunathan K 78e59a22d0 Add support for fontification of odt src blocks using htmlfontify
* contrib/lisp/org-lparse.el (org-do-lparse): Bind
hfy-user-sheet-assoc.
* contrib/lisp/org-odt.el
(org-export-odt-default-org-styles-alist): Rename
OrgSourceBlock to OrgSrcBlock for consistency.
(org-odt-format-source-code-or-example): Modified. Call either
org-odt-format-source-code-or-example-plain or
org-odt-format-source-code-or-example-colored.
(org-odt-format-source-code-or-example-plain): New. Identical
to the earlier org-odt-format-source-code-or-example.
(org-odt-format-source-code-or-example-colored): New
defun. Use htmlfontify for emitting coloring of source blocks.
(org-export-odt-use-htmlfontify)
(org-export-odt-create-custom-styles-for-srcblocks): New
customizable variables
(org-src-block-paragraph-format): New variable.
(org-odt-hfy-face-to-css)
(org-odt-insert-custom-styles-for-srcblocks): New defuns.
(org-odt-save-as-outfile): Modified. Use
org-odt-insert-custom-styles-for-srcblocks.
2011-08-19 01:02:00 +05:30
Jambunathan K ad9f393b61 org-odt: Rename style `OrgSourceBlock' to `OrgFixedWidthBlock'
* contrib/odt/styles/OrgOdtStyles.xml: Rename the style
`OrgSourceBlock' to `OrgFixedWidthBlock'.
* contrib/lisp/org-odt.el
(org-export-odt-default-org-styles-alist): Map fixedwidth
paragraphs to the custom style `OrgFixedWidthBlock'.
(org-odt-format-line, org-odt-format-source-code-or-example):
Style both fixedwidth paragraphs and src/example blocks in
fixedwidth format.
2011-08-19 00:38:44 +05:30
Jambunathan K 1ab7fbeb46 org-odt.el: Minor refactoring of src and example block formatters
* contrib/lisp/org-odt.el (org-odt-format-source-code-or-example-line)
(org-odt-format-example): Removed.
(org-odt-format-source-code-or-example, org-odt-format-line);
Changes related to above removal.
2011-08-19 00:38:35 +05:30
Jambunathan K 321f4d3a42 Introduce a new customizable variable org-export-odt-prettify-xml
* contrib/lisp/org-odt.el (org-export-odt-prettify-xml): New
customizable variable.
(org-odt-save-as-outfile): Honor the setting of the above
variable.

There have not been much reported issues with the odt output.  So turn
off prettifying of xml buffers.  But retain the option to turn it on
if required.
2011-08-19 00:38:25 +05:30
Jambunathan K a2e6a7ef90 Minor cleanups in org-odt
* contrib/lisp/org-odt.el (org-odt-format-spaces): Minor
change. Always emit a leading space.
(org-odt-fill-tabs-and-spaces): Simplify.
(org-odt-finalize-outfile): Remove a stray message.
2011-08-19 00:38:16 +05:30
Bastien Guerry 0538dd3188 Fix some double-space after ponctuation mark in docstrings. 2011-08-18 18:38:05 +02:00
Bastien Guerry 58f1dbccf8 Remove the "Version" header in Org libraries (leave it in org.el).
Also remove blank lines before the ";;; org*el ends here" declarations.

Having a "Version" header forced us to update every file when releasing a
new version of Org; it also forced us to update every file when merging Org
with Emacs trunk, thus cluttering the diffs between the previously merged
version and the new one with useless information.

Glenn Morris suggested this in emacs-devel:
http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00322.html
2011-08-17 14:42:34 +02:00
Jambunathan K 395a816a18 Prettify inlinetasks in odt and (x)html backends
* lisp/org-inlinetask.el (org-inlinetask-export-templates):
Fixed template for html so that the exported file is valid
xhtml. Added template for odt.
(org-inlinetask-export-handler): Fix typo in the regexp that
trims content. Make sure that the content is flanked by
paragraph boundaries on either side.

* lisp/org-html.el (org-export-html-style-default): Add style
for inlinetask.

* contrib/lisp/org-xhtml.el (org-export-xhtml-style-default):
Add style for inlinetask.

* contrib/odt/styles/OrgOdtStyles.xml: Added following custom
styles:  OrgInlineTaskHeading and OrgInlineTaskFrame.

* contrib/lisp/org-odt.el (org-odt-format-textbox)
(org-odt-format-inlinetask): Added

Refer following threads:
1. http://lists.gnu.org/archive/html/emacs-orgmode/2011-08/msg00238.html
2. http://lists.gnu.org/archive/html/emacs-orgmode/2011-08/msg00154.html

Thanks to Suvayu Ali for reporting this issue and suggesting
improvements.
2011-08-16 21:29:52 +02:00
Bastien Guerry ad23b7d173 Fix bzg email address (s/altern/gnu). 2011-08-15 21:22:30 +02:00
Bastien Guerry 28a338ea3a contrib/lisp/org-jira.el: remove Creative Commons license.
This license was just a leftover and is not compatible with
the GPLv2 license Jonathan wants to use for this file.
2011-08-15 20:10:04 +02:00
Bastien Guerry 7a18799e25 Remove arch-tag at the bottom of files. 2011-08-15 20:04:38 +02:00
Bastien Guerry 904ed18bc2 Fix copyright years for elisp files in core and contrib.
Also add "This file is not part of GNU Emacs." when this is the case.
2011-08-15 15:23:11 +02:00
Don Roberts 662c7a047b org-mac-ical: Clean up org-mac-iCal-range checking to eliminate end-of-year special cases and include repeating events in diary file 2011-08-14 18:34:37 +02:00
Carsten Dominik ca3935b6e3 Add org-sudoku to contrib directory
* contrib/lisp/org-sudoku.el: New file
2011-08-09 18:25:29 +02:00
Jambunathan K 99466ce716 Fix issues with numbering of lists found during odt to doc conversion
* contrib/lisp/org-lparse.el (org-do-lparse): Add new let
bound variable org-lparse-list-level.
(org-lparse-begin-list, org-lparse-end-list): New functions.
(org-lparse-export-list-line, org-lparse-begin-level)
(org-lparse-end-level): Use new functions.

* contrib/lisp/org-odt.el (org-odt-begin-list): Fixed
signature so that it is consistent with how org-lparse library
invokes it. Forcibly emit text:continue-numbering="false"
attribute for the top-level <text:list> element. This fixes
numbering issue found during odt to doc conversion. See
http://thread.gmane.org/gmane.comp.documentfoundation.libreoffice.devel/14739
(org-odt-begin-list-item, org-odt-end-list-item): Use
org-lparse-begin-list and org-lparse-end-list.

* contrib/lisp/org-xhtml.el (org-xhtml-format-toc-item)
(org-xhtml-begin-toc, org-xhtml-end-toc): Use
org-lparse-begin-list and org-lparse-end-list.
(org-xhtml-begin-list): Fixed signature so that it is
consistent with how org-lparse library invokes it.
2011-08-08 11:31:17 +05:30