Commit Graph

422 Commits

Author SHA1 Message Date
Aaron Ecay cce317faf6 Fix bug in 95e2777 2015-11-06 19:11:07 +00:00
Aaron Ecay 95e2777663 ox.el: Add :safe declarations to defcustoms
* lisp/ox.el: Add :safe declarations to defcustoms.
2015-11-06 17:49:57 +00:00
Aaron Ecay e4cd3dd22b Remove some home-grown copies of cl-lib functions.
* lisp/org.el (org-count, org-remove-if, org-remove-if-not):
(org-reduce, org-every, org-some): Obsolete, use cl-lib versions
everywhere.
(org-sublist): Reimplement in terms of `cl-subseq'; make obsolete.
2015-11-06 12:50:40 +00:00
Aaron Ecay 07e16c2fc5 Use setq-local and defvar-local.
* lisp/org-macs.el (org-set-local): Remove.  All callers changed.
* lisp/org-clock.el:
* lisp/org-colview.el:
* lisp/org-macro.el:
* lisp/org-mouse.el:
* lisp/org-table.el:
* lisp/org.el: Use defvar-local.
* lisp/org-agenda.el:
* lisp/org-capture.el:
* lisp/org-crypt.el:
* lisp/org-ctags.el:
* lisp/org-plot.el:
* lisp/org.el:
* lisp/ox-odt.el:
* lisp/ox.el: Use setq-local instead of set + make-local-variable.

Changes in contrib:

* contrib/lisp/org-colview-xemacs.el (org-colview-xemacs-set-local): New
macro. Adjust old callers of `org-set-local'.
2015-11-05 16:47:38 +00:00
Nicolas Goaziou 3b8ebff351 ox: Fix failing tests
* lisp/ox.el (org-export-as): Add missing arguments to
  `org-export--get-export-attributes'.
2015-11-05 12:07:48 +01:00
Nicolas Goaziou 47573133a6 ox: Small refactoring
* lisp/ox.el (org-export--get-min-level):
(org-export-install-filters):
(org-export--generate-copy-script):
(org-export-table-has-special-column-p):
(org-export-table-row-is-special-p):
(org-export-table-cell-borders):
(org-export--dispatch-action): Use dolist instead of `mapc' + `lambda'.
2015-11-05 11:05:29 +01:00
Nicolas Goaziou 8048973bae ox: Rename `org-export-collect-tree-properties'
* lisp/ox.el (org-export-collect-tree-properties): Remove function.
(org-export--collect-tree-properties): New function.
  Renamed from `org-export-collect-tree-properties'
(org-export-as): Apply renaming.
* testing/lisp/test-ox.el (org-test-with-parsed-data): Apply renaming.
2015-11-05 10:56:59 +01:00
Nicolas Goaziou b414b85a7c ox: Factorize export properties
* lisp/ox.el (org-export-get-environment): Do not handle :back-end
  and :translate-alist.
(org-export--collect-tree-properties): Do not handle :exported-data.
(org-export--get-export-attributes): New function.
(org-export-as): Use new function.

* testing/lisp/test-ox.el (org-test-with-parsed-data): Use new function.
2015-11-05 10:56:42 +01:00
Nicolas Goaziou f329279757 ox: Check id links in export scope only
* lisp/ox.el (org-export-get-environment): Do not fill :id-alist yet.
(org-export-collect-tree-properties): Complete it here instead.

Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/102540>
2015-11-05 09:20:05 +01:00
Nicolas Goaziou 6e6b19bc96 org-compat: Implement `org-define-error'
* lisp/org-compat.el (org-define-error): New function.
* lisp/ox.el (org-link-broken): Use new function.
2015-10-31 22:26:13 +01:00
Nicolas Goaziou a709aed145 ox: Tiny refactoring 2015-10-18 23:06:08 +02:00
Nicolas Goaziou c2eeaca0ca ox: Preserve compatibility for Emacs 24.3 2015-10-18 11:02:51 +02:00
Nicolas Goaziou 59761024b1 ox: Add an option to ignore broken links
* lisp/ox.el (org-export-with-broken-links): New variable.
(org-export-options-alist): Add new OPTIONS item.
(org-link-broken): New error type.
(org-export-resolve-coderef):
(org-export-resolve-fuzzy-link):
(org-export-resolve-id-link): Raise appropriate error symbol when a link
cannot be resolved.
(org-export-data): Handle new error type.

* doc/org.texi (Export settings): Document new feature.

* testing/lisp/test-ox.el (test-org-export/resolve-id-link):
(test-org-export/resolve-fuzzy-link):
(test-org-export/resolve-coderef): Update tests.
2015-10-17 14:42:07 +02:00
Nicolas Goaziou 348890f79b org-element: Remove now useless function
* lisp/org-element.el (org-element-remove-indentation): Mark as
  an obsolete replacement for `org-remove-indentation'.
