From 7637e361d3baeefc7e6ab147ccfccfcc774dcd01 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 20 Jun 2023 16:35:09 +0300 Subject: [PATCH] Don't truncate filenames with "emacs.el" in them * lisp/emacs-lisp/find-func.el (find-function-search-for-symbol): Avoid false positives when looking for "emacs.el" matches the likes of "emacs.elpa". (Bug#64143) --- lisp/emacs-lisp/find-func.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index f9f919afb1b..bf890fc35a9 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el @@ -407,7 +407,7 @@ The search is done in the source for library LIBRARY." (setq library (substring library 0 (match-beginning 1)))) ;; Strip extension from .emacs.el to make sure symbol is searched in ;; .emacs too. - (when (string-match "\\.emacs\\(.el\\)" 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)))) -- 2.39.2