mirror of
https://github.com/vale981/boon
synced 2025-03-06 01:51:38 -05:00
improve navigation of tags
This commit is contained in:
parent
57913e5db4
commit
47e04abf60
3 changed files with 10 additions and 4 deletions
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
|
|
||||||
(define-key boon-moves-map "k" 'boon-switch-mark) ; bacK to marK
|
(define-key boon-moves-map "k" 'boon-switch-mark) ; bacK to marK
|
||||||
(define-key boon-moves-map "K" 'pop-global-mark)
|
(define-key boon-moves-map "K" 'pop-tag-mark)
|
||||||
|
|
||||||
(define-key boon-moves-map "j" 'boon-find-definition)
|
(define-key boon-moves-map "j" 'boon-find-definition)
|
||||||
(define-key boon-moves-map "J" 'find-function)
|
(define-key boon-moves-map "J" 'find-function)
|
||||||
|
|
|
@ -64,6 +64,7 @@
|
||||||
(define-key boon-x-map "vv" 'magit-status)
|
(define-key boon-x-map "vv" 'magit-status)
|
||||||
(define-key boon-x-map "g" 'magit-status)
|
(define-key boon-x-map "g" 'magit-status)
|
||||||
(define-key boon-x-map "x" 'helm-M-x)
|
(define-key boon-x-map "x" 'helm-M-x)
|
||||||
|
(define-key boon-x-map ":" 'eval-expression)
|
||||||
|
|
||||||
(eval-after-load 'flycheck
|
(eval-after-load 'flycheck
|
||||||
'(define-key boon-x-map "y" flycheck-command-map)
|
'(define-key boon-x-map "y" flycheck-command-map)
|
||||||
|
|
11
boon-main.el
11
boon-main.el
|
@ -31,7 +31,11 @@ Search preferentially for a function, then a variable."
|
||||||
"Find the symbol at point in the current tags table."
|
"Find the symbol at point in the current tags table."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((symb (thing-at-point 'symbol)))
|
(let ((symb (thing-at-point 'symbol)))
|
||||||
(cond (symb (find-tag symb))
|
(cond (symb
|
||||||
|
(find-tag symb (when (and current-prefix-arg (bound-and-true-p last-tag))
|
||||||
|
(if (< (prefix-numeric-value current-prefix-arg) 0)
|
||||||
|
'-
|
||||||
|
t))))
|
||||||
(t (call-interactively 'find-tag)))))
|
(t (call-interactively 'find-tag)))))
|
||||||
|
|
||||||
(defcustom boon-find-definition-dispatch '()
|
(defcustom boon-find-definition-dispatch '()
|
||||||
|
@ -39,7 +43,7 @@ Search preferentially for a function, then a variable."
|
||||||
:group 'boon
|
:group 'boon
|
||||||
:type '(alist :key-type symbol :value-type function))
|
:type '(alist :key-type symbol :value-type function))
|
||||||
(setq boon-find-definition-dispatch
|
(setq boon-find-definition-dispatch
|
||||||
'((c-mode . (lambda () (interactive) (boon-find-tag-at-point)))
|
'((c-mode . boon-find-tag-at-point)
|
||||||
(emacs-lisp-mode . boon-find-elisp-thing-at-point)
|
(emacs-lisp-mode . boon-find-elisp-thing-at-point)
|
||||||
(lisp-interaction-mode . boon-find-elisp-thing-at-point)
|
(lisp-interaction-mode . boon-find-elisp-thing-at-point)
|
||||||
(haskell-mode . haskell-mode-jump-to-def-or-tag)))
|
(haskell-mode . haskell-mode-jump-to-def-or-tag)))
|
||||||
|
@ -48,9 +52,10 @@ Search preferentially for a function, then a variable."
|
||||||
"Find a definition, in a way which is adapted to the 'major-mode'.
|
"Find a definition, in a way which is adapted to the 'major-mode'.
|
||||||
If possible, prompt the symbol at point."
|
If possible, prompt the symbol at point."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
;; TODO (ring-insert find-tag-marker-ring (point-marker))
|
||||||
(let ((mode-fap (assoc major-mode boon-find-definition-dispatch)))
|
(let ((mode-fap (assoc major-mode boon-find-definition-dispatch)))
|
||||||
(if mode-fap (call-interactively (cdr mode-fap))
|
(if mode-fap (call-interactively (cdr mode-fap))
|
||||||
(error "Finding definitions is not defined for %s. Update the variable 'boon-find-definition-dispatch'."
|
(error "Finding definitions is not dering-insert fined for %s. Update the variable 'boon-find-definition-dispatch'."
|
||||||
major-mode))))
|
major-mode))))
|
||||||
|
|
||||||
(defcustom boon-hints-enabled 't "Display hints." :group 'boon)
|
(defcustom boon-hints-enabled 't "Display hints." :group 'boon)
|
||||||
|
|
Loading…
Add table
Reference in a new issue