(org-element-example-block-parser):
(org-element-example-block-interpreter):
(org-element-src-block-parser):
* lisp/ox.el (org-export-unravel-code): Apply obsolescence.
2015-10-08 16:25:29 +02:00
Nicolas Goaziou c2a0bfe580 Merge branch 'maint' 2015-10-03 09:22:41 +02:00
Nicolas Goaziou ee3d9363c5 ox: Change misleading keys in `org-export-smart-quotes-alist'
* lisp/ox.el (org-export-smart-quotes-alist):
(org-export--smart-quote-status): Change misleading quote names.

Due to the new smart quotes algorithm, "..." are always primary quotes,
even though they may be translated as single quotes.  Conversely, '...'
are secondary quotes and may not be translated to single quotes.
2015-10-03 09:19:21 +02:00
Nicolas Goaziou 6f2579b4fc Merge branch 'maint' 2015-09-26 00:14:36 +02:00
Nicolas Goaziou fd8a18151a Fix file uri
* lisp/ox.el (org-export-file-uri): Properly expand file uri.

* lisp/org-element.el (org-element-link-parser): Start path with "//"
  when referring to a remote file.

* testing/lisp/test-ox.el (test-org-export/file-uri): Add test.

Reported-by: AW <alexander.willand@t-online.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/101471>
2015-09-26 00:11:42 +02:00
Nicolas Goaziou d4aa7692bd Merge branch 'maint' 2015-09-24 10:19:38 +02:00
Richard Hansen 11bba63dc3 fix SETUPFILE pathname expansion with subdirectories
* lisp/org-macro.el (org-macro--collect-macros): cd to the directory
containing the SETUPFILE before recursing so that relative pathnames
in the SETUPFILE are expanded properly.

* lisp/org.el (org--setup-collect-keywords): cd to the directory
containing the SETUPFILE before recursing so that relative pathnames
in the SETUPFILE are expanded properly.

* lisp/ox.el (org-export--get-inbuffer-options,
org-export--list-bound-variables): cd to the directory containing the
SETUPFILE before recursing so that relative pathnames in the SETUPFILE
are expanded properly.

If /path/to/foo.org contains:

    #+SETUPFILE: settings/beamer.org

and /path/to/settings/beamer.org contains:

    #+SETUPFILE: common.org

then we want to read /path/to/settings/common.org, not
/path/to/common.org.

TINYCHANGE
2015-09-24 10:16:04 +02:00
Kyle Meyer 5362f63fad Merge branch 'maint' 2015-09-21 18:46:41 -04:00
Kyle Meyer fbf4fa8cc7 Partially revert backport of commit 284c470
Revert cases in the last backport that converted "\[" in strings to "[",
which results in an error when eval-defun is called on them.
2015-09-21 18:38:39 -04:00
Paul Eggert c86a10b0bc Backport commit 284c470 from Emacs master branch
Backslash cleanup in Elisp source files
284c470ef752967fcd8bae6a450dc138462b1e49
Paul Eggert
Thu Sep 17 16:09:39 2015 -0700
2015-09-21 18:38:39 -04:00
Kyle Meyer 0839dc4322 Protect remaining apostrophes in docstrings
Protect apostrophes not covered by the last backport.  Convert
expressions like '(...)  to \\='(...)  and symbols written as 'name to
`name'.  (In addition to ensuring the correct display, the latter also
improves consistency with many Org docstrings.)

If these aren't protected, Emacs 25 may display them as curved quotes in
the help buffer, depending on the value of text-quoting-style.
2015-09-21 18:38:39 -04:00
Kyle Meyer 077810e521 Modify quote-related backport
These changes are in line with the changes proposed on the mailing list,
but many of those changes weren't necessary because they had already
been reverted in the Emacs repo.

