branch: externals/setup
commit d44d3336daed8a31bfa03d28925e57b31bbf1e7e
Author: Philip K <phil...@posteo.net>
Commit: Philip K <phil...@posteo.net>

    Add :load-from macro
---
 setup.el | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/setup.el b/setup.el
index 29757bb..18527ab 100644
--- a/setup.el
+++ b/setup.el
@@ -497,6 +497,14 @@ the first PACKAGE."
   :debug '(form)
   :repeatable t)
 
+(setup-define :load-from
+  (lambda (path)
+    `(add-to-list 'load-path ,path))
+  :documentation "Add PATH to load path.
+This macro can be used as HEAD, and it will replace itself with
+the nondirectory part of PATH."
+  :shorthand (lambda (path) (intern (file-name-nondirectory path))))
+
 (setup-define :when-loaded
   (lambda (&rest body) `(progn ,@body))
   :documentation "Evaluate BODY after the current feature has been loaded.

Reply via email to