about summary refs log tree commit diff
path: root/configs/shared/emacs/.emacs.d/elpa/add-node-modules-path-20180710.2342
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2018-09-10T18·51-0400
committerWilliam Carroll <wpcarro@gmail.com>2018-09-10T18·53-0400
commit17ee0e400bef47c371afcae76037f9ea6a44ad13 (patch)
tree0e5efee6f00e402890e91f3eceb4b29408a498b6 /configs/shared/emacs/.emacs.d/elpa/add-node-modules-path-20180710.2342
parent8b2fadf4776b7ddb4a67b4bc8ff6463770e56028 (diff)
Support Vim, Tmux, Emacs with Stow
After moving off of Meta, Dotfiles has a greater responsibility to
manage configs. Vim, Tmux, and Emacs are now within Stow's purview.
Diffstat (limited to 'configs/shared/emacs/.emacs.d/elpa/add-node-modules-path-20180710.2342')
-rw-r--r--configs/shared/emacs/.emacs.d/elpa/add-node-modules-path-20180710.2342/add-node-modules-path-autoloads.el35
-rw-r--r--configs/shared/emacs/.emacs.d/elpa/add-node-modules-path-20180710.2342/add-node-modules-path-pkg.el2
-rw-r--r--configs/shared/emacs/.emacs.d/elpa/add-node-modules-path-20180710.2342/add-node-modules-path.el79
-rw-r--r--configs/shared/emacs/.emacs.d/elpa/add-node-modules-path-20180710.2342/add-node-modules-path.elcbin0 -> 1688 bytes
4 files changed, 116 insertions, 0 deletions
diff --git a/configs/shared/emacs/.emacs.d/elpa/add-node-modules-path-20180710.2342/add-node-modules-path-autoloads.el b/configs/shared/emacs/.emacs.d/elpa/add-node-modules-path-20180710.2342/add-node-modules-path-autoloads.el
new file mode 100644
index 000000000000..3c43ba2bdbc4
--- /dev/null
+++ b/configs/shared/emacs/.emacs.d/elpa/add-node-modules-path-20180710.2342/add-node-modules-path-autoloads.el
@@ -0,0 +1,35 @@
+;;; add-node-modules-path-autoloads.el --- automatically extracted autoloads
+;;
+;;; Code:
+(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
+
+;;;### (autoloads nil "add-node-modules-path" "add-node-modules-path.el"
+;;;;;;  (23438 54284 226170 718000))
+;;; Generated autoloads from add-node-modules-path.el
+
+(defvar add-node-modules-path-debug nil "\
+Enable verbose output when non nil.")
+
+(custom-autoload 'add-node-modules-path-debug "add-node-modules-path" t)
+
+(defvar add-node-modules-max-depth 20 "\
+Max depth to look for node_modules.")
+
+(custom-autoload 'add-node-modules-max-depth "add-node-modules-path" t)
+
+(autoload 'add-node-modules-path "add-node-modules-path" "\
+Search the current buffer's parent directories for `node_modules/.bin`.
+Traverse the directory structure up, until reaching the user's home directory,
+ or hitting add-node-modules-max-depth.
+Any path found is added to the `exec-path'.
+
+\(fn)" t nil)
+
+;;;***
+
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; End:
+;;; add-node-modules-path-autoloads.el ends here
diff --git a/configs/shared/emacs/.emacs.d/elpa/add-node-modules-path-20180710.2342/add-node-modules-path-pkg.el b/configs/shared/emacs/.emacs.d/elpa/add-node-modules-path-20180710.2342/add-node-modules-path-pkg.el
new file mode 100644
index 000000000000..3c5d53fd57a7
--- /dev/null
+++ b/configs/shared/emacs/.emacs.d/elpa/add-node-modules-path-20180710.2342/add-node-modules-path-pkg.el
@@ -0,0 +1,2 @@
+;;; -*- no-byte-compile: t -*-
+(define-package "add-node-modules-path" "20180710.2342" "Add node_modules to your exec-path" 'nil :commit "f31e69ccb681f882aebb806ce6e9478e3ac39708" :keywords '("javascript" "node" "node_modules" "eslint") :authors '(("Neri Marschik" . "marschik_neri@cyberagent.co.jp")) :maintainer '("Neri Marschik" . "marschik_neri@cyberagent.co.jp") :url "https://github.com/codesuki/add-node-modules-path")
diff --git a/configs/shared/emacs/.emacs.d/elpa/add-node-modules-path-20180710.2342/add-node-modules-path.el b/configs/shared/emacs/.emacs.d/elpa/add-node-modules-path-20180710.2342/add-node-modules-path.el
new file mode 100644
index 000000000000..cd8adc0f8d51
--- /dev/null
+++ b/configs/shared/emacs/.emacs.d/elpa/add-node-modules-path-20180710.2342/add-node-modules-path.el
@@ -0,0 +1,79 @@
+;;; add-node-modules-path.el --- Add node_modules to your exec-path
+
+;; Copyright (C) 2016 Neri Marschik
+;; This package uses the MIT License.
+;; See the LICENSE file.
+
+;; Author: Neri Marschik <marschik_neri@cyberagent.co.jp>
+;; Version: 1.0
+;; Package-Version: 20180710.2342
+;; Package-Requires: ()
+;; Keywords: javascript, node, node_modules, eslint
+;; URL: https://github.com/codesuki/add-node-modules-path
+
+;;; Commentary:
+;;
+;; This file provides `add-node-modules-path', which searches
+;; the current files parent directories for the `node_modules/.bin/' directory
+;; and adds it to the buffer local `exec-path'.
+;; This allows Emacs to find project based installs of e.g. eslint.
+;;
+;; Usage:
+;;     M-x add-node-modules-path
+;;
+;;     To automatically run it when opening a new buffer:
+;;     (Choose depending on your favorite mode.)
+;;
+;;     (eval-after-load 'js-mode
+;;       '(add-hook 'js-mode-hook #'add-node-modules-path))
+;;
+;;     (eval-after-load 'js2-mode
+;;       '(add-hook 'js2-mode-hook #'add-node-modules-path))
+
+;;; Code:
+
+;;;###autoload
+(defcustom add-node-modules-path-debug nil
+  "Enable verbose output when non nil."
+  :type 'boolean)
+
+;;;###autoload
+(defcustom add-node-modules-max-depth 20
+  "Max depth to look for node_modules."
+  :type 'integer)
+
+;;;###autoload
+(defun add-node-modules-path ()
+  "Search the current buffer's parent directories for `node_modules/.bin`.
+Traverse the directory structure up, until reaching the user's home directory,
+ or hitting add-node-modules-max-depth.
+Any path found is added to the `exec-path'."
+  (interactive)
+  (let* ((default-dir (expand-file-name default-directory))
+         (file (or (buffer-file-name) default-dir))
+         (home (expand-file-name "~"))
+         (iterations add-node-modules-max-depth)
+         (root (directory-file-name (or (and (buffer-file-name) (file-name-directory (buffer-file-name))) default-dir)))
+         (roots '()))
+    (while (and root (> iterations 0))
+      (setq iterations (1- iterations))
+      (let ((bindir (expand-file-name "node_modules/.bin/" root)))
+        (when (file-directory-p bindir)
+          (add-to-list 'roots bindir)))
+      (if (string= root home)
+          (setq root nil)
+        (setq root (directory-file-name (file-name-directory root)))))
+    (if roots
+        (progn
+          (make-local-variable 'exec-path)
+          (while roots
+            (add-to-list 'exec-path (car roots))
+            (when add-node-modules-path-debug
+              (message (concat "added " (car roots) " to exec-path")))
+            (setq roots (cdr roots))))
+      (when add-node-modules-path-debug
+        (message (concat "node_modules/.bin not found for " file))))))
+
+(provide 'add-node-modules-path)
+
+;;; add-node-modules-path.el ends here
diff --git a/configs/shared/emacs/.emacs.d/elpa/add-node-modules-path-20180710.2342/add-node-modules-path.elc b/configs/shared/emacs/.emacs.d/elpa/add-node-modules-path-20180710.2342/add-node-modules-path.elc
new file mode 100644
index 000000000000..a8db407d772b
--- /dev/null
+++ b/configs/shared/emacs/.emacs.d/elpa/add-node-modules-path-20180710.2342/add-node-modules-path.elc
Binary files differ