<http://permalink.gmane.org/gmane.emacs.orgmode/100896/>
2015-09-21 18:38:39 -04:00
Kyle Meyer d77a52a502 Backport quote-related commits from Emacs
These changes are the combination of the commits below (in order
applied).  Unlike other backports, these are applied in one commit
because they are closely related and because some of the later commits
reverse changes in earlier commits.  Changes to message and help quote
display for Emacs 25 seem to be here to stay.  The quote protections are
required to ensure grave accents and apostrophes are displayed as
intended in Emacs 25, and they should not affect earlier versions.

  Quoting fixes in lisp/org
  6cd2629bd1b3ce77d29ac28e29237c94a4197116
  Paul Eggert
  Mon Aug 31 00:29:40 2015 -0700

  More-conservative ‘format’ quote restyling
  fbb5531fa11d13854b274d28ccd329c9b6652cfc
  Paul Eggert
  Sun Aug 23 22:39:06 2015 -0700

  Prefer directed to neutral quotes
  875a5d0ead827d3da32ecbd30e739a29f07bbc87
  Paul Eggert
  Mon Aug 24 23:57:25 2015 -0700

  Escape ` and ' in doc
  19532d147b431a4fe34f088d6de07891c48e2c5c
  Paul Eggert
  Tue Sep 1 18:23:21 2015 -0700

  Fix some more docstring etc. quoting problems
  26bd978d87dfbf9baa115cd961a67d42b416c4bf
  Paul Eggert
  Thu Sep 3 15:32:54 2015 -0700

  Go back to grave quoting in source-code docstrings etc.
  6afef3f6ca2f3009c722b84e249903b7f807b044
  Paul Eggert
  Mon Sep 7 16:09:27 2015 -0700
2015-09-21 18:38:18 -04:00
Nicolas Goaziou 66a2119ae6 Merge branch 'maint' 2015-09-10 09:37:39 +02:00
Nicolas Goaziou f051d663ab ox: Ignore statistics cookies with stat:nil
* lisp/ox.el (org-export--prune-tree): Fix bug preventing pruning within
  secondary strings.

* testing/lisp/test-ox.el (test-org-export/handle-options): Update test.

Reported-by: Thomas S. Dye <tsd@tsdye.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/100999>
2015-09-10 09:32:58 +02:00
Nicolas Goaziou a34a334582 Merge branch 'maint' 2015-09-09 22:51:31 +02:00
Nicolas Goaziou c708fc0bb8 ox: Fix OPTION keyword parsing
* lisp/ox.el (org-export--parse-option-keyword): Handle multiple
  properties referring to the same option item.

* testing/lisp/test-ox.el (test-org-export/parse-option-keyword): Add
  test.
2015-09-09 22:50:08 +02:00
Nicolas Goaziou 88f755ca64 Merge branch 'maint' 2015-09-09 14:31:46 +02:00
Nicolas Goaziou 89483bc873 ox: Fix a docstring
* lisp/ox.el (org-export-resolve-fuzzy-link): Return value cannot be
  nil.
2015-09-09 14:30:25 +02:00
Nicolas Goaziou 40cc8623f1 Merge branch 'maint' 2015-09-07 19:13:05 +02:00
Nicolas Goaziou a6514e995b ox: Do not check footnote validity when including files
* lisp/ox.el (org-export--update-footnote-label): Remove function.
(org-export--prepare-file-contents): Do not error when a footnote
definition cannot be found.

In particular, it should not throw an error when a footnote is not
defined outside of export scope.

Reported-by: Leonard Randall <leonard.a.randall@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/100924>
2015-09-07 19:09:17 +02:00
Nicolas Goaziou 4ca3d3bbe2 Merge branch 'maint' 2015-09-06 22:17:30 +02:00
Nicolas Goaziou 366dc4e369 ox: Change internal tag for included footnotes
* lisp/ox.el (org-export--update-footnote-label):
(org-export--prepare-file-contents): Use a new naming scheme for
internal footnotes, less likely to introduce collisions.

The previous one introduced a collision between [1] and [fn:1].
2015-09-06 22:14:47 +02:00
Nicolas Goaziou a7394224aa ox: Fix footnotes in included files
* lisp/ox.el (org-export--prepare-file-contents): Do not error when
  including multiple footnotes with the same label.

* testing/lisp/test-ox.el (test-org-export/expand-include): Update test.

Reported-by: Leonard Randall <leonard.a.randall@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/100906>
2015-09-06 21:54:57 +02:00
Nicolas Goaziou a6165748cf Merge branch 'maint' 2015-09-02 21:05:46 +02:00
Nicolas Goaziou d66d6f55e0 ox: Fix smart inner quotes
* lisp/ox.el (org-export--smart-quote-status): Fix inner smart quotes.
* testing/lisp/test-ox.el (test-org-export/activate-smart-quotes): Add
  tests.

Reported-by: "T.F. Torrey" <tftorrey@tftorrey.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/100779>
2015-09-02 21:02:41 +02:00
Nicolas Goaziou bed2caf56f Merge branch 'maint' 2015-08-25 14:46:38 +02:00
Nicolas Goaziou 48f009bc9f ox: Fix uninterpreted data in captions
* lisp/ox.el (org-export--remove-uninterpreted-data-1): Handle
  uninterpreted data in captions.

* testing/lisp/test-ox.el (test-org-export/uninterpreted): Add tests.

Reported-by: Johannes Rainer <johannes.rainer@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/100476>
2015-08-25 14:44:20 +02:00
Nicolas Goaziou cf6d936701 Merge branch 'maint' 2015-08-23 23:51:07 +02:00
Nicolas Goaziou cd1d623b85 ox: Fix inheritance for EXPORT_... properties
* lisp/ox.el (org-export--get-subtree-options):
(org-export-output-file-name): Let user control inheritance for these
properties instead of hard-coding (an inconsistent) behavior.

Reported-by: Eric Abrahamsen <eric@ericabrahamsen.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/100373>
2015-08-23 23:50:49 +02:00
Nicolas Goaziou 80a6262ca1 Silence byte-compiler
* lisp/ox.el (org-export-backend):
(org-export-define-backend):
(org-export-define-derived-backend):
(org-export--get-subtree-options):
(org-export--get-inbuffer-options):
(org-export--collect-headline-numbering):
(org-export--selected-trees):
(org-export--skip-p):
(org-export--delete-comments):
(org-export--remove-uninterpreted-data-1):
(org-export--merge-external-footnote-definitions):
(org-export-insert-default-template):
(org-export-expand-include-keyword):
(org-export--inclusion-absolute-lines):
(org-export-collect-footnote-definitions):
(org-export-get-footnote-number):
(org-export-get-reference):
(org-export-get-ordinal):
(org-export-unravel-code):
(org-export-format-code):
(org-export-format-code-default):
(org-export-table-has-header-p):
(org-export-table-row-group):
(org-export-table-cell-alignment):
(org-export-table-row-number):
(org-export-table-dimensions):
(org-export-table-cell-address):
(org-export-get-table-cell-at):
(org-export--smart-quote-status):
(org-export-get-previous-element):
(org-export-get-next-element):
(org-export-dispatch):
(org-export--dispatch-ui):
(org-export--dispatch-action): Silence byte-compiler.
2015-08-15 00:33:11 +02:00
Nicolas Goaziou d47f03ca24 ox: Activate lexical binding
* lisp/ox.el (org-export-define-backend):
(org-export-define-derived-backend): Remove unused argument.

(org-export--get-inbuffer-options):
(org-export--list-bound-variables):
(org-export--selected-trees):
(org-export-transcoder):
(org-export--prune-tree):
(org-export--merge-external-footnote-definitions):
(org-export--footnote-reference-map):
(org-export-get-alt-title):
(org-export-get-node-property):
(org-export-table-row-is-special-p):
(org-export-table-dimensions):
(org-export-stack-refresh): Refactor code.

* testing/lisp/test-ox.el (org-test-default-backend):
(test-org-export/with-backend):
(test-org-export/footnote-first-reference-p): Comply to lexical binding.
2015-08-15 00:11:20 +02:00
Paul Eggert ecf3a4af2c Backport remaining changes from commit 7e09ef0
Add changes from Emacs repo that should have been backported with
bb77dd2.

Update copyright year to 2015
7e09ef09a479731d01b1ca46e94ddadd73ac98e3
Paul Eggert
Thu Jan 1 14:26:41 2015 -0800
2015-08-10 02:17:19 -04:00
Bastien 0d0d0ad56e Merge branch 'backport-master'
Conflicts:
	lisp/org-table.el
2015-08-05 01:01:46 +02:00
Nicolas Goaziou cfe5bc97f8 Fix link search
* lisp/org.el (org-open-link-marker): Remove variable.
(org-open-at-point): Apply removal.
(org-link-search): Sanitize function.  Fix issue with internal link
encoding.
(org-search-not-self): Remove function.

* lisp/ox.el (org-export--inclusion-absolute-lines): Ensure INCLUDE
  keywords with locations can find named elements and targets.

* testing/lisp/test-org.el (test-org/return):
(test-org/coderef):
(test-org/custom-id): Update tests.
(test-org/fuzzy-links): Add tests.

Reported-by: Ivanov Dmitry <usr345@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/99340>
2015-08-03 01:06:32 +02:00
Kyle Meyer 6f9184a294 Merge branch 'maint' into backport-master 2015-07-26 23:56:50 -04:00
Paul Eggert 72416b82ac Backport commit 7aa506e from Emacs master branch
Spelling fixes
7aa506eed8881788485a9774165454404bac2623
Paul Eggert
Thu Dec 25 18:08:47 2014 -0800
2015-07-26 23:28:25 -04:00
Ruben Maher eccd704aea ox.el: Remove docstring for nonexistent argument
* lisp/ox.el (org-export-output-file-name): Remove docstring for
  nonexistent argument VISIBLE-ONLY.
2015-07-25 14:17:49 +02:00
Nicolas Goaziou a833d35159 ox: Properly fix internal regexps after each buffer change
* lisp/ox.el (org-export-as): Refresh regexps before executing Babel
  code, running last hook and parsing buffer so precomputed regular
  expressions are correct at each of these steps.

This is not necessary before macros since those are not expected to
rely on computed expression.  Actually, advanced macros, i.e. with
"(eval ...)" syntax, could make use of them, but a Babel snippet is
more likely in this situation.

Reported-by: Robert Klein <RoKlein@roklein.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/98550>
2015-06-25 15:09:20 +02:00
Nicolas Goaziou b07bd32081 ox: Handle subtree properties referring to multiple options
* lisp/ox.el (org-export--get-subtree-options): When multiple options
  refer to the same keyword, and, as a consequence, to the same export
  property, make sure all of them get updated.
* testing/lisp/test-ox.el (test-org-export/get-subtree-options): Add
  test.

Reported-by: Myles English <mylesenglish@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/98583>
2015-06-23 22:09:43 +02:00
Nicolas Goaziou 47265b31ca ox: Add external footnotes definitions in parse tree
* lisp/ox.el (org-export-get-environment):
(org-export-collect-tree-properties):
Remove :footnote-definition-alist property.
(org-export-get-footnote-definition): Apply removal of property.

(org-export--merge-external-footnote-definitions): New function.
(org-export-as): Use new function.

* testing/lisp/test-ox.el (test-org-export/footnotes): Update tests.

This change allows to have all footnote definitions within the parse
tree, so they can be reached with, e.g., a parse tree filter.
2015-06-23 15:28:01 +02:00
Nicolas Goaziou e6f36cfe3a ox: Tiny refactoring
* lisp/ox.el (org-export-replace-region-by): Refactor.
2015-06-18 15:21:02 +02:00
Nicolas Goaziou d1f9aa3a02 ox: Simplify fuzzy link matching
* lisp/ox.el (org-export-resolve-fuzzy-link): When a fuzzy link
  matches more than one headline, prefer the first one in the parse
  tree.

* testing/lisp/test-ox.el (test-org-export/fuzzy-link): Remove a test.

This behaviour is consistent with `org-open-at-point'.  Also, it
allows to cache destinations.
2015-06-16 23:24:42 +02:00
Nicolas Goaziou 2c27e85f11 Sanitize link encoding
* lisp/org.el (org-store-link): Improve docstring.
(org-make-link-string): Escape internal links only when absolutely
necessary.
(org-link-escape-chars): Add percent character.
(org-link-escape-chars-browser): Make space character more visible.
(org-link-escape): Refactor code.
(org-display-inline-images): Properly unescape path before creating
the link.
(org-extract-attributes): Remove function.

