unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Jake Shilling <shilling.jake@gmail.com>
To: jgart <jgart@dismail.de>
Cc: Guix Help <help-guix@gnu.org>
Subject: Re: geiser-edit-symbol-at-point
Date: Fri, 11 Nov 2022 15:43:26 -0500	[thread overview]
Message-ID: <877d01dxxt.fsf@gmail.com> (raw)
In-Reply-To: <20221111124046.GB17675@dismail.de>

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

On 2022-11-11 12:40, jgart@dismail.de wrote:

> On Fri, 11 Nov 2022 09:31:40 -0500 Jake Shilling <shilling.jake@gmail.com> wrote:
>> my configuration files, I have a toplevel script which updates the
>> %load-path:
>> 
>> ```
>> (when (current-filename)
>>   (add-to-load-path
>>    (dirname (current-filename))))
>> ```
>> 
>> So when I load that file into the repl with C-c C-l all the subsequent
>> use-modules work.
>
> You have to do all that before geiser will pick up the source files in
> my guix checkout?

You would only need to do that for a script that is not included in
either your `GUILE_LOAD_PATH` environment variable or in
'geiser-guile-load-path. The directories set up in either of those
places will be used to initialize %load-path when the guile repl starts.

To give you a sense of where I'm using this: I have a repository [1]
cloned to ~/dotfiles, which contains a script that generates a
configuration for guix home. I want that script to know about other
modules I make in the same directory, but I don't what scheme programs I
work on in other places to be aware of my dotfiles helpers. Putting that
block at the top of the file is what makes that work (i.e. ~/dotfiles is
only in my %load-path after I evaluate ~/dotfiles/config.scm).

This same dotfiles repository also makes use of modules that come from
different channels (mostly the default guix channel and RDE [2]). I do
want these modules to be visible in ever guile repl though no matter
what script I'm working on, so I handle that by setting my
GUILE_LOAD_PATH:

```
GUILE_LOAD_PATH="/run/current-system/profile/share/guile/site/3.0:${HOME}/.config/guix/current/share/guile/site/3.0"
```

Any time I add a new channel and run `guix pull`, that channel is going
to be checked out to ${HOME}/.config/guix/current/share/guile/site/3.0
and be picked up by default. This works for me because I'm not actively
working on the guix source code, so I don't want to manage that as a
project cloned down manually. For me, guix is just a collection of
modules to use in my other scripts.

All that is to say, you only need to do something like the block above
if you have a directory that should only be visible to certain
projects/script files. If you add any directory to the
geiser-guile-load-path then it is going to be picked up anyway and you
don't need to do anything special.

[1] https://gitlab.com/shilling.jake/dotfiles/-/blob/master/config.scm#L5
[2] https://sr.ht/~abcdw/rde/

>
> Just doing the following as recommended in the guix manual is not enough?
>
>> (with-eval-after-load 'geiser-guile
>>   (add-to-list 'geiser-guile-load-path "~/guix"))
>
> My source checkout of guix is in `~/guix`.
>

That is definitly enouhg to make sure ~/guix is processed by guile and
then Gieser. The only caveat is that if you forget to update the
repository there, or forget to guix pull, then you could end up with
Geiser looking at a different version of the guix modules than what is
actually installed in your profile.

-- 
Best regards,
Jake Shilling

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

  reply	other threads:[~2022-11-11 20:44 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-11  1:35 geiser-edit-symbol-at-point jgart
2022-11-11  1:39 ` geiser-edit-symbol-at-point jgart
2022-11-11  1:44 ` geiser-edit-symbol-at-point jgart
2022-11-11 14:31   ` geiser-edit-symbol-at-point Jake Shilling
2022-11-11 16:17     ` geiser-edit-symbol-at-point Olivier Dion via
2022-11-11 16:47       ` geiser-edit-symbol-at-point Jake Shilling
2022-11-11 17:10         ` geiser-edit-symbol-at-point Olivier Dion via
2022-11-11 18:40     ` geiser-edit-symbol-at-point jgart
2022-11-11 20:43       ` Jake Shilling [this message]
2022-11-11 21:42         ` geiser-edit-symbol-at-point jgart
2022-11-11 21:45           ` geiser-edit-symbol-at-point jgart
2022-11-11 22:06           ` geiser-edit-symbol-at-point Jake Shilling
2022-11-11 22:15             ` geiser-edit-symbol-at-point jgart
2022-11-12  0:07               ` geiser-edit-symbol-at-point jgart
2022-11-12  0:12                 ` geiser-edit-symbol-at-point jgart
2022-11-12 15:48                   ` geiser-edit-symbol-at-point Jake Shilling
2022-11-14 15:01                     ` geiser-edit-symbol-at-point jgart
2022-11-14 15:16                       ` geiser-edit-symbol-at-point Jake Shilling
2022-11-14 22:38                         ` geiser-edit-symbol-at-point jgart
2022-11-15  1:31                           ` geiser-edit-symbol-at-point Jake Shilling

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877d01dxxt.fsf@gmail.com \
    --to=shilling.jake@gmail.com \
    --cc=help-guix@gnu.org \
    --cc=jgart@dismail.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).