From 87e858a6921ccc53b816abf5762dd94c86658a44 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Mon, 13 Jan 2025 14:27:15 +0100 Subject: [PATCH] More sensible implementation of just-skipped commit --- lisp/emacs-lisp/find-func.el | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index c6f41dcf36e..0a5938ff62a 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el @@ -22,23 +22,9 @@ ;; along with GNU Emacs. If not, see . ;;; 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: @@ -499,7 +485,9 @@ The search is done in the source for library LIBRARY." (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) -- 2.39.5