* lisp/ox.el (org-export-resolve-fuzzy-link): Decode path before
  resolving link.

* testing/lisp/test-ox.el (test-org-export/resolve-fuzzy-link): Add
  test.
2015-06-16 23:24:38 +02:00
Nicolas Goaziou 4049c680fb ox-texinfo: Handle listings with captions and list of listings
* lisp/ox-texinfo.el (org-texinfo-keyword): Handle "#+TOC: listings".
(org-texinfo-src-block): Wrap listings with captions within @float.
2015-05-26 10:03:59 +02:00
Nicolas Goaziou d0fab8bb6f ox: Tiny refactoring
* lisp/ox.el (org-export-resolve-fuzzy-link): Use `string-to-char'
  instead of (aref STRING 0).
2015-05-11 01:33:24 +02:00
Nicolas Goaziou f653495419 ox: Tiny refactoring
* lisp/ox.el (org-export-expand-include-keyword):
(org-export--prepare-file-contents):
(org-export-with-backend): Wrap line of code within 80 columns.
(org-export--inclusion-absolute-lines): Remove unecessary `format'
call for error message.
2015-05-11 01:30:45 +02:00
Nicolas Goaziou 2965f8fb0c ox: Refresh buffer properties after including files
* lisp/ox.el (org-export-as): Call `org-set-regexps-and-options'.

Suggested-by: Detlef Steuer <detlef.steuer@gmx.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/97244>
2015-04-27 20:40:28 +02:00
Nicolas Goaziou 79db2d5dbb ox: Tiny fix to code comments
* lisp/ox.el (org-export--get-subtree-options): Tiny fix.
2015-04-22 14:05:51 +02:00
Nicolas Goaziou c88256c776 ox: Fix OPTIONS line parsing
* lisp/ox.el (org-export--parse-option-keyword): Fix parsing of items.
* testing/lisp/test-ox.el (test-org-export/parse-option-keyword): Add
  test.
2015-04-22 14:05:37 +02:00
Nicolas Goaziou e040ad58a1 Rename `org-export--registered-backends'
* lisp/ox.el (org-export-registered-backends): Renamed from
  `org-export--registered-backends'.
(org-export-get-backend):
(org-export-register-backend):
(org-export-insert-default-template):
(org-export--dispatch-ui):

* lisp/org.el (org-export-registered-backends):
(org-export-backends):
(org-get-export-keywords):

* lisp/org-pcomplete.el (pcomplete/org-mode/file-option/options):

* testing/lisp/test-ox.el (test-org-export/define-backend):
(test-org-export/define-derived-backend):
(test-org-export/derived-backend-p):
(test-org-export/get-all-transcoders):
(test-org-export/get-all-options):
(test-org-export/get-all-filters):
(test-org-export/with-backend): Apply renaming.

Since the variable is copiously used outside of "ox.el", there's no
reason to mark it as internal.
2015-04-22 10:27:24 +02:00
Nicolas Goaziou f85a961c23 ox: Implement `org-export-file-uri'
* lisp/ox.el (org-export-file-uri): New function.
* testing/lisp/test-ox.el (test-org-export/file-uri): New test.
2015-04-20 12:36:47 +02:00
Rasmus 4ee8f4f286 Revert "ox: Change label naming scheme"
This reverts commit cf7d64f1e4.
2015-04-19 16:00:06 +02:00
Rasmus cf7d64f1e4 ox: Change label naming scheme
* ox.el (org-export-get-reference): Change labeling scheme.

