;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
-;;
-;; The funniest thing about this is that I can't imagine why a package
-;; so obviously useful as this hasn't been written before!!
-;; ;;; find-func
-;; (find-function-setup-keys)
-;;
-;; or just:
-;;
-;; (load "find-func")
-;;
-;; if you don't like the given keybindings and away you go! It does
-;; pretty much what you would expect, putting the cursor at the
-;; definition of the function or variable at point.
-;;
-;; The code started out from `describe-function', `describe-key'
-;; ("help.el") and `fff-find-loaded-emacs-lisp-function' (Noah Friedman's
-;; "fff.el").
+
+;; Find the definition of an ELisp function (or variable, or a face...)
+;; by name.
;;; Code:
(when (string-match "\\.emacs\\(.el\\)\\'" library)
(setq library (substring library 0 (match-beginning 1))))
(let* ((filename (find-library-name library))
- (regexp-symbol (cdr (assq type find-function-regexp-alist))))
+ (regexp-symbol
+ (alist-get type (append (get symbol 'find-definition-alist)
+ find-function-regexp-alist))))
(with-current-buffer (find-file-noselect filename)
(let ((regexp (if (functionp regexp-symbol) regexp-symbol
(format (symbol-value regexp-symbol)