c6a6c41d92
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.
32 lines
923 B
EmacsLisp
32 lines
923 B
EmacsLisp
;;; 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))
|