From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id aMfyD6T9sV/tQwAA0tVLHw (envelope-from ) for ; Mon, 16 Nov 2020 04:18:44 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id OGbdC6T9sV9OVwAAB5/wlQ (envelope-from ) for ; Mon, 16 Nov 2020 04:18:44 +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 EDF559403E6 for ; Mon, 16 Nov 2020 04:18:43 +0000 (UTC) Received: from localhost ([::1]:45168 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1keVyU-0002K5-PA for larch@yhetil.org; Sun, 15 Nov 2020 23:18:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43792) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1keVyN-0002Jx-0i for guix-devel@gnu.org; Sun, 15 Nov 2020 23:18:35 -0500 Received: from mail-qv1-xf43.google.com ([2607:f8b0:4864:20::f43]:41570) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1keVyK-0006Dv-Nd for guix-devel@gnu.org; Sun, 15 Nov 2020 23:18:34 -0500 Received: by mail-qv1-xf43.google.com with SMTP id x13so8200367qvk.8 for ; Sun, 15 Nov 2020 20:18:31 -0800 (PST) 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=0lMfqFOEmX1klYAdhxw046QUTfQvi/ZTnNTz4IEKWHg=; b=t0ofHWrdjpSEO+Ge1E6U2Zr5BmCLzqNMfAoohLXwWus3e7a8dGjCJEJw55bP68bqwU a4nIW5ZxwIp+wFhodII11dSamLFts/qmtyzoPC4AlFb9XT4as9RwOpydgcj3A+A/3xof zF4M9xV3NaM1StjcbiAbl/c8TFHeUnJCVk4hkoqV1W5EUdHOIbJ5dyQXQz41+ebPl8zG Tb8KrD6BQ4oY1XYhNMUFMH9a2vWWviU6CpIOcNb9S6DDAz9xrgWv7g9KUdzkJvi6SWPT 1/XSbSif6M0sKytdFVpGfcHUqZoeX4BNjJKixvf4GGPQ/NkC1+UetTFKqP56TPEQacf4 epag== 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=0lMfqFOEmX1klYAdhxw046QUTfQvi/ZTnNTz4IEKWHg=; b=jVIEL+ljRXqBF+4iHv6iM/ZoC6VIWxD8GNrkYMVTR+of8g7x/BU6d+4mHO6HA0j9Ad VLqYf+91SkAQaEEYuphmfQB3ycANc+1pDbBzaV8a4RTrycCpUDXNNWRuKiiN8uFxYlTT kNvtWl1H8GvN8riNya19YVgl90NlqVsv5LpOw0FnMcyXiBAcNwGNZ7y/wTX+qPCiIcgS vi0MjEm5x7uNQZnqPeJKAMXfi7klDFtfJ80VwM1nc9b2AQp9TP+dde98weYZQx9iv/l+ WOdtQv+ckLwHtNm184gySggRv+V758ROdwREMzmfaZ1UECfyyLCRC3CwXQenxfFF71vy ai2g== X-Gm-Message-State: AOAM53170vykp4nJmgiYySPGhfA/NS5d1rwXjMrCTNPAHK+4XkZiPQ0N rA6aoIIXc4fvvtB48fPxG20Hqy+eeD1ohg== X-Google-Smtp-Source: ABdhPJxHZktGeGsyHikgYhoxfYraS044WzJUe6M0HJ8EAftvvHzXlk7YgzNS//YsDDAg5+TGwig4Cg== X-Received: by 2002:ad4:584e:: with SMTP id de14mr14052253qvb.35.1605500311074; Sun, 15 Nov 2020 20:18:31 -0800 (PST) Received: from hurd (dsl-10-128-91.b2b2c.ca. [72.10.128.91]) by smtp.gmail.com with ESMTPSA id d82sm11790949qkc.14.2020.11.15.20.18.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Nov 2020 20:18:30 -0800 (PST) From: Maxim Cournoyer To: Christopher Lemmer Webber Subject: Re: [PATCH] Automatically set `geiser-guile-load-path' from .dir-locals References: <87tuuixjno.fsf@gmail.com> <87zh3w5ytp.fsf@dustycloud.org> <87wnz05u7d.fsf@dustycloud.org> <87tuu46tqm.fsf@gmail.com> <87lff3iueo.fsf@dustycloud.org> Date: Sun, 15 Nov 2020 23:18:14 -0500 In-Reply-To: <87lff3iueo.fsf@dustycloud.org> (Christopher Lemmer Webber's message of "Sat, 14 Nov 2020 14:57:03 -0500") Message-ID: <87y2j2c4u1.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::f43; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qv1-xf43.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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_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: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=fail (headers rsa verify failed) header.d=gmail.com header.s=20161025 header.b=t0ofHWrd; 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: 0.09 X-TUID: qfcNdaFhOVTk Hello Christopher, CC'ing Ludovic since they had that problem as well, so might be interested in testing your solution. Christopher Lemmer Webber writes: [...] > I figured out what was happening! The bug is *technically* in vc-mode. > However, nontheless it manifested here... > > Here's what happened. vc-mode has some various hacks, as you can see > above with "hack-local-variables-apply"... which traverses the dirlocals > stuff. (Not sure what the purpose is, didn't look too long.) > > However for whatever reason, vc-mode also seems to be reusing buffers > such as `*vc-diff*'... and somehow still is left in the directory > context it *first* was used in. > > Thus if I C-x v = in a guix-oriented buffer first, and then switch to > another completely different project and do the same, it's loading the > dirlocals from Guix(...!!!!) > > This is clearly a bug in vc-mode, I'll try to report it as such. Thank you for the investigation. I'd be really happy if you could report the problem upstream (M-x report-emacs-bug) and link to it here! Be sure to include a very detailed description of how to reproduce; I for one still am unable to reproduce with the above instructions. I've tried many ways, using a pure environment, not loading my Emacs init file, etc. based on what Miguel had written in IRC at the time of the initial report, but to no avail. > In the meanwhile, I used this hacky "fix". Maybe worth applying for the > moment... what do you think of it? I'd like to have the upstream bug linked in that fix rather than the Guix one; that way it'll be possible to track upstream resolution and know when the workaround can be removed. > #+BEGIN_SRC diff > diff --git a/.dir-locals.el b/.dir-locals.el > index 8e5d3902e3..2aa446a4f6 100644 > --- a/.dir-locals.el > +++ b/.dir-locals.el > @@ -17,17 +17,19 @@ > ;; Geiser > ;; This allows automatically setting the `geiser-guile-load-path' > ;; variable when using various Guix checkouts (e.g., via git worktrees). > - (eval . (let* ((root-dir (expand-file-name > - (locate-dominating-file > - default-directory ".dir-locals.el"))) > - ;; Workaround for bug https://issues.guix.gnu.org/43818. > - (root-dir* (directory-file-name root-dir))) > - (unless (boundp 'geiser-guile-load-path) > - (defvar geiser-guile-load-path '())) > - (make-local-variable 'geiser-guile-load-path) > - (require 'cl-lib) > - (cl-pushnew root-dir* geiser-guile-load-path > - :test #'string-equal))))) > + (eval . (let ((root-dir-unexpanded (locate-dominating-file > + default-directory ".dir-locals.el"))) > + (when root-dir-unexpanded > + (let* ((root-dir (expand-file-name root-dir-unexpanded)) > + ;; Workaround for bug https://issues.guix.gnu.org/43818. > + (root-dir* (directory-file-name root-dir))) > + > + (unless (boundp 'geiser-guile-load-path) > + (defvar geiser-guile-load-path '())) > + (make-local-variable 'geiser-guile-load-path) > + (require 'cl-lib) > + (cl-pushnew root-dir* geiser-guile-load-path > + :test #'string-equal))))))) > > (c-mode . ((c-file-style . "gnu"))) > (scheme-mode > #+END_SRC > > Btw, I'm not very familiar with dirlocals. I see that setq is used in > the previous definition. Woudl setq-local be better... or does it do > that by default? Good observation. The `guix-directory' is set globally. It could be neater if we made it also a buffer-local variable like the `geiser-guile-load-path' below. Thank you for having persevered in understanding the root cause of the issue you had, and sharing the details here. Maxim