From 9b0a2d222e411c61e539e1d18f653a9da03c9378 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 2 Mar 2018 22:31:23 -0500 Subject: [PATCH] feature/file-templates: new :file-template setting --- modules/feature/file-templates/config.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/feature/file-templates/config.el b/modules/feature/file-templates/config.el index 095cc1aab..a92e3dfb3 100644 --- a/modules/feature/file-templates/config.el +++ b/modules/feature/file-templates/config.el @@ -6,6 +6,14 @@ (expand-file-name "templates/" (file-name-directory load-file-name)) "The path to a directory of yasnippet folders to use for file templates.") +(def-setting! :file-template (regexp trigger mode &optional project-only-p) + "Register a file template (associated with TRIGGER, the uuid of the target +snippet) for empty files that match REGEXP in MODE (a major mode symbol). + +If PROJECT-ONLY-P is non-nil, the template won't be expanded if the buffer isn't +in a project." + `(+file-templates-add (list ,regexp ,trigger ,mode ,project-only-p))) + ;; ;; Plugins