unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* questionable advice about Geiser load path setting
@ 2023-08-26  4:03 Csepp
  2023-08-26 11:27 ` brian via Development of GNU Guix and the GNU System distribution.
  2023-08-27  1:42 ` Maxim Cournoyer
  0 siblings, 2 replies; 7+ messages in thread
From: Csepp @ 2023-08-26  4:03 UTC (permalink / raw)
  To: guix-devel

The docs contain this recommended Emacs setting:

@lisp
;; @r{Assuming the Guix checkout is in ~/src/guix.}
(with-eval-after-load 'geiser-guile
  (add-to-list 'geiser-guile-load-path "~/src/guix"))
@end lisp

I haven't been using it for a while because I remember it causing
trouble whenever I was working on other Guile projects.  I have been
running Emacs inside ./pre-inst-env instead, which seems to work just as
well, if not better.

I'd like to make an amendment to the relevant docs, but would welcome
some info on why it was originally written this way, maybe there are use
cases I'm missing.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: questionable advice about Geiser load path setting
  2023-08-26  4:03 questionable advice about Geiser load path setting Csepp
@ 2023-08-26 11:27 ` brian via Development of GNU Guix and the GNU System distribution.
  2023-08-31 19:10   ` wolf
  2023-08-27  1:42 ` Maxim Cournoyer
  1 sibling, 1 reply; 7+ messages in thread
From: brian via Development of GNU Guix and the GNU System distribution. @ 2023-08-26 11:27 UTC (permalink / raw)
  To: Csepp; +Cc: guix-devel

Csepp <raingloom@riseup.net> writes:

> The docs contain this recommended Emacs setting:
>
> @lisp
> ;; @r{Assuming the Guix checkout is in ~/src/guix.}
> (with-eval-after-load 'geiser-guile
>   (add-to-list 'geiser-guile-load-path "~/src/guix"))
> @end lisp
>
> I haven't been using it for a while because I remember it causing
> trouble whenever I was working on other Guile projects.  I have been
> running Emacs inside ./pre-inst-env instead, which seems to work just as
> well, if not better.
>
> I'd like to make an amendment to the relevant docs, but would welcome
> some info on why it was originally written this way, maybe there are use
> cases I'm missing.

I agree that it's bad advice, since it assumes the only reason to use
Guile is to hack on Guix. I also think it's not necessary, since
‘.dir-locals.el’ in the Guix root should be taking care of this for you
already. I don't use the manual addition to ‘load-path’ you quote above,
and Geiser seems to work fine (within the bounds of Geiser's definition
of “fine”, anyway).

The downside of using dir-locals is that Emacs yells quite loudly about
unsafe variables being set. Another option may be direnv or bufenv? I
haven't tried them myself, but have heard good things.

-bjc


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: questionable advice about Geiser load path setting
  2023-08-26  4:03 questionable advice about Geiser load path setting Csepp
  2023-08-26 11:27 ` brian via Development of GNU Guix and the GNU System distribution.
@ 2023-08-27  1:42 ` Maxim Cournoyer
  1 sibling, 0 replies; 7+ messages in thread
From: Maxim Cournoyer @ 2023-08-27  1:42 UTC (permalink / raw)
  To: Csepp; +Cc: guix-devel

Hi,

Csepp <raingloom@riseup.net> writes:

> The docs contain this recommended Emacs setting:
>
> @lisp
> ;; @r{Assuming the Guix checkout is in ~/src/guix.}
> (with-eval-after-load 'geiser-guile
>   (add-to-list 'geiser-guile-load-path "~/src/guix"))
> @end lisp
>
> I haven't been using it for a while because I remember it causing
> trouble whenever I was working on other Guile projects.  I have been
> running Emacs inside ./pre-inst-env instead, which seems to work just as
> well, if not better.
>
> I'd like to make an amendment to the relevant docs, but would welcome
> some info on why it was originally written this way, maybe there are use
> cases I'm missing.

Perhaps we should simply mention that when allowing the .dir-locals.el
file at the root of the Guix repo to configure your Emacs, it'll take
care of adding its directory to the load path of Geiser?

This is very handy when working with multiple Guix checkouts at the same
time.

-- 
Thanks,
Maxim


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: questionable advice about Geiser load path setting
  2023-08-26 11:27 ` brian via Development of GNU Guix and the GNU System distribution.
@ 2023-08-31 19:10   ` wolf
  2023-09-05  1:41     ` Maxim Cournoyer
  0 siblings, 1 reply; 7+ messages in thread
From: wolf @ 2023-08-31 19:10 UTC (permalink / raw)
  To: brian; +Cc: Csepp, guix-devel

[-- Attachment #1: Type: text/plain, Size: 2126 bytes --]

On 2023-08-26 07:27:22 -0400, brian via Development of GNU Guix and the GNU System distribution. wrote:
> Csepp <raingloom@riseup.net> writes:
> 
> > The docs contain this recommended Emacs setting:
> >
> > @lisp
> > ;; @r{Assuming the Guix checkout is in ~/src/guix.}
> > (with-eval-after-load 'geiser-guile
> >   (add-to-list 'geiser-guile-load-path "~/src/guix"))
> > @end lisp
> >
> > I haven't been using it for a while because I remember it causing
> > trouble whenever I was working on other Guile projects.  I have been
> > running Emacs inside ./pre-inst-env instead, which seems to work just as
> > well, if not better.
> >
> > I'd like to make an amendment to the relevant docs, but would welcome
> > some info on why it was originally written this way, maybe there are use
> > cases I'm missing.
> 
> I agree that it's bad advice, since it assumes the only reason to use
> Guile is to hack on Guix. I also think it's not necessary, since
> ‘.dir-locals.el’ in the Guix root should be taking care of this for you
> already. I don't use the manual addition to ‘load-path’ you quote above,
> and Geiser seems to work fine (within the bounds of Geiser's definition
> of “fine”, anyway).

Geiser seems to add the project root (I assume based on the git) into the load
path automatically.  geiser-repl-current-project-function seems to be set by
default, and rest is described in the docs: (geiser)Customization and tips, Init
files and load paths.

Maybe it once was necessary to set this, I am not sure it still is the case.

I also use (setq geiser-repl-per-project-p t) and everything seems to just work
out of the box.


> 
> The downside of using dir-locals is that Emacs yells quite loudly about unsafe
> variables being set.

In emacs 29 it should be possible to whitelist it, so it will stop being so
annoying.

> Another option may be direnv or bufenv? I haven't tried them myself, but have
> heard good things.
> 
> -bjc
>

W.

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: questionable advice about Geiser load path setting
  2023-08-31 19:10   ` wolf
@ 2023-09-05  1:41     ` Maxim Cournoyer
  2023-09-05 16:32       ` wolf
  0 siblings, 1 reply; 7+ messages in thread
From: Maxim Cournoyer @ 2023-09-05  1:41 UTC (permalink / raw)
  To: brian; +Cc: Csepp, guix-devel

Hello,

wolf <wolf@wolfsden.cz> writes:

[...]

> Geiser seems to add the project root (I assume based on the git) into the load
> path automatically.  geiser-repl-current-project-function seems to be set by
> default, and rest is described in the docs: (geiser)Customization and tips, Init
> files and load paths.
>
> Maybe it once was necessary to set this, I am not sure it still is the case.
>
> I also use (setq geiser-repl-per-project-p t) and everything seems to just work
> out of the box.

I haven't followed up with the latest Geiser features, but if what you
wrote is true, then it would be nice to streamline our .dir-locals.el
and simply set geiser-repl-per-project-p to t (as a directory-local
variable).

Would you like to see if that continues working the same, across
e.g. Git worktrees of Guix checkouts?

-- 
Thanks,
Maxim


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: questionable advice about Geiser load path setting
  2023-09-05  1:41     ` Maxim Cournoyer
@ 2023-09-05 16:32       ` wolf
  2023-09-06 18:46         ` Maxim Cournoyer
  0 siblings, 1 reply; 7+ messages in thread
From: wolf @ 2023-09-05 16:32 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: brian, Csepp, guix-devel

[-- Attachment #1: Type: text/plain, Size: 1923 bytes --]

On 2023-09-04 21:41:44 -0400, Maxim Cournoyer wrote:
> Hello,
> 
> wolf <wolf@wolfsden.cz> writes:
> 
> [...]
> 
> > Geiser seems to add the project root (I assume based on the git) into the load
> > path automatically.  geiser-repl-current-project-function seems to be set by
> > default, and rest is described in the docs: (geiser)Customization and tips, Init
> > files and load paths.
> >
> > Maybe it once was necessary to set this, I am not sure it still is the case.
> >
> > I also use (setq geiser-repl-per-project-p t) and everything seems to just work
> > out of the box.
> 
> I haven't followed up with the latest Geiser features, but if what you
> wrote is true, then it would be nice to streamline our .dir-locals.el
> and simply set geiser-repl-per-project-p to t (as a directory-local
> variable).
> 
> Would you like to see if that continues working the same, across
> e.g. Git worktrees of Guix checkouts?

Seems to work as one would expect.  My Guix checkout is in /home/wolf/src/guix,
those in /tmp are worktrees.  I pressed C-c C-z in each of these files, a new
REPL was spawned for each of them.  After that I evaluated the snippet to verify
the paths.

/home/wolf/src/guix/gnu/packages/linux.scm:

    (values (car %load-path) (car %load-compiled-path))
    $8 = "/home/wolf/src/guix"
    $9 = "/home/wolf/src/guix"

/tmp/guix-a/gnu/packages/linux.scm:

    (values (car %load-path) (car %load-compiled-path))
    $5 = "/tmp/guix-a"
    $6 = "/tmp/guix-a"

/tmp/guix-b/gnu/packages/linux.scm:

    (values (car %load-path) (car %load-compiled-path))
    $5 = "/tmp/guix-b"
    $6 = "/tmp/guix-b"

C-c C-z in /tmp/guix-b/gnu/packages/abduco.scm reused the already running REPL
for the guix-b.

> 
> -- 
> Thanks,
> Maxim
>

W.

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: questionable advice about Geiser load path setting
  2023-09-05 16:32       ` wolf
@ 2023-09-06 18:46         ` Maxim Cournoyer
  0 siblings, 0 replies; 7+ messages in thread
From: Maxim Cournoyer @ 2023-09-06 18:46 UTC (permalink / raw)
  To: brian; +Cc: Csepp, guix-devel

Hi,

I've made the change proposed and tested; then installed as 65dcfb3f
(".dir-locals: Streamline Geiser configuration.").  Let me know if
you encounter any problem.

-- 
Thanks,
Maxim


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-09-06 18:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-26  4:03 questionable advice about Geiser load path setting Csepp
2023-08-26 11:27 ` brian via Development of GNU Guix and the GNU System distribution.
2023-08-31 19:10   ` wolf
2023-09-05  1:41     ` Maxim Cournoyer
2023-09-05 16:32       ` wolf
2023-09-06 18:46         ` Maxim Cournoyer
2023-08-27  1:42 ` Maxim Cournoyer

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).