summaryrefslogtreecommitdiff
path: root/lisp/subr.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2016-12-07 23:18:36 -0800
committerGlenn Morris <rgm@gnu.org>2016-12-07 23:18:36 -0800
commite63c489dd496e53b68b942d0b76e13b62117fae9 (patch)
treefc7b7cd01211c8d2c9d25ce50e60e38e1a6caf98 /lisp/subr.el
parentaf96803459cb777fa4528e02bd0f60c1d502638f (diff)
downloademacs-e63c489dd496e53b68b942d0b76e13b62117fae9.tar.gz
Minor fix for symbol-file
* lisp/subr.el (symbol-file): Avoid false matches with "require" elements in load-history. (Bug#25109)
Diffstat (limited to 'lisp/subr.el')
-rw-r--r--lisp/subr.el5
1 files 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)))