* [PATCH] ox.el: Customize org-export-dispatch options
@ 2023-04-15 4:48 Jim Wisniewski
2023-04-15 9:49 ` Ihor Radchenko
2023-04-15 11:08 ` Max Nikulin
0 siblings, 2 replies; 14+ messages in thread
From: Jim Wisniewski @ 2023-04-15 4:48 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 1258 bytes --]
Here's a small enhancement I wrote to add customizable variables for the
`org-export-dispatch' UI options that don't already have one. I almost always
export with "Body only" switched on, and I got tired of manually toggling it
each time; while I was at it I also added variables for "Visible only" and
"Force publishing", because why not. Hopefully others will find this helpful as
well.
I tried this out locally by eval-ing the new code and customizing the new
variables, and it appears to have the desired effect. `make test' and `make
compile' also succeed.
I sent in the copyright assignment form but haven't gotten the contract back to
sign yet.
Changelog:
* lisp/ox.el: Add customizable variables `org-export-body-only',
`org-export-visible-only', and `org-export-force-publishing', and use
them in `org-export-dispatch'.
* doc/org-manual.org: Document the new export variables.
Currently when calling `org-export-dispatch', two of the export
options can have their defaults specified with customizable variables:
"Export scope" (via `org-export-initial-scope') and "Async export"
(via `org-export-in-background'). This change adds customizable
variables for the "Body only", "Visible only", and "Force publishing"
options as well.
--
JJW
[-- Attachment #2: 0001-ox.el-Customize-org-export-dispatch-options.patch --]
[-- Type: text/x-patch, Size: 4069 bytes --]
From 563a31988df9fb1b1b2093918e03cd92b7a671a0 Mon Sep 17 00:00:00 2001
From: Jim Wisniewski <wisnij@gmail.com>
Date: Fri, 14 Apr 2023 02:46:25 -0400
Subject: [PATCH] ox.el: Customize org-export-dispatch options
* lisp/ox.el: Add customizable variables `org-export-body-only',
`org-export-visible-only', and `org-export-force-publishing', and use
them in `org-export-dispatch'.
* doc/org-manual.org: Document the new export variables.
Currently when calling `org-export-dispatch', two of the export
options can have their defaults specified with customizable variables:
"Export scope" (via `org-export-initial-scope') and "Async export"
(via `org-export-in-background'). This change adds customizable
variables for the "Body only", "Visible only", and "Force publishing"
options as well.
---
doc/org-manual.org | 22 ++++++++++++++++++++++
lisp/ox.el | 28 ++++++++++++++++++++++++++++
2 files changed, 50 insertions(+)
diff --git a/doc/org-manual.org b/doc/org-manual.org
index a54bd6f35..2e98793bf 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -11773,6 +11773,24 @@ further alter what is exported, and how.
in the export. Affects only those back-end formats that have
sections like =<head>...</head>= in HTML.
+ #+vindex: org-export-body-only
+ To make body-only export the default, customize the variable
+ ~org-export-body-only~.
+
+- {{{kbd(C-f)}}} ::
+ #+kindex: C-c C-e C-f
+
+ Toggle force-publishing export. Publish functions normally only
+ publish changed files (see [[**Triggering Publication]]). Forced
+ publishing causes files to be published even if their timestamps do
+ not indicate the file has been changed.
+
+ #+vindex: org-export-force-publishing
+ To make forced publishing the default, customize the variable
+ ~org-export-force-publishing~. (This is similar to
+ ~org-publish-use-timestamps-flag~, but only affects the export
+ dispatcher.)
+
- {{{kbd(C-s)}}} ::
#+kindex: C-c C-e C-s
@@ -11794,6 +11812,10 @@ further alter what is exported, and how.
certain parts of an Org document by adjusting the visibility of
particular headings. See also [[*Sparse Trees]].
+ #+vindex: org-export-visible-only
+ To make visible-only export the default, customize the variable
+ ~org-export-visible-only~.
+
** Export Settings
:PROPERTIES:
:DESCRIPTION: Common export settings.
diff --git a/lisp/ox.el b/lisp/ox.el
index 8be60985f..736d9d1c8 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -955,6 +955,31 @@ these cases."
:group 'org-export-general
:type 'boolean)
+(defcustom org-export-body-only nil
+ "The initial \"Body only\" setting when exporting with `org-export-dispatch'.
+Non-nil means only export body code, without the surrounding
+template."
+ :group 'org-export-general
+ :version "30.0"
+ :package-version '(Org . "9.7")
+ :type 'boolean)
+
+(defcustom org-export-visible-only nil
+ "The initial \"Visible only\" setting when exporting with `org-export-dispatch'.
+Non-nil means don't export the contents of hidden elements."
+ :group 'org-export-general
+ :version "30.0"
+ :package-version '(Org . "9.7")
+ :type 'boolean)
+
+(defcustom org-export-force-publishing nil
+ "The initial \"Force publishing\" setting when exporting with `org-export-dispatch'.
+Non-nil means force all files in the project to be published."
+ :group 'org-export-general
+ :version "30.0"
+ :package-version '(Org . "9.7")
+ :type 'boolean)
+
(defcustom org-export-in-background nil
"Non-nil means export and publishing commands will run in background.
Results from an asynchronous export are never displayed
@@ -7094,6 +7119,9 @@ asynchronous export stack."
(setq org-export-dispatch-last-action
(org-export--dispatch-ui
(list org-export-initial-scope
+ (and org-export-body-only 'body)
+ (and org-export-visible-only 'visible)
+ (and org-export-force-publishing 'force)
(and org-export-in-background 'async))
nil
org-export-dispatch-use-expert-ui)))
--
2.39.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH] ox.el: Customize org-export-dispatch options
2023-04-15 4:48 [PATCH] ox.el: Customize org-export-dispatch options Jim Wisniewski
@ 2023-04-15 9:49 ` Ihor Radchenko
2023-04-15 20:36 ` Jim Wisniewski
2023-04-15 11:08 ` Max Nikulin
1 sibling, 1 reply; 14+ messages in thread
From: Ihor Radchenko @ 2023-04-15 9:49 UTC (permalink / raw)
To: Jim Wisniewski; +Cc: emacs-orgmode
Jim Wisniewski <wisnij@gmail.com> writes:
> Here's a small enhancement I wrote to add customizable variables for the
> `org-export-dispatch' UI options that don't already have one. I almost always
> export with "Body only" switched on, and I got tired of manually toggling it
> each time; while I was at it I also added variables for "Visible only" and
> "Force publishing", because why not. Hopefully others will find this helpful as
> well.
Thanks! Looks like reasonable addition. See some minor comments below.
> I sent in the copyright assignment form but haven't gotten the contract back to
> sign yet.
FSF should reply within 5 working days. If not, follow up with them once.
> * doc/org-manual.org: Document the new export variables.
In addition to the manual, please announce the new customization options
in etc/ORG-NEWS.
> +(defcustom org-export-body-only nil
> + "The initial \"Body only\" setting when exporting with `org-export-dispatch'.
> +Non-nil means only export body code, without the surrounding
> +template."
> + :group 'org-export-general
> + :version "30.0"
Here, and in other new options, :version is not needed.
> + :package-version '(Org . "9.7")
> + :type 'boolean)
You can also add :safe keyword as these options are safe to set as
buffer-locals.
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] ox.el: Customize org-export-dispatch options
2023-04-15 9:49 ` Ihor Radchenko
@ 2023-04-15 20:36 ` Jim Wisniewski
2023-04-16 13:00 ` Ihor Radchenko
0 siblings, 1 reply; 14+ messages in thread
From: Jim Wisniewski @ 2023-04-15 20:36 UTC (permalink / raw)
To: Ihor Radchenko; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 340 bytes --]
On Sat, Apr 15, 2023 at 5:47 AM Ihor Radchenko <yantar92@posteo.net> wrote:
> Thanks! Looks like reasonable addition. See some minor comments below.
Ah, thanks for your feedback; this is my first time contributing to Emacs so I
appreciate the pointers. Okay, I've attached an updated patch per your review
comments.
--
JJW
[-- Attachment #2: 0001-ox.el-Customize-org-export-dispatch-options.patch --]
[-- Type: text/x-patch, Size: 4983 bytes --]
From 1a5f35c6dbea99cfca66ad5c4de098ba02c73306 Mon Sep 17 00:00:00 2001
From: Jim Wisniewski <wisnij@gmail.com>
Date: Fri, 14 Apr 2023 02:46:25 -0400
Subject: [PATCH] ox.el: Customize org-export-dispatch options
* lisp/ox.el (org-export-dispatch): Add customizable variables
`org-export-body-only', `org-export-visible-only', and
`org-export-force-publishing', and use them in `org-export-dispatch'.
* doc/org-manual.org (The Export Dispatcher): Document the new export
variables.
* etc/ORG-NEWS (New customization options for ~org-export-dispatch~):
Announce the new customization options.
Currently when calling `org-export-dispatch', two of the export
options can have their defaults specified with customizable variables:
"Export scope" (via `org-export-initial-scope') and "Async export"
(via `org-export-in-background'). This change adds customizable
variables for the "Body only", "Visible only", and "Force publishing"
options as well.
---
doc/org-manual.org | 22 ++++++++++++++++++++++
etc/ORG-NEWS | 8 ++++++++
lisp/ox.el | 28 ++++++++++++++++++++++++++++
3 files changed, 58 insertions(+)
diff --git a/doc/org-manual.org b/doc/org-manual.org
index a54bd6f35..2e98793bf 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -11773,6 +11773,24 @@ further alter what is exported, and how.
in the export. Affects only those back-end formats that have
sections like =<head>...</head>= in HTML.
+ #+vindex: org-export-body-only
+ To make body-only export the default, customize the variable
+ ~org-export-body-only~.
+
+- {{{kbd(C-f)}}} ::
+ #+kindex: C-c C-e C-f
+
+ Toggle force-publishing export. Publish functions normally only
+ publish changed files (see [[**Triggering Publication]]). Forced
+ publishing causes files to be published even if their timestamps do
+ not indicate the file has been changed.
+
+ #+vindex: org-export-force-publishing
+ To make forced publishing the default, customize the variable
+ ~org-export-force-publishing~. (This is similar to
+ ~org-publish-use-timestamps-flag~, but only affects the export
+ dispatcher.)
+
- {{{kbd(C-s)}}} ::
#+kindex: C-c C-e C-s
@@ -11794,6 +11812,10 @@ further alter what is exported, and how.
certain parts of an Org document by adjusting the visibility of
particular headings. See also [[*Sparse Trees]].
+ #+vindex: org-export-visible-only
+ To make visible-only export the default, customize the variable
+ ~org-export-visible-only~.
+
** Export Settings
:PROPERTIES:
:DESCRIPTION: Common export settings.
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index b6acafc3d..59a7498a0 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -168,6 +168,14 @@ backend used for evaluation of ClojureScript.
official [[https://clojure.org/guides/deps_and_cli][Clojure CLI tools]].
The command can be customized with ~ob-clojure-cli-command~.
+*** New customization options for ~org-export-dispatch~
+
+New custom variables ~org-export-body-only~,
+~org-export-visible-only~, and ~org-export-force-publishing~ allow the
+default settings of "Body only", "Visible only", and "Force
+publishing" in the ~org-export-dispatch~ UI to be customized,
+respectively.
+
** New features
*** Add support for ~logind~ idle time in ~org-user-idle-seconds~
diff --git a/lisp/ox.el b/lisp/ox.el
index 8be60985f..af5b0abe8 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -955,6 +955,31 @@ these cases."
:group 'org-export-general
:type 'boolean)
+(defcustom org-export-body-only nil
+ "The initial \"Body only\" setting when exporting with `org-export-dispatch'.
+Non-nil means only export body code, without the surrounding
+template."
+ :group 'org-export-general
+ :package-version '(Org . "9.7")
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-export-visible-only nil
+ "The initial \"Visible only\" setting when exporting with `org-export-dispatch'.
+Non-nil means don't export the contents of hidden elements."
+ :group 'org-export-general
+ :package-version '(Org . "9.7")
+ :type 'boolean
+ :safe #'booleanp)
+
+(defcustom org-export-force-publishing nil
+ "The initial \"Force publishing\" setting when exporting with `org-export-dispatch'.
+Non-nil means force all files in the project to be published."
+ :group 'org-export-general
+ :package-version '(Org . "9.7")
+ :type 'boolean
+ :safe #'booleanp)
+
(defcustom org-export-in-background nil
"Non-nil means export and publishing commands will run in background.
Results from an asynchronous export are never displayed
@@ -7094,6 +7119,9 @@ asynchronous export stack."
(setq org-export-dispatch-last-action
(org-export--dispatch-ui
(list org-export-initial-scope
+ (and org-export-body-only 'body)
+ (and org-export-visible-only 'visible)
+ (and org-export-force-publishing 'force)
(and org-export-in-background 'async))
nil
org-export-dispatch-use-expert-ui)))
--
2.39.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH] ox.el: Customize org-export-dispatch options
2023-04-15 20:36 ` Jim Wisniewski
@ 2023-04-16 13:00 ` Ihor Radchenko
2023-04-19 21:44 ` Jim Wisniewski
0 siblings, 1 reply; 14+ messages in thread
From: Ihor Radchenko @ 2023-04-16 13:00 UTC (permalink / raw)
To: Jim Wisniewski; +Cc: emacs-orgmode
Jim Wisniewski <wisnij@gmail.com> writes:
> On Sat, Apr 15, 2023 at 5:47 AM Ihor Radchenko <yantar92@posteo.net> wrote:
>
>> Thanks! Looks like reasonable addition. See some minor comments below.
>
> Ah, thanks for your feedback; this is my first time contributing to Emacs so I
> appreciate the pointers. Okay, I've attached an updated patch per your review
> comments.
No further comments from me.
Now, need to wait until your copyright is in order.
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] ox.el: Customize org-export-dispatch options
2023-04-16 13:00 ` Ihor Radchenko
@ 2023-04-19 21:44 ` Jim Wisniewski
2023-04-20 8:48 ` Ihor Radchenko
0 siblings, 1 reply; 14+ messages in thread
From: Jim Wisniewski @ 2023-04-19 21:44 UTC (permalink / raw)
To: Ihor Radchenko; +Cc: emacs-orgmode
On Sun, Apr 16, 2023 at 8:57 AM Ihor Radchenko <yantar92@posteo.net> wrote:
> No further comments from me.
>
> Now, need to wait until your copyright is in order.
Okay, I just emailed back my signed copyright assignment.
[sorry for the double mail]
--
JJW
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] ox.el: Customize org-export-dispatch options
2023-04-19 21:44 ` Jim Wisniewski
@ 2023-04-20 8:48 ` Ihor Radchenko
2023-04-21 18:04 ` Jim Wisniewski
0 siblings, 1 reply; 14+ messages in thread
From: Ihor Radchenko @ 2023-04-20 8:48 UTC (permalink / raw)
To: Jim Wisniewski; +Cc: emacs-orgmode
Jim Wisniewski <wisnij@gmail.com> writes:
>> Now, need to wait until your copyright is in order.
>
> Okay, I just emailed back my signed copyright assignment.
Thanks! Let us know when FSF replies with a countersignature.
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] ox.el: Customize org-export-dispatch options
2023-04-20 8:48 ` Ihor Radchenko
@ 2023-04-21 18:04 ` Jim Wisniewski
2023-04-22 12:40 ` Ihor Radchenko
0 siblings, 1 reply; 14+ messages in thread
From: Jim Wisniewski @ 2023-04-21 18:04 UTC (permalink / raw)
To: Ihor Radchenko; +Cc: emacs-orgmode
On Thu, Apr 20, 2023 at 4:46 AM Ihor Radchenko <yantar92@posteo.net> wrote:
> Thanks! Let us know when FSF replies with a countersignature.
Just got it back today.
--
JJW ~ FB/Twitter: @wisnij ~ cell: (203) 722-3931
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] ox.el: Customize org-export-dispatch options
2023-04-21 18:04 ` Jim Wisniewski
@ 2023-04-22 12:40 ` Ihor Radchenko
2023-05-02 21:05 ` Jim Wisniewski
2023-05-14 13:21 ` Bastien Guerry
0 siblings, 2 replies; 14+ messages in thread
From: Ihor Radchenko @ 2023-04-22 12:40 UTC (permalink / raw)
To: Jim Wisniewski; +Cc: emacs-orgmode, Bastien
Jim Wisniewski <wisnij@gmail.com> writes:
> On Thu, Apr 20, 2023 at 4:46 AM Ihor Radchenko <yantar92@posteo.net> wrote:
>
>> Thanks! Let us know when FSF replies with a countersignature.
>
> Just got it back today.
Thanks for the update!
Bastien, may you confirm?
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] ox.el: Customize org-export-dispatch options
2023-04-22 12:40 ` Ihor Radchenko
@ 2023-05-02 21:05 ` Jim Wisniewski
2023-05-03 11:46 ` Ihor Radchenko
2023-05-14 13:21 ` Bastien Guerry
1 sibling, 1 reply; 14+ messages in thread
From: Jim Wisniewski @ 2023-05-02 21:05 UTC (permalink / raw)
To: Ihor Radchenko; +Cc: emacs-orgmode, Bastien
On Sat, Apr 22, 2023 at 8:38 AM Ihor Radchenko <yantar92@posteo.net> wrote:
> Jim Wisniewski <wisnij@gmail.com> writes:
>
> > On Thu, Apr 20, 2023 at 4:46 AM Ihor Radchenko <yantar92@posteo.net> wrote:
> >
> >> Thanks! Let us know when FSF replies with a countersignature.
> >
> > Just got it back today.
>
> Thanks for the update!
> Bastien, may you confirm?
Hi, any update here?
--
JJW
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] ox.el: Customize org-export-dispatch options
2023-04-22 12:40 ` Ihor Radchenko
2023-05-02 21:05 ` Jim Wisniewski
@ 2023-05-14 13:21 ` Bastien Guerry
2023-05-14 14:19 ` Ihor Radchenko
1 sibling, 1 reply; 14+ messages in thread
From: Bastien Guerry @ 2023-05-14 13:21 UTC (permalink / raw)
To: Ihor Radchenko; +Cc: Jim Wisniewski, emacs-orgmode
Hi,
Ihor Radchenko <yantar92@posteo.net> writes:
> Jim Wisniewski <wisnij@gmail.com> writes:
>
>> On Thu, Apr 20, 2023 at 4:46 AM Ihor Radchenko <yantar92@posteo.net> wrote:
>>
>>> Thanks! Let us know when FSF replies with a countersignature.
>>
>> Just got it back today.
>
> Thanks for the update!
> Bastien, may you confirm?
Yes I do, sorry for the delay.
--
Bastien Guerry
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] ox.el: Customize org-export-dispatch options
2023-04-15 4:48 [PATCH] ox.el: Customize org-export-dispatch options Jim Wisniewski
2023-04-15 9:49 ` Ihor Radchenko
@ 2023-04-15 11:08 ` Max Nikulin
1 sibling, 0 replies; 14+ messages in thread
From: Max Nikulin @ 2023-04-15 11:08 UTC (permalink / raw)
To: Jim Wisniewski, emacs-orgmode
On 15/04/2023 11:48, Jim Wisniewski wrote:
> I almost always
> export with "Body only" switched on, and I got tired of manually toggling it
> each time
I believed it is annoying till I discovered that with universal argument
(C-u C-c C-e) export dispatcher uses options and format selected
previous time.
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2023-05-14 18:36 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-15 4:48 [PATCH] ox.el: Customize org-export-dispatch options Jim Wisniewski
2023-04-15 9:49 ` Ihor Radchenko
2023-04-15 20:36 ` Jim Wisniewski
2023-04-16 13:00 ` Ihor Radchenko
2023-04-19 21:44 ` Jim Wisniewski
2023-04-20 8:48 ` Ihor Radchenko
2023-04-21 18:04 ` Jim Wisniewski
2023-04-22 12:40 ` Ihor Radchenko
2023-05-02 21:05 ` Jim Wisniewski
2023-05-03 11:46 ` Ihor Radchenko
2023-05-14 13:21 ` Bastien Guerry
2023-05-14 14:19 ` Ihor Radchenko
2023-05-14 18:35 ` Jim Wisniewski
2023-04-15 11:08 ` Max Nikulin
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).