lisp/files.el (require-with-check): Fix bug#74091.
This commit is contained in:
parent
90c97d3fac
commit
3496234c8e
1 changed files with 6 additions and 5 deletions
|
@ -1280,7 +1280,7 @@ NOERROR is equal to `reload'), or otherwise emit a warning."
|
||||||
(let* ((fn (locate-file (or filename (symbol-name feature))
|
(let* ((fn (locate-file (or filename (symbol-name feature))
|
||||||
load-path (get-load-suffixes) nil
|
load-path (get-load-suffixes) nil
|
||||||
)) ;; load-prefer-newer
|
)) ;; load-prefer-newer
|
||||||
;; We used to look for `fn' in `load-history' with `assoc'
|
;; We used to look for `fn' in `load-history' with `assoc'
|
||||||
;; which works in most cases, but in some cases (e.g. when
|
;; which works in most cases, but in some cases (e.g. when
|
||||||
;; `load-prefer-newer' is set) `locate-file' can return a
|
;; `load-prefer-newer' is set) `locate-file' can return a
|
||||||
;; different file than the file that `require' would load,
|
;; different file than the file that `require' would load,
|
||||||
|
@ -1288,10 +1288,11 @@ NOERROR is equal to `reload'), or otherwise emit a warning."
|
||||||
;; we did load "it". (bug#74040)
|
;; we did load "it". (bug#74040)
|
||||||
;; So use a "permissive" search which doesn't pay attention to
|
;; So use a "permissive" search which doesn't pay attention to
|
||||||
;; differences between file extensions.
|
;; differences between file extensions.
|
||||||
(prefix (if (string-match
|
(prefix (when fn
|
||||||
(concat (regexp-opt (get-load-suffixes)) "\\'") fn)
|
(if (string-match
|
||||||
(concat (substring fn 0 (match-beginning 0)) ".")
|
(concat (regexp-opt (get-load-suffixes)) "\\'") fn)
|
||||||
fn))
|
(concat (substring fn 0 (match-beginning 0)) ".")
|
||||||
|
fn)))
|
||||||
(lh load-history))
|
(lh load-history))
|
||||||
(while (and lh (let ((file (car-safe (car lh))))
|
(while (and lh (let ((file (car-safe (car lh))))
|
||||||
(not (and file (string-prefix-p prefix file)))))
|
(not (and file (string-prefix-p prefix file)))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue