emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [PATCH] Add support for Babel with Eshell, (updated PATCH)


From: Nicolas Goaziou
Subject: Re: [O] [PATCH] Add support for Babel with Eshell, (updated PATCH)
Date: Mon, 23 Apr 2018 11:34:59 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Hello,

stardiviner <address@hidden> writes:

> From 596da7b0384d64f3c1c22a49bc9bced8d0d8abf8 Mon Sep 17 00:00:00 2001
> From: stardiviner <address@hidden>
> Date: Sun, 22 Apr 2018 09:37:40 +0800
> Subject: [PATCH] ob-eshell.el: Add Eshell support for Babel.

Thank you. This could go into master branch once Org 9.2 is out.

>  | D          | d          | ditaa          | ditaa      |
>  | Graphviz   | dot        | Emacs Calc     | calc       |
>  | Emacs Lisp | emacs-lisp | Fortran        | fortran    |
> +| Shell      | sh         | Eshell         | eshell     |
>  | Gnuplot    | gnuplot    | Haskell        | haskell    |
>  | Java       | java       | Javascript     | js         |
>  | LaTeX      | latex      | Ledger         | ledger     |

Shell sh pair is already defined later in the table (ordered
alphabetically). Those are spurious.

> +;; Org-Babel support for evaluating Eshell source code.

Org Babel support....

> +(defvar org-babel-default-header-args:eshell '())
> +
> +(defun org-babel-execute:eshell (body params)
> +  "Execute a block of Eshell code.
> +This function is called by `org-babel-execute-src-block'."

Could you expound a bit and explain what are the arguments, i.e., BODY
and PARAMS?

> +(defun org-babel-prep-session:eshell (session params)
> +  "Prepare SESSION according to the header arguments specified in PARAMS."
> +  (let* ((session (org-babel-eshell-initiate-session session))
> +      ;; Eshell session buffer is read from variable `eshell-buffer-name'.
> +      (eshell-buffer-name session)
> +      (var-lines (org-babel-variable-assignments:eshell params)))
> +    (call-interactively 'eshell)

    #'eshell

> +    (dolist (var-line var-lines)
> +      (eshell-command var-line))

    (mapc #'eshell-command var-lines)

> +    session))
> +
> +(defun ob-eshell-session-live-p (session)
> +  "Detect Eshell SESSION exist."

"Non-nil if Eshell SESSION exists."

> +  (and (get-buffer session) t))

Simply:

    (get-buffer session)

> +;;; test-ob-eshell.el
> +
> +;; Copyright (c) 2010-2014 Eric Schulte

I don't think so ;)

Barring the minor comments above, it looks good.

Could you send an updated patch?

Regards,

-- 
Nicolas Goaziou



reply via email to

[Prev in Thread] Current Thread [Next in Thread]