From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: [PATCH] Add 'inline-only option to org-export-babel-evaluate Date: Tue, 02 Apr 2013 16:14:19 -0600 Message-ID: <87bo9wr33z.fsf@gmail.com> References: <1364795085-14578-1-git-send-email-aaronecay@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:44460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UN9Ue-0005aI-Fi for emacs-orgmode@gnu.org; Tue, 02 Apr 2013 18:15:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UN9Ud-0000RW-1o for emacs-orgmode@gnu.org; Tue, 02 Apr 2013 18:15:52 -0400 Received: from mail-pd0-f175.google.com ([209.85.192.175]:59850) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UN9Uc-0000RG-N1 for emacs-orgmode@gnu.org; Tue, 02 Apr 2013 18:15:50 -0400 Received: by mail-pd0-f175.google.com with SMTP id g10so256043pdj.20 for ; Tue, 02 Apr 2013 15:15:50 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Aaron Ecay Cc: emacs-orgmode@gnu.org I'm happy to apply this patch, however please also supply a patch which updates the corresponding documentation. Thanks! Aaron Ecay writes: > * lisp/ob-exp.el (org-export-babel-evaluate): Update defcustom to > provide 'inline-only option > (org-babel-exp-results): Implement 'inline-only for > org-export-babel-evaluate > > This is useful because there is no way for inline results to be stored. > The imagined usecase is that all non-inline source blocks will be > evaluated manually by the user. Inline blocks, however, must be > evaluated during export, or they will be simply deleted by the exporter. > --- > lisp/ob-exp.el | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) > > diff --git a/lisp/ob-exp.el b/lisp/ob-exp.el > index 0d98690..6783bd5 100644 > --- a/lisp/ob-exp.el > +++ b/lisp/ob-exp.el > @@ -52,10 +52,13 @@ > (defcustom org-export-babel-evaluate t > "Switch controlling code evaluation during export. > When set to nil no code will be evaluated as part of the export > -process." > +process. When set to 'inline-only, only inline code blocks will > +be executed." > :group 'org-babel > :version "24.1" > - :type 'boolean) > + :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 (lambda (x) (eq x nil))) > > (defun org-babel-exp-get-export-buffer () > @@ -378,7 +381,9 @@ Results are prepared in a manner suitable for export by org-mode. > This function is called by `org-babel-exp-do-export'. The code > block will be evaluated. Optional argument SILENT can be used to > inhibit insertion of results into the buffer." > - (when (and org-export-babel-evaluate > + (when (and (or (eq org-export-babel-evaluate t) > + (and (eq type 'inline) > + (eq org-export-babel-evaluate 'inline-only))) > (not (and hash (equal hash (org-babel-current-result-hash))))) > (let ((lang (nth 0 info)) > (body (if (org-babel-noweb-p (nth 2 info) :eval) -- Eric Schulte http://cs.unm.edu/~eschulte