all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to do initialization specific to guix repl inside .guile?
@ 2024-03-06 14:47 Tomas Volf
  2024-03-08 17:45 ` Parnikkapore via
  0 siblings, 1 reply; 3+ messages in thread
From: Tomas Volf @ 2024-03-06 14:47 UTC (permalink / raw)
  To: help-guix

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

Hello,

As far as I can tell, there is one shared configuration file for guile and guix
repls (or rather, guix just uses ~/.guile).  However I would like to have some
configuration that is executed only for guix repl, since it does not make sense
for guile repl.

Is there a way to detect from .guile whether guix repl or guile repl is starting
so that I can branch on that?

Thank you in advance and have a nice day,
Tomas Volf

--
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] 3+ messages in thread

* Re: How to do initialization specific to guix repl inside .guile?
  2024-03-06 14:47 How to do initialization specific to guix repl inside .guile? Tomas Volf
@ 2024-03-08 17:45 ` Parnikkapore via
  2024-03-09 14:30   ` Tomas Volf
  0 siblings, 1 reply; 3+ messages in thread
From: Parnikkapore via @ 2024-03-08 17:45 UTC (permalink / raw)
  To: Tomas Volf, help-guix

Hi,

On Wed, 2024-03-06 at 15:47 +0100, Tomas Volf wrote:
> Is there a way to detect from .guile whether guix repl or guile repl is starting<br>
> so that I can branch on that?<br>

The kludge I currently use for this is this:

```scheme
(when (equal? (module-name (current-module)) '(guix-user))
  ; `guix repl`-only init code
  )
```

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

* Re: How to do initialization specific to guix repl inside .guile?
  2024-03-08 17:45 ` Parnikkapore via
@ 2024-03-09 14:30   ` Tomas Volf
  0 siblings, 0 replies; 3+ messages in thread
From: Tomas Volf @ 2024-03-09 14:30 UTC (permalink / raw)
  To: Parnikkapore; +Cc: help-guix

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

On 2024-03-09 00:45:32 +0700, Parnikkapore wrote:
> Hi,
>
> On Wed, 2024-03-06 at 15:47 +0100, Tomas Volf wrote:
> > Is there a way to detect from .guile whether guix repl or guile repl is starting<br>
> > so that I can branch on that?<br>
>
> The kludge I currently use for this is this:
>
> ```scheme
> (when (equal? (module-name (current-module)) '(guix-user))
>   ; `guix repl`-only init code
>   )
> ```

Yes, that seems to work just fine, thank you very much :)

T.

--
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] 3+ messages in thread

end of thread, other threads:[~2024-03-09 14:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-06 14:47 How to do initialization specific to guix repl inside .guile? Tomas Volf
2024-03-08 17:45 ` Parnikkapore via
2024-03-09 14:30   ` Tomas Volf

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.