emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* a patch to ob-lisp.el
@ 2016-03-26 16:02 stardiviner
  2016-03-28  4:01 ` Nick Dokos
  0 siblings, 1 reply; 12+ messages in thread
From: stardiviner @ 2016-03-26 16:02 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 196 bytes --]


Here is my repo, and I also created an recipe on MELPA.

- http://gituhb.com/stardiviner/ob-lisp
- https://github.com/melpa/melpa/pull/3682

I hope to merge this patch to Org-mode `ob-lisp.el`.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: ob-lisp patch --]
[-- Type: text/x-diff, Size: 4797 bytes --]

1c1
< ;;; ob-lisp.el --- org-babel functions for common lisp evaluation with SLY or SLIME.
---
> ;;; ob-lisp.el --- org-babel functions for common lisp evaluation
3c3
< ;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
---
> ;; Copyright (C) 2009-2016 Free Software Foundation, Inc.
5,11c5,9
< ;; Authors: stardiviner <numbchild@gmail.com>
< ;; Maintainer: stardiviner <numbchild@gmail.com>
< ;; Keywords: org babel lisp sly slime
< ;; URL: https://github.com/stardiviner/ob-lisp
< ;; Created: 1th March 2016
< ;; Version: 0.0.1
< ;; Package-Requires: ((org "8"))
---
> ;; Authors: Joel Boehland
> ;;	 Eric Schulte
> ;;	 David T. O'Toole <dto@gnu.org>
> ;; Keywords: literate programming, reproducible research
> ;; Homepage: http://orgmode.org
30c28
< ;;; Support for evaluating Common Lisp code, relies on SLY or SLIME for all eval.
---
> ;;; support for evaluating common lisp code, relies on slime for all eval
34,37c32,33
< ;; Requires SLY (Sylvester the Cat's Common Lisp IDE) and SLIME
< ;; See:
< ;; - https://github.com/capitaomorte/sly
< ;; - http://common-lisp.net/project/slime/
---
> ;; Requires SLIME (Superior Lisp Interaction Mode for Emacs.)
> ;; See http://common-lisp.net/project/slime/
42,50c38
< (defcustom org-babel-lisp-eval-fn "sly-eval"
<   "The function to be called to evaluate code on the Lisp side."
<   :group 'org-babel
<   :version "24.1"
<   :options '("sly-eval" "slime-eval")
<   :type 'stringp)
< 
< 
< ;; (declare-function sly-eval "ext:sly" (sexp &optional package))
---
> (declare-function slime-eval "ext:slime" (sexp &optional package))
70,80c58,68
<          (result-params (cdr (assoc :result-params params)))
<          (print-level nil) (print-length nil)
<          (body (org-babel-trim
<                 (if (> (length vars) 0)
<                     (concat "(let ("
<                             (mapconcat
<                              (lambda (var)
<                                (format "(%S (quote %S))" (car var) (cdr var)))
<                              vars "\n      ")
<                             ")\n" body ")")
<                   body))))
---
> 	 (result-params (cdr (assoc :result-params params)))
> 	 (print-level nil) (print-length nil)
> 	 (body (org-babel-trim
> 		(if (> (length vars) 0)
> 		    (concat "(let ("
> 			    (mapconcat
> 			     (lambda (var)
> 			       (format "(%S (quote %S))" (car var) (cdr var)))
> 			     vars "\n      ")
> 			    ")\n" body ")")
> 		  body))))
82,83c70,71
<             (member "pp" result-params))
<         (format "(pprint %s)" body)
---
> 	    (member "pp" result-params))
> 	(format "(pprint %s)" body)
86d73
< ;;;###autoload
88,91c75,76
<   "Execute a block `BODY' with `PARAMS' of Common Lisp code with Babel."
<   (pcase org-babel-lisp-eval-fn
<     ("slime-eval" (require 'slime))
<     ("sly-eval" (require 'sly)))
---
>   "Execute a block of Common Lisp code with Babel."
>   (require 'slime)
94,108c79,92
<           (funcall (if (member "output" (cdr (assoc :result-params params)))
<                        #'car #'cadr)
<                    (with-temp-buffer
<                      (insert (org-babel-expand-body:lisp body params))
<                      (funcall org-babel-lisp-eval-fn
<                               `(swank:eval-and-grab-output
<                                 ,(let ((dir (if (assoc :dir params)
<                                                 (cdr (assoc :dir params))
<                                               default-directory)))
<                                    (format
<                                     (if dir (format org-babel-lisp-dir-fmt dir)
<                                       "(progn %s\n)")
<                                     (buffer-substring-no-properties
<                                      (point-min) (point-max)))))
<                               (cdr (assoc :package params)))))))
---
> 	  (funcall (if (member "output" (cdr (assoc :result-params params)))
> 		       #'car #'cadr)
> 		   (with-temp-buffer
> 		     (insert (org-babel-expand-body:lisp body params))
> 		     (slime-eval `(swank:eval-and-grab-output
> 				   ,(let ((dir (if (assoc :dir params)
> 						   (cdr (assoc :dir params))
> 						 default-directory)))
> 				      (format
> 				       (if dir (format org-babel-lisp-dir-fmt dir)
> 					 "(progn %s\n)")
> 				       (buffer-substring-no-properties
> 					(point-min) (point-max)))))
> 				 (cdr (assoc :package params)))))))
115c99
<                         (cdr (assoc :colnames params)))
---
> 			(cdr (assoc :colnames params)))
117c101
<                         (cdr (assoc :rownames params)))))
---
> 			(cdr (assoc :rownames params)))))

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: a patch to ob-lisp.el
  2016-03-26 16:02 a patch to ob-lisp.el stardiviner
