ox-org: Export special table rows by default

* lisp/ox.el (org-export-options-alist): New internal plist option -
:with-special-rows.  Defaults to nil.
(org-export--skip-p): Do not skip special table rows when
:with-special-rows is non-nil.
* lisp/ox-org.el (org-org-with-special-rows): New custom option
controlling whether to export special table rows.  t by default.
(org): Use `org-org-with-special-rows' as the value of
:with-special-rows option.
* etc/ORG-NEWS (=ox-org= now exports special table rows by default):
(New option ~org-org-with-special-rows~): Announce the change.
This commit is contained in:
Ihor Radchenko 2024-02-12 12:55:37 +01:00
parent f4f0fc8bda
commit 6ff0de5c3e
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
3 changed files with 25 additions and 2 deletions

View File

@ -13,6 +13,13 @@ Please send Org bug reports to mailto:emacs-orgmode@gnu.org.
* Version 9.7 (not released yet)
** Important announcements and breaking changes
*** =ox-org= now exports special table rows by default
Previously, when exporting to Org, special table rows (for example,
width cookies) were not exported. Now, they are exported by default.
You can customize new option ~org-org-with-special-rows~ to fall back to previous behavior.
*** Org babel backends are now expected to define an additional API function ~org-babel-session-buffer:<lang>~
Org babel now uses session buffer (if it exists) to retrieve
@ -501,6 +508,11 @@ The change is breaking when ~org-use-property-inheritance~ is set to ~t~.
The =TEST= parameter is better served by Emacs debugging tools.
** New and changed options
*** New option ~org-org-with-special-rows~
The new options controls whether to export special table rows in
Org-Org (=ox-org=) export. The default value is ~t~.
*** New option ~org-babel-comint-fallback-regexp-threshold~
Org babel is often using Emacs' interactive REPL feature to implement

View File

@ -54,6 +54,11 @@ setting of `org-html-htmlize-output-type' is `css'."
(const :tag "Don't include external stylesheet link" nil)
(string :tag "URL or local href")))
(defcustom org-org-with-special-rows t
"Non-nil means export special table rows.
Special rows are the rows containing special marking characters, as
described in the Info node `(org)Advanced features'.")
(org-export-define-backend 'org
'((babel-call . org-org-identity)
(bold . org-org-identity)
@ -112,7 +117,10 @@ setting of `org-html-htmlize-output-type' is `css'."
(lambda (a s v b)
(if a (org-org-export-to-org t s v b)
(org-open-file (org-org-export-to-org nil s v b)))))))
:filters-alist '((:filter-parse-tree . org-org--add-missing-sections)))
:filters-alist '((:filter-parse-tree . org-org--add-missing-sections))
:options-alist
;; Export special table rows.
'((:with-special-rows nil nil org-org-with-special-rows)))
(defun org-org--add-missing-sections (tree _backend _info)
"Ensure each headline has an associated section.

View File

@ -140,6 +140,7 @@
(:with-properties nil "prop" org-export-with-properties)
(:with-smart-quotes nil "'" org-export-with-smart-quotes)
(:with-special-strings nil "-" org-export-with-special-strings)
(:with-special-rows nil nil nil)
(:with-statistics-cookies nil "stat" org-export-with-statistics-cookies)
(:with-sub-superscript nil "^" org-export-with-sub-superscripts)
(:with-toc nil "toc" org-export-with-toc)
@ -1838,7 +1839,9 @@ not exported."
(and (org-export-table-has-special-column-p
(org-element-lineage datum 'table))
(org-export-first-sibling-p datum options)))
(table-row (org-export-table-row-is-special-p datum options))
(table-row
(unless (plist-get options :with-special-rows)
(org-export-table-row-is-special-p datum options)))
(timestamp
;; `:with-timestamps' only applies to isolated timestamps
;; objects, i.e. timestamp objects in a paragraph containing only