emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Lawrence Mitchell <wence@gmx.li>
To: emacs-orgmode@gnu.org
Subject: Re: [PATCH 2/2] lisp/ob.el: Don't modify babel info when hashing it
Date: Fri, 03 Jun 2011 09:33:57 +0100	[thread overview]
Message-ID: <m3aadzuxe2.fsf@e4300lm.epcc.ed.ac.uk> (raw)
In-Reply-To: 87y61k9jil.fsf@gmail.com

Eric Schulte wrote:
> Hi Lawrence,

> Is there a reason to make this copy?  Given that params is used like a
> hash/dictionary the order of it's elements should not matter.  Is there
> a case where this patch is necessary to avoid buggy behavior?

Ah, but the sorting is happening so that the hashing function is
stable to changes in the order of the arguments, no?  So I think
sorting is necessary.  At least, the sort was already there, I've
just added the copy-sequence.

> If so then I'm happy to apply the patch, but if there is no need then
> I'd rather avoid the (admittedly small) overhead of making a copy of the
> params list.

[...]

It seems to be necessary to correctly link to the produced
graphics output from (say) R plotting if :cache yes is specified.
Try this without the patch:

* header
#+begin_src R :cache yes :exports results :file plot.png :results graphics
  curve(1*x, from=1, to=10, lwd=2)
#+end_src

#+results:

and evaluate the code block, we get:

#+results[4d3e7ef5e40f7b608d400c310401c15e913a22c0]:
: plot.png

Rather than the (correct):
#+results[4d3e7ef5e40f7b608d400c310401c15e913a22c0]:
[[file:plot.png]]

The problem is that (sort v 'string<) destructively modifies v,
and in this case, that means that the "file" argument to
:result-params in thrown away.

Lawrence
-- 
Lawrence Mitchell <wence@gmx.li>

  reply	other threads:[~2011-06-03  8:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-02 10:04 [PATCH 1/2] lisp/ob.el: Fix org-babel-result-regexp to match users Lawrence Mitchell
2011-06-02 10:04 ` [PATCH 2/2] lisp/ob.el: Don't modify babel info when hashing it Lawrence Mitchell
2011-06-02 18:22   ` Eric Schulte
2011-06-03  8:33     ` Lawrence Mitchell [this message]
2011-06-02 18:20 ` [PATCH 1/2] lisp/ob.el: Fix org-babel-result-regexp to match users Eric Schulte

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=m3aadzuxe2.fsf@e4300lm.epcc.ed.ac.uk \
    --to=wence@gmx.li \
    --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).