Commit Graph

313 Commits

Author SHA1 Message Date
Ihor Radchenko dbf415b840
Revert "org-texinfo--match-definition: Drop redundant `save-match-data'"
This reverts commit e32bd5f7c7.

This is `pcase-let*', not `pcase', so the arguments are _all_
evaluated and match data must be preserved in the ARGS binding.

Link: https://yhetil.org/emacs-devel/877cp8bkpa.fsf@bernoul.li
2023-09-02 20:07:07 +03:00
Ihor Radchenko e32bd5f7c7
org-texinfo--match-definition: Drop redundant `save-match-data'
* lisp/ox-texinfo.el (org-texinfo--match-definition): It is safe to
drop `save-match-data' as the function modifies the match data anyway,
and `save-match-data' does not affect anything else.
2023-08-29 12:38:04 +03:00
Ihor Radchenko bc29f5de41
org-element: New `org-element-*property*' functions
* lisp/org-element.el (org-element-begin):
(org-element-end):
(org-element-contents-begin):
(org-element-contents-end):
(org-element-post-affiliated):
(org-element-post-blank): New functions for fast access to frequently
used element properties.  The functions are `setf'-able.

Update all the relevant code in Org to use the new functions instead
of genetic property queries.
2023-07-01 14:35:43 +03:00
Ihor Radchenko 81a7e8c836
org-element-lineage: Allow TYPES to be a symbol
* lisp/org-element-ast.el (org-element-lineage): Allow TYPES argument
to be a symbol.
* lisp/ox-ascii.el (org-ascii--current-text-width):
(org-ascii-format-inlinetask-default):
(org-ascii-section):
* lisp/ox-beamer.el (org-beamer--format-block):
* lisp/ox-html.el (org-html-section):
(org-html-table-cell):
(org-html-table-row):
* lisp/ox-latex.el (org-latex-table-cell):
(org-latex-table-row):
* lisp/ox-odt.el (org-odt-headline):
(org-odt-table-style-spec):
(org-odt-get-table-cell-styles):
(org-odt-table-cell):
(org-odt-table-row):
* lisp/ox-org.el (org-org-section):
* lisp/ox-publish.el (org-publish-collect-index):
* lisp/ox-texinfo.el (org-texinfo--get-node):
(org-texinfo-section):
(org-texinfo-table-row):
* lisp/ox.el (org-export--skip-p):
(org-export-get-node-property):
(org-export-table-cell-borders):
(org-export-table-row-in-header-p):
(org-export-table-row-number):
(org-export-collect-headlines): Update all the callers.
2023-07-01 14:35:43 +03:00
Ihor Radchenko 2d22d7f515
ox.el: Rename `org-element-get-parent-element' and move to org-element
* lisp/org-element.el: Rename `org-element-get-parent-element' to
`org-element-parent-element'.
* lisp/org-compat.el (org-export-get-parent-element):
* lisp/ox.el (org-export-get-parent-element): Remove, adding obsolete
alias.
(org-export--skip-p):
* lisp/org-table.el:
* lisp/ox-beamer.el (org-beamer-link):
* lisp/ox-html.el (org-html-link):
* lisp/ox-latex.el (org-latex-footnote-reference):
* lisp/ox-md.el (org-md-link):
* lisp/ox-odt.el (org-odt-format-label):
(org-odt-link--inline-image):
(org-odt-link--inline-formula):
* lisp/ox-texinfo.el (org-texinfo--inline-image): Update all the
callers.
2023-07-01 14:35:42 +03:00
Ihor Radchenko ea4f4fdf58
Rename `org-export-get-parent' to `org-element-parent' 2023-07-01 14:35:41 +03:00
Ihor Radchenko 6a7aee2c35
org-texinfo--normalize-headlines: Use `org-element-create' 2023-07-01 14:35:40 +03:00
Ihor Radchenko a7d1dfa171
Use `org-element-type-p'
Use `org-element-type-p' across Org source, except some tests, where `eq' can
produce more meaningful failure explanations.
2023-07-01 14:35:35 +03:00
Ihor Radchenko c22697f472
Use new function names `org-element-extract' and `org-element-set' 2023-07-01 14:35:32 +03:00
Matthew Trzcinski 88c572de25 Create aliases for export region functions
lisp/ox-ascii.el: Create alias `org-export-region-to-ascii` for
`org-ascii-convert-region-to-ascii`.
lisp/ox-html.el: Create alias `org-export-region-to-html` for
`org-html-convert-region-to-html`.
lisp/ox-latex.el: Create alias `org-export-region-to-latex` for
`org-latex-convert-region-to-latex`.
lisp/ox-md.el: Create alias `org-export-region-to-md` for
`org-md-convert-region-to-md`.
lisp/ox-texinfo.el: Create alias `org-export-region-to-texinfo` for
`org-texinfo-convert-region-to-texinfo`.
doc/org-manual.org: Change commands from "*-convert-region-*" form to
the "org-export-region-to-*" aliases.  Add function index for aliases.
2023-06-29 21:18:01 +02:00
Ihor Radchenko 2c77551a68
org-texinfo-export-to-info: Fix docstring
* lisp/ox-texinfo.el (org-texinfo-export-to-info): Remove description
of a removed argument from the docstring.  The PUB-DIR argument has
been removed in 496ed832d.

