From 1eb95dc50daabd375ba036668789d9e516e0a9f0 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Tue, 4 Sep 2018 15:57:59 -0400 Subject: [PATCH 1/2] Use the editor mode of the REPL to send regions. This fixes issue #17 (see: https://github.com/abicky/nodejs-repl.el/issues/17). * nodejs-repl.el: (nodejs-repl-send-region): Enable the editor mode when sending the region. --- nodejs-repl.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nodejs-repl.el b/nodejs-repl.el index ab85e14..78b769e 100644 --- a/nodejs-repl.el +++ b/nodejs-repl.el @@ -374,8 +374,13 @@ when receive the output string" "Send the current region to the `nodejs-repl-process'" (interactive "r") (let ((proc (nodejs-repl--get-or-create-process))) + ;; Enclose the region in .editor ... EOF as this is more robust. + ;; See: https://github.com/abicky/nodejs-repl.el/issues/17 + (comint-send-string proc ".editor\n") (comint-send-region proc start end) - (comint-send-string proc "\n"))) + (comint-send-string proc "\n") + (with-current-buffer (process-buffer proc) + (comint-send-eof)))) ;;;###autoload (defun nodejs-repl-send-buffer () From 4b0f85517ef0980af55394f6eb567e8d6db7481e Mon Sep 17 00:00:00 2001 From: abicky Date: Sat, 15 Sep 2018 13:48:22 +0900 Subject: [PATCH 2/2] Bump the version number to 0.1.7 --- nodejs-repl.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nodejs-repl.el b/nodejs-repl.el index 78b769e..f111ac8 100644 --- a/nodejs-repl.el +++ b/nodejs-repl.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2012-2017 Takeshi Arabiki ;; Author: Takeshi Arabiki -;; Version: 0.1.6 +;; Version: 0.1.7 ;; This program is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -53,7 +53,7 @@ "Run Node.js REPL and communicate the process." :group 'processes) -(defconst nodejs-repl-version "0.1.6" +(defconst nodejs-repl-version "0.1.7" "Node.js mode Version.") (defcustom nodejs-repl-command "node"