From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Bjarte Johansen <bjarte.johansen@infomedia.uib.no>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: ob-sed
Date: Wed, 27 May 2015 23:31:41 +0200 [thread overview]
Message-ID: <877frtd7wi.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <D5085DF7-B664-4969-8122-2D5093E55E84@infomedia.uib.no> (Bjarte Johansen's message of "Wed, 27 May 2015 10:56:17 +0200")
Hello,
Bjarte Johansen <bjarte.johansen@infomedia.uib.no> writes:
> I had loosely based it on my own ob-sparql and ob-awk, I saw that
> there was a remnant of ob-sparql left in there. Here is an updated
> version.
Thank you. Some comments follow.
> ;;; ob-sed.el --- org-babel functions for sed scripts
>
> ;; Copyright (C) 2015 Bjarte Johansen
You need to change the copyright to Free Software Foundation, Inc.
>
> ;; Author: Bjarte Johansen
> ;; Keywords: literate programming, reproducible research
> ;; Version: 0.1.0
You will need to add "This file is part of GNU Emacs."
> ;; Provides a way to evaluate sed scripts in org-mode.
org-mode -> Org mode
> (defvar org-babel-sed-command "sed")
Missing docstring.
> (defun org-babel-execute:sed (body params)
> "Execute a block of sed code with org-babel. This function is
> called by `org-babel-execute-src-block'"
org-babel -> Org Babel
"This function is" should be moved to a new line, not on the summary
line. BODY and PARAMS ought to be explained.
> (message "executing sed source code block")
> (let* ((result-params (cdr (assoc :result-params params)))
`assoc' -> `assq' (same goes for other occurrences)
> (cmd-line (cdr (assoc :cmd-line params)))
> (in-file (cdr (assoc :in-file params)))
:cmd-line and :in-file look like sed-specific header arguments. If
that's correct, you should create a defconst,
`org-babel-header-args:sed' and list them here, probably with :any
value.
> (cmd (mapconcat #'identity (remove nil (list org-babel-sed-command
> "-f" code-file
> cmd-line
> in-file))
> " ")))
`remove' -> `remq'
Bonus points for tests, too. Also, "org.texi" needs to be updated.
Regards,
--
Nicolas Goaziou
next prev parent reply other threads:[~2015-05-27 21:30 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-27 8:51 ob-sed Bjarte Johansen
2015-05-27 8:56 ` ob-sed Bjarte Johansen
2015-05-27 21:31 ` Nicolas Goaziou [this message]
2015-05-28 11:47 ` ob-sed Bjarte Johansen
2015-05-29 9:00 ` ob-sed Nicolas Goaziou
2015-05-29 13:32 ` ob-sed Bjarte Johansen
2015-05-29 17:08 ` ob-sed Suvayu Ali
2015-05-30 12:32 ` ob-sed Nicolas Goaziou
2015-05-30 12:36 ` ob-sed Bjarte Johansen
2015-05-30 13:01 ` ob-sed Nicolas Goaziou
2015-05-31 2:08 ` ob-sed Nick Dokos
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=877frtd7wi.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).