* [PATCH] doc: Fix 'geiser-guile-load-path' example.
@ 2015-11-14 18:56 Alex Kost
2015-11-15 17:41 ` Ludovic Courtès
0 siblings, 1 reply; 8+ messages in thread
From: Alex Kost @ 2015-11-14 18:56 UTC (permalink / raw)
To: guix-devel
[-- Attachment #1: Type: text/plain, Size: 161 bytes --]
(add-to-list 'geiser-guile-load-path 'foo) errors if "geiser-guile.el"
is not loaded yet, so I think it's better to put it inside
'with-eval-after-load', WDYT?
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-doc-Fix-geiser-guile-load-path-example.patch --]
[-- Type: text/x-diff, Size: 954 bytes --]
From a7b4af5d3115d6caa9129cdf8a9933f640742063 Mon Sep 17 00:00:00 2001
From: Alex Kost <alezost@gmail.com>
Date: Sat, 14 Nov 2015 21:13:07 +0300
Subject: [PATCH] doc: Fix 'geiser-guile-load-path' example.
Reported by marusich on #guix.
* doc/contributing.texi (The Perfect Setup): Wrap modifying
'geiser-guile-load-path' into 'with-eval-after-load'.
---
doc/contributing.texi | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/doc/contributing.texi b/doc/contributing.texi
index cdc3f6d..55b844a 100644
--- a/doc/contributing.texi
+++ b/doc/contributing.texi
@@ -141,7 +141,8 @@ that it finds source files from your checkout:
@lisp
;; @r{Assuming the Guix checkout is in ~/src/guix.}
-(add-to-list 'geiser-guile-load-path "~/src/guix")
+(with-eval-after-load 'geiser-guile
+ (add-to-list 'geiser-guile-load-path "~/src/guix"))
@end lisp
To actually edit the code, Emacs already has a neat Scheme mode. But in
--
2.6.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] doc: Fix 'geiser-guile-load-path' example.
2015-11-14 18:56 [PATCH] doc: Fix 'geiser-guile-load-path' example Alex Kost
@ 2015-11-15 17:41 ` Ludovic Courtès
2015-11-17 8:04 ` Alex Kost
0 siblings, 1 reply; 8+ messages in thread
From: Ludovic Courtès @ 2015-11-15 17:41 UTC (permalink / raw)
To: Alex Kost; +Cc: guix-devel
Alex Kost <alezost@gmail.com> skribis:
> (add-to-list 'geiser-guile-load-path 'foo) errors if "geiser-guile.el"
> is not loaded yet, so I think it's better to put it inside
> 'with-eval-after-load', WDYT?
Sounds good. I guess that’s because (require 'guix-init) doesn’t
require 'geiser?
Ludo’.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] doc: Fix 'geiser-guile-load-path' example.
2015-11-15 17:41 ` Ludovic Courtès
@ 2015-11-17 8:04 ` Alex Kost
2015-11-17 16:16 ` Ludovic Courtès
0 siblings, 1 reply; 8+ messages in thread
From: Alex Kost @ 2015-11-17 8:04 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: guix-devel
Ludovic Courtès (2015-11-15 20:41 +0300) wrote:
> Alex Kost <alezost@gmail.com> skribis:
>
>> (add-to-list 'geiser-guile-load-path 'foo) errors if "geiser-guile.el"
>> is not loaded yet, so I think it's better to put it inside
>> 'with-eval-after-load', WDYT?
>
> Sounds good. I guess that’s because (require 'guix-init) doesn’t
> require 'geiser?
"guix-init.el" shouldn't require geiser. IMO it should load as less
code as possible, because it will increase the Emacs start time.
In general I think requiring/loading packages is evil (as it slows down
starting Emacs), so I avoid 'require'-s when possible in my init file.
--
Alex
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] doc: Fix 'geiser-guile-load-path' example.
2015-11-17 8:04 ` Alex Kost
@ 2015-11-17 16:16 ` Ludovic Courtès
2015-11-17 17:22 ` Alex Kost
0 siblings, 1 reply; 8+ messages in thread
From: Ludovic Courtès @ 2015-11-17 16:16 UTC (permalink / raw)
To: Alex Kost; +Cc: guix-devel
Alex Kost <alezost@gmail.com> skribis:
> Ludovic Courtès (2015-11-15 20:41 +0300) wrote:
>
>> Alex Kost <alezost@gmail.com> skribis:
>>
>>> (add-to-list 'geiser-guile-load-path 'foo) errors if "geiser-guile.el"
>>> is not loaded yet, so I think it's better to put it inside
>>> 'with-eval-after-load', WDYT?
>>
>> Sounds good. I guess that’s because (require 'guix-init) doesn’t
>> require 'geiser?
>
> "guix-init.el" shouldn't require geiser. IMO it should load as less
> code as possible, because it will increase the Emacs start time.
>
> In general I think requiring/loading packages is evil (as it slows down
> starting Emacs), so I avoid 'require'-s when possible in my init file.
Agreed, I was just making sure I understood the issue at hand.
The patch you sent looks good to me then.
Thanks!
Ludo’.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] doc: Fix 'geiser-guile-load-path' example.
2015-11-17 16:16 ` Ludovic Courtès
@ 2015-11-17 17:22 ` Alex Kost
2015-11-17 21:40 ` Ludovic Courtès
0 siblings, 1 reply; 8+ messages in thread
From: Alex Kost @ 2015-11-17 17:22 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: guix-devel
Ludovic Courtès (2015-11-17 19:16 +0300) wrote:
> Alex Kost <alezost@gmail.com> skribis:
>
>> Ludovic Courtès (2015-11-15 20:41 +0300) wrote:
>>
>>> Alex Kost <alezost@gmail.com> skribis:
>>>
>>>> (add-to-list 'geiser-guile-load-path 'foo) errors if "geiser-guile.el"
>>>> is not loaded yet, so I think it's better to put it inside
>>>> 'with-eval-after-load', WDYT?
>>>
>>> Sounds good. I guess that’s because (require 'guix-init) doesn’t
>>> require 'geiser?
>>
>> "guix-init.el" shouldn't require geiser. IMO it should load as less
>> code as possible, because it will increase the Emacs start time.
>>
>> In general I think requiring/loading packages is evil (as it slows down
>> starting Emacs), so I avoid 'require'-s when possible in my init file.
>
> Agreed, I was just making sure I understood the issue at hand.
OK. Actually I thought that you use 'with-eval-after-load' or
'eval-after-load' or 'use-package', and you just didn't mention it in
the manual because it's a common Emacs thing. But it looks like you use
a straightforward (add-to-list ...), which can work only if
"geiser-guile.el" is already loaded. Out of curiosity, do you somehow
load the whole geiser in your emacs config? If so, why?
I mean not just (require 'geiser), as it does not load
"geiser-guile.el", but maybe (require 'geiser-mode) or something like
it.
(I personally don't touch 'geiser-guile-load-path' at all, I just set
GUILE_LOAD_PATH in my ".bash_profile" instead)
> The patch you sent looks good to me then.
Thanks!
--
Alex
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] doc: Fix 'geiser-guile-load-path' example.
2015-11-17 17:22 ` Alex Kost
@ 2015-11-17 21:40 ` Ludovic Courtès
2015-11-18 17:26 ` Alex Kost
0 siblings, 1 reply; 8+ messages in thread
From: Ludovic Courtès @ 2015-11-17 21:40 UTC (permalink / raw)
To: Alex Kost; +Cc: guix-devel
Alex Kost <alezost@gmail.com> skribis:
> OK. Actually I thought that you use 'with-eval-after-load' or
> 'eval-after-load' or 'use-package', and you just didn't mention it in
> the manual because it's a common Emacs thing. But it looks like you use
> a straightforward (add-to-list ...), which can work only if
> "geiser-guile.el" is already loaded. Out of curiosity, do you somehow
> load the whole geiser in your emacs config? If so, why?
>
> I mean not just (require 'geiser), as it does not load
> "geiser-guile.el", but maybe (require 'geiser-mode) or something like
> it.
I have:
(require 'geiser-install)
(require 'geiser)
> (I personally don't touch 'geiser-guile-load-path' at all, I just set
> GUILE_LOAD_PATH in my ".bash_profile" instead)
I touch ‘geiser-guile-load-path’ because I want it to point to a bunch
of source trees.
Conversely, I don’t want GUILE_LOAD_PATH to point to source trees, so it
only points to installation directories.
Ludo’.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] doc: Fix 'geiser-guile-load-path' example.
2015-11-17 21:40 ` Ludovic Courtès
@ 2015-11-18 17:26 ` Alex Kost
2015-11-18 21:36 ` Ludovic Courtès
0 siblings, 1 reply; 8+ messages in thread
From: Alex Kost @ 2015-11-18 17:26 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: guix-devel
Ludovic Courtès (2015-11-18 00:40 +0300) wrote:
> Alex Kost <alezost@gmail.com> skribis:
>
>> OK. Actually I thought that you use 'with-eval-after-load' or
>> 'eval-after-load' or 'use-package', and you just didn't mention it in
>> the manual because it's a common Emacs thing. But it looks like you use
>> a straightforward (add-to-list ...), which can work only if
>> "geiser-guile.el" is already loaded. Out of curiosity, do you somehow
>> load the whole geiser in your emacs config? If so, why?
>>
>> I mean not just (require 'geiser), as it does not load
>> "geiser-guile.el", but maybe (require 'geiser-mode) or something like
>> it.
>
> I have:
>
> (require 'geiser-install)
> (require 'geiser)
You don't need (require 'geiser) as (require 'geiser-install) loads it
anyway (look at "M-x find-library geiser-install").
But after this, 'geiser-guile-load-path' shouldn't be available, as it
is placed in "geiser-guile.el" which is not loaded by "geiser.el". So
if (featurep 'geiser-guile) gives you `t' right after Emacs start, then
there is something else (I would say “something evil” :-)) in your
config that loads the whole Geiser functionality.
>> (I personally don't touch 'geiser-guile-load-path' at all, I just set
>> GUILE_LOAD_PATH in my ".bash_profile" instead)
>
> I touch ‘geiser-guile-load-path’ because I want it to point to a bunch
> of source trees.
>
> Conversely, I don’t want GUILE_LOAD_PATH to point to source trees, so it
> only points to installation directories.
Ah, I see your point, thanks.
--
Alex
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] doc: Fix 'geiser-guile-load-path' example.
2015-11-18 17:26 ` Alex Kost
@ 2015-11-18 21:36 ` Ludovic Courtès
0 siblings, 0 replies; 8+ messages in thread
From: Ludovic Courtès @ 2015-11-18 21:36 UTC (permalink / raw)
To: Alex Kost; +Cc: guix-devel
Alex Kost <alezost@gmail.com> skribis:
> Ludovic Courtès (2015-11-18 00:40 +0300) wrote:
[...]
>> I have:
>>
>> (require 'geiser-install)
>> (require 'geiser)
>
> You don't need (require 'geiser) as (require 'geiser-install) loads it
> anyway (look at "M-x find-library geiser-install").
>
> But after this, 'geiser-guile-load-path' shouldn't be available, as it
> is placed in "geiser-guile.el" which is not loaded by "geiser.el". So
> if (featurep 'geiser-guile) gives you `t' right after Emacs start, then
> there is something else (I would say “something evil” :-)) in your
> config that loads the whole Geiser functionality.
Weird, I don’t see anything obvious. Nevertheless, I’ve changed my
.emacs to use ‘with-eval-after-load’.
Thanks for educating me! :-)
Ludo’.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2015-11-18 21:36 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-14 18:56 [PATCH] doc: Fix 'geiser-guile-load-path' example Alex Kost
2015-11-15 17:41 ` Ludovic Courtès
2015-11-17 8:04 ` Alex Kost
2015-11-17 16:16 ` Ludovic Courtès
2015-11-17 17:22 ` Alex Kost
2015-11-17 21:40 ` Ludovic Courtès
2015-11-18 17:26 ` Alex Kost
2015-11-18 21:36 ` Ludovic Courtès
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).