Browse Source

Remove the usage of exec-path-from-shell

workspaces
Nicolas Petton 5 years ago
parent
commit
84cc6d0030
Signed by: nico GPG Key ID: 233587A47C207910
6 changed files with 14 additions and 18 deletions
  1. +2
    -2
      Cask
  2. +4
    -1
      doc/Indium.texi
  3. +0
    -14
      indium-nodejs.el
  4. +1
    -1
      indium.el
  5. +4
    -0
      sphinx-doc/setup.rst
  6. +3
    -0
      test/test-helper.el

+ 2
- 2
Cask View File

@ -5,7 +5,6 @@
(depends-on "websocket")
(depends-on "company")
(depends-on "exec-path-from-shell")
(development
(depends-on "undercover")
@ -13,4 +12,5 @@
(depends-on "seq")
(depends-on "map")
(depends-on "js2-mode")
(depends-on "assess"))
(depends-on "assess")
(depends-on "exec-path-from-shell"))

+ 4
- 1
doc/Indium.texi View File

@ -21,7 +21,7 @@
@copying
@quotation
Indium 0.6.1, Jun 02, 2017
Indium 0.6.1, Jun 09, 2017
Nicolas Petton
@ -274,6 +274,9 @@ $ nvm alias default v7
$ node --version
@end example
If you install NodeJS using @code{nvm}, chances are that Emacs won't have it in its
@code{exec path}. A simple solution is to use the excellent exec-path-from-shell@footnote{https://github.com/purcell/exec-path-from-shell} package.
@node Executing NodeJS from Emacs,Connecting to a Nodejs process,Installing a recent version of NodeJS,NodeJS
@anchor{setup executing-nodejs-from-emacs}@anchor{d}
@subsubsection Executing NodeJS from Emacs


+ 0
- 14
indium-nodejs.el View File

@ -41,16 +41,12 @@
(require 'json)
(require 'map)
(require 'seq)
(require 'exec-path-from-shell)
(require 'indium-webkit)
(defvar indium-nodejs-commands-history nil
"Nodejs commands history.")
(defvar indium-exec-path-setup nil
"Whether the exec path has been set up.")
(defun indium-run-node (command)
"Start a NodeJS process.
Execute COMMAND, adding the `--inspect' and `--debug-brk' flags.
@ -58,7 +54,6 @@ When the process is ready, open an Indium connection on it."
(interactive (list (read-shell-command "Node command: "
(or (car indium-nodejs-commands-history) "node ")
'indium-nodejs-commands-history)))
(indium--setup-exec-path)
(let ((process (make-process :name "indium-nodejs-process"
:buffer "*node process*"
:filter #'indium-nodejs--process-filter
@ -111,14 +106,5 @@ socket URL to connect to."
(when-let ((path (match-string 1 output)))
(indium-nodejs--connect "127.0.0.1" "9229" path))))
(defun indium--setup-exec-path ()
"Setup the exec path using `exec-path-from-shell'.
This ensures that the nodejs binary used by Emacs will be the
same as the one from the user's shell."
(unless indium-exec-path-setup
(exec-path-from-shell-initialize)
(setq indium-exec-path-setup t)))
(provide 'indium-nodejs)
;;; indium-nodejs.el ends here

+ 1
- 1
indium.el View File

@ -6,7 +6,7 @@
;; URL: https://github.com/NicolasPetton/indium
;; Keywords: tools, javascript
;; Version: 0.6.1
;; Package-Requires: ((emacs "25") (seq "2.16") (js2-mode "20140114") (company "0.9.0") (websocket "1.6") (exec-path-from-shell "1.11"))
;; Package-Requires: ((emacs "25") (seq "2.16") (js2-mode "20140114") (company "0.9.0") (websocket "1.6"))
;; 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


+ 4
- 0
sphinx-doc/setup.rst View File

@ -25,6 +25,10 @@ you want: ::
$ nvm alias default v7
$ node --version
If you install NodeJS using ``nvm``, chances are that Emacs won't have it in its
``exec path``. A simple solution is to use the excellent `exec-path-from-shell
<https://github.com/purcell/exec-path-from-shell>`_ package.
Executing NodeJS from Emacs
~~~~~~~~~~~~~~~~~~~~~~~~~~~


+ 3
- 0
test/test-helper.el View File

@ -24,6 +24,8 @@
;;; Code:
(require 'exec-path-from-shell)
(when (require 'undercover nil t)
(setq undercover-force-coverage t)
(undercover "*.el" (:exclude "run-lint.el" "test/*.el")))
@ -86,6 +88,7 @@ a temporary file, which is removed afterwards."
"Run BODY within a NodeJS connection on a process on fixtures/test.js."
(declare (indent 0))
`(progn
(ignore-errors (exec-path-from-shell-initialize))
(indium-run-node "node fixtures/test.js")
(wait-for-repl-buffer)
,@body


Loading…
Cancel
Save