160820bc94 and later changed the label naming scheme to follow types.
This commit maps to types to more standard names, e.g. 'headline' to
'sec'.
2015-04-16 12:08:34 +02:00
Nicolas Goaziou 68eb1d0ab0 ox: Remove `org-export-solidify-link-text'
* lisp/ox.el (org-export-solidify-link-text): Remove function.

* etc/ORG-NEWS: Signal removal.
2015-04-13 15:21:22 +02:00
Nicolas Goaziou 186bae42a4 ox: Remove `org-export-get-headline-id'
* lisp/ox.el (org-export-get-headline-id):
(org-export--collect-unnumbered-headline-id): Remove function.
(org-export-collect-tree-properties): Apply removal.

* testing/lisp/test-ox.el (test-org-export/org-export-get-headline-id):
  Remove test.
(test-org-export/numbered-headline-p): Update test.

`org-export-get-reference' supersedes it.
2015-04-13 15:21:22 +02:00
Nicolas Goaziou 160820bc94 ox: Implement `org-export-get-reference'
* lisp/ox.el (org-export-get-reference): New function.

* etc/ORG-NEWS: Signal new function.
2015-04-13 15:21:22 +02:00
Vicente Vera Parra d6bd969ab2 ox: Fix Spanish translations
* lisp/ox.el (org-export-dictionary): Fix Spanish translations,
  including :ascii and :html properties. Also add :default Spanish
  property for "References".

