emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Bjarte Johansen <bjarte.johansen@infomedia.uib.no>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Make ob-shell conform to the org-babel interface
Date: Mon, 01 Jun 2015 19:18:09 +0200	[thread overview]
Message-ID: <877frntkj2.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <3651FC40-E9B3-4027-91D7-DD03147591C4@infomedia.uib.no> (Bjarte Johansen's message of "Wed, 27 May 2015 17:30:27 +0200")

Hello,

Bjarte Johansen <bjarte.johansen@infomedia.uib.no> writes:

> I found that ob-shell’s org-babel-variable-assignments:bash function
> does not respect the interface for org-babel. It takes multiple
> arguments when it should only take 1. This is a problem when f.ex.
> org-babel-sha1-hash tries to expand the body of a bash source block
> and tries to call that function with only 1 argument.
>
> I am not sure if the following patch follows best practices in the
> project, but it solves the problem for me.

Thank you for the patch. Some comments follow.

> From 04f00e4f69c5352d51b7de1ba8783ddd96124c1f Mon Sep 17 00:00:00 2001
> From: Bjarte Johansen <bjarte.johansen@gmail.com>
> Date: Wed, 27 May 2015 17:20:41 +0200
> Subject: [PATCH] ob-shell: Conform to variable assignment interface

You need to list modified functions in commit message.


> Change org-babel-variable-assignments functions in ob-shell to use the
> same function so conform to the interface used for variable assignment
> in org-babel.

"Org Babel"

> +(ert-deftest test-ob-shell/should-respect-ob-interface-naming-convention ()
> +  "Functions used to interface with the different org-babel
> +  should have the correct signature."

"Org Babel".

Also, do not indent second line, and please make first sentence fit on
a single line.

> +  (dolist (shell org-babel-shell-names)
> +    (org-test-with-temp-text
> +	(format "#+BEGIN_SRC<point> %s :cache yes
> +  echo test
> +#+END_SRC" shell)
> +      (let ((info (org-babel-get-src-block-info)))
> +	(org-babel-sha1-hash info)))))

You need to wrap this within a `should' in order to define a proper
test.


Regards,

-- 
Nicolas Goaziou

  reply	other threads:[~2015-06-01 17:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-27 15:30 Make ob-shell conform to the org-babel interface Bjarte Johansen
2015-06-01 17:18 ` Nicolas Goaziou [this message]
2015-06-03 10:58   ` Bjarte Johansen

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=877frntkj2.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=bjarte.johansen@infomedia.uib.no \
    --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).