@ 2016-03-28  4:01 ` Nick Dokos
  2016-03-30 15:30   ` numbchild
  0 siblings, 1 reply; 12+ messages in thread
From: Nick Dokos @ 2016-03-28  4:01 UTC (permalink / raw)
  To: emacs-orgmode

stardiviner <numbchild@gmail.com> writes:

> I hope to merge this patch to Org-mode `ob-lisp.el`.
>

I have only looked at the surface of it, but I see some issues.

> < ;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
> ---
> > ;; Copyright (C) 2009-2016 Free Software Foundation, Inc.

Why did you leave out the previous copyright statement?
Where did 2020 come from?

> < ;; Authors: stardiviner <numbchild@gmail.com>
> < ;; Maintainer: stardiviner <numbchild@gmail.com>
> < ;; Keywords: org babel lisp sly slime
> < ;; URL: https://github.com/stardiviner/ob-lisp
> < ;; Created: 1th March 2016
> < ;; Version: 0.0.1
> < ;; Package-Requires: ((org "8"))
> ---
>> ;; Authors: Joel Boehland
>> ;;	 Eric Schulte
>> ;;	 David T. O'Toole <dto@gnu.org>
>> ;; Keywords: literate programming, reproducible research
>> ;; Homepage: http://orgmode.org

Why did you erase the previous authors?

Are you volunteering to be the maintainer of ob-lisp.el or are you
planning to keep your own repo and submit patches? Have you signed FSF
papers?