TINYCHANGE
2015-04-09 20:06:36 +02:00
Nicolas Goaziou 105ec604c2 ox: Allow multi-line objects in `parse' options
* lisp/ox.el (org-export--get-inbuffer-options): Allow multi-line objects.
* testing/lisp/test-ox.el (test-org-export/get-inbuffer-options): Add
  tests.  Update some others.

It is possible to write, e.g.,

  #+TITLE: *bold
  #+TITLE: sentence*
2015-04-09 14:11:25 +02:00
Nicolas Goaziou fa64b59b05 org-macro: Allow macros in parsed keywords and associated properties
* lisp/org-macro.el (org-macro-replace-all): Add optional argument.
  Now accept macros in parsed keywords and associated properties.

* lisp/ox.el (org-export-as): Apply signature change.

* testing/lisp/test-ox.el (test-org-export/expand-macro): Add test.
2015-04-05 13:48:28 +02:00
Nicolas Goaziou ae9db17482 ox: Implement `parse' behavior for options
* lisp/ox.el (org-export-options-alist): Implement `parse' behavior
  and use it for parsed keywords.  Update docstring.
(org-export-document-properties): Remove variable.

(org-export--get-subtree-options):
(org-export--get-inbuffer-options):
(org-export--get-global-options):
(org-export--prune-tree):
(org-export--remove-uninterpreted-data): Handle `parse' behavior.

(org-export-as): Do not assume :date is always a secondary string
and :email is never one.

* testing/lisp/test-ox.el (test-org-export/get-inbuffer-options):
  Update tests.
2015-04-05 12:21:25 +02:00
Rasmus 79c0aa21ca ox: Remove #+KEYWORD and #+DESCRIPTION
* ox.el: Remove #+KEYWORD: and #+DESCRIPTION:.
* ox-deck.el, ox-rss.el, ox-html, ox-latex, ox-odt, ox-org: Add
  #+KEYWORD and #+DESCRIPTION.
* org.texi (Export settings): Explicit state which backends
  support #+DESCRIPTION and #+KEYWORDS.
2015-03-29 14:08:13 +02:00
Nicolas Goaziou a8f8ea8b69 ox: New smart quote algorithm
* lisp/ox.el (org-export-smart-quotes-alist): Fix indentation.
(org-export-smart-quotes-regexps): Remove variable.
(org-export--smart-quote-status): New function.
(org-export-activate-smart-quotes): Use new function.

* testing/lisp/test-ox.el (test-org-export/activate-smart-quotes):
  Update tests.
2015-03-28 15:41:46 +01:00
Nicolas Goaziou 3ece4c5e5e ox: Tiny fix
* lisp/ox.el (org-export--get-inbuffer-options): Do not consider
  `quote' value as t.
2015-03-28 10:56:16 +01:00
Nicolas Goaziou 0ac26737f0 ox: Remove filter associated to comments
* lisp/ox.el (org-export-filters-alist): Remove reference to comment
  filters.
(org-export-filter-comment-functions,
org-export-filter-comment-block-functions): Remove variables.

* doc/org.texi (Advanced configuration): Remove reference to comment
  filters.

* etc/ORG-NEWS: Signal removal.

Comments are removed before parsing the buffer.  As a consequence,
filters are never called.
2015-03-28 10:45:36 +01:00
Nicolas Goaziou 69dd4301ab ox: Remove comments and comment blocks prior to export
* lisp/ox.el (org-export--delete-comments): Renamed from
  `org-export--delete-commented-subtrees'.  Also remove comments and
  comment blocks.
(org-export-as): Apply renaming.

* testing/lisp/test-ox.el (org-test-with-parsed-data): Apply renaming.

