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

    Add :file-match macro
---
 setup.el | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/setup.el b/setup.el
index 75ad046..d2b786e 100644
--- a/setup.el
+++ b/setup.el
@@ -502,6 +502,13 @@ 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 :file-match
+  (lambda (pat)
+    `(add-to-list 'auto-mode-alist (cons ,pat setup-mode)))
+  :documentation "Associate the current mode with files that match PAT."
+  :debug '(form)
+  :repeatable t)
+
 (setup-define :when-loaded
   (lambda (&rest body) `(progn ,@body))
   :documentation "Evaluate BODY after the current feature has been loaded.

Reply via email to