Reported-by: Niall Dooley <dooleyn@gmail.com>
Link: https://list.orgmode.org/orgmode/CADS3Lq7W=LZYd3F3aA0p1RaDWdHSmwahvs8oyJfx_Hw0WF9K9Q@mail.gmail.com/
2023-06-02 10:23:57 +03:00
Ihor Radchenko f81ba451a7
Prefer "backend" over "back-end"
* doc/org-manual.org (Exporting): Add cindex entry for both "backend"
and "back-end" for better searchability.

All other changes are trivial.

Note that `org-element-export-snippet-parser' will still use :back-end
property.  So will ox.el in INFO channel.
2023-04-20 14:11:19 +02:00
Ihor Radchenko 4c01eba265
org-texinfo-supports-math-p: Fix CI test failures
* lisp/ox-texinfo.el (org-texinfo-supports-math-p): Consider
compilation error as indication that math is not supported.  texinfo
compiler throws "unknown command `displaymath'" error in such case,
causing `org-texinfo-compile' to err as well.

Fixes CI tests failures when testing with Texinfo versions with no
math support.

https://builds.sr.ht/~bzg/job/959487
2023-03-19 13:58:07 +01:00
Rudolf Adamkovič 99c8ed09f8
ox-texinfo: Fix invalid syntax in Texinfo version detection code
* lisp/ox-texinfo.el (org-texinfo-supports-math-p): Fix the incorrect
syntax @displaymath{1 + 1 = 2} used to detect whether Texinfo supports
TeX "math mode".  Instead, use the correct syntax @math{1 + 1 = 2}.
2023-02-17 13:30:16 +03:00
Eli Zaretskii e0815d7545 Backport commit cae528457 from Emacs
; Add 2023 to copyright years.
cae528457cb862dc886a34240c9d4c73035b6659
Eli Zaretskii
Sun Jan 1 05:31:12 2023 -0500
2023-01-01 12:44:47 -05:00
Ihor Radchenko 5a10517d02
Add missing :package-version tags in changed `defcustom'
* lisp/ob-clojure.el (ob-clojure-babashka-command):
(ob-clojure-nbb-command):
* lisp/ob-exp.el (org-babel-exp-code-template):
* lisp/ob-latex.el (org-babel-latex-pdf-svg-process):
* lisp/org-agenda.el (org-agenda-show-outline-path):
* lisp/org-capture.el (org-capture-templates):
* lisp/org-clock.el (org-clocktable-defaults):
* lisp/org-persist.el (org-persist-directory):
(org-persist-remote-files):
(org-persist-default-expiry):
* lisp/org-refile.el (org-refile-use-outline-path):
* lisp/org-src.el (org-src-lang-modes):
* lisp/org.el (org-resource-download-policy):
(org-safe-remote-resources):
(org-time-stamp-custom-formats):
(org-property-separators):
(org-preview-latex-process-alist):
(org-structure-template-alist):
* lisp/ox-latex.el (org-latex-inline-image-rules):
(org-latex-src-block-backend):
(org-latex-engraved-options):
(org-latex-engraved-theme):
* lisp/ox-md.el (org-md-toplevel-hlevel):
* lisp/ox-texinfo.el (org-texinfo-with-latex): Add :package-version
keywords to the new custom options, and those with the value or
meaning changed.
2022-11-13 15:29:15 +08:00
Rudolf Adamkovič c940b460c7
ox-texinfo: Include LaTeX in Texinfo exports
* lisp/ox-texinfo.el (org-texinfo-with-latex): New customize.
* lisp/ox-texinfo.el (org-texinfo-latex-environment): New function.
* lisp/ox-texinfo.el (org-texinfo-latex-fragment): New function.
* lisp/ox-texinfo.el (org-texinfo-supports-math-p): New function.
* lisp/ox-texinfo.el (org-texinfo-supports-math--cache): New variable.
* lisp/ox-texinfo.el (texinfo): Set latex-environment.
* lisp/ox-texinfo.el (texinfo): Set latex-fragment.
* testing/lisp/test-ox-texinfo.el: Add basic tests.
2022-09-21 15:29:50 +08:00
Ihor Radchenko e81a094383
Assert all the Org files to load the same Org version
* lisp/org-compat.el (org-assert-version): New macro comparing Org
version at compile time and laod time.

