Commit Graph

306 Commits

Author SHA1 Message Date
Nicolas Goaziou bb40d29b45 org-export: Fix subtree export when parent section is empty
* contrib/lisp/org-export.el (org-export--get-subtree-options): When
  point is at an headline and subtree export is called, make sure
  export properties are extracted from parent headline.
* testing/lisp/test-org-export.el: Add test.
2013-01-26 18:05:56 +01:00
Nicolas Goaziou cf968c510c org-export: Fix compilation for Emacsen <= 23
* contrib/lisp/org-export.el (org-export-async-start): Fix compilation
  for Emacsen <= 23.
2013-01-16 19:27:38 +01:00
Jambunathan K 35204a83dd org-export: Change dispatcher keys and improve UI
* contrib/lisp/org-export.el (org-export-dispatch-ui,
org-export-dispatch-action): Set export options via control keys.  UI
changes.
2013-01-13 21:42:36 +01:00
Nicolas Goaziou 9d26797448 Move functions operating on timestamp objects into org.el
* contrib/lisp/org-export.el (org-export-timestamp-has-time-p,
  org-export-format-timestamp, org-export-split-timestamp-range,
  org-export-translate-timestamp): Removed functions.
* lisp/org.el (org-timestamp-has-time-p, org-timestamp-format,
  org-timestamp-split-range, org-timestamp-translate): New functions.
* contrib/lisp/org-e-ascii.el (org-e-ascii-timestamp): Apply move.
* contrib/lisp/org-e-groff.el (org-e-groff-timestamp): Apply move.
* contrib/lisp/org-e-html.el (org-e-html-timestamp): Apply move.
* contrib/lisp/org-e-latex.el (org-e-latex-timestamp): Apply move.
* contrib/lisp/org-e-odt.el (org-e-odt--format-timestamp,
  org-e-odt-timestamp): Apply move.
* contrib/lisp/org-e-texinfo.el (org-e-texinfo-timestamp): Apply move.
* testing/lisp/test-org-export.el: Remove tests.
* testing/lisp/test-org.el: Add tests.
2013-01-13 10:01:05 +01:00
Bastien Guerry 60b23bdeac Merge branch 'maint'
Conflicts:
	contrib/lisp/htmlize.el
	etc/schema/od-manifest-schema-v1.2-os.rnc
	etc/schema/od-schema-v1.2-os.rnc
	lisp/org-exp-blocks.el
2013-01-01 16:06:17 +01:00
Bastien Guerry 98cd4687a2 Update copyright years.
Happy new year!
2013-01-01 16:04:24 +01:00
Nicolas Goaziou f506348bcf org-export: Allow to force viewing of a stack source in Emacs
* contrib/lisp/org-export.el (org-export--stack-view): Add optional
  prefix argument to view a file in Emacs.

Patch from Jambunathan K.
2012-12-19 22:27:58 +01:00
Nicolas Goaziou 27f06c104e org-export: Implement function to locally override translation table
* contrib/lisp/org-export.el (org-export-data-with-translations,
  org-export-data-with-backend): New functions.
* testing/lisp/test-org-export.el: Add tests.
2012-12-19 17:48:51 +01:00
Nicolas Goaziou 27d7d0ea17 org-export: Remove NOEXPAND optional argument from `org-export-as'
* contrib/lisp/org-export.el (org-export-options-alist): Fix
  docstring.
(org-export-as): Remove NOEXPAND argument.
(org-export-to-buffer, org-export-to-file): Apply argument removal.

This argument is not needed since a function removing macros, babel
code and include keywords can be added to
`org-export-before-processing-hook'.
2012-12-18 22:42:00 +01:00
Nicolas Goaziou 83b567925a org-export: Fix docstring
* contrib/lisp/org-export.el (org-export-define-backend): Fix
  docstring to include asynchronous export and additional sub-menus.
2012-12-16 08:22:41 +01:00
Nicolas Goaziou e556812db5 org-export: Fix docstring
* contrib/lisp/org-export.el (org-export-stack-mode): Fix docstring.
2012-12-14 19:02:34 +01:00
Nicolas Goaziou 5319cec24e org-e-publish: Activate asynchronous publishing
* contrib/lisp/org-e-publish.el (org-e-publish, org-e-publish-all,
  org-e-publish-current-file, org-e-publish-current-project): Activate
  asynchronous publishing.
(org-e-publish-initial-buffer): Remove unused variable.
* contrib/lisp/org-export.el (org-export-dispatch): Send asynchronous
  flag to publishing functions, when needed.
