From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: "Charles C. Berry" <ccberry@ucsd.edu>
Cc: Org-Mode mailing list <emacs-orgmode@gnu.org>
Subject: Re: [PATCH] Re: HTML export with ":export" parameter with Orgmode 9.0
Date: Sun, 13 Nov 2016 09:02:36 +0100 [thread overview]
Message-ID: <87bmxjst7n.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <alpine.OSX.2.20.1611121857480.3656@charles-berrys-macbook.local> (Charles C. Berry's message of "Sat, 12 Nov 2016 19:09:28 -0800")
Hello,
"Charles C. Berry" <ccberry@ucsd.edu> writes:
> OK. I changed the name to `org-export-process-with-babel', which
> I hope suggests more profound actions than
> `org-export-babel-evaluate'.
Thank you.
Thinking about it, wouldn't `org-export-use-babel' or even
`org-export-with-babel' (as `org-export-with-author'...) be simpler and
yet, as clear?
> I think the attached patch does this properly, but this is my first
> use of `define-obsolete-function-alias', so it might be best to check
> what I have done.
It looks good.
> From 3885129980a02eb0d4694e9e15888dea6ee95c60 Mon Sep 17 00:00:00 2001
> From: Charles Berry <ccberry@ucsd.edu>
> Date: Sat, 12 Nov 2016 18:54:20 -0800
> Subject: [PATCH] make-obsolete-variable `org-export-babel-evaluate'
What about:
Replace `org-export-babel-evaluate' with `org-export-process-with-babel'
> * doc/org.texi: Better explain what the variable
> `org-export-process-with-babel' does.
>
> * lisp/ob-exp.el: Small docstring change.
>
> * lisp/org-compat.el: Define `org-export-babel-evaluate' as the
> obsolete alias for `org-export-process-with-babel'.
>
> * lisp/ox-icalendar.el, lisp/ox.el, testing/lisp/test-ob-exp.el,
> testing/lisp/test-ob-lob.el, testing/lisp/test-ox.el: Change the
> obsolete variable name in many places.
Could you also specify the functions, or the manual section, being
modified?
OTOH, I don't think the chande made to "org-compat" requires an entry.
> Users were often confused that setting this variable to nil will cause
> header arguments to be ignored in addition to preventing code from
> being evaluated. It is hoped that the documentation changes and the
> name `org-export-process-with-babel' will better convey that everything
> babel does can be switched off with this variable.
> ---
> doc/org.texi | 24 +++++++++++++-----------
> lisp/ob-exp.el | 12 ++++++------
> lisp/org-compat.el | 2 ++
> lisp/ox-icalendar.el | 2 +-
> lisp/ox.el | 2 +-
> testing/lisp/test-ob-exp.el | 36 ++++++++++++++++++------------------
> testing/lisp/test-ob-lob.el | 2 +-
> testing/lisp/test-ox.el | 2 +-
> 8 files changed, 43 insertions(+), 39 deletions(-)
>
> diff --git a/doc/org.texi b/doc/org.texi
> index ede2352..81364d2 100644
> --- a/doc/org.texi
> +++ b/doc/org.texi
> @@ -14938,17 +14938,19 @@ Both the code block and its results will be exported.
> Neither the code block nor its results will be exported.
> @end table
>
> -It is possible to inhibit the evaluation of code blocks during export.
> -Setting the @code{org-export-babel-evaluate} variable to @code{nil} will
> -ensure that no code blocks are evaluated as part of the export process. This
> -can be useful in situations where potentially untrusted Org mode files are
> -exported in an automated fashion, for example when Org mode is used as the
> -markup language for a wiki. It is also possible to set this variable to
> -@code{inline-only}. In that case, only inline code blocks will be
> -evaluated, in order to insert their results. Non-inline code blocks are
> -assumed to have their results already inserted in the buffer by manual
> -evaluation. This setting is useful to avoid expensive recalculations during
> -export, not to provide security.
> +It is possible to inhibit the evaluation of code blocks and ignore header
> +arguments during export. Setting the @code{org-export-process-with-babel}
> +variable to @code{nil} will ensure that no code blocks are evaluated as part
> +of the export process. This can be useful in situations where potentially
> +untrusted Org mode files are exported in an automated fashion, for example
Nitpick: Org files
> +when Org mode is used as the markup language for a wiki. No header arguments
Nitpick: when Org is used as ...
Rationale : in both case, we refer to Org as a markup language, not as
an editing mode.
> +will be processed. For this reason it is often better to set `:eval
> +never-export' to prevent code evaluation but still allow headers to be
> +honored. It is also possible to set this variable to @code{inline-only}. In
> +that case, only inline code blocks will be evaluated, in order to insert
> +their results. Non-inline code blocks are assumed to have their results
> +already inserted in the buffer by manual evaluation. This setting is useful
> +to avoid expensive recalculations during export, not to provide
> security.
Could you add
@vindex org-export-process-with-babel
above the whole paragraph?
> Code blocks in commented subtrees (@pxref{Comment lines}) are never evaluated
> on export. However, code blocks in subtrees excluded from export
> diff --git a/lisp/ob-exp.el b/lisp/ob-exp.el
> index 6aebcd5..1d77e6a 100644
> --- a/lisp/ob-exp.el
> +++ b/lisp/ob-exp.el
> @@ -38,10 +38,10 @@
>
> (defvar org-src-preserve-indentation)
>
> -(defcustom org-export-babel-evaluate t
> - "Switch controlling code evaluation during export.
> +(defcustom org-export-process-with-babel t
> + "Switch controlling code evaluation and header processing during export.
> When set to nil no code will be evaluated as part of the export
> -process and no header argumentss will be obeyed. When set to
> +process and no header arguments will be obeyed. When set to
> `inline-only', only inline code blocks will be executed. Users
> who wish to avoid evaluating code on export should use the header
> argument `:eval never-export'."
> @@ -50,7 +50,7 @@ argument `:eval never-export'."
> :type '(choice (const :tag "Never" nil)
> (const :tag "Only inline code" inline-only)
> (const :tag "Always" t)))
> -(put 'org-export-babel-evaluate 'safe-local-variable #'null)
> +(put 'org-export-process-with-babel 'safe-local-variable #'null)
I think it is cleaner to add :safe #'null in the defcustom.
Regards,
--
Nicolas Goaziou
next prev parent reply other threads:[~2016-11-13 8:02 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-08 13:30 HTML export with ":export" parameter with Orgmode 9.0 Frederick Giasson
2016-11-11 9:33 ` Nicolas Goaziou
2016-11-11 14:11 ` Frederick Giasson
2016-11-11 17:21 ` Charles C. Berry
2016-11-11 18:15 ` Frederick Giasson
2016-11-12 3:21 ` Charles C. Berry
2016-11-12 11:00 ` Nicolas Goaziou
2016-11-13 3:09 ` [PATCH] " Charles C. Berry
2016-11-13 8:02 ` Nicolas Goaziou [this message]
2016-11-13 23:38 ` Charles C. Berry
2016-11-14 7:43 ` Nicolas Goaziou
2016-11-14 13:32 ` Frederick Giasson
2016-11-11 17:10 ` Frederick Giasson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bmxjst7n.fsf@nicolasgoaziou.fr \
--to=mail@nicolasgoaziou.fr \
--cc=ccberry@ucsd.edu \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).