emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Aaron Ecay <aaronecay@gmail.com>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>,
	"Charles C. Berry" <ccberry@ucsd.edu>
Cc: mcg <giepen.m@googlemail.com>,
	Andreas Leha <andreas.leha@med.uni-goettingen.de>,
	emacs-orgmode@gnu.org, Ista Zahn <istazahn@gmail.com>
Subject: Re: [PATCH] inline src block results can be removed
Date: Fri, 14 Nov 2014 23:04:06 +0000	[thread overview]
Message-ID: <877fyx1j15.fsf@gmail.com> (raw)
In-Reply-To: <87sihltt3v.fsf@selenimh.mobile.lan>

Hi Chuck, Hi Nicolas,

I had a response to Chuck’s earlier message that was sitting around
waiting to be finished...time marches on however.  Apologies.  I think
the following bit is the only part that’s potentially still relevant:

> 
> I don't think the usual #+MACRO works here, as the definition would be 
> found in `org-macro-templates' by the first call and existing stuff would 
> be expanded instead of being left for babel to remove it. 

I see what you mean.  One option might be to do the following in
org-export-as (untested pseudocode):

(org-macro-initialize-templates)
(let (results-macro)
  (setq results-macro (assoc "results" org-macro-templates))
  (setq org-macro-templates (remove results-macro org-macro-templates))
  (org-macro-replace-all org-macro-templates)
  (org-export-execute-babel-code)
  (org-macro-replace-all (list (or results-macro
                                   (cons "results"
                                         org-default-result-macro) ;; new defcustom or defvar
                                   ))))

Back to the present:

2014ko azaroak 14an, Nicolas Goaziou-ek idatzi zuen:
> 
> "Charles C. Berry" <ccberry@ucsd.edu> writes:
> 
>> More patches (as you can see). Now ox.el, ob-core.el, and ob-exp.el
>> are patched.
> 
> Thanks.
> 
>> Also, the user can customize org-babel-inline-result-wrap to always
>> get verbatim or otherwise wrap the contents of the macro.
> 
> I don't think this is a good idea.
> 
> If we rely on the macro recognition to properly inline results, setting
> to anything else would break Org. It should be a defconst or we are
> bound to shoot ourselves in the foot.
> 
> If a user wants verbatim output, he will have to somehow generate
> {{{results:=output=}}}, e.g., through appropriate code or parameters.

This is a step back from the present situation, where a user can get
a custom format applied by default to all inline results by setting
‘org-babel-inline-result-wrap’.  I think it’s reasonable for users to
want to set off babel results in a special font (to indicate that
they are automatically generated, e.g.)  This proposal would add an
additional overhead for generating this formatting to every inline
call.

I think the method I sketched above will allow users to redefine the
results macro in the same way as any other macro (via #+MACRO), thus
allowing the possibility of user-specified special formatting.

[...]

>> * lisp/ob-core.el (org-babel-inline-result-wrap): Default is
>> "{{{results(%s)}}}".
> 
> As written earlier, I highly suggest to make it a defconst.

Indeed, this seems correct.  (The “const” designation is just a hint to
users/developers – it doesn’t affect the ability of people who really
want to customize the value to setq it to something else in their init
file.)

> With {{{results(@@backend:...@@)}}}, we don't need the extra trick. Even
> if it is more verbose, I think a regular syntax is better.

This doesn’t mesh with the suggestion to allow the results macro to
supply formatting.

-- 
Aaron Ecay

  reply	other threads:[~2014-11-14 23:04 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-12  0:49 [PATCH] inline src block results can be removed Charles C. Berry
2014-11-12  1:10 ` Andreas Leha
2014-11-12  6:58   ` Charles C. Berry
2014-11-12 19:34 ` Aaron Ecay
2014-11-12 23:47   ` Charles C. Berry
2014-11-13 17:48     ` Nicolas Goaziou
2014-11-13 19:06       ` Andreas Leha
2014-11-14 17:43       ` Charles C. Berry
2014-11-14 20:39         ` Nicolas Goaziou
2014-11-14 23:04           ` Aaron Ecay [this message]
2014-11-16  0:10             ` Nicolas Goaziou
2014-11-15 20:22           ` Charles C. Berry
2014-11-16 23:23             ` Nicolas Goaziou
2014-11-24  9:48               ` Daniele Pizzolli
2014-11-24 10:18                 ` Andreas Leha
2015-01-13  0:48               ` New patches WAS " Charles C. Berry
2015-01-16 22:41                 ` Nicolas Goaziou
2015-01-19  3:22                   ` Charles C. Berry
2015-01-19 17:53                     ` Nicolas Goaziou
2015-01-19 19:31                       ` Charles C. Berry
2015-01-20 23:30                         ` Nicolas Goaziou
2015-01-22  3:07                           ` Charles C. Berry
2015-01-22 23:08                             ` Nicolas Goaziou
2015-01-24 22:47                               ` Charles C. Berry
2015-01-25  1:14                                 ` Aaron Ecay
2015-01-25  5:01                                   ` Charles C. Berry
2015-01-29 20:31                               ` Charles C. Berry
2015-01-17  3:22                 ` Aaron Ecay
2015-01-17 22:20                   ` Nicolas Goaziou
2015-01-18 19:13                     ` Aaron Ecay
2015-01-18 22:34                       ` Nicolas Goaziou
2015-01-18 22:55                         ` Aaron Ecay
  -- strict thread matches above, loose matches on Subject: below --
2014-11-24 11:12 Daniele Pizzolli
2014-11-25  8:04 ` Daniele Pizzolli
2014-11-25  9:52   ` Andreas Leha

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=877fyx1j15.fsf@gmail.com \
    --to=aaronecay@gmail.com \
    --cc=andreas.leha@med.uni-goettingen.de \
    --cc=ccberry@ucsd.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=giepen.m@googlemail.com \
    --cc=istazahn@gmail.com \
    --cc=mail@nicolasgoaziou.fr \
    /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).