2012-12-13 15:36:51 +01:00
Nicolas Goaziou ffb630b85d org-export: Add asynchronous process wrapper for export
* contrib/lisp/org-export.el (org-export-async-stack,
org-export-async-debug, org-export-in-background,
org-export-async-init-file, org-export-stack-mode-map): New
variables.
(org-export-async-start): New macro.
(org-export--stack-source-at-point, org-export--stack-refresh,
 org-export-add-to-stack, org-export--stack-remove,
 org-export--stack-view, org-export--stack-clear,
 org-export-stack, org-export-copy-buffer,
 org-export--generate-copy-script): New functions.
(org-export-dispatch, org-export-dispatch-ui): Allow to toggle
asynchronous export.
(org-export-with-buffer-copy): Renamed from
`org-export-with-current-buffer-copy'.
(org-export-execute-babel-code): Use new function to copy a buffer.
(org-export-as): Remove all text properties from output so it still
can be sent to the original process.
2012-12-13 15:36:51 +01:00
Nicolas Goaziou b1f36921d7 org-export: Allow to retrieve all previous/next exportable objects
* contrib/lisp/org-export.el (org-export-get-previous-element,
  org-export-get-next-element): Allow to retrieve all previous/next
  exportable objects by specifying a non-nil, non positive integer
  argument.
* testing/lisp/test-org-export.el: Add tests.
2012-12-10 08:54:52 +01:00
Nicolas Goaziou cbb96d69d3 org-export: Add an optional argument to previous an next elements getters
* contrib/lisp/org-export.el (org-export-get-previous-element,
  org-export-get-next-element): Change signature.
* testing/lisp/test-org-export.el: Add tests.
2012-12-08 18:57:10 +01:00
Nicolas Goaziou 07f4d867e5 org-export: Dispatcher repeats last export action when called with C-u
* contrib/lisp/org-export.el (org-export-dispatch-last-action): New
  variable.
(org-export-dispatch): Repeat last export action when called with C-u.
2012-11-28 20:39:55 +01:00
Nicolas Goaziou dbdbf53cd6 org-export: Fix *:nil export option
* contrib/lisp/org-export.el (org-export--interpret-p): Fix *:nil
  export option.
(org-export-with-emphasize): Update docstring.
2012-11-28 13:36:31 +01:00
Nicolas Goaziou b7053b5f9c org-export: Fix Babel unresolved references error
* contrib/lisp/org-export.el (org-export-execute-babel-code): New
  function.
(org-export-as): Use new function.
2012-11-25 00:24:25 +01:00
Nicolas Goaziou 0a142efdde org-export: Add tools for timestamps objects
* contrib/lisp/org-export.el (org-export-split-timestamp-range,
  org-export-translate-timestamp): New functions.
* testing/lisp/test-org-export.el: Add tests.
2012-11-23 18:41:58 +01:00
Nicolas Goaziou 68234d5a41 org-export: uniquify and sort allowed keys in dispatcher expert UI
* contrib/lisp/org-export.el (org-export-dispatch-ui): uniquify and
  sort allowed keys.
2012-11-22 22:32:48 +01:00
Nicolas Goaziou eb1ef7267b org-export: Fix "wrong number of arguments" error
* contrib/lisp/org-export.el (org-export-with-backend): Fix "wrong
  number of arguments" error.

This fixexs d1a075e6bb.
2012-11-22 17:44:10 +01:00
Nicolas Goaziou d1a075e6bb org-export: Allow variable arity in `org-export-with-backend'
* contrib/lisp/org-export.el (org-export-with-backend): Allow to
  ignore contents and info, if necessary.  Also fix code typo.
2012-11-22 15:02:21 +01:00
Nicolas Goaziou 1a0f8b5c8b org-export: Add tools for timestamps
* contrib/lisp/org-export.el (org-export-timestamp-has-time-p,
  org-export-format-timestamp): New functions.
* testing/lisp/test-org-export.el: Add tests.
2012-11-19 21:52:32 +01:00
Nicolas Goaziou dadde768f7 org-export: Fix docstring
* contrib/lisp/org-export.el (org-export-smart-quotes-alist): Fix
  docstring.
2012-11-19 21:32:59 +01:00
Nicolas Goaziou 5107ca3c9b org-export: Fix subtree option with `split' behaviour
* contrib/lisp/org-export.el (org-export--get-subtree-options): Store
  value of options with `split' behaviour as a list of strings, not
  simply as a string.  Small refactoring.
* testing/lisp/test-org-export.el: Add tests.
2012-11-18 14:44:20 +01:00
Nicolas Goaziou 74faf5bd26 org-export: New `org-export-derived-backend-p' predicate
* contrib/lisp/org-export.el (org-export-define-derived-backend): Add
  `:parent' property to derived backend.
(org-export-derived-backend-p): New function.
* testing/lisp/test-org-export.el: Add tests.

