Commit Graph

445 Commits

Author SHA1 Message Date
Nicolas Goaziou 9508dc9af2 ox: Internal references are always 10 character long
* lisp/ox.el (org-export-format-reference): Internal references are
  always 10 character long.

This reduces further possible reference clashes with user-defined
labels.
2016-04-26 21:04:41 +02:00
Nicolas Goaziou bef3fc6f82 ox-publish: Better handling of cross-references
* lisp/ox-publish.el (org-publish--collect-references): Renamed...
(org-publish--store-crossrefs): ... to this.
(org-publish-org-to): Use previous function.  Small refactoring.

(org-publish-resolve-external-link): Use tight integration with
`org-export-get-reference' so as to provide reliable cross references.

* lisp/ox.el (org-export-get-reference): Conversely, take into
  consideration references suggested by
  `org-publish-resolve-external-link'.
2016-03-12 23:18:55 +01:00
Nicolas Goaziou 32c3f33d00 ox: Use a new scheme for internal references
* lisp/ox.el (org-export-get-reference): Use randomly generated labels.
(org-export-new-reference):
(org-export-format-reference): New functions.

* testing/lisp/test-ox.el (test-org-export/get-reference): New test.

The new scheme is better when datum type cannot be known ahead of time
or when references are not created sequentially, e.g., during
a publishing process where a reference to a file can be require before
the file is published.
2016-03-12 23:18:55 +01:00
Nicolas Goaziou 6ec06dcff9 ox: Abstract fuzzy link searches with search cells
* lisp/ox.el (org-export-search-cells):
(org-export-string-to-search-cell):
(org-export-match-search-cell-p): New functions.

(org-export-resolve-fuzzy-link): Use new functions.

* testing/lisp/test-ox.el (test-org-export/fuzzy-link): Tiny
  refactoring.
(test-org-export/resolve-fuzzy-link): Fix failing test.
2016-03-12 23:18:55 +01:00
Nicolas Goaziou 0b59a5994e Merge branch 'maint' 2016-03-10 10:11:24 +01:00
Nicolas Goaziou 5a735b0b80 ox: Fix smart quotes within tables
* lisp/ox.el (org-export--smart-quote-status): Handle smart quotes
  within objects.

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

Reported-by: Philipp Middendorf <pmi@hacon.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/105586>
2016-03-10 10:10:29 +01:00
Kyle Meyer 034c176995 Merge branch 'maint' 2016-01-24 16:41:20 -05:00
Alan Mackenzie 347191042a Backport commit fbce475 from Emacs
Expunge "allow" + infinitive without direct object from source and doc.
fbce4757a874cc43806eb41b8637538b101c3c69
Alan Mackenzie
Sun Jan 24 20:30:39 2016 +0000
2016-01-24 16:35:22 -05:00
Nicolas Goaziou fdbf441560 Obsolete `org-icompleting-read' and `org-completing-read-no-i'
* lisp/org.el (org-icompleting-read, org-completing-read-no-i): Obsolete
  aliases for `completing-read'
(org-iswitchb-completing-read): Remove function.
(org-sort-entries):
(org-refile-get-location):
(org-todo):
(org-deadline):
(org-occur-parameters):
(org-change-tag-in-region):
(org-fast-tag-selection):
(org-delete-property-globally):
(org-compute-property-at-point):
(org-buffer-list): Use genuine function.

* contrib/lisp/org-colview-xemacs.el (org-columns-edit-value):
(org-columns-new):
(org-insert-columns-dblock):
* contrib/lisp/org-index.el (org-index):
* contrib/lisp/ox-bibtex.el (org-bibtex-goto-citation):
* lisp/ob-core.el (org-babel-insert-header-arg):
(org-babel-goto-named-src-block):
(org-babel-goto-named-result):
(org-babel-demarcate-block):
* lisp/org-agenda.el (org-todo-list):
(org-agenda-filter-by-tag):
(org-agenda-bulk-action):
* lisp/org-attach.el (org-attach-delete-one):
(org-attach-open):
* lisp/org-bibtex.el (org-bibtex-fleshout):
(org-bibtex-create):
* lisp/org-capture.el (org-capture-fill-template):
* lisp/org-colview.el (org-columns-edit-value):
(org-columns-new):
(org-insert-columns-dblock):
* lisp/org-footnote.el (org-footnote-new):
* lisp/org-list.el (org-sort-list):
* lisp/ox-publish.el (org-publish):
* lisp/ox.el (org-export-dispatch): Use genuine function.
2016-01-10 21:16:29 +01:00
Kyle Meyer 6345de2d05 Merge branch 'maint' 2016-01-09 17:43:27 -05:00
Kyle Meyer 6bc48c5f41 Update copyright years 2016-01-09 17:12:03 -05:00
Nicolas Goaziou deafe56554 org-element: Ignore plain footnotes
* lisp/org-element.el (org-element--set-regexps):
(org-element-footnote-definition-interpreter):
(org-element-footnote-reference-parser):
(org-element-footnote-reference-interpreter): Do not consider [1]-like
constructs as footnotes anymore.

* lisp/ox.el (org-export-expand-include-keyword):
(org-export--prepare-file-contents): Apply changes to footnotes.

* doc/org.texi (Footnotes): Remove references to plain footnotes.

* testing/lisp/test-org-element.el (test-org-element/footnote-reference-parser):
(test-org-element/footnote-reference-interpreter):
* testing/lisp/test-ox.el (test-org-export/expand-include):
(test-org-export/expand-macro):
(test-org-export/get-footnote-number):
(test-org-export/collect-footnote-definitions):
(test-org-export/footnotes):
(test-org-export/fuzzy-link): Update tests.

Since it is possible to refer unambiguously to a label without the "fn:"
prefix, the latter becomes part of the syntax and no longer part of the
label.  In particular [fn:1] and [fn:label] are labelled, respectively,
"1" and "label".
2015-12-22 16:55:17 +01:00
Nicolas Goaziou 54318add34 Change export block syntax
* lisp/org-element.el (org-element-export-block-parser):
(org-element--current-element): Use new syntax for export blocks.
(org-element-block-name-alist): Remove.

* lisp/ox.el (org-export-register-backend):
(org-export-define-derived-backend): Remove :export-block keyword from
back-end's definition.
(org-export-expand-include-keyword): Use new syntax for include
keywords.

* lisp/ox-ascii.el (ascii):
* lisp/ox-beamer.el (beamer):
* lisp/ox-html.el (html):
* lisp/ox-latex.el (latex):
(org-latex-prefer-user-labels):
* lisp/ox-man.el (man):
* lisp/ox-md.el (md):
* lisp/ox-odt.el (odt):
* lisp/ox-texinfo.el (texinfo): Propagate changes to "ox.el".

* lisp/ob-core.el (org-babel-insert-result):
* lisp/ob-haskell.el (org-babel-haskell-export-to-lhs): Use new syntax.

* lisp/org.el (org-structure-template-alist): Use new syntax.
(org-protecting-blocks): Add "export" to protected blocks.  Remove
  back-ends blocks, which are now special blocks.
(org-fontify-meta-lines-and-blocks-1): Fontify correctly new blocks.

* lisp/org-footnote.el (org-footnote-forbidden-blocks):
* lisp/org-list.el (org-list-forbidden-blocks): Add "export" to
  forbidden blocks.  Remove back-ends blocks, which are now special
  blocks.

* contrib/lisp/ox-extra.el: Update comments.

* testing/lisp/test-org-element.el (test-org-element/export-block-parser):
(test-org-element/export-block-interpreter):
* testing/lisp/test-ob.el (test-ob/org-babel-remove-result--results-html):
(test-ob/org-babel-remove-result--results-latex):
* testing/lisp/test-ox.el (test-org-export/expand-include): Update tests.

Export blocks are explicitly marked as such at the syntax level to
disambiguate their parsing from special blocks.  The new syntax is

  #+BEGIN_EXPORT backend
  ...
  #+END_EXPORT

instead of

  #+BEGIN_backend
  ...
  #+END_backend

As a consequence, =INCLUDE= keywords syntax is modified, e.g.,

  #+INCLUDE: "file.org" HTML

becomes

  #+INCLUDE: "file.org" export html
2015-12-20 21:56:27 +01:00
Kyle Meyer f57778090e Update for change in letrec behavior
* lisp/ox-latex.el (org-latex--delayed-footnotes-definitions):
* lisp/ox.el (org-export--selected-trees):
(org-export--prune-tree):
(org-export--merge-external-footnote-definitions):
(org-export--footnote-reference-map): Provide nil value for binders.

Using

  (letrec ((SYMBOL)) ...)

to bind SYMBOL to nil relies on (setq SYMBOL) setting SYMBOL to nil.  As
of 5d93a89 (Byte compiler: on setq with an odd number of arguments,
generate a `signal', 2015-11-26) in the Emacs repo, setq signals an
error when given an odd number of arguments.

