From e63c489dd496e53b68b942d0b76e13b62117fae9 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 7 Dec 2016 23:18:36 -0800 Subject: [PATCH] Minor fix for symbol-file * lisp/subr.el (symbol-file): Avoid false matches with "require" elements in load-history. (Bug#25109) --- lisp/subr.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/subr.el b/lisp/subr.el index 5da5bf8388a..7d4409e3167 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1879,7 +1879,7 @@ definition, variable definition, or face definition only." (autoloadp (symbol-function symbol))) (nth 1 (symbol-function symbol)) (let ((files load-history) - file) + file match) (while files (if (if type (if (eq type 'defvar) @@ -1890,7 +1890,8 @@ definition, variable definition, or face definition only." ;; We accept all types, so look for variable def ;; and then for any other kind. (or (member symbol (cdr (car files))) - (rassq symbol (cdr (car files))))) + (and (setq match (rassq symbol (cdr (car files)))) + (not (eq 'require (car match)))))) (setq file (car (car files)) files nil)) (setq files (cdr files))) file))) -- 2.39.2