From afe8cf0f674d9e4b83ef93b7c3259253657be163 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Bernardy Date: Fri, 5 Feb 2016 23:46:28 +0100 Subject: [PATCH] for C, use tags --- boon-main.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/boon-main.el b/boon-main.el index 39aa3f5..7345563 100644 --- a/boon-main.el +++ b/boon-main.el @@ -20,12 +20,19 @@ Search preferentially for a function, then a variable." ((boundp symb) (find-function-do-it symb 'defvar 'switch-to-buffer)) (t (call-interactively 'helm-apropos))))) +(defun boon-find-tag-at-point () + (interactive) + (let ((symb (thing-at-point 'symbol))) + (cond (symb (find-tag symb)) + (t (call-interactively 'find-tag))))) + (defcustom boon-find-definition-dispatch '() "An alist mapping major modes to finding the symbol at point." :group 'boon :type '(alist :key-type symbol :value-type function)) (setq boon-find-definition-dispatch - '((emacs-lisp-mode . boon-find-elisp-thing-at-point) + '((c-mode . (lambda () (interactive) (boon-find-tag-at-point))) + (emacs-lisp-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)))