Reported-by: Zack Piper <zack@apertron.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/103539>
<http://permalink.gmane.org/gmane.emacs.devel/196182>
2015-12-12 22:46:24 -05:00
Nicolas Goaziou ce4143e79d Merge branch 'maint' 2015-12-12 00:41:43 +01:00
Nicolas Goaziou 7d1a6777d0 ox: Fix uninterpreted subscript
* lisp/ox.el (org-export--remove-uninterpreted-data-1): Fix
  un-interpreted subscript containing another object.

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

Reported-by: Yasushi SHOJI <yashi@atmark-techno.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/103553>
2015-12-12 00:38:39 +01:00
Nicolas Goaziou a5977a2740 ox: Tiny refactoring
* lisp/ox.el (org-export--smart-quote-status): Tiny refactoring.
2015-12-02 23:27:28 +01:00
Nicolas Goaziou bd921f0858 Merge branch 'maint' 2015-11-12 11:29:55 +01:00
Nicolas Goaziou 53a4209003 ox: Fix comments removal
* lisp/ox.el (org-export--delete-comments): Preserve document's
  structure when removing comment lines or comment blocks.

* testing/lisp/test-ox.el (test-org-export/comments): New test.

Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/102860>
2015-11-12 11:28:13 +01:00
Nicolas Goaziou b5b08a7f52 ox: Look for export and noexport tags in FILETAGS
* lisp/ox.el (org-export--selected-trees):
(org-export--skip-p): Check also FILETAGS.
* lisp/ox.el (org-export-get-tags): Also report export and noexport
  tags.

Reported-by: Michael Welle <mwe012008@gmx.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/102754>
2015-11-10 23:38:04 +01:00
Nicolas Goaziou 24aaa53573 ox: Fix code comment
* lisp/ox.el (org-export-output-file-name): Fix code comment.
2015-11-08 16:48:31 +01:00
Nicolas Goaziou 75c93f7c21 ox: Small refactoring
* lisp/ox.el (org-export-output-file-name): Small refactoring.
2015-11-08 16:44:26 +01:00
Nicolas Goaziou d24a9b7645 Change references from Org 8.4 to 9.0
According to <http://mid.gmane.org/87oai4w69i.fsf@gnu.org>, master is
the root for Org 9.0, not Org 8.4.
2015-11-07 17:11:48 +01:00
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