From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH] inline src block results can be removed Date: Mon, 17 Nov 2014 00:23:37 +0100 Message-ID: <87zjbqrapy.fsf@nicolasgoaziou.fr> References: <87egt81acy.fsf@gmail.com> <8761ejq9ek.fsf@nicolasgoaziou.fr> <87sihltt3v.fsf@selenimh.mobile.lan> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52659) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xq99k-0006bu-I6 for emacs-orgmode@gnu.org; Sun, 16 Nov 2014 18:23:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xq99c-0006AD-Os for emacs-orgmode@gnu.org; Sun, 16 Nov 2014 18:22:56 -0500 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:33137) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xq99c-0006A4-DQ for emacs-orgmode@gnu.org; Sun, 16 Nov 2014 18:22:48 -0500 In-Reply-To: (Charles C. Berry's message of "Sat, 15 Nov 2014 12:22:22 -0800") 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: "Charles C. Berry" Cc: Aaron Ecay , Andreas Leha , emacs-orgmode@gnu.org, Ista Zahn , mcg "Charles C. Berry" writes: > For now, I'd be willing to make patches that will allow removal of the > inline src block results that do *not* involve these header args: > > - :file > - :wrap > - :results latex html drawer org code > > which I can do barely touching `org-babel-insert-result' and this > simplifies matters a lot. IMO, we're too much focused on the implementation details. We ought to agree on what should be done first. For example, considering `org-babel-insert-result' and its RESULT-PARAMS argument, I think the following makes sense: | Param | Example output | |---------+-----------------------------------| | default | {{{results(42)}}} | | file | {{{results(file:something.pdf)}}} | | list | | | raw | 42 | | drawer | | | org | {{{results(src_org{...})}}} | | html | {{{results(@@html:...@@)}}} | | latex | {{{results(@@latex:...@@)}}} | | code | {{{results(src_xxx{...})}}} | Basically, it should be possible to remove any kind of result using "results" macro, with the exception of "raw". "list" and "drawer" can be ignored since there is no inline equivalent. Another option for "drawer" is to also use export snippets. So, basically, "drawer something" would generate {{{results(@@something:...@@)}}}. > I propose to do this by using the patches of ox.el and ob-exp.el from > my last post. For ob-core.el, I would > > - leave defcustom org-babel-inline-wrap as "=%s=" (or use defconst - I > do not have a strong opinion either way). `org-babel-inline-wrap' as a defcustom is fine if you hardcode {{{results(...)}}} wrapping at a higher level. > - modify `org-babel-examplify-region' along these lines > #+BEGIN_SRC emacs-lisp > (insert > (replace-regexp-in-string > "," "\\," > (format > (concat "{{{results(" > org-babel-inline-result-wrap > ")}}}" > (prog1 (buffer-substring beg end) > (delete-region beg end)))) > nil t)) > > #+END_SRC But this is unrelated to "examplify". Wrapping should probably be a dedicated function systematically called on results from an inline block. > If it is felt that more retooling of `org-babel-insert-results' is really > needed, I can get to it early next year. In fact, I'll be out of email > range from late this month till then, so any problems I create now will > have to wait till then for me to work on them. It's going to be difficult not to alter `org-babel-insert-results' since the plan is to change completely how inline source blocks are handled. There's no rush, however. Non-removable results from inline source blocks have been there for a long time. Regards,