From mboxrd@z Thu Jan 1 00:00:00 1970 From: stardiviner Subject: [PATCH] fix org-babel-js-initiate-session required second optional argument Date: Sun, 01 Apr 2018 17:42:07 +0800 Message-ID: <87woxrclg0.fsf@gmail.com> Reply-To: numbchild@gmail.com Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f2ZVG-00044w-VQ for emacs-orgmode@gnu.org; Sun, 01 Apr 2018 05:42:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f2ZVD-0003te-UN for emacs-orgmode@gnu.org; Sun, 01 Apr 2018 05:42:23 -0400 Received: from [183.249.136.119] (port=3923 helo=dark.localdomain) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f2ZVD-0003rA-Dw for emacs-orgmode@gnu.org; Sun, 01 Apr 2018 05:42:19 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: org-mode --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-ob-js.el-org-babel-js-initiate-session-add-required-.patch Content-Transfer-Encoding: quoted-printable From=20e6e11810c793aaaca0c491c263447fcad39b2eb0 Mon Sep 17 00:00:00 2001 From: stardiviner Date: Sun, 1 Apr 2018 17:25:19 +0800 Subject: [PATCH 1/2] * ob-js.el (org-babel-js-initiate-session) add required optional second arg. =2D-- lisp/ob-js.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/ob-js.el b/lisp/ob-js.el index f18aa9da6..69be1b8a4 100644 =2D-- a/lisp/ob-js.el +++ b/lisp/ob-js.el @@ -156,8 +156,8 @@ specifying a variable of the same value." (car pair) (org-babel-js-var-to-js (cdr pair)))) (org-babel--get-vars params))) =20 =2D(defun org-babel-js-initiate-session (&optional session) =2D "If there is not a current inferior-process-buffer in SESSION +(defun org-babel-js-initiate-session (&optional session _params) + "If there is not a current inferior-process-buffer in `SESSION' then create. Return the initialized session." (cond ((string=3D session "none") =2D-=20 2.16.3 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0002-ob-js.el-org-babel-js-initiate-session-skewer-mode-s.patch Content-Transfer-Encoding: quoted-printable From=20e03755e41e55c47f1132c530e37f35c340262b99 Mon Sep 17 00:00:00 2001 From: stardiviner Date: Sun, 1 Apr 2018 17:26:05 +0800 Subject: [PATCH 2/2] * ob-js.el (org-babel-js-initiate-session) skewer-mode session initiate REPL. =2D-- lisp/ob-js.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/ob-js.el b/lisp/ob-js.el index 69be1b8a4..1da29969a 100644 =2D-- a/lisp/ob-js.el +++ b/lisp/ob-js.el @@ -43,6 +43,7 @@ (declare-function run-mozilla "ext:moz" (arg)) (declare-function httpd-start "simple-httpd" ()) (declare-function run-skewer "skewer-mode" ()) +(declare-function skewer-repl "skewer-repl" ()) (declare-function indium-run-node "indium-nodejs" (command)) (declare-function indium-eval "indium-interaction" (string &optional callb= ack)) =20 @@ -165,12 +166,14 @@ then create. Return the initialized session." ((string=3D "*skewer-repl*" session) (require 'skewer-repl) (let ((session-buffer (get-buffer "*skewer-repl*"))) =2D (if (and (org-babel-comint-buffer-livep (get-buffer session-buffer= )) + (if (and session-buffer + (org-babel-comint-buffer-livep (get-buffer session-buffer)) (comint-check-proc session-buffer)) session-buffer ;; start skewer REPL. (httpd-start) (run-skewer) + (skewer-repl) session-buffer))) ((string=3D "*Javascript REPL*" session) (require 'js-comint) =2D-=20 2.16.3 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAlrAqW8ACgkQG13xyVro msNCnwgAo8vpzkhRXxohc3SXoJH5nFDXFZQB5yL4/jquDUHq5N+DYL7/moKyUZia rjsdMlaXmbKDOB894gBMJfipuG1ew+kMRY88V6uhOIwwGrrnWo0GIDSxPYge3Dqm /IsTV2m/Tfno5Om80syQKRtsATnRdk1SHIUTkWomtm/2GCZiH/yvrglE77ARNRtl ZquFE/mdP/Os1qXR/eBUnt/vh4l5J2k1+dZdCx6fUDlBzyYpxL1jzLxkAs+o6FCT mC2ChHwdxVEhf6Ru628qzKDAFkN2i6a3Z+VWLlP9/Dr5LfXny4GVLH6dI2Ym/NRv s0A1gZDbnYfsFgyWgfd3bTzFG4fqPg== =O6tv -----END PGP SIGNATURE----- --==-=-=--