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 kFVVFRt5o1/dTQAA0tVLHw (envelope-from ) for ; Thu, 05 Nov 2020 04:01:31 +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 6N4xERt5o1+NbgAA1q6Kng (envelope-from ) for ; Thu, 05 Nov 2020 04:01:31 +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 76B8794023B for ; Thu, 5 Nov 2020 04:01:30 +0000 (UTC) Received: from localhost ([::1]:48698 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kaWSn-0003eh-AJ for larch@yhetil.org; Wed, 04 Nov 2020 23:01:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36746) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kaWSd-0003eO-9Y for guix-devel@gnu.org; Wed, 04 Nov 2020 23:01:19 -0500 Received: from dustycloud.org ([2600:3c02::f03c:91ff:feae:cb51]:43276) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kaWSb-00086X-6s for guix-devel@gnu.org; Wed, 04 Nov 2020 23:01:19 -0500 Received: from twig (localhost [127.0.0.1]) by dustycloud.org (Postfix) with ESMTPS id 1AB9C26616; Wed, 4 Nov 2020 23:00:49 -0500 (EST) References: <87tuuixjno.fsf@gmail.com> <87zh3w5ytp.fsf@dustycloud.org> User-agent: mu4e 1.4.13; emacs 27.1 From: Christopher Lemmer Webber Subject: Re: [PATCH] Automatically set `geiser-guile-load-path' from .dir-locals In-reply-to: <87zh3w5ytp.fsf@dustycloud.org> Date: Wed, 04 Nov 2020 23:00:22 -0500 Message-ID: <87wnz05u7d.fsf@dustycloud.org> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2600:3c02::f03c:91ff:feae:cb51; envelope-from=cwebber@dustycloud.org; helo=dustycloud.org X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) BAYES_00=-1.9, MISSING_HEADERS=1.021, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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, Maxim Cournoyer 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=none; dmarc=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.99 X-TUID: x66KpOurh5br Also, I hope this email isn't interpreted as being dismissive or negative about what looks like it's probably a real usability improvement for hacking on Guix! I just thought my experience indicated maybe there are additional considerations to address. Christopher Lemmer Webber writes: > Maxim Cournoyer writes: > >> Hello Guix! >> >> I've been experimenting with the following modification to the >> .dir-locals file shipped with Guix, that allows setting per-buffer >> variables within Emacs when visiting a file in the same directory (or in >> one of its sub-directories). >> >> This makes life a bit easier, by ensuring that a Geiser REPL started >> with C-c C-a in a file of either the main 'guix' checkout, a >> 'guix-core-updates' worktree or a 'guix-staging' worktree will set up >> the GUILE_LOAD_PATH and GUILE_LOAD_COMPILED_PATH correctly (via the >> `geiser-guile-load-path' Elisp variable). >> >> The only requirement for it to work reliably is that any Guix checkout >> or worktree name should start with "guix". >> >> It doesn't require Geiser to be installed (it will just set the above >> variable uselessly if it isn't used -- not a big deal). >> >> What do you think? Is it useful? Should we include this as part of the >> default .dir-locals of Guix? >> >> Patch to follow! >> >> Thanks, >> >> Maxim > > 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. > > 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... :\ > > 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) and b) it seems like this change isn't scoped to Guix's checkout > itself somehow...