Message ID | 8735dvqws5.fsf@trop.in |
---|---|
State | Accepted |
Headers | show |
Series | [bug#56955] .dir-locals.el: Add guix yasnippets. | expand |
Context | Check | Description |
---|---|---|
cbaines/comparison | success | View comparision |
cbaines/git-branch | success | View Git branch |
cbaines/applying patch | success | View Laminar job |
cbaines/issue | success | View issue |
Hi Andrew, [...] >> Perhaps what it could do is check if the yas-snippet-dirs already has >> the guix snippets directory, and do nothing if it does. > > That's right, attaching v2 with the fix. > > From 43ab1f3da75cd8bb719b664c42f23f053b3fbb69 Mon Sep 17 00:00:00 2001 > From: Andrew Tropin <andrew@trop.in> > Date: Wed, 3 Aug 2022 17:51:48 +0300 > Subject: [PATCH v2] .dir-locals.el: Add guix yasnippets. > > * .dir-locals.el (eval): Add guix yasnippets. > --- > .dir-locals.el | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/.dir-locals.el b/.dir-locals.el > index e4c1da8026..6fa0ec8bc6 100644 > --- a/.dir-locals.el > +++ b/.dir-locals.el > @@ -14,6 +14,17 @@ > (eval . (setq-local guix-directory > (locate-dominating-file default-directory > ".dir-locals.el"))) > + ;; YASnippet > + (eval . (with-eval-after-load > + 'yasnippet > + (let ((guix-yasnippets > + (expand-file-name > + "etc/snippets" > + (locate-dominating-file default-directory > + ".dir-locals.el")))) > + (unless (member guix-yasnippets yas-snippet-dirs) > + (add-to-list 'yas-snippet-dirs guix-yasnippets) > + (yas-reload-all))))) Sorry for failing to produce a reply earlier: the above LGTM! Another small step toward a zero-config Emacs setup for hacking on Guix :-). Feel free to push! Thanks, Maxim
From 43ab1f3da75cd8bb719b664c42f23f053b3fbb69 Mon Sep 17 00:00:00 2001 From: Andrew Tropin <andrew@trop.in> Date: Wed, 3 Aug 2022 17:51:48 +0300 Subject: [PATCH v2] .dir-locals.el: Add guix yasnippets. * .dir-locals.el (eval): Add guix yasnippets. --- .dir-locals.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.dir-locals.el b/.dir-locals.el index e4c1da8026..6fa0ec8bc6 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -14,6 +14,17 @@ (eval . (setq-local guix-directory (locate-dominating-file default-directory ".dir-locals.el"))) + ;; YASnippet + (eval . (with-eval-after-load + 'yasnippet + (let ((guix-yasnippets + (expand-file-name + "etc/snippets" + (locate-dominating-file default-directory + ".dir-locals.el")))) + (unless (member guix-yasnippets yas-snippet-dirs) + (add-to-list 'yas-snippet-dirs guix-yasnippets) + (yas-reload-all))))) ;; Geiser ;; This allows automatically setting the `geiser-guile-load-path' -- 2.37.1