emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/setup 22b5312 23/25: Add :file-match macro


From: Stefan Monnier
Subject: [elpa] externals/setup 22b5312 23/25: Add :file-match macro
Date: Wed, 14 Apr 2021 18:49:04 -0400 (EDT)

branch: externals/setup
commit 22b531263be38df9fedf83fd617c12f1f5b08ec2
Author: Philip K <philipk@posteo.net>
Commit: Philip K <philipk@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

[Prev in Thread] Current Thread [Next in Thread]