diff --git a/core/core-lib.el b/core/core-lib.el index 90e1fe56c..c6ff2ab27 100644 --- a/core/core-lib.el +++ b/core/core-lib.el @@ -199,6 +199,14 @@ If FETCHER is a function, ELT is used as the key in LIST (an alist)." elt) ,list))) +(defmacro add-load-path! (&rest dirs) + "Add DIRS to `load-path', relative to the current file. +The current file is the file from which `add-to-load-path!' is used." + `(let ((default-directory ,(dir!)) + file-name-handler-alist) + (dolist (dir (list ,@dirs)) + (cl-pushnew (expand-file-name dir) load-path)))) + (defmacro add-transient-hook! (hook-or-function &rest forms) "Attaches a self-removing function to HOOK-OR-FUNCTION.