From 38faf8846f7738b533aa29622fd7f78a8c6c81cd Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 21 Aug 2016 10:51:38 -0400 Subject: [PATCH v1] Improvements to --load argument handling * lisp/startup.el (command-line-1): Search for files with load-suffixes in default dir (Bug #17484). Only pass normal files that were found, since `load' doesn't handle directories (Bug #16406). --- lisp/startup.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/startup.el b/lisp/startup.el index fcdc376..9134604 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -2392,8 +2392,9 @@ command-line-1 (or argval (pop command-line-args-left)))) ;; Take file from default dir if it exists there; ;; otherwise let `load' search for it. - (file-ex (expand-file-name file))) - (when (file-exists-p file-ex) + (file-ex (locate-file file (list default-directory) + load-suffixes))) + (when (and file-ex (file-regular-p file-ex)) (setq file file-ex)) (load file nil t))) -- 2.9.2