]> git.eshelyaron.com Git - emacs.git/commitdiff
More sensible implementation of just-skipped commit
authorEshel Yaron <me@eshelyaron.com>
Mon, 13 Jan 2025 13:27:15 +0000 (14:27 +0100)
committerEshel Yaron <me@eshelyaron.com>
Mon, 13 Jan 2025 13:27:15 +0000 (14:27 +0100)
lisp/emacs-lisp/find-func.el

index c6f41dcf36e7eb35fd8b38e7ec34324fea1fe222..0a5938ff62ad47a8203889a4d12c0709a29e1a32 100644 (file)
 ;; 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:
 
@@ -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)