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 CF56Fa0KpF+ONAAA0tVLHw (envelope-from ) for ; Thu, 05 Nov 2020 14:22:37 +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 0LZiEa0KpF/mGAAA1q6Kng (envelope-from ) for ; Thu, 05 Nov 2020 14:22:37 +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 CB32D940105 for ; Thu, 5 Nov 2020 14:22:36 +0000 (UTC) Received: from localhost ([::1]:60320 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kag9r-0000lY-Js for larch@yhetil.org; Thu, 05 Nov 2020 09:22:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40766) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kag9Q-0000kR-P4 for guix-devel@gnu.org; Thu, 05 Nov 2020 09:22:08 -0500 Received: from mail-qt1-x82e.google.com ([2607:f8b0:4864:20::82e]:36204) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kag9N-0001mN-MO for guix-devel@gnu.org; Thu, 05 Nov 2020 09:22:08 -0500 Received: by mail-qt1-x82e.google.com with SMTP id c5so1160971qtw.3 for ; Thu, 05 Nov 2020 06:22:01 -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=gm1eVG8YCOcZub9Ou71atYasLl5BCu2FvPtIQGK2Axs=; b=lwG/4B8mMFjSfS1uZWclY5ItmUCx4s5QyMgmCGkZDrVV9x+B/hQqomR4L7iHwSzTse oKYCjTi0lWVDoIJ0OvmI3GsLdU/UC/aLaSl7CNL3uQhf/rTPCEneYk/Byg4J5BRnhQbH U9J2EFVsaHDueSQI/i90H2Jx3kudHCYQdIeG06B0XnB+OVCHB85OkHrJfPQ/vofVNj2R OQR+r9tk9kEUpFC36qFViXnBvphm+NuWrdXwTnyseCZNvUrPPsa1PSAdW0npnTkHlN+W p10jGXK3MVH8MKM9FEuwFoaqJwDQ7gFSaFXQExZq436NMkJjyzNme88gAgQPq7VnHZ8g Q/lg== 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=gm1eVG8YCOcZub9Ou71atYasLl5BCu2FvPtIQGK2Axs=; b=B+EU+cMtGq6bdnL4bUy5dS17l/zZbnAjxa3XUW5VeR+79KmwfITubrMjBx9CDYpEcu 5HtdTsDqwFmIpGaeabnHad+Lvsxwzg7GGJC4gUKgS7r3jDNmtnnxSAcjVtsikpDeO4xn Ypn65Q0Hi7bm8lM3GJAQjWn7hRnXMffVUuknOBNqGzRnabCK2pxwfNBj5Warc55bmI4n 6KgUj6equGmDO9z0PB9SlNGgPVaiz2P16Vas0hFHm2keaH06Wx57XDug/ocnewwUg+ec DjRR7in4iANo8VhjOaUWXnm1DuHsMSLaMMfOrr1SgLChsVpvP0rjusQn3/x+76aCz+WK Tq1Q== X-Gm-Message-State: AOAM531aWkwiLo1VKJ5qFC1o8GIPKh79j7Q5eatBGdEvA2mp6yP268Dm Mn4kzxr1I9w/BJWumdn4P1cvEWIi2CQ= X-Google-Smtp-Source: ABdhPJy7xNEENNJH/mtcTYurt+dy9TfFEgWjmGblObyq2ZwiX/Mwfsn2QTrZ//1gdew82xTbTmNoPQ== X-Received: by 2002:a05:622a:18f:: with SMTP id s15mr2037831qtw.160.1604586121067; Thu, 05 Nov 2020 06:22:01 -0800 (PST) Received: from hurd (dsl-154-213.b2b2c.ca. [66.158.154.213]) by smtp.gmail.com with ESMTPSA id p13sm931232qti.58.2020.11.05.06.21.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2020 06:21:59 -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> Date: Thu, 05 Nov 2020 09:21:58 -0500 In-Reply-To: <87zh3w5ytp.fsf@dustycloud.org> (Christopher Lemmer Webber's message of "Wed, 04 Nov 2020 21:20:34 -0500") Message-ID: <875z6jx4s9.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::82e; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qt1-x82e.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=lwG/4B8m; 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: SZej3TpS7RGm Hi Christopher, Christopher Lemmer Webber writes: [...] > I'm a bit unsure what the implications fully are with this change, but > here was my user experience: > > - Did a pull using magit to guix > - Suddenly every file I open in Guix is prompting me if I want to > enable these dir-locals, I notice some have "eval" and I don't know > what it's doing so I say no > - But it's asking me every file > - And oh no, it's asking me about ten times for every magit operation! > (Presumably due to the reload operation.) Fine okay fine, YES, okay > cool it's quiet now... I hope that was safe. Thanks for the feedback (even though it's not a great experience you've had!). If I understand correctly when prompted like this following the change to .dir-locals.el: --8<---------------cut here---------------start------------->8--- The local variables list in /home/maxim/src/guix/ contains values that may not be safe (*). Do you want to apply it? You can type y -- to apply the local variables list. n -- to ignore the local variables list. ! -- to apply the local variables list, and permanently mark these values (*) as safe (in the future, they will be set automatically.) fill-column : 78 tab-width : 8 sentence-end-double-space : t bug-reference-url-format : "http://bugs.gnu.org/%s" bug-reference-bug-regexp : "" * eval : (setq guix-directory (locate-dominating-file default-directory ".dir-locals.el")) * eval : (let* ((root-dir (expand-file-name (locate-dominating-file default-directory ".dir-locals.el"))) (root-dir* (directory-file-name root-dir))) (unless (boundp 'geiser-guile-load-path) (defvar geiser-guile-load-path 'nil)) (make-local-variable 'geiser-guile-load-path) (require 'cl-lib) (cl-pushnew root-dir* geiser-guile-load-path :test #'string-equal)) --8<---------------cut here---------------end--------------->8--- You've been trying to decline with 'n', but Emacs doesn't remember your choice and keeps bugging you with it. To be honest, that seems a design shortcoming in Emacs; there's a '!' that means 'yes and remember it' but there doesn't seem to be an equivalent option for 'no and remember it'. So it keeps forgetting. Also note that this isn't the first use of 'eval' in the Guix .dir-locals file; so if you started hacking on the Guix sources in Emacs for the first time, you'd have been greeted with this (!): --8<---------------cut here---------------start------------->8--- The local variables list in /home/maxim/src/guix/ contains values that may not be safe (*). Do you want to apply it? You can type y -- to apply the local variables list. n -- to ignore the local variables list. ! -- to apply the local variables list, and permanently mark these values (*) as safe (in the future, they will be set automatically.) fill-column : 78 tab-width : 8 sentence-end-double-space : t bug-reference-url-format : "http://bugs.gnu.org/%s" bug-reference-bug-regexp : "" indent-tabs-mode : nil eval : (put 'eval-when 'scheme-indent-function 1) eval : (put 'call-with-prompt 'scheme-indent-function 1) eval : (put 'test-assert 'scheme-indent-function 1) eval : (put 'test-assertm 'scheme-indent-function 1) eval : (put 'test-equalm 'scheme-indent-function 1) eval : (put 'test-equal 'scheme-indent-function 1) eval : (put 'test-eq 'scheme-indent-function 1) eval : (put 'call-with-input-string 'scheme-indent-function 1) eval : (put 'guard 'scheme-indent-function 1) eval : (put 'lambda* 'scheme-indent-function 1) eval : (put 'substitute* 'scheme-indent-function 1) eval : (put 'match-record 'scheme-indent-function 2) eval : (put 'modify-phases 'scheme-indent-function 1) eval : (put 'replace 'scheme-indent-function 1) eval : (put 'add-before 'scheme-indent-function 2) eval : (put 'add-after 'scheme-indent-function 2) eval : (put 'modify-services 'scheme-indent-function 1) eval : (put 'with-directory-excursion 'scheme-indent-function 1) eval : (put 'with-file-lock 'scheme-indent-function 1) eval : (put 'with-file-lock/no-wait 'scheme-indent-function 1) eval : (put 'with-profile-lock 'scheme-indent-function 1) eval : (put 'with-writable-file 'scheme-indent-function 2) eval : (put 'package 'scheme-indent-function 0) eval : (put 'package/inherit 'scheme-indent-function 1) eval : (put 'origin 'scheme-indent-function 0) eval : (put 'build-system 'scheme-indent-function 0) eval : (put 'bag 'scheme-indent-function 0) eval : (put 'graft 'scheme-indent-function 0) eval : (put 'operating-system 'scheme-indent-function 0) eval : (put 'file-system 'scheme-indent-function 0) eval : (put 'manifest-entry 'scheme-indent-function 0) eval : (put 'manifest-pattern 'scheme-indent-function 0) eval : (put 'substitute-keyword-arguments 'scheme-indent-function 1) eval : (put 'with-store 'scheme-indent-function 1) eval : (put 'with-external-store 'scheme-indent-function 1) eval : (put 'with-error-handling 'scheme-indent-function 0) eval : (put 'with-mutex 'scheme-indent-function 1) eval : (put 'with-atomic-file-output 'scheme-indent-function 1) eval : (put 'call-with-compressed-output-port 'scheme-indent-function 2) eval : (put 'call-with-decompressed-port 'scheme-indent-function 2) eval : (put 'call-with-gzip-input-port 'scheme-indent-function 1) eval : (put 'call-with-gzip-output-port 'scheme-indent-function 1) eval : (put 'call-with-lzip-input-port 'scheme-indent-function 1) eval : (put 'call-with-lzip-output-port 'scheme-indent-function 1) eval : (put 'signature-case 'scheme-indent-function 1) eval : (put 'emacs-batch-eval 'scheme-indent-function 0) eval : (put 'emacs-batch-edit-file 'scheme-indent-function 1) eval : (put 'emacs-substitute-sexps 'scheme-indent-function 1) eval : (put 'emacs-substitute-variables 'scheme-indent-function 1) eval : (put 'with-derivation-narinfo 'scheme-indent-function 1) eval : (put 'with-derivation-substitute 'scheme-indent-function 2) eval : (put 'with-status-report 'scheme-indent-function 1) eval : (put 'with-status-verbosity 'scheme-indent-function 1) eval : (put 'with-build-handler 'scheme-indent-function 1) eval : (put 'mlambda 'scheme-indent-function 1) eval : (put 'mlambdaq 'scheme-indent-function 1) eval : (put 'syntax-parameterize 'scheme-indent-function 1) eval : (put 'with-monad 'scheme-indent-function 1) eval : (put 'mbegin 'scheme-indent-function 1) eval : (put 'mwhen 'scheme-indent-function 1) eval : (put 'munless 'scheme-indent-function 1) eval : (put 'mlet* 'scheme-indent-function 2) eval : (put 'mlet 'scheme-indent-function 2) eval : (put 'run-with-store 'scheme-indent-function 1) eval : (put 'run-with-state 'scheme-indent-function 1) eval : (put 'wrap-program 'scheme-indent-function 1) eval : (put 'with-imported-modules 'scheme-indent-function 1) eval : (put 'with-extensions 'scheme-indent-function 1) eval : (put 'with-parameters 'scheme-indent-function 1) eval : (put 'let-system 'scheme-indent-function 1) eval : (put 'with-database 'scheme-indent-function 2) eval : (put 'call-with-transaction 'scheme-indent-function 1) eval : (put 'with-statement 'scheme-indent-function 3) eval : (put 'call-with-retrying-transaction 'scheme-indent-function 1) eval : (put 'call-with-savepoint 'scheme-indent-function 1) eval : (put 'call-with-retrying-savepoint 'scheme-indent-function 1) eval : (put 'call-with-container 'scheme-indent-function 1) eval : (put 'container-excursion 'scheme-indent-function 1) eval : (put 'eventually 'scheme-indent-function 1) eval : (put 'call-with-progress-reporter 'scheme-indent-function 1) eval : (put 'with-repository 'scheme-indent-function 2) eval : (put 'with-temporary-git-repository 'scheme-indent-function 2) eval : (put 'with-temporary-git-worktree 'scheme-indent-function 2) eval : (put 'with-environment-variables 'scheme-indent-function 1) eval : (put 'with-fresh-gnupg-setup 'scheme-indent-function 1) eval : (put 'with-paginated-output-port 'scheme-indent-function 1) * eval : (modify-syntax-entry 126 "'") * eval : (modify-syntax-entry 36 "'") * eval : (modify-syntax-entry 43 "'") --8<---------------cut here---------------end--------------->8--- So I don't see how the new behavior is much different. The experience is bad unless you trust (and tell Emacs to remember your choice) the .dir-locals with '!', and sadly Emacs doesn't seem to provide an alternative. > Later... > > - I'm hacking on another file in another repo > - C-x v = (check to see a diff of the work-in-progress changes of the > file I'm working on) > - Error in the minibuffer! "Wrong type argument: stringp, nil" > - wtf, okay M-x toggle-debug-on-error > > Debugger entered--Lisp error: (wrong-type-argument stringp nil) > expand-file-name(nil) > (let* ((root-dir (expand-file-name (locate-dominating-file default-directory ".dir-locals.el"))) (root-dir* (directory-file-name root-dir))) (unless (boundp 'geiser-guile-load-path) (defvar geiser-guile-load-path 'nil)) (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 (expand-file-name (locate-dominating-file default-directory ".dir-locals.el"))) (root-dir* (directory-file-name root-dir))) (unless (boundp 'geiser-guile-load-path) (defvar geiser-guile-load-path 'nil)) (make-local-variable 'geiser-guile-load-path) (require 'cl-lib) (cl-pushnew root-dir* geiser-guile-load-path :test #'string-equal))) > hack-one-local-variable(eval (let* ((root-dir (expand-file-name (locate-dominating-file default-directory ".dir-locals.el"))) (root-dir* (directory-file-name root-dir))) (unless (boundp 'geiser-guile-load-path) (defvar geiser-guile-load-path 'nil)) (make-local-variable 'geiser-guile-load-path) (require 'cl-lib) (cl-pushnew root-dir* geiser-guile-load-path :test #'string-equal))) > hack-local-variables-apply() > hack-dir-local-variables-non-file-buffer() > diff-mode() > vc-diff-internal(t (Git ("/home/cwebber/devel/scribble/scribble-lib/scribble...")) nil nil t) > vc-diff(nil t) > funcall-interactively(vc-diff nil t) > call-interactively(vc-diff nil nil) > command-execute(vc-diff) > > - Oh... it's whatever thing I enabled earlier in the guix repo. Well > now my vc-diff is broken outside of there... :\ This is quite unexpected, given the new Elisp snippet should run only for buffers attached to the Guix source tree. > I'm presuming that if I understood whatever this is doing, it's probably > something that gives me a better user experience if I accept it while > working on Guix. But a) for whatever reason Emacs' dir-locals stuff is > written in such a way that it antagonizes me for not accepting it and I > didn't know what it eval was (maybe this is a lack of understanding in > how to "say no and get it to listen to me"... I didn't resist for too > long) I think my explanation above covers a); basically this is a shortcoming in Emacs and was already the case with the previous version of .dir-locals. b) it seems like this change isn't scoped to Guix's checkout itself somehow... I'll try to reproduce, and report back. Thanks for the feedback! Maxim