From the export point of view COMMENTed subtrees and regular comments
are expected to be treated in the same way.
2015-03-28 10:27:04 +01:00
Nicolas Goaziou e8b2a120c2 ox: Fix `org-export--delete-commented-subtrees'
* lisp/ox.el (org-export--delete-commented-subtrees): Match COMMENT
  subtree even with a priority cookie or a TODO keyword.
2015-03-28 09:59:08 +01:00
Nicolas Goaziou fa0cc0ab70 Revert "Fix c9a52787c14c3a7429bcd3c8975350525e0baa04"
This reverts commit 359572d37e.

COMMENT headlines are expected to be ignored completely during export.
2015-03-28 09:54:37 +01:00
Nicolas Goaziou 359572d37e Fix c9a52787c1
* lisp/org-macro.el (org-macro--collect-macros): Ignore macro
  definitions in commented subtrees.
* lisp/ox.el (org-export--get-inbuffer-options): Ignore options in
  commented subtrees.
(org-export--delete-commented-subtrees): Remove function.
(org-export-as): Apply removal.

Removing the whole subtree is not subtle as Babel might want to use
data there.

Reported-by: Robert Klein <RoKlein@roklein.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/96347>
2015-03-24 09:35:39 +01:00
Nicolas Goaziou c9a52787c1 ox: Ignore export settings in commented subtrees
* lisp/ox.el (org-export--delete-commented-subtrees): New function.
(org-export-as): Use new function.

* testing/lisp/test-ox.el (org-test-with-parsed-data,
  test-org-export/get-inbuffer-options): Use new function.
(test-org-export/expand-macro): Add tests.

Reported-by: Andreas Leha <andreas.leha@med.uni-goettingen.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/96267>
2015-03-24 00:32:15 +01:00
Nicolas Goaziou f7b27896e9 ox: Rename some internal functions
* lisp/ox.el (org-export--prune-tree): Renamed from
  `org-export-prune-tree'.  Move it close to its caller.
(org-export--remove-uninterpreted-data): Renamed from
`org-export-remove-uninterpreted-data'.  Move it close to its caller.
(org-export--remove-uninterpreted-data-1): Move internal function
close to its caller.
(org-export-as): Apply renaming.

* testing/lisp/test-ox.el (org-test-with-parsed-data): Apply renaming.
2015-03-24 00:09:46 +01:00
Nicolas Goaziou e0b19dedb9 ox: Throw an error on unresolved id links
* lisp/ox.el (org-export-get-environment): Properly find file
  associated to id link.
(org-export-resolve-id-link): Throw an error on unresolved id links.

Use `org-id-find' instead of `org-id-find-id-file' as the latter may
returns the file attached to current buffer on search failure.

Reported-by: Jacob Gerlach <jacobgerlach@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/96020>
2015-03-17 23:31:49 +01:00
Jacob Gerlach dc08e98885 ox.el: Issue error for unresolved fuzzy link
* lisp/ox.el (org-export-resolve-fuzzy-link): Throw an error instead
  of returning nil when link can't be resolved.

* testing/lisp/test-ox.el (test-org-export/resolve-fuzzy-link): Change
  last test from should-not to should-error

In addition to throwing an error, don't store the failed match in the
link cache.

TINYCHANGE
2015-03-17 22:46:05 +01:00
Nicolas Goaziou a886b23476 ox: Throw an error on unresolved coderef
* lisp/ox.el (org-export-resolve-coderef): Throw an error on
  unresolved coderef.

* testing/lisp/test-ox.el (test-org-export/resolve-coderef): Update
  test.
2015-03-17 22:42:45 +01:00
Nicolas Goaziou 22ff8381ed ox: Fix defcustom
* lisp/ox.el (org-export-with-title): Fix :package-information value.
2015-03-17 15:51:30 +01:00
Nicolas Goaziou 16cea3d7b7 ox: Remove `comment' special value for `org-export-with-creator'
* lisp/ox.el (org-export-with-creator): Change default value.

* lisp/ox-ascii.el (org-ascii-template):
* lisp/ox-beamer.el (org-beamer-template):
* lisp/ox-latex.el (org-latex-template):
* lisp/ox-odt.el (org-odt-template):
* lisp/ox-org.el (org-org-template):
* lisp/ox-texinfo.el (org-texinfo-template): Treat
  `org-export-with-creator' as a boolean.

* testing/lisp/test-ox.el (test-org-export/parse-option-keyword):
  Update test.

* doc/org.texi (Export settings): Update allowed values in
  `org-export-with-creator'.

* etc/ORG-NEWS: Signal change.