This function can be useful in filters implemation. I.e.

  (defun my-filter (contents backend info)
    (when (memq backend '(e-latex e-beamer some-derived-backend-from-latex))
      ...))

can be replaced with:

  (defun my filter (contents backend info)
    (when (org-export-derived-backend-p backend 'e-latex)
      ...))
2012-11-17 13:33:38 +01:00
Nicolas Goaziou aa7dbec775 org-export: Fix dispatcher
* contrib/lisp/org-export.el (org-export-dispatch-ui): Correctly
  compute allowed keys, taking into account derived backends.
(org-export-dispatch-action): Correctly compute action associated to
key combination, taking into account derived backends.
2012-11-15 14:05:05 +01:00
Nicolas Goaziou 72a27c3b3f org-export: Make backend registration more stable wrt Org reload
* contrib/lisp/org-export.el (org-export-define-backend,
  org-export-define-derived-backend): Modify backend properties if
  backend is already registered.
(org-export-registered-backends): Use defvar instead of defconst so
a reload doesn't reset it.
2012-11-14 14:43:11 +01:00
Nicolas Goaziou 3d56f56399 org-export: Internal changes to back-end definition
* contrib/lisp/org-export.el (org-export-registered-backends): New
  variable.
(org-export-define-backend, org-export-define-derived-backend): Use
new variable. Also redefine how sub-menus are defined.
(org-export-backend-filters, org-export-backend-menu,
org-export-backend-options, org-export-backend-translate-table): New
functions.
(org-export-get-environment, org-export--parse-option-keyword,
org-export--get-subtree-options, org-export--get-inbuffer-options,
org-export--get-global-options, org-export-install-filters,
org-export-with-backend): Access to data stored in new variable.
(org-export-dispatch-ui): Display sub-menus according to new
definition.
(org-export-dispatch-menu-entries): Removed variable.
* contrib/lisp/org-e-beamer.el: Use new sub-menu definition.
(org-e-beamer--format-section, org-e-beamer-item,
org-e-beamer-keyword): Use `org-export-with-backend' instead of
relying on removed variables.
* testing/lisp/test-org-export.el: Update tests.

This patch gets rid of "invisible" variables, that is variables
defvar'ed within a macro.
2012-11-13 23:25:08 +01:00
Nicolas Goaziou c6d709d0ed org-export: Allow to toggle date insertion
* contrib/lisp/org-export.el (org-export-with-date): New variable.
(org-export-options-alist): Use new variable.
* contrib/lisp/org-e-ascii.el (org-e-ascii-template--document-title):
  Check `:with-date' property in communication channel.
* contrib/lisp/org-e-beamer.el (org-e-beamer-template): Check
  `:with-date' property in communication channel.
* contrib/lisp/org-e-groff.el (org-e-groff--mt-head): Check
  `:with-date' property in communication channel.
(org-e-groff-date-format): Remove variable.
* contrib/lisp/org-e-html.el (org-e-html--build-meta-info,
  org-e-html--build-preamble, org-e-html--build-postamble): Check
  `:with-date' property in communication channel.
(org-e-html-format-date): Remove variable.
* contrib/lisp/org-e-latex.el (org-e-latex-template): Check
  `:with-date' property in communication channel.
contrib/lisp/org-e-man.el: Do not redefine DATE keyword.
2012-11-09 11:04:07 +01:00
Nicolas Goaziou 359891f811 org-export: Consider colons as a safe character for targets
* contrib/lisp/org-export.el (org-export-solidify-link-text): Consider
  colons as a safe character for targets.
2012-11-08 00:36:41 +01:00
Nicolas Goaziou d8a3b84c93 org-export: New function to locally use another back-end
* contrib/lisp/org-export.el (org-export-with-backend): New function.
* contrib/lisp/org-e-beamer.el (org-e-beamer-link): Use new function.
2012-11-03 17:43:04 +01:00
Nicolas Goaziou 203d5123bc org-export: Fix `org-export-get-category'
* contrib/lisp/org-export.el (org-export-get-category):
  `org-entry-properties' is over-zealous when it comes to "CATEGORY"
  property.  Ignore its "???" return value, which only means it wasn't
  able to find an appropriate category.
2012-11-03 11:24:28 +01:00
Nicolas Goaziou 3d1ae7b7f2 org-export: Do not push empty strings to kill ring
* contrib/lisp/org-export.el (org-export-as): Do not push empty
  strings to kill ring.
2012-11-03 00:25:13 +01:00
Nicolas Goaziou 5d4243bccc org-export: Run a hook just before expanding include keywords and macros
* contrib/lisp/org-export.el (org-export-before-processing-hook): New
  variable.
(org-export-as): Run a hook just before expanding include keywords and
macros, and evaluating Babel blocks.
* testing/lisp/test-org-export.el: Add test.
2012-11-02 14:06:50 +01:00
Nicolas Goaziou 22ac03bee5 org-export: Add a function to retrieve category of an element or object
* contrib/lisp/org-export.el (org-export-get-category): New function.
* testing/lisp/test-org-export.el: Add tests.
2012-11-02 13:44:46 +01:00
Nicolas Goaziou 32c3456020 org-export: Fix previous/next element finding in secondary strings
* contrib/lisp/org-export.el (org-export-get-previous-element,
  org-export-get-next-element): Correctly retrieve previous and next
  object, if any, in secondary strings.
* testing/lisp/test-org-export.el: Add tests.
2012-10-31 13:21:16 +01:00
Nicolas Goaziou 14e0cd553f org-export: require ob-exp 2012-10-30 22:21:33 +01:00
Nicolas Goaziou caee8076f8 org-export: Fix docstring
* contrib/lisp/org-export.el (org-export-with-tasks): Fix docstring.
2012-10-30 16:28:33 +01:00
Nicolas Goaziou 1a7610ed98 org-export: Add FILETAGS when retreiving tags with inheritance
* contrib/lisp/org-export.el (org-export-special-keywords): New
  "FILETAGS" keyword.
(org-export--get-inbuffer-options): Handle "FILETAGS" keywords.
(org-export-get-tags): Add FILETAGS when retreiving tags with
inheritance.
* testing/lisp/test-org-export.el: Add test.
2012-10-30 16:03:59 +01:00
Nicolas Goaziou dda56367b8 org-export: Fix :input-file property
* contrib/lisp/org-export.el (org-export-get-environment): Add misc
  properties.
(org-export-as): Extract buffer attributes before entering its copy.
2012-10-30 15:07:44 +01:00
Nicolas Goaziou ad811f5437 org-export: Fix inclusion of files with no final newline
* contrib/lisp/org-export.el (org-export--prepare-file-contents): File
  contents should end with a newline character.
2012-10-30 13:53:28 +01:00
Nicolas Goaziou 1f3a2c42c6 org-element, org-export: Fix documentation typos
* contrib/lisp/org-export.el (org-export--get-subtree-options): Fix
  code comment.
* lisp/org-element.el (org-element-map): Fix docstring.
2012-10-29 21:57:46 +01:00
Nicolas Goaziou 8fb5987e56 org-export: Fix smart quotes with isolated quotes
* contrib/lisp/org-export.el (org-export-activate-smart-quotes): Fix
  smart quotes in some corner-cases.  Refactor code.
* testing/lisp/test-org-export.el: Add test.
2012-10-29 20:36:03 +01:00
Nicolas Goaziou a2120a9d73 org-export: Expand correctly {{{title}}} and such
* contrib/lisp/org-export.el (org-export-as): Expand correctly
  {{{title}}} and such when they already contain a regular macro.
  This is done by expanding macros in two steps: at first regular
  macros,  then document specific macros.
(org-export-expand-macro): Remove function.
* testing/lisp/test-org-export.el: Add test.
2012-10-29 14:01:20 +01:00
Nicolas Goaziou a8c026cb26 org-export: Explicit error when using invalid syntax for INCLUDE keywords
* contrib/lisp/org-export.el (org-export-expand-include-keyword):
  Error out when file isn't specified within double quotes.
* testing/lisp/test-org-export.el: Add test.
2012-10-29 11:31:19 +01:00
Nicolas Goaziou 90fcb4b841 org-export: Add filter set for diary sexp elements
* contrib/lisp/org-export.el (org-export-filters-alist): Add filter
  set for diary sexp elements.
(org-export-filter-comment-block-functions): Fix docstring.
(org-export-filter-diary-sexp-functions): New variable.
2012-10-28 23:00:04 +01:00
Nicolas Goaziou ccc98ebc2d org-export: Fix expansion of babel calls in included files
* contrib/lisp/org-export.el (org-export-as):
  `org-current-export-file' should refer to current, temporary, buffer
  containing included contents, not to original buffer with include
  keywords.
(org-export-with-current-buffer-copy): Buffer copy must contain the
whole buffer, possibly narrowed to a proper part, not only the
narrowed part.
* testing/lisp/test-org-export.el: Tweak tests.
2012-10-28 16:21:30 +01:00
Nicolas Goaziou b2047a2565 org-export: Implement a generic smart quote module
* contrib/lisp/org-export.el (org-export-options-alist): Add an option
  item to toggle smart quotes during export.
(org-export-with-smart-quotes, org-export-smart-quotes-alist,
org-export-smart-quotes-regexps): New variables.
(org-export-activate-smart-quotes): New function.
(org-export-data): Remove residual text properties.
* testing/lisp/test-org-export.el: Add tests.
2012-10-27 11:42:31 +02:00
Nicolas Goaziou 00eaa4dc97 org-export: Fix error when exporting buffers not visiting a file
* contrib/lisp/org-export.el (org-export-output-file-name): Do not
  return an error when exported buffer isn't visiting a file.
2012-10-27 00:02:52 +02:00