all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Charles C. Berry" <ccberry@ucsd.edu>
To: Daniele Pizzolli <dan@toel.it>
Cc: org-mode mailing list <emacs-orgmode@gnu.org>
Subject: Re: idempotency and inconsistency for org-babel-remove-inline-result
Date: Fri, 30 Jan 2015 11:13:45 -0800	[thread overview]
Message-ID: <alpine.OSX.2.00.1501301045510.411@charles-berrys-macbook.local> (raw)
In-Reply-To: <86fvasqmpb.fsf@me.localhost.invalid>

On Fri, 30 Jan 2015, Daniele Pizzolli wrote:

> Hello,
>
> I really like the new inline results.  Thanks for this new cool feature.
> I have only a few problems with it.
>

Thanks for your feedback.

> Is there a way to evaluate a buffer an then remove inline results or
> better, to get the very same buffer after:
>
> (org-babel-execute-buffer)
> (org-babel-map-inline-src-blocks nil (org-babel-remove-inline-result))
>
> Every call add an extra white space:
>
> Original:
>
> 1 + 4 in R is src_R[:exports results]{1+4}.
>
> After (org-babel-execute-buffer):
>
> 1 + 4 in R is src_R[:exports results]{1+4} {{{results(5)}}}.
>
> After: (org-babel-map-inline-src-blocks nil (org-babel-remove-inline-result))
>
> 1 + 4 in R is src_R[:exports results]{1+4} .
>
> After (org-babel-execute-buffer):
>
> 1 + 4 in R is src_R[:exports results]{1+4} {{{results(5)}}} .
>
> And so on...
>
> I see that the function docs says: Extraneous leading whitespace is
> trimmed. Is this the intended result?
>

It is intended to remove `extraneous' whitespace. But the way
`extraneous' is operationalized leaves something to be desired if
users wish to do as you have done. Maybe preserving whitespace (if any)
after the result and deleting all that is before it might work.

I'll take a look at changing the defn to deal with your ECM.


>
> Also, is there anything that prevents to make
> org-babel-remove-inline-result interactive as is
> org-babel-remove-result?

AFAICS, no.

> Wwhy not have also
> org-babel-remove-inline-result-one-or-many and
> org-babel-remove-all-result-one-or-many to remove all the babel result
> with one function call?

Easy enough, but is this really needed? What about call block/line 
results?

>
> I do no not know lisp a lot, but I can try to submit a patch if you
> agree that will be useful.
>

The main issue (IMO) is figuring out what whitespace to delete around
a `{{{results(...)}}}' macro. I can get to this in a day or so, but
feel free to send a patch.

Chuck

  reply	other threads:[~2015-01-30 19:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-30 16:04 idempotency and inconsistency for org-babel-remove-inline-result Daniele Pizzolli
2015-01-30 19:13 ` Charles C. Berry [this message]
2015-01-30 23:06   ` Daniele Pizzolli
2015-01-31  4:13     ` [RFC] removing all results WAS: Re: idempotency ... org-babel-remove-inline-result Charles C. Berry
2015-01-31  8:34       ` Nicolas Goaziou
2015-01-31 19:08         ` Charles C. Berry
2015-01-31 23:05           ` Nicolas Goaziou
2015-01-31 11:31       ` Daniele Pizzolli
2015-01-31 20:00         ` Charles C. Berry
2015-02-03 18:19           ` Charles C. Berry
2015-02-04  8:59             ` Daniele Pizzolli

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.OSX.2.00.1501301045510.411@charles-berrys-macbook.local \
    --to=ccberry@ucsd.edu \
    --cc=dan@toel.it \
    --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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.