From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id wJtkOjq1ll8VfQAA0tVLHw (envelope-from ) for ; Mon, 26 Oct 2020 11:38:34 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id oG44Njq1ll/hTQAA1q6Kng (envelope-from ) for ; Mon, 26 Oct 2020 11:38:34 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A20C394043B for ; Mon, 26 Oct 2020 11:38:34 +0000 (UTC) Received: from localhost ([::1]:60284 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kX0pd-0003JB-Jn for larch@yhetil.org; Mon, 26 Oct 2020 07:38:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35172) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kX0pU-0003J1-BW for guix-devel@gnu.org; Mon, 26 Oct 2020 07:38:24 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:54163) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kX0pS-0006fb-Jl for guix-devel@gnu.org; Mon, 26 Oct 2020 07:38:24 -0400 Received: by mail-wm1-x32b.google.com with SMTP id d78so11280329wmd.3 for ; Mon, 26 Oct 2020 04:38:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=ZO4SJEoca3bMnD9stNAf6syt2D9yPmFaTBHeCCWA3Ec=; b=SIqlVv9COzVzY0AdYlWYLMpg6VNqy3kA6QAd1jj+i9/4J7cVD535XyjfezHqcFDFhy ZwwtuVD0NKRE27AeaQrGFWHRSolPF+Xd/eyIZN3C5nDiY43Pc5FIzgeOtVeoYRoM5sRY 9QJm7J6Oogs2o569ecAVtGdHOYi/sXjsSk2hygUZuFkh6Sdl8CG33iIpxsZZvoocv99U D/7ACeiPW4pG0CBAkYE5QCBAECwF5KsHvk3N4L1C1w2lP7uL321TzeYI1fVwgpfe2XK7 nzWAN4rvAD/xSRyDJBO6368tZKh8ida4B8iRc5kykpf/6wrRdhZeWzEI8mJGLToZaD0C l9SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=ZO4SJEoca3bMnD9stNAf6syt2D9yPmFaTBHeCCWA3Ec=; b=TB5Z3bfiqkkIUi0YTSUwmTCgUpHJ5sXIcGvZWXcXopAgTDzlSOiAhEv19NoNvYW9qg ectn51Y11GZcae4kAx3rfujARRaIZWk5MJTWdHKLPJW1INALfF0nByGWV+y2g5am9l+J DSBZ1Rg4SoEkBH121dNtl3cm91JH/LcCEqxd1imo2RAjGKztnSqGM8Jd7/MwTlOWtXa8 oe/AirtHBQUaaNAoD/lvwyuOoiEgc8IRkFzlfmCzK2Ex6t3wuReCwuXn3nc9v2fadSRb LivYnQvCLyz6WdDRx6MJKAtmO7pRkyWiGjjZnMauIhQgl56aXgwFO3a2x6L0M68FGRZW XZ4Q== X-Gm-Message-State: AOAM530q/G1qzAr4K4ia4kLwIh7M7C8MoAc7Tecn2ujwZF9CnQ4rENUy ZFFJBm6U12KVnPrVyeehlSU= X-Google-Smtp-Source: ABdhPJzhn2h5GckzgHK2mFUO0/vdJf9eHx+ib3Nyu/e8CphoH+r8+fALRERlZznsjMHitRjjnTm/Dw== X-Received: by 2002:a05:600c:214c:: with SMTP id v12mr14968114wml.23.1603712301165; Mon, 26 Oct 2020 04:38:21 -0700 (PDT) Received: from unfall (218.139.134.37.dynamic.jazztel.es. [37.134.139.218]) by smtp.gmail.com with ESMTPSA id h206sm21002615wmf.47.2020.10.26.04.38.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Oct 2020 04:38:19 -0700 (PDT) From: =?utf-8?Q?Miguel_=C3=81ngel_Arruga_Vivas?= To: Maxim Cournoyer Subject: Re: [PATCH v2] .dir-locals.el: Automatically set the GEISER-GUILE-LOAD-PATH variable. References: <87o8kqowa5.fsf@gmail.com> <20201026055316.25592-1-maxim.cournoyer@gmail.com> Date: Mon, 26 Oct 2020 12:38:14 +0100 In-Reply-To: <20201026055316.25592-1-maxim.cournoyer@gmail.com> (Maxim Cournoyer's message of "Mon, 26 Oct 2020 01:53:16 -0400") Message-ID: <877drdp68p.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=rosen644835@gmail.com; helo=mail-wm1-x32b.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=SIqlVv9C; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Spam-Score: -2.01 X-TUID: 8cH94xYog6xT --=-=-= Content-Type: text/plain Hello, Maxim! Thanks for your effort in this, some comments with the quotes for context. Maxim Cournoyer writes: >> This fails if geiser-guile-load-path does not exist (void-variable). >> The cleanup removes other guixes, isn't it? I suggest making the >> variable buffer-local and forget about hard-coded names. :-) > > That's a good suggestion! I toyed with it and it's a bit tricky but I > think the v2 patch I'll send as a follow-up does the trick. My concern > was also supporting when a user has previously set > geiser-guile-load-path in their .emacs init file, e.g.: > > (setq geiser-guile-load-path (list (expand-file-name "~/src/guix") > (expand-file-name "~/src/shepherd"))) > > That would mean their entries don't get cleaned up (it seems this > doesn't matter in my latest tests with the v2 patch though!). That cleanup seems to me responsibility of that .emacs maintainer instead of something to take into account in .dir-locals. ;-) >> (eval . (setq guix-directory >> (locate-dominating-file default-directory ".dir-locals.el"))) >> (eval . (when (boundp 'geiser-guile-load-path) > > This check makes it so that if geiser-guile-load-path is not already > defined, nothing happens. It is likely that this is the case, as when > relying on just Geiser's autoloads, it is not loaded. The user would > have to either set explicitly before hand or call (require > 'geiser-guile), which we can't rely on. But we can drop this check. You're right, as you can only bind the keys and enable it when used, not at file load as I do, great catch. :-) > One thing that worried me was the %load-compiled-path not appearing in > the order defined from guile-geiser-load-path, but in my latest tests as > mentioned above it didn't matter. With the right directories (meaning no-conflicts between modules) it shouldn't matter, but it's weird. Looking into geiser-guile.el the load path is provided to guile through -L parameters in geiser-guile--parameters, and the extra path for Geiser code is added with geiser-guile--set-geiser-load-path (that's why it is not added to %load-compiled-path)... I'd have to check Guile to be sure why are the differences, but they seem harmless. > + (unless (fboundp 'geiser-guile-load-path) > + (defvar geiser-guile-load-path '())) This checks the function definition, not the variable, as Emacs Lisp has two separate namespaces. > I ended up using `cl-pushnew' here instead of push, as otherwise > repeated entries were accumulated. I wanted to avoid exactly that check, as the variable should end up with duplicated entries only when you call it twice from the same buffer, how could that happen? > + (make-local-variable 'geiser-guile-load-path) > + (cl-pushnew root-dir* geiser-guile-load-path > + :test #'string-equal))))) If there is some way this may happen, then this call is OK, but I'd try to stay with a cheaper push unless it's really needed, as O(1) < O(n), for almost every n. :-) Again, thank you very much for taking care of this, as it would make life easier for everybody of us who uses Geiser. Happy hacking! Miguel --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAEBCgAdFiEEiIeExBRZrMuD5+hMY0xuiXn6vsIFAl+WtSYACgkQY0xuiXn6 vsJ0rwv+Ky91v5eazhu7eVVVdyLV726Qa66xEiPSplyao3iu0Tpvm6II6akM/yOD SVvYKTKjrOJTF7cqII3QO8+JoKrE1hmKYRCJgApgZWtU8LMgTHxjf7aztzk4tt1+ EscQNz5bNOBmZAhmveCZ9uBLMiMVrhwHZdZMgIvAbygg2CpwoWzN8qhmKfKTruVQ q97a/PxkGJ/pDG+nUXSg9wfMFghTGR7am9Rd0wqPlsXhRhP05OiwyLx1Yzf2bLJK H5L5553Jf2d2sRfnZVNhQ/9kF99EsCRTsZ9gSWRO3Zwx4XlJa029/IZzPTTLl59W VcRNyDxDkW/OYPudek9G85crp4SO6/4dIul+izA1povkT+tCS6utCF12YGDv67s9 mAFkLpyfjw681yTg4bXr4I7cvSuB2w3CRtP50mvjHMAOXCWCLebOYw3dMWF1EhxP Vh4uSXinyF5FH09t9I5YLKUxm7cBmeeXMYuGM+DJ4kprr9gObUwstsKMkNEHVocZ l2KiL25V =B14Q -----END PGP SIGNATURE----- --=-=-=--