GNU bug report logs - #56955
[PATCH] .dir-locals.el: Add guix yasnippets.

Previous Next

Package: guix-patches;

Reported by: Andrew Tropin <andrew <at> trop.in>

Date: Wed, 3 Aug 2022 15:03:01 UTC

Severity: normal

Tags: patch

Done: Andrew Tropin <andrew <at> trop.in>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Andrew Tropin <andrew <at> trop.in>
Cc: 56955 <at> debbugs.gnu.org
Subject: [bug#56955] [PATCH] .dir-locals.el: Add guix yasnippets.
Date: Wed, 10 Aug 2022 16:26:10 -0400
Hi Andrew,

Andrew Tropin <andrew <at> trop.in> writes:

> * .dir-locals.el (eval): Add guix yasnippets.
> ---
>  .dir-locals.el | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/.dir-locals.el b/.dir-locals.el
> index e4c1da8026..ecaec8de87 100644
> --- a/.dir-locals.el
> +++ b/.dir-locals.el
> @@ -14,6 +14,15 @@
>       (eval . (setq-local guix-directory
>                           (locate-dominating-file default-directory
>                                                   ".dir-locals.el")))
> +     ;; YASnippet
> +     (eval . (with-eval-after-load
> +                 'yasnippet
> +               (add-to-list 'yas-snippet-dirs
> +                            (expand-file-name
> +                             "etc/snippets"
> +                             (locate-dominating-file default-directory
> +                                                     ".dir-locals.el")))
> +               (yas-reload-all)))

That's an interesting idea, but wouldn't the `yas-reload-all` be
triggered for every module visited?  That may take some time if a user
has lots of snippets in their collection.

Perhaps what it could do is check if the yas-snippet-dirs already has
the guix snippets directory, and do nothing if it does.

Thanks,

Maxim




This bug report was last modified 2 years and 260 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.