From patchwork Wed Aug 17 05:11:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Tropin X-Patchwork-Id: 41750 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 210A027BBEA; Wed, 17 Aug 2022 06:12:40 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 12D3A27BBE9 for ; Wed, 17 Aug 2022 06:12:39 +0100 (BST) Received: from localhost ([::1]:35856 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oOBM6-0004mo-7a for patchwork@mira.cbaines.net; Wed, 17 Aug 2022 01:12:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59626) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oOBLW-0004mY-GO for guix-patches@gnu.org; Wed, 17 Aug 2022 01:12:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59358) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oOBLW-00015B-1D for guix-patches@gnu.org; Wed, 17 Aug 2022 01:12:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oOBLV-0005YD-Mp for guix-patches@gnu.org; Wed, 17 Aug 2022 01:12:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56955] [PATCH] .dir-locals.el: Add guix yasnippets. Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 17 Aug 2022 05:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56955 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxim Cournoyer Cc: 56955@debbugs.gnu.org Received: via spool by 56955-submit@debbugs.gnu.org id=B56955.166071311221323 (code B ref 56955); Wed, 17 Aug 2022 05:12:01 +0000 Received: (at 56955) by debbugs.gnu.org; 17 Aug 2022 05:11:52 +0000 Received: from localhost ([127.0.0.1]:49107 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oOBLM-0005Xp-D3 for submit@debbugs.gnu.org; Wed, 17 Aug 2022 01:11:52 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:43131) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oOBLJ-0005XZ-Ib for 56955@debbugs.gnu.org; Wed, 17 Aug 2022 01:11:50 -0400 Received: (Authenticated sender: andrew@trop.in) by mail.gandi.net (Postfix) with ESMTPSA id 760CDC0004; Wed, 17 Aug 2022 05:11:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1660713103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ijgcdT99oIl9htpe0v6rFDYR+3ugfP9zj1set7b+cBQ=; b=MiYXSaosJeYCHa6CJW5gjJuxNo9K7xt854GdT8TdREWR8E5kMC3e1QNnHhnnd1li6VxdE0 /2m9BLJ+bCJT9D5q47PVb7B6Wlwfm4acPHUSSgTVBFpXK3XwJVEWBh1EyPxlwrsYeXQnOq vbOtRINBjHhDwKaMe+RInEW+TLgMPaeCfEKlarwQLN4F9R3QDo3dRUou5gL599CN0QYMmb m+GEvoPEJVupPqD9T/U9D/GYqQ9+rFATEvVtpD3+adXt2ly8Hvse3FLoo55WqzAqihvdv/ eqT4YJWr8qzDDla/5YxI700fsZj8PCWccF05xXGhOVy6dnz+PjfCENyVfz+PDA== From: Andrew Tropin In-Reply-To: <87o7wrlual.fsf@gmail.com> References: <877d3pid5m.fsf@trop.in> <87o7wrlual.fsf@gmail.com> Date: Wed, 17 Aug 2022 08:11:38 +0300 Message-ID: <8735dvqws5.fsf@trop.in> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches On 2022-08-10 16:26, Maxim Cournoyer wrote: > Hi Andrew, > > Andrew Tropin 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. That's right, attaching v2 with the fix. From 43ab1f3da75cd8bb719b664c42f23f053b3fbb69 Mon Sep 17 00:00:00 2001 From: Andrew Tropin 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