Special `comment' value isn't meaningful for all back-ends and is not
implemented in every back-end where it makes sense anyway.

It is possible to add a comment including creator at the end of the
document using a body filter instead.
2015-03-17 15:51:22 +01:00
Nicolas Goaziou 1c5db20860 ox: Small refactoring
* lisp/ox.el (org-export-collect-footnote-definitions): Small
  refactoring.
2015-02-27 12:06:37 +01:00
Nicolas Goaziou 5738086a6b ox: Small refactoring
* lisp/ox.el (org-export-prune-tree): Small refactoring.
2015-02-27 11:53:24 +01:00
Nicolas Goaziou c76f254e8b ox: Fix custom link handling in anonymous back-end
* lisp/ox.el (org-export-custom-protocol-maybe): Change signature.
* contrib/lisp/ox-groff.el (org-groff-link):
* lisp/ox-ascii.el (org-ascii-link):
* lisp/ox-beamer.el (org-beamer-link):
* lisp/ox-html.el (org-html-link):
* lisp/ox-latex.el (org-latex-link):
* lisp/ox-man.el (org-man-link):
* lisp/ox-md.el (org-md-link):
* lisp/ox-odt.el (org-odt-link):
* lisp/ox-org.el (org-org-link):
* lisp/ox-texinfo.el (org-texinfo-link): Apply signature change.

* testing/lisp/test-ox.el (test-org-export/custom-protocol-maybe):
  Update test.

Provide explicitly back-end used instead of guessing it from INFO
channel as an anonymous back-end could be used, masquerading the real
one.

Reported-by: Christian Moe <mail@christianmoe.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/95402>
2015-02-24 15:54:01 +01:00
Nicolas Goaziou fa145361ec ox: Allow to narrow scope in footnotes API
* lisp/ox.el (org-export--footnote-reference-map,
  org-export-collect-footnote-definitions,
  org-export-footnote-first-reference-p,
  org-export-get-footnote-number): Allow to specify scope, through
  a new optional argument.

* lisp/ox-odt.el (org-odt-footnote-reference): Apply API change.

* testing/lisp/test-ox.el (test-org-export/footnote-first-reference-p,
  test-org-export/get-footnote-number,
  test-org-export/collect-footnote-definitions): Update tests.
2015-02-21 11:29:40 +01:00
Nicolas Goaziou 719dda85ea ox: Small refactoring
* lisp/ox.el (org-export-document-properties): New variable.
(org-export-prune-tree, org-export-remove-uninterpreted-data): Use new variable.
2015-02-20 18:50:27 +01:00
Nicolas Goaziou 014de0a532 ox: Change `org-export-collect-footnote-definitions' signature
* lisp/ox.el (org-export-collect-footnote-definitions): Refactor
  code.  Change signature.

* testing/lisp/test-ox.el (test-org-export/collect-footnote-definitions):
  New test.
(test-org-export/footnotes): Update test.

* lisp/ox-ascii.el (org-ascii-inner-template):
* lisp/ox-html.el (org-html-footnote-section): Apply signature change.

* etc/ORG-NEWS: Document signature change.

This change makes `org-export-collect-footnote-definitions' compatible
with `org-export-get-footnote-number' and
`org-export-footnote-first-reference-p'.
2015-02-20 18:06:23 +01:00
Nicolas Goaziou ccb663c742 ox: Add optional order argument to some footnotes related functions
* lisp/ox.el (org-export--footnote-reference-map): New function.
(org-export-footnote-first-reference-p,
org-export-get-footnote-number): Allow to change order when footnotes
references are contained within footnote definitions.

* testing/lisp/test-ox.el (test-org-export/footnote-first-reference-p):
(test-org-export/get-footnote-number):  New tests.
(test-org-export/footnotes): Update test.
2015-02-13 14:10:51 +01:00
Rasmus e6fcc853c5 ox: Optional export of title
* ox.el (org-export-with-title): New variable.
* ox (org-export-options-alist),
  ox-ascii.el (org-ascii-template--document-title),
  ox-beamer.el (org-beamer-template), ox-html.el (org-html-template),
  ox-latex.el (org-latex-template), ox-man.el (org-man-template),
  ox-odt.el (org-odt-template), ox-org.el (org-org-template),
  ox-publish.el (org-publish-project-alist),
  ox-texinfo.el (org-texinfo-template),
  ox-groff.el (org-groff--mt-head): Use new variable.
* ox-koma-letter.el (org-koma-letter-use-title): Mark obsolete.
* test-ox.el (test-org-export/parse-option-keyword): Add :with-title.
* ORG-NEWS, org.texi: Mention org-export-with-title.

This is useful in e.g. ox-html where title can be set via
`org-html-preamble-template' or when using the {{{title}}}-macro.
2015-02-12 01:45:39 +01:00
Nicolas Goaziou 16841306ed Use `org-element-copy'
* lisp/org.el (org-timestamp-split-range): Use `org-element-copy'.  Do
  not preserve :parent property anymore.

* lisp/ox.el (org-export-as): Use `org-element-copy'.

* testing/lisp/test-org.el (test-org/timestamp-split-range): Update test.
2015-02-09 10:15:59 +01:00
Rasmus 8f38f037b4 ox.el: {{{date}}} formatting argument
* ox.el (org-export-as): Allow {{{date}}} to take formatting-argument.
* org.texi (Macro replacement): Document {{{date}}} formatting.
* test-ox.el (test-org-export/expand-macro): Test {{{data(format)}}}
* org-NEWS: Mention optional {{{data}}} argument.

Optional argument to {{{date}}} like {{{date(FMT)}}} are treated
similar to {{{time(FMT)}}} if \#+DATE is a timestamp.
2015-02-09 01:47:21 +01:00
Charles Berry 638cde3ac9 lisp/ox.el: Enable removable inline src results
* lisp/ox.el: (org-export-as): Treat `results' as an `identity' macro
  with one argument after Babel executes.
2015-01-29 12:05:31 -08:00