> < ;; Requires SLY (Sylvester the Cat's Common Lisp IDE) and SLIME
> < ;; See:
> < ;; - https://github.com/capitaomorte/sly
> < ;; - http://common-lisp.net/project/slime/
> ---
>> ;; Requires SLIME (Superior Lisp Interaction Mode for Emacs.)
>> ;; See http://common-lisp.net/project/slime/

Does it really require both? If so, I suggest you rework it so
either can be used, but only one is required. If not, I suggest
you fix the comment.

-- 
Nick

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: a patch to ob-lisp.el
  2016-03-28  4:01 ` Nick Dokos
@ 2016-03-30 15:30   ` numbchild
  2016-03-30 16:52     ` Thomas S. Dye
  0 siblings, 1 reply; 12+ messages in thread
From: numbchild @ 2016-03-30 15:30 UTC (permalink / raw)
  To: Nick Dokos; +Cc: Org-mode


[-- Attachment #1.1: Type: text/plain, Size: 2066 bytes --]

I updated all comments which you point out.
I wandering how to sign the FSF papers? Sorry about this, this is my first
time to contribute code in open source.



[stardiviner]           <Hack this world!>      GPG key ID: 47C32433
IRC(freeenode): stardiviner                     Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Mon, Mar 28, 2016 at 12:01 PM, Nick Dokos <ndokos@gmail.com> wrote:

> stardiviner <numbchild@gmail.com> writes:
>
> > I hope to merge this patch to Org-mode `ob-lisp.el`.
> >
>
> I have only looked at the surface of it, but I see some issues.
>
> > < ;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
> > ---
> > > ;; Copyright (C) 2009-2016 Free Software Foundation, Inc.
>
> Why did you leave out the previous copyright statement?
> Where did 2020 come from?
>
> > < ;; Authors: stardiviner <numbchild@gmail.com>
> > < ;; Maintainer: stardiviner <numbchild@gmail.com>
> > < ;; Keywords: org babel lisp sly slime
> > < ;; URL: https://github.com/stardiviner/ob-lisp
> > < ;; Created: 1th March 2016
> > < ;; Version: 0.0.1
> > < ;; Package-Requires: ((org "8"))
> > ---
> >> ;; Authors: Joel Boehland
> >> ;;    Eric Schulte
> >> ;;    David T. O'Toole <dto@gnu.org>
> >> ;; Keywords: literate programming, reproducible research
> >> ;; Homepage: http://orgmode.org
>
> Why did you erase the previous authors?
>
> Are you volunteering to be the maintainer of ob-lisp.el or are you
> planning to keep your own repo and submit patches? Have you signed FSF
> papers?
>
> > < ;; Requires SLY (Sylvester the Cat's Common Lisp IDE) and SLIME
> > < ;; See:
> > < ;; - https://github.com/capitaomorte/sly
> > < ;; - http://common-lisp.net/project/slime/
> > ---
> >> ;; Requires SLIME (Superior Lisp Interaction Mode for Emacs.)
> >> ;; See http://common-lisp.net/project/slime/
>
> Does it really require both? If so, I suggest you rework it so
> either can be used, but only one is required. If not, I suggest
> you fix the comment.
>
> --
> Nick
>
>
>

[-- Attachment #1.2: Type: text/html, Size: 3892 bytes --]

[-- Attachment #2: ediff-output --]
[-- Type: application/octet-stream, Size: 6334 bytes --]

*** /home/stardiviner/Code/Emacs/ob-lisp/ob-lisp.el	2016-03-30 11:22:10.967967353 +0800
--- /home/stardiviner/.emacs.d/elpa/org-plus-contrib-20160321/ob-lisp.el	2016-03-30 11:21:04.847963494 +0800
***************
*** 1,4 ****
! ;;; ob-lisp.el --- org-babel functions for common lisp evaluation with SLY or SLIME.
  
  ;; Copyright (C) 2009-2016 Free Software Foundation, Inc.
  
--- 1,4 ----
! ;;; ob-lisp.el --- org-babel functions for common lisp evaluation
  
  ;; Copyright (C) 2009-2016 Free Software Foundation, Inc.
  
***************
*** 25,51 ****
  
  ;;; Commentary:
  
! ;;; Support for evaluating Common Lisp code, relies on SLY or SLIME for all eval.
  
  ;;; Requirements:
  
! ;; Requires SLY (Sylvester the Cat's Common Lisp IDE) or SLIME.
! ;; See:
! ;; - https://github.com/capitaomorte/sly
! ;; - http://common-lisp.net/project/slime/
  
  ;;; Code:
  (require 'ob)
  
! (defcustom org-babel-lisp-eval-fn "sly-eval"
!   "The function to be called to evaluate code on the Lisp side."
!   :group 'org-babel
!   :version "24.1"
!   :options '("sly-eval" "slime-eval")
!   :type 'stringp)
! 
! 
! ;; (declare-function sly-eval "ext:sly" (sexp &optional package))
  
  (defvar org-babel-tangle-lang-exts)
  (add-to-list 'org-babel-tangle-lang-exts '("lisp" . "lisp"))
--- 25,41 ----
  
  ;;; Commentary:
  
! ;;; support for evaluating common lisp code, relies on slime for all eval
  
  ;;; Requirements:
  
! ;; Requires SLIME (Superior Lisp Interaction Mode for Emacs.)
! ;; See http://common-lisp.net/project/slime/
  
  ;;; Code:
  (require 'ob)
  
! (declare-function slime-eval "ext:slime" (sexp &optional package))
  
  (defvar org-babel-tangle-lang-exts)
  (add-to-list 'org-babel-tangle-lang-exts '("lisp" . "lisp"))
***************
*** 65,118 ****
  (defun org-babel-expand-body:lisp (body params)
    "Expand BODY according to PARAMS, return the expanded body."
    (let* ((vars (mapcar #'cdr (org-babel-get-header params :var)))
!          (result-params (cdr (assoc :result-params params)))
!          (print-level nil) (print-length nil)
!          (body (org-babel-trim
!                 (if (> (length vars) 0)
!                     (concat "(let ("
!                             (mapconcat
!                              (lambda (var)
!                                (format "(%S (quote %S))" (car var) (cdr var)))
!                              vars "\n      ")
!                             ")\n" body ")")
!                   body))))
      (if (or (member "code" result-params)
!             (member "pp" result-params))
!         (format "(pprint %s)" body)
        body)))
  
- ;;;###autoload
  (defun org-babel-execute:lisp (body params)
!   "Execute a block `BODY' with `PARAMS' of Common Lisp code with Babel."
!   (pcase org-babel-lisp-eval-fn
!     ("slime-eval" (require 'slime))
!     ("sly-eval" (require 'sly)))
    (org-babel-reassemble-table
     (let ((result
!           (funcall (if (member "output" (cdr (assoc :result-params params)))
!                        #'car #'cadr)
!                    (with-temp-buffer
!                      (insert (org-babel-expand-body:lisp body params))
!                      (funcall org-babel-lisp-eval-fn
!                               `(swank:eval-and-grab-output
!                                 ,(let ((dir (if (assoc :dir params)
!                                                 (cdr (assoc :dir params))
!                                               default-directory)))
!                                    (format
!                                     (if dir (format org-babel-lisp-dir-fmt dir)
!                                       "(progn %s\n)")
!                                     (buffer-substring-no-properties
!                                      (point-min) (point-max)))))
!                               (cdr (assoc :package params)))))))
       (org-babel-result-cond (cdr (assoc :result-params params))
         result
         (condition-case nil
             (read (org-babel-lisp-vector-to-list result))
           (error result))))
     (org-babel-pick-name (cdr (assoc :colname-names params))
!                         (cdr (assoc :colnames params)))
     (org-babel-pick-name (cdr (assoc :rowname-names params))
!                         (cdr (assoc :rownames params)))))
  
  (defun org-babel-lisp-vector-to-list (results)
    ;; TODO: better would be to replace #(...) with [...]
--- 55,104 ----
  (defun org-babel-expand-body:lisp (body params)
    "Expand BODY according to PARAMS, return the expanded body."
    (let* ((vars (mapcar #'cdr (org-babel-get-header params :var)))
! 	 (result-params (cdr (assoc :result-params params)))
! 	 (print-level nil) (print-length nil)
! 	 (body (org-babel-trim
! 		(if (> (length vars) 0)
! 		    (concat "(let ("
! 			    (mapconcat
! 			     (lambda (var)
! 			       (format "(%S (quote %S))" (car var) (cdr var)))
! 			     vars "\n      ")
! 			    ")\n" body ")")
! 		  body))))
      (if (or (member "code" result-params)
! 	    (member "pp" result-params))
! 	(format "(pprint %s)" body)
        body)))
  
  (defun org-babel-execute:lisp (body params)
!   "Execute a block of Common Lisp code with Babel."
!   (require 'slime)
    (org-babel-reassemble-table
     (let ((result
! 	  (funcall (if (member "output" (cdr (assoc :result-params params)))
! 		       #'car #'cadr)
! 		   (with-temp-buffer
! 		     (insert (org-babel-expand-body:lisp body params))
! 		     (slime-eval `(swank:eval-and-grab-output
! 				   ,(let ((dir (if (assoc :dir params)
! 						   (cdr (assoc :dir params))
! 						 default-directory)))
! 				      (format
! 				       (if dir (format org-babel-lisp-dir-fmt dir)
! 					 "(progn %s\n)")
! 				       (buffer-substring-no-properties
! 					(point-min) (point-max)))))
! 				 (cdr (assoc :package params)))))))
       (org-babel-result-cond (cdr (assoc :result-params params))
         result
         (condition-case nil
             (read (org-babel-lisp-vector-to-list result))
           (error result))))
     (org-babel-pick-name (cdr (assoc :colname-names params))
! 			(cdr (assoc :colnames params)))
     (org-babel-pick-name (cdr (assoc :rowname-names params))
! 			(cdr (assoc :rownames params)))))
  
  (defun org-babel-lisp-vector-to-list (results)
    ;; TODO: better would be to replace #(...) with [...]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: a patch to ob-lisp.el
  2016-03-30 15:30   ` numbchild
@ 2016-03-30 16:52     ` Thomas S. Dye
  2016-04-06  5:54       ` numbchild
  0 siblings, 1 reply; 12+ messages in thread
From: Thomas S. Dye @ 2016-03-30 16:52 UTC (permalink / raw)
  To: numbchild@gmail.com; +Cc: Nick Dokos, Org-mode

Aloha stardiviner,

For instructions about the FSF papers, see
http://orgmode.org/worg/org-contribute.html.

All the best,
Tom

numbchild@gmail.com writes:

> I updated all comments which you point out.
> I wandering how to sign the FSF papers? Sorry about this, this is my first time
> to contribute code in open source.
>
>
>
> [stardiviner] <Hack this world!> GPG key ID: 47C32433
> IRC(freeenode): stardiviner  Twitter: @numbchild
> Key fingerprint = 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433
> Blog: http://stardiviner.github.io/
>
> On Mon, Mar 28, 2016 at 12:01 PM, Nick Dokos <ndokos@gmail.com> wrote:
>
>     stardiviner <numbchild@gmail.com> writes:
>
>     > I hope to merge this patch to Org-mode `ob-lisp.el`.
>     >
>
>     I have only looked at the surface of it, but I see some issues.
>
>     > < ;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
>     > ---
>     > > ;; Copyright (C) 2009-2016 Free Software Foundation, Inc.
>
>     Why did you leave out the previous copyright statement?
>     Where did 2020 come from?
>
>     > < ;; Authors: stardiviner <numbchild@gmail.com>
>     > < ;; Maintainer: stardiviner <numbchild@gmail.com>
>     > < ;; Keywords: org babel lisp sly slime
>     > < ;; URL: https://github.com/stardiviner/ob-lisp
>     > < ;; Created: 1th March 2016
>     > < ;; Version: 0.0.1
>     > < ;; Package-Requires: ((org "8"))
>     > ---
>     >> ;; Authors: Joel Boehland
>     >> ;;  Eric Schulte
>     >> ;;  David T. O'Toole <dto@gnu.org>
>     >> ;; Keywords: literate programming, reproducible research
>     >> ;; Homepage: http://orgmode.org
>
>     Why did you erase the previous authors?
>
>     Are you volunteering to be the maintainer of ob-lisp.el or are you
>     planning to keep your own repo and submit patches? Have you signed FSF
>     papers?
>
>     > < ;; Requires SLY (Sylvester the Cat's Common Lisp IDE) and SLIME
>     > < ;; See:
>     > < ;; - https://github.com/capitaomorte/sly
>     > < ;; - http://common-lisp.net/project/slime/
>     > ---
>     >> ;; Requires SLIME (Superior Lisp Interaction Mode for Emacs.)
>     >> ;; See http://common-lisp.net/project/slime/
>
>     Does it really require both? If so, I suggest you rework it so
>     either can be used, but only one is required. If not, I suggest
>     you fix the comment.
>    
>     --
>     Nick


-- 
Thomas S. Dye
http://www.tsdye.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: a patch to ob-lisp.el
  2016-03-30 16:52     ` Thomas S. Dye
@ 2016-04-06  5:54       ` numbchild
  2016-04-06  5:55         ` numbchild
  2016-04-06  9:24         ` Nicolas Goaziou
  0 siblings, 2 replies; 12+ messages in thread
From: numbchild @ 2016-04-06  5:54 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: Nick Dokos, Org-mode

[-- Attachment #1: Type: text/plain, Size: 3045 bytes --]

My think my patch modifies less than 15 lines. Do I have to assign the
copyright of FSF?
I have sent one. But no response for some days. I hope Org-mode maintainer
can merge this patch.

[stardiviner]           <Hack this world!>      GPG key ID: 47C32433
IRC(freeenode): stardiviner                     Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Thu, Mar 31, 2016 at 12:52 AM, Thomas S. Dye <tsd@tsdye.com> wrote:

> Aloha stardiviner,
>
> For instructions about the FSF papers, see
> http://orgmode.org/worg/org-contribute.html.
>
> All the best,
> Tom
>
> numbchild@gmail.com writes:
>
> > I updated all comments which you point out.
> > I wandering how to sign the FSF papers? Sorry about this, this is my
> first time
> > to contribute code in open source.
> >
> >
> >
> > [stardiviner] <Hack this world!> GPG key ID: 47C32433
> > IRC(freeenode): stardiviner  Twitter: @numbchild
> > Key fingerprint = 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433
> > Blog: http://stardiviner.github.io/
> >
> > On Mon, Mar 28, 2016 at 12:01 PM, Nick Dokos <ndokos@gmail.com> wrote:
> >
> >     stardiviner <numbchild@gmail.com> writes:
> >
> >     > I hope to merge this patch to Org-mode `ob-lisp.el`.
> >     >
> >
> >     I have only looked at the surface of it, but I see some issues.
> >
> >     > < ;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
> >     > ---
> >     > > ;; Copyright (C) 2009-2016 Free Software Foundation, Inc.
> >
> >     Why did you leave out the previous copyright statement?
> >     Where did 2020 come from?
> >
> >     > < ;; Authors: stardiviner <numbchild@gmail.com>
> >     > < ;; Maintainer: stardiviner <numbchild@gmail.com>
> >     > < ;; Keywords: org babel lisp sly slime
> >     > < ;; URL: https://github.com/stardiviner/ob-lisp
> >     > < ;; Created: 1th March 2016
> >     > < ;; Version: 0.0.1
> >     > < ;; Package-Requires: ((org "8"))
> >     > ---
> >     >> ;; Authors: Joel Boehland
> >     >> ;;  Eric Schulte
> >     >> ;;  David T. O'Toole <dto@gnu.org>
> >     >> ;; Keywords: literate programming, reproducible research
> >     >> ;; Homepage: http://orgmode.org
> >
> >     Why did you erase the previous authors?
> >
> >     Are you volunteering to be the maintainer of ob-lisp.el or are you
> >     planning to keep your own repo and submit patches? Have you signed
> FSF
> >     papers?
> >
> >     > < ;; Requires SLY (Sylvester the Cat's Common Lisp IDE) and SLIME
> >     > < ;; See:
> >     > < ;; - https://github.com/capitaomorte/sly
> >     > < ;; - http://common-lisp.net/project/slime/
> >     > ---
> >     >> ;; Requires SLIME (Superior Lisp Interaction Mode for Emacs.)
> >     >> ;; See http://common-lisp.net/project/slime/
> >
> >     Does it really require both? If so, I suggest you rework it so
> >     either can be used, but only one is required. If not, I suggest
> >     you fix the comment.
> >
> >     --
> >     Nick
>
>
> --
> Thomas S. Dye
> http://www.tsdye.com
>

[-- Attachment #2: Type: text/html, Size: 5414 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: a patch to ob-lisp.el
  2016-04-06  5:54       ` numbchild
@ 2016-04-06  5:55         ` numbchild
  2016-04-06  9:26           ` Nicolas Goaziou
  2016-04-06  9:24         ` Nicolas Goaziou
  1 sibling, 1 reply; 12+ messages in thread
From: numbchild @ 2016-04-06  5:55 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: Nick Dokos, Org-mode

[-- Attachment #1: Type: text/plain, Size: 3670 bytes --]

Ask a beside question. I cloned org-mode git repo, should I contribute my
patch with git way? (I mean create a git branch on my own public clone,
then paste it here to let maintainer merge it?)

[stardiviner]           <Hack this world!>      GPG key ID: 47C32433
IRC(freeenode): stardiviner                     Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Wed, Apr 6, 2016 at 1:54 PM, numbchild@gmail.com <numbchild@gmail.com>
wrote:

> My think my patch modifies less than 15 lines. Do I have to assign the
> copyright of FSF?
> I have sent one. But no response for some days. I hope Org-mode maintainer
> can merge this patch.
>
> [stardiviner]           <Hack this world!>      GPG key ID: 47C32433
> IRC(freeenode): stardiviner                     Twitter:  @numbchild
> Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> Blog: http://stardiviner.github.io/
>
> On Thu, Mar 31, 2016 at 12:52 AM, Thomas S. Dye <tsd@tsdye.com> wrote:
>
>> Aloha stardiviner,
>>
>> For instructions about the FSF papers, see
>> http://orgmode.org/worg/org-contribute.html.
>>
>> All the best,
>> Tom
>>
>> numbchild@gmail.com writes:
>>
>> > I updated all comments which you point out.
>> > I wandering how to sign the FSF papers? Sorry about this, this is my
>> first time
>> > to contribute code in open source.
>> >
>> >
>> >
>> > [stardiviner] <Hack this world!> GPG key ID: 47C32433
>> > IRC(freeenode): stardiviner  Twitter: @numbchild
>> > Key fingerprint = 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433
>> > Blog: http://stardiviner.github.io/
>> >
>> > On Mon, Mar 28, 2016 at 12:01 PM, Nick Dokos <ndokos@gmail.com> wrote:
>> >
>> >     stardiviner <numbchild@gmail.com> writes:
>> >
>> >     > I hope to merge this patch to Org-mode `ob-lisp.el`.
>> >     >
>> >
>> >     I have only looked at the surface of it, but I see some issues.
>> >
>> >     > < ;; Copyright (C) 2016-2020 Free Software Foundation, Inc.
>> >     > ---
>> >     > > ;; Copyright (C) 2009-2016 Free Software Foundation, Inc.
>> >
>> >     Why did you leave out the previous copyright statement?
>> >     Where did 2020 come from?
>> >
>> >     > < ;; Authors: stardiviner <numbchild@gmail.com>
>> >     > < ;; Maintainer: stardiviner <numbchild@gmail.com>
>> >     > < ;; Keywords: org babel lisp sly slime
>> >     > < ;; URL: https://github.com/stardiviner/ob-lisp
>> >     > < ;; Created: 1th March 2016
>> >     > < ;; Version: 0.0.1
>> >     > < ;; Package-Requires: ((org "8"))
>> >     > ---
>> >     >> ;; Authors: Joel Boehland
>> >     >> ;;  Eric Schulte
>> >     >> ;;  David T. O'Toole <dto@gnu.org>
>> >     >> ;; Keywords: literate programming, reproducible research
>> >     >> ;; Homepage: http://orgmode.org
>> >
>> >     Why did you erase the previous authors?
>> >
>> >     Are you volunteering to be the maintainer of ob-lisp.el or are you
>> >     planning to keep your own repo and submit patches? Have you signed
>> FSF
>> >     papers?
>> >
>> >     > < ;; Requires SLY (Sylvester the Cat's Common Lisp IDE) and SLIME
>> >     > < ;; See:
>> >     > < ;; - https://github.com/capitaomorte/sly
>> >     > < ;; - http://common-lisp.net/project/slime/
>> >     > ---
>> >     >> ;; Requires SLIME (Superior Lisp Interaction Mode for Emacs.)
>> >     >> ;; See http://common-lisp.net/project/slime/
>> >
>> >     Does it really require both? If so, I suggest you rework it so
>> >     either can be used, but only one is required. If not, I suggest
>> >     you fix the comment.
>> >
>> >     --
>> >     Nick
>>
>>
>> --
>> Thomas S. Dye
>> http://www.tsdye.com
>>
>
>

[-- Attachment #2: Type: text/html, Size: 6663 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: a patch to ob-lisp.el
  2016-04-06  5:54       ` numbchild
  2016-04-06  5:55         ` numbchild
@ 2016-04-06  9:24         ` Nicolas Goaziou
  1 sibling, 0 replies; 12+ messages in thread
From: Nicolas Goaziou @ 2016-04-06  9:24 UTC (permalink / raw)
  To: numbchild@gmail.com; +Cc: Nick Dokos, Org-mode

Hello,

"numbchild@gmail.com" <numbchild@gmail.com> writes:

> My think my patch modifies less than 15 lines. Do I have to assign the
> copyright of FSF?

No you don't. That will be helpful for your next patches.

> I have sent one. But no response for some days. I hope Org-mode maintainer
> can merge this patch.

The copyright is not an issue.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: a patch to ob-lisp.el
  2016-04-06  5:55         ` numbchild
@ 2016-04-06  9:26           ` Nicolas Goaziou
  2016-04-06 10:51             ` numbchild
  0 siblings, 1 reply; 12+ messages in thread
From: Nicolas Goaziou @ 2016-04-06  9:26 UTC (permalink / raw)
  To: numbchild@gmail.com; +Cc: Nick Dokos, Org-mode

Hello,

"numbchild@gmail.com" <numbchild@gmail.com> writes:

> Ask a beside question. I cloned org-mode git repo, should I contribute my
> patch with git way? (I mean create a git branch on my own public clone,
> then paste it here to let maintainer merge it?)

Please look at the document suggested by Thomas. In particular, please
read section "For Org contributors: preferred way of submitting
patches".

Following advices there tremendeously helps maintainers.

Thank you.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: a patch to ob-lisp.el
  2016-04-06  9:26           ` Nicolas Goaziou
@ 2016-04-06 10:51             ` numbchild
  2016-04-06 12:49               ` Nicolas Goaziou
  0 siblings, 1 reply; 12+ messages in thread
From: numbchild @ 2016-04-06 10:51 UTC (permalink / raw)
  To: numbchild@gmail.com, Thomas S. Dye, Nick Dokos, Org-mode

[-- Attachment #1: Type: text/plain, Size: 1344 bytes --]

Hi, Nicolas, the another email which you commented many places is outdated.
That patch is modified from the version of MELPA package `org-plus-conrtib`.

I cloned org-mode git repo, and created public repo branch at here:
https://github.com/stardiviner/org-mode/tree/sly-support-for-ob-lisp

I checked this branch's diff with your mentioned places. All checked.
I followed org-mode contrib guide to create this commit.
Please let me know if there is any place need to modify.

[stardiviner]           <Hack this world!>      GPG key ID: 47C32433
IRC(freeenode): stardiviner                     Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Wed, Apr 6, 2016 at 5:26 PM, Nicolas Goaziou <mail@nicolasgoaziou.fr>
wrote:

> Hello,
>
> "numbchild@gmail.com" <numbchild@gmail.com> writes:
>
> > Ask a beside question. I cloned org-mode git repo, should I contribute my
> > patch with git way? (I mean create a git branch on my own public clone,
> > then paste it here to let maintainer merge it?)
>
> Please look at the document suggested by Thomas. In particular, please
> read section "For Org contributors: preferred way of submitting
> patches".
>
> Following advices there tremendeously helps maintainers.
>
> Thank you.
>
> Regards,
>
> --
> Nicolas Goaziou
>

[-- Attachment #2: Type: text/html, Size: 2875 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: a patch to ob-lisp.el
  2016-04-06 10:51             ` numbchild
@ 2016-04-06 12:49               ` Nicolas Goaziou
  2016-04-06 14:51                 ` numbchild
  0 siblings, 1 reply; 12+ messages in thread
From: Nicolas Goaziou @ 2016-04-06 12:49 UTC (permalink / raw)
  To: numbchild@gmail.com; +Cc: Nick Dokos, Org-mode

Hello,

"numbchild@gmail.com" <numbchild@gmail.com> writes:

> Hi, Nicolas, the another email which you commented many places is outdated.
> That patch is modified from the version of MELPA package `org-plus-conrtib`.
>
> I cloned org-mode git repo, and created public repo branch at here:
> https://github.com/stardiviner/org-mode/tree/sly-support-for-ob-lisp
>
> I checked this branch's diff with your mentioned places. All checked.
> I followed org-mode contrib guide to create this commit.
> Please let me know if there is any place need to modify.

From your local branch, use

  git format-patch master

This will generate a patch file, which you can send to this ML.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: a patch to ob-lisp.el
  2016-04-06 12:49               ` Nicolas Goaziou
@ 2016-04-06 14:51                 ` numbchild
  2016-04-10  8:12                   ` Nicolas Goaziou
  0 siblings, 1 reply; 12+ messages in thread
From: numbchild @ 2016-04-06 14:51 UTC (permalink / raw)
  To: numbchild@gmail.com, Thomas S. Dye, Nick Dokos, Org-mode


[-- Attachment #1.1: Type: text/plain, Size: 5041 bytes --]

Oh, right. I should attach it.

```diff
From 30eec5a63e4f720fa3880b9aef06aedd84072078 Mon Sep 17 00:00:00 2001
From: stardiviner <numbchild@gmail.com>
Date: Sat, 2 Apr 2016 00:46:36 +0800
Subject: [PATCH] add SLY support in ob-lisp

* ob-lisp.el (org-babel-execute:lisp): Support using SLY to evaluate
  lisp src block.

SLY has some advantages over SLIME, let user can evaluate Lisp src block
with SLY.

modified from a patch proposal by stardiviner.

TINYCHANGE
---
 etc/ORG-NEWS    |  2 ++
 lisp/ob-lisp.el | 51 ++++++++++++++++++++++++++++++++-------------------
 2 files changed, 34 insertions(+), 19 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 3ddc3f9..bb8a00d 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -819,6 +819,8 @@ See the docstring of ~org-latex-classes~ and

 *** `org-insert-heading' can be forced to insert top-level headline

+*** let ob-lisp supporting use SLY to evaluate
+
 ** Removed functions

 *** Removed function ~org-translate-time~
diff --git a/lisp/ob-lisp.el b/lisp/ob-lisp.el
index 64b032d..68ea5e2 100644
--- a/lisp/ob-lisp.el
+++ b/lisp/ob-lisp.el
@@ -25,16 +25,26 @@

 ;;; Commentary:

-;;; support for evaluating common lisp code, relies on slime for all eval
+;;; Support for evaluating Common Lisp code, relies on SLY or SLIME for
all eval.

 ;;; Requirements:

-;; Requires SLIME (Superior Lisp Interaction Mode for Emacs.)
-;; See http://common-lisp.net/project/slime/
+;; Requires SLY (Sylvester the Cat's Common Lisp IDE) or SLIME.
+;; See:
+;; - https://github.com/capitaomorte/sly
+;; - http://common-lisp.net/project/slime/

 ;;; Code:
 (require 'ob)

+(defcustom org-babel-lisp-eval-fn "sly-eval"
+  "The function to be called to evaluate code on the Lisp side."
+  :group 'org-babel
+  :version "24.1"
+  :options '("sly-eval" "slime-eval")
+  :type 'stringp)
+
+(declare-function sly-eval "ext:sly" (sexp &optional package))
 (declare-function slime-eval "ext:slime" (sexp &optional package))

 (defvar org-babel-tangle-lang-exts)
@@ -72,24 +82,27 @@ current directory string."
       body)))

 (defun org-babel-execute:lisp (body params)
-  "Execute a block of Common Lisp code with Babel."
-  (require 'slime)
+  "Execute a block `BODY' with `PARAMS' of Common Lisp code with Babel."
+  (pcase org-babel-lisp-eval-fn
+    ("slime-eval" (require 'slime))
+    ("sly-eval" (require 'sly)))
   (org-babel-reassemble-table
    (let ((result
-  (funcall (if (member "output" (cdr (assoc :result-params params)))
-       #'car #'cadr)
-   (with-temp-buffer
-     (insert (org-babel-expand-body:lisp body params))
-     (slime-eval `(swank:eval-and-grab-output
-   ,(let ((dir (if (assoc :dir params)
-   (cdr (assoc :dir params))
- default-directory)))
-      (format
-       (if dir (format org-babel-lisp-dir-fmt dir)
- "(progn %s\n)")
-       (buffer-substring-no-properties
- (point-min) (point-max)))))
- (cdr (assoc :package params)))))))
+          (funcall (if (member "output" (cdr (assoc :result-params
params)))
+                       #'car #'cadr)
+                   (with-temp-buffer
+                     (insert (org-babel-expand-body:lisp body params))
+                     (funcall org-babel-lisp-eval-fn
+                              `(swank:eval-and-grab-output
+                                ,(let ((dir (if (assoc :dir params)
+                                                (cdr (assoc :dir params))
+                                              default-directory)))
+                                   (format
+                                    (if dir (format org-babel-lisp-dir-fmt
dir)
+                                      "(progn %s\n)")
+                                    (buffer-substring-no-properties
+                                     (point-min) (point-max)))))
+                              (cdr (assoc :package params)))))))
      (org-babel-result-cond (cdr (assoc :result-params params))
        result
        (condition-case nil
-- 
2.8.0
```

[stardiviner]           <Hack this world!>      GPG key ID: 47C32433
IRC(freeenode): stardiviner                     Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Wed, Apr 6, 2016 at 8:49 PM, Nicolas Goaziou <mail@nicolasgoaziou.fr>
wrote:

> Hello,
>
> "numbchild@gmail.com" <numbchild@gmail.com> writes:
>
> > Hi, Nicolas, the another email which you commented many places is
> outdated.
> > That patch is modified from the version of MELPA package
> `org-plus-conrtib`.
> >
> > I cloned org-mode git repo, and created public repo branch at here:
> > https://github.com/stardiviner/org-mode/tree/sly-support-for-ob-lisp
> >
> > I checked this branch's diff with your mentioned places. All checked.
> > I followed org-mode contrib guide to create this commit.
> > Please let me know if there is any place need to modify.
>
> From your local branch, use
>
>   git format-patch master
>
> This will generate a patch file, which you can send to this ML.
>
> Regards,
>
> --
> Nicolas Goaziou
>

[-- Attachment #1.2: Type: text/html, Size: 16430 bytes --]

[-- Attachment #2: 0001-add-SLY-support-in-ob-lisp.patch --]
[-- Type: text/x-patch, Size: 3982 bytes --]

From 30eec5a63e4f720fa3880b9aef06aedd84072078 Mon Sep 17 00:00:00 2001
From: stardiviner <numbchild@gmail.com>
Date: Sat, 2 Apr 2016 00:46:36 +0800
Subject: [PATCH] add SLY support in ob-lisp

* ob-lisp.el (org-babel-execute:lisp): Support using SLY to evaluate
  lisp src block.

SLY has some advantages over SLIME, let user can evaluate Lisp src block
with SLY.

modified from a patch proposal by stardiviner.

TINYCHANGE
---
 etc/ORG-NEWS    |  2 ++
 lisp/ob-lisp.el | 51 ++++++++++++++++++++++++++++++++-------------------
 2 files changed, 34 insertions(+), 19 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 3ddc3f9..bb8a00d 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -819,6 +819,8 @@ See the docstring of ~org-latex-classes~ and
 
 *** `org-insert-heading' can be forced to insert top-level headline
 
+*** let ob-lisp supporting use SLY to evaluate
+
 ** Removed functions
 
 *** Removed function ~org-translate-time~
diff --git a/lisp/ob-lisp.el b/lisp/ob-lisp.el
index 64b032d..68ea5e2 100644
--- a/lisp/ob-lisp.el
+++ b/lisp/ob-lisp.el
@@ -25,16 +25,26 @@
 
 ;;; Commentary:
 
-;;; support for evaluating common lisp code, relies on slime for all eval
+;;; Support for evaluating Common Lisp code, relies on SLY or SLIME for all eval.
 
 ;;; Requirements:
 
-;; Requires SLIME (Superior Lisp Interaction Mode for Emacs.)
-;; See http://common-lisp.net/project/slime/
+;; Requires SLY (Sylvester the Cat's Common Lisp IDE) or SLIME.
+;; See:
+;; - https://github.com/capitaomorte/sly
+;; - http://common-lisp.net/project/slime/
 
 ;;; Code:
 (require 'ob)
 
+(defcustom org-babel-lisp-eval-fn "sly-eval"
+  "The function to be called to evaluate code on the Lisp side."
+  :group 'org-babel
+  :version "24.1"
+  :options '("sly-eval" "slime-eval")
+  :type 'stringp)
+
+(declare-function sly-eval "ext:sly" (sexp &optional package))
 (declare-function slime-eval "ext:slime" (sexp &optional package))
 
 (defvar org-babel-tangle-lang-exts)
@@ -72,24 +82,27 @@ current directory string."
       body)))
 
 (defun org-babel-execute:lisp (body params)
-  "Execute a block of Common Lisp code with Babel."
-  (require 'slime)
+  "Execute a block `BODY' with `PARAMS' of Common Lisp code with Babel."
+  (pcase org-babel-lisp-eval-fn
+    ("slime-eval" (require 'slime))
+    ("sly-eval" (require 'sly)))
   (org-babel-reassemble-table
    (let ((result
-	  (funcall (if (member "output" (cdr (assoc :result-params params)))
-		       #'car #'cadr)
-		   (with-temp-buffer
-		     (insert (org-babel-expand-body:lisp body params))
-		     (slime-eval `(swank:eval-and-grab-output
-				   ,(let ((dir (if (assoc :dir params)
-						   (cdr (assoc :dir params))
-						 default-directory)))
-				      (format
-				       (if dir (format org-babel-lisp-dir-fmt dir)
-					 "(progn %s\n)")
-				       (buffer-substring-no-properties
-					(point-min) (point-max)))))
-				 (cdr (assoc :package params)))))))
+          (funcall (if (member "output" (cdr (assoc :result-params params)))
+                       #'car #'cadr)
+                   (with-temp-buffer
+                     (insert (org-babel-expand-body:lisp body params))
+                     (funcall org-babel-lisp-eval-fn
+                              `(swank:eval-and-grab-output
+                                ,(let ((dir (if (assoc :dir params)
+                                                (cdr (assoc :dir params))
+                                              default-directory)))
+                                   (format
+                                    (if dir (format org-babel-lisp-dir-fmt dir)
+                                      "(progn %s\n)")
+                                    (buffer-substring-no-properties
+                                     (point-min) (point-max)))))
+                              (cdr (assoc :package params)))))))
      (org-babel-result-cond (cdr (assoc :result-params params))
        result
        (condition-case nil
-- 
2.8.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: a patch to ob-lisp.el
  2016-04-06 14:51                 ` numbchild
@ 2016-04-10  8:12                   ` Nicolas Goaziou
  0 siblings, 0 replies; 12+ messages in thread
From: Nicolas Goaziou @ 2016-04-10  8:12 UTC (permalink / raw)
  To: numbchild@gmail.com; +Cc: Nick Dokos, Org-mode

Hello,

"numbchild@gmail.com" <numbchild@gmail.com> writes:

> Oh, right. I should attach it.

Applied, with a few fixes. Thank you.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-04-10  8:10 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-26 16:02 a patch to ob-lisp.el stardiviner
2016-03-28  4:01 ` Nick Dokos
2016-03-30 15:30   ` numbchild
2016-03-30 16:52     ` Thomas S. Dye
2016-04-06  5:54       ` numbchild
2016-04-06  5:55         ` numbchild
2016-04-06  9:26           ` Nicolas Goaziou
2016-04-06 10:51             ` numbchild
2016-04-06 12:49               ` Nicolas Goaziou
2016-04-06 14:51                 ` numbchild
2016-04-10  8:12                   ` Nicolas Goaziou
2016-04-06  9:24         ` Nicolas Goaziou

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).