spacemacs/layers/+lang/javascript/funcs.el
syl20bnr c6a6c41d92 Replace hooks by regular list for jump lists
Hook semantic is to be used with run-hooks API and run all hooks
sequentially, jump list semantic is different since the running
functions are not guaranteed to be executed so we prefer using regular
list API to manage jump-lists.
2016-09-04 12:28:40 -04:00

32 lines
923 B
EmacsLisp
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

;;; funcs.el --- Javascript Layer functions File for Spacemacs
;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;;
;; Author: Muneeb Shaikh <muneeb@reversehack.in>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
;; tern
(defun spacemacs//set-tern-key-bindings (mode)
"Set the key bindings for tern and the given MODE."
(add-to-list (intern (format "spacemacs-jump-handlers-%S" mode))
'tern-find-definition)
(spacemacs/set-leader-keys-for-major-mode mode
"rrV" 'tern-rename-variable
"hd" 'tern-get-docs
"gG" 'tern-find-definition-by-name
(kbd "C-g") 'tern-pop-find-definition
"ht" 'tern-get-type))
(defun spacemacs//tern-detect ()
"Detect tern binary and warn if not found."
(let ((found (executable-find "tern")))
(unless found
(spacemacs-buffer/warning "tern binary not found!"))
found))