Add `org-assert-version' call to all files:

* lisp/org-macs.el:
* lisp/org-crypt.el:
* lisp/org-ctags.el:
* lisp/org-cycle.el:
* lisp/org-datetree.el:
* lisp/org-duration.el:
* lisp/org-element.el (avl-tree):
* lisp/org-entities.el:
* lisp/org-faces.el:
* lisp/org-feed.el:
* lisp/org-fold-core.el:
* lisp/org-fold.el:
* lisp/org-footnote.el:
* lisp/org-goto.el:
* lisp/org-habit.el:
* lisp/org-id.el:
* lisp/org-indent.el:
* lisp/org-inlinetask.el:
* lisp/org-keys.el:
* lisp/org-lint.el:
* lisp/org-list.el:
* lisp/org-macro.el:
* lisp/org-mobile.el:
* lisp/org-mouse.el:
* lisp/org-num.el:
* lisp/org-pcomplete.el:
* lisp/org-persist.el:
* lisp/org-plot.el:
* lisp/org-protocol.el:
* lisp/org-refile.el:
* lisp/org-src.el:
* lisp/org-table.el:
* lisp/org-tempo.el:
* lisp/org-timer.el:
* lisp/org.el:
* lisp/ox-ascii.el:
* lisp/ox-beamer.el:
* lisp/ox-html.el:
* lisp/ox-icalendar.el:
* lisp/ox-koma-letter.el:
* lisp/ox-latex.el:
* lisp/ox-man.el:
* lisp/ox-md.el:
* lisp/ox-odt.el:
* lisp/ox-org.el:
* lisp/ox-publish.el:
* lisp/ox-texinfo.el:
* lisp/ox.el:
2022-09-04 12:24:55 +08:00
Stefan Kangas 41e19f1d7a
; Fix typos 2022-07-01 17:42:52 +08:00
Jonas Bernoulli 98588ebfe1 ox-texinfo: Allow enabling compact syntax for @itemx per file
* doc/org-manual.org (Plain lists in Texinfo export): Document the
:texinfo-compact-itemx export option and variable
org-texinfo-compact-itemx.
(Texinfo specific properties): Mention new export option and variable.
* lisp/ox-texinfo.el: Add org-texinfo-compact-itemx to the
:options-alist of the texinfo backend.
* lisp/ox-texinfo.el (org-texinfo-compact-itemx): New option.
* lisp/ox-texinfo.el (org-texinfo--massage-key-item): Add INFO
argument and use the :texinfo-compact-itemx export option.
* lisp/ox-texinfo.el (org-texinfo-item): Use the
:texinfo-compact-itemx export option.
2022-02-09 00:38:23 +01:00
Jonas Bernoulli 1312e1a938 ox-texinfo: Define definition commands using description lists
* doc/org-manual.org (Plain lists in Texinfo export): Document use
of definition command prefixes in description lists.
* lisp/ox-texinfo.el: Add org-texinfo--separate-definitions to the
list of :filter-parse-tree functions of the texinfo backend.
* lisp/ox-texinfo.el (org-texinfo--definition-command-alist)
(org-texinfo--definition-command-regexp): New variables.
* lisp/ox-texinfo.el (org-texinfo--separate-definitions)
(org-texinfo--match-definition, org-texinfo--split-definition)
(org-texinfo--split-plain-list, org-texinfo--massage-key-item):
New functions.
2022-02-09 00:35:59 +01:00
Jonas Bernoulli e52743fb30 ox-texinfo: Optionally use @itemx for certain description list items
* doc/org-manual.org (Plain lists in Texinfo export): Reorder and
document new functionality.
* lisp/ox-texinfo.el (org-texinfo-item): In a description list when
its :compact attribute is non-nil, then transcode consecutive items
using one @item and one or more @itemx commands, if all of them
except for the last one lack content.
2022-02-08 22:45:36 +01:00
Jonas Bernoulli 3d0f592de7 ox-texinfo: Add function for use by kbd macro
* doc/doc-setup.org: Use org-texinfo-kbd-macro for kbd macro.
* doc/org-manual.org: Add new node "Key bindings in Texinfo export".
* lisp/ox-texinfo.el (org-texinfo--quoted-keys-regexp): New variable.
* lisp/ox-texinfo.el (org-texinfo-kbd-macro): New function.
2022-02-08 22:45:27 +01:00
Kyle Meyer aae2ac3a68 Merge branch 'bugfix' 2022-01-01 15:21:37 -05:00
Kyle Meyer 5a229cbc44 Update copyright year to 2022 2022-01-01 15:17:08 -05:00
Nicolas Goaziou 96e022bbe0 Merge branch 'bugfix' 2021-12-10 10:29:41 +01:00
Sébastien Miquel 8d189720b2 ox: Fix async export with native compilation
* lisp/ox-beamer.el (org-beamer-export-to-pdf):
* lisp/ox-icalendar.el (org-icalendar-export-to-ics):
* lisp/ox-koma-letter.el (org-koma-letter-export-to-pdf):
* lisp/ox-man.el (org-man-export-to-pdf):
* lisp/ox-texinfo.el (org-texinfo-export-to-info): Quote lambda.

Quote or name lambdas to prevent their compilation into anonymous
functions which cannot be passed to the external async emacs process.
2021-12-10 10:22:53 +01:00
Bastien 8b78d482a6 Fix email addresses in some *.el headers 2021-10-03 08:54:33 +02:00
Bastien 806ac1b7f6 *el: Fix indentation 2021-09-29 09:22:47 +02:00
Stefan Kangas 51cdd6e30f Various minor docfixes found by checkdoc 2021-09-16 21:24:59 +02:00
Nicolas Goaziou f70e36252a Merge branch 'maint' 2021-06-02 17:22:41 +02:00
Nicolas Goaziou 093c94e31b texinfo: Fix off-by-one error
* lisp/ox-texinfo.el (org-texinfo--menu-entries): Fix off-by-one
error.

This is a follow-up to f99f26306c.

Reported-by: Jonas Bernoulli <jonas@bernoul.li>
<http://lists.gnu.org/r/emacs-orgmode/2021-05/msg01290.html>
2021-06-02 17:21:15 +02:00
Bastien c9be80ceb0 Add Nicolas as the maintainer for a few ox-*.el files
* lisp/ox.el:
* lisp/ox-texinfo.el:
* lisp/ox-publish.el:
* lisp/ox-org.el:
* lisp/ox-md.el:
* lisp/ox-icalendar.el:
* lisp/ox-beamer.el:
* lisp/ox-ascii.el: Add Nicolas as the maintainer.
2021-05-03 06:41:56 +02:00
Nicolas Goaziou e3153145f4 Merge branch 'maint' 2021-04-30 15:51:20 +02:00
Nicolas Goaziou e266fac1ed ox-texinfo: Property display images with relative file names
* lisp/ox-texinfo.el (org-texinfo--inline-image): Make sure to remove
leading "./" from file name.

Reported-by: Ramesh Nedunchezian <rameshnedunchezian@outlook.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-04/msg00873.html>
2021-04-30 15:50:25 +02:00
Nicolas Goaziou f918ba1094 Merge branch 'maint' 2021-04-19 14:34:43 +02:00
Nicolas Goaziou a89d96e6a5 texinfo: Consider any variation on "Top" a reserved node name
* lisp/ox-texinfo.el (org-texinfo--get-node): Change node name if it
conflicts with variations like "top", since they also appear to be
reserved by Texinfo.
2021-04-19 14:32:53 +02:00
Nicolas Goaziou b33face41c Merge branch 'maint' 2021-04-13 00:37:16 +02:00
Nicolas Goaziou 6dbd132e62 ox-texinfo: Fix footnotes ending on a special environment
* lisp/ox-texinfo.el (org-texinfo-footnote-reference): Prevent
a footnote from ending on an "@end" line.

Reported-by: Ramesh Nedunchezian <rameshnedunchezian@outlook.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-04/msg00228.html>
2021-04-13 00:36:31 +02:00
Nicolas Goaziou bf98b12d5c Merge branch 'maint' 2021-04-10 12:29:28 +02:00
Nicolas Goaziou 94be20a334 ox-texinfo: Fix references to low-level headlines
* lisp/ox-texinfo.el (org-texinfo-headline): Provide an anchor for
low-level headlines.

Reported-by: Ramesh Nedunchezian <rameshnedunchezian@outlook.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-04/msg00206.html>
2021-04-10 12:28:08 +02:00
Nicolas Goaziou 0457d8d5a3 Merge branch 'maint' 2021-04-09 22:33:00 +02:00
Nicolas Goaziou f99f26306c ox-texinfo: Do not create menu for headlines without sectioning command
* lisp/ox-texinfo.el (org-texinfo--sectioning-structure): New function.
(org-texinfo-headline): Use new function.
(org-texinfo--menu-entries): Filter out headlines with no sectioning
command defined.

Reported-by: Ramesh Nedunchezian <rameshnedunchezian@outlook.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-04/msg00196.html>
2021-04-09 22:29:50 +02:00
Nicolas Goaziou 635920c730 Merge branch 'maint' 2021-04-01 17:15:36 +02:00
Nicolas Goaziou f7e0e17e82 ox-texinfo: Fix colons removal in menu entries
* lisp/ox-texinfo.el (org-texinfo--format-entries): Fix regexp
matching unwanted colons.

Reported-by: Ramesh Nedunchezian <rameshnedunchezian@outlook.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-04/msg00008.html>
2021-04-01 17:10:52 +02:00
Glenn Morris 2da3b0ebc3 Backport commit 18e1455c8 from Emacs
* lisp/ox-texinfo.el (org-texinfo-export-to-texinfo-batch):
Overwrite existing output.

Make generation of texi from org overwrite output
18e1455c8ae851791a047dc56eef972cc24e5b6c
Glenn Morris
Sun Feb 28 15:13:07 2021 -0800
2021-03-09 22:12:02 -05:00
Glenn Morris 6382dbc950 Backport commit fddd63f8b from Emacs
* lisp/ox-texinfo.el (org-texinfo-export-to-texinfo-batch): New
function.

Distribute the real source for some doc/misc manuals (bug#45143)
fddd63f8b854f6bfa91403f69ba694ccb54197bc
Glenn Morris
Fri Feb 26 19:36:09 2021 -0800
2021-02-28 17:24:25 -05:00
Kyle Meyer 99eafe3787 Update copyright year to 2021 2021-01-01 14:59:01 -05:00
Kyle Meyer 1c5bebdad9 Merge branch 'maint' into master 2020-09-07 21:23:16 -04:00
Nicolas Goaziou 13dfab3fb2 ox-texinfo: Tiny refactoring
* lisp/ox-texinfo.el (org-texinfo-link): Use
`org-texinfo--sanitize-content'.

(cherry picked from commit 8fd24c0a53)
[km]: This fixes a double-escaping regression introduced by 706970efb
      (ox-texinfo.el: Fix escaping special chars in raw-path,
      2020-06-05).
2020-09-07 21:15:40 -04:00