unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Emacs autoloads
@ 2017-03-02 11:51 Catonano
  2017-03-02 13:13 ` Thomas Danckaert
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Catonano @ 2017-03-02 11:51 UTC (permalink / raw)
  To: help-guix

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

I installed emacs-debbugs

But it doesn't get autoloaded, so I had to comment out this line in my
.emacs file

(add-to-list 'debbugs-gnu-all-packages "guix-patches")

because otherwise when launching emacs it claims that
"debbugs-gnu-all-packages" value is void

I have to manually launch debbugs and only after that I can manipulate said
variable

Not so with the Zenburn theme, though. That is available when .emacs is
processed.

Both are autoloaded, as you can see
http://paste.lisp.org/display/340347

I know that Alex already discussed this but I can't find the email or maybe
it was on the irc channel ? Sorry, I don't remember

Thanks in advance

[-- Attachment #2: Type: text/html, Size: 918 bytes --]

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

* Re: Emacs autoloads
  2017-03-02 11:51 Emacs autoloads Catonano
@ 2017-03-02 13:13 ` Thomas Danckaert
  2017-03-02 21:31   ` Alex Kost
  2017-03-02 13:35 ` Federico Beffa
  2017-03-02 21:30 ` Alex Kost
  2 siblings, 1 reply; 9+ messages in thread
From: Thomas Danckaert @ 2017-03-02 13:13 UTC (permalink / raw)
  To: catonano; +Cc: help-guix

From: Catonano <catonano@gmail.com>
Subject: Emacs autoloads
Date: Thu, 2 Mar 2017 12:51:13 +0100

> I installed emacs-debbugs
>
> But it doesn't get autoloaded, so I had to comment out this line in
> my .emacs file
>
> (add-to-list 'debbugs-gnu-all-packages "guix-patches")
>
> because otherwise when launching emacs it claims that
> "debbugs-gnu-all-packages" value is void

I had the same issue, solved it using “with-eval-after-load”, like 
this:

(with-eval-after-load 'debbugs-gnu
   (add-to-list 'debbugs-gnu-all-packages "guix-patches"))

In fact I sent a message to guix-devel about this, but it never made 
it through...

Thomas

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

* Re: Emacs autoloads
  2017-03-02 11:51 Emacs autoloads Catonano
  2017-03-02 13:13 ` Thomas Danckaert
@ 2017-03-02 13:35 ` Federico Beffa
  2017-03-02 14:42   ` Catonano
  2017-03-02 21:33   ` Alex Kost
  2017-03-02 21:30 ` Alex Kost
  2 siblings, 2 replies; 9+ messages in thread
From: Federico Beffa @ 2017-03-02 13:35 UTC (permalink / raw)
  To: Catonano; +Cc: help-guix

Catonano <catonano@gmail.com> writes:

> I installed emacs-debbugs
>
> But it doesn't get autoloaded, so I had to comment out this line in my .emacs file
>
> (add-to-list 'debbugs-gnu-all-packages "guix-patches")
>
> because otherwise when launching emacs it claims that "debbugs-gnu-all-packages" value is void

If you put this

(require 'debbugs-gnu)

before '(add-to-list ...)' is should work.

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

* Re: Emacs autoloads
  2017-03-02 13:35 ` Federico Beffa
@ 2017-03-02 14:42   ` Catonano
  2017-03-02 17:55     ` Federico Beffa
  2017-03-02 21:33   ` Alex Kost
  1 sibling, 1 reply; 9+ messages in thread
From: Catonano @ 2017-03-02 14:42 UTC (permalink / raw)
  To: Federico Beffa, Thomas Danckaert; +Cc: help-guix

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

2017-03-02 14:35 GMT+01:00 Federico Beffa <beffa@ieee.org>:

> Catonano <catonano@gmail.com> writes:
>
> > I installed emacs-debbugs
> >
> > But it doesn't get autoloaded, so I had to comment out this line in my
> .emacs file
> >
> > (add-to-list 'debbugs-gnu-all-packages "guix-patches")
> >
> > because otherwise when launching emacs it claims that
> "debbugs-gnu-all-packages" value is void
>
> If you put this
>
> (require 'debbugs-gnu)
>
> before '(add-to-list ...)' is should work.
>

Thank you Federico

Isn't the autoload machinery meant to avoid the explicit require ?

Not that it bothers me that much, just saying

Thanks again !
Ciao

[-- Attachment #2: Type: text/html, Size: 1258 bytes --]

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

* Re: Emacs autoloads
  2017-03-02 14:42   ` Catonano
@ 2017-03-02 17:55     ` Federico Beffa
  0 siblings, 0 replies; 9+ messages in thread
From: Federico Beffa @ 2017-03-02 17:55 UTC (permalink / raw)
  To: Catonano; +Cc: Thomas Danckaert, help-guix

Catonano <catonano@gmail.com> writes:

> Isn't the autoload machinery meant to avoid the explicit require ? 

As far as I understand 'autoload' tells Emacs that a function does exit
and where to find it, without Emacs having to load the whole file
https://www.gnu.org/software/emacs/manual/elisp.html#Autoload.  It is
used to tell Emacs about the most important functions such as
'debbugs-gnu'.  It doesn't know about 'debbugs-gnu-all-packages' because
it is not autoloaded (see debbugs-gnu.el).  Once you load the whole
file, you will see everything.

Regards,
Fede

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

* Re: Emacs autoloads
  2017-03-02 11:51 Emacs autoloads Catonano
  2017-03-02 13:13 ` Thomas Danckaert
  2017-03-02 13:35 ` Federico Beffa
@ 2017-03-02 21:30 ` Alex Kost
  2017-03-02 23:49   ` Catonano
  2 siblings, 1 reply; 9+ messages in thread
From: Alex Kost @ 2017-03-02 21:30 UTC (permalink / raw)
  To: Catonano; +Cc: help-guix

Catonano (2017-03-02 12:51 +0100) wrote:

> I installed emacs-debbugs
>
> But it doesn't get autoloaded

It does!  You probably think that all functions and variables are
autoloaded, but it's not the case.  Autoloads are generated only for
those symbols (usually interactive commands) that have ";;;###autoload"
cookies.  For example, look at "M-x find-library debbugs-gnu" and search
for ";;;###autoload" there.

> so I had to comment out this line in
> my .emacs file
>
> (add-to-list 'debbugs-gnu-all-packages "guix-patches")
>
> because otherwise when launching emacs it claims that
> "debbugs-gnu-all-packages" value is void

Yes, because this variable is void indeed when your emacs config is
loaded.  Wrap such configurations of external Emacs packages inside
'with-eval-after-load' as Thomas suggested.

-- 
Alex

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

* Re: Emacs autoloads
  2017-03-02 13:13 ` Thomas Danckaert
@ 2017-03-02 21:31   ` Alex Kost
  0 siblings, 0 replies; 9+ messages in thread
From: Alex Kost @ 2017-03-02 21:31 UTC (permalink / raw)
  To: Thomas Danckaert; +Cc: help-guix

Thomas Danckaert (2017-03-02 14:13 +0100) wrote:

> From: Catonano <catonano@gmail.com>
> Subject: Emacs autoloads
> Date: Thu, 2 Mar 2017 12:51:13 +0100
>
>> I installed emacs-debbugs
>>
>> But it doesn't get autoloaded, so I had to comment out this line in
>> my .emacs file
>>
>> (add-to-list 'debbugs-gnu-all-packages "guix-patches")
>>
>> because otherwise when launching emacs it claims that
>> "debbugs-gnu-all-packages" value is void
>
> I had the same issue, solved it using “with-eval-after-load”, like this:

This is not the issue, it is expected (see my answer to Catonano), and
'with-eval-after-load' is exactly what should be used in such cases.

> (with-eval-after-load 'debbugs-gnu
>   (add-to-list 'debbugs-gnu-all-packages "guix-patches"))
>
> In fact I sent a message to guix-devel about this, but it never made it
> through...

-- 
Alex

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

* Re: Emacs autoloads
  2017-03-02 13:35 ` Federico Beffa
  2017-03-02 14:42   ` Catonano
@ 2017-03-02 21:33   ` Alex Kost
  1 sibling, 0 replies; 9+ messages in thread
From: Alex Kost @ 2017-03-02 21:33 UTC (permalink / raw)
  To: Federico Beffa; +Cc: help-guix

Federico Beffa (2017-03-02 14:35 +0100) wrote:

> Catonano <catonano@gmail.com> writes:
>
>> I installed emacs-debbugs
>>
>> But it doesn't get autoloaded, so I had to comment out this line in my .emacs file
>>
>> (add-to-list 'debbugs-gnu-all-packages "guix-patches")
>>
>> because otherwise when launching emacs it claims that "debbugs-gnu-all-packages" value is void
>
> If you put this
>
> (require 'debbugs-gnu)
>
> before '(add-to-list ...)' is should work.

No, no, do not require packages if you can avoid it!  This will really
slow emacs start time.  Well, of course, you are free to do whatever you
want, but I just can't see all the useless "require"s people have in
their configs.

Instead you can use 'with-eval-after-load' or 'eval-after-load' or
'use-package' <https://github.com/jwiegley/use-package>.

-- 
Alex

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

* Re: Emacs autoloads
  2017-03-02 21:30 ` Alex Kost
@ 2017-03-02 23:49   ` Catonano
  0 siblings, 0 replies; 9+ messages in thread
From: Catonano @ 2017-03-02 23:49 UTC (permalink / raw)
  To: Alex Kost; +Cc: help-guix

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

2017-03-02 22:30 GMT+01:00 Alex Kost <alezost@gmail.com>:

> Catonano (2017-03-02 12:51 +0100) wrote:
>
> > I installed emacs-debbugs
> >
> > But it doesn't get autoloaded
>
> It does!  You probably think that all functions and variables are
> autoloaded, but it's not the case.  Autoloads are generated only for
> those symbols (usually interactive commands) that have ";;;###autoload"
> cookies.  For example, look at "M-x find-library debbugs-gnu" and search
> for ";;;###autoload" there.
>
> > so I had to comment out this line in
> > my .emacs file
> >
> > (add-to-list 'debbugs-gnu-all-packages "guix-patches")
> >
> > because otherwise when launching emacs it claims that
> > "debbugs-gnu-all-packages" value is void
>
> Yes, because this variable is void indeed when your emacs config is
> loaded.  Wrap such configurations of external Emacs packages inside
> 'with-eval-after-load' as Thomas suggested.
>

Thanks so much for clarifying, Alex

[-- Attachment #2: Type: text/html, Size: 1544 bytes --]

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

end of thread, other threads:[~2017-03-02 23:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-02 11:51 Emacs autoloads Catonano
2017-03-02 13:13 ` Thomas Danckaert
2017-03-02 21:31   ` Alex Kost
2017-03-02 13:35 ` Federico Beffa
2017-03-02 14:42   ` Catonano
2017-03-02 17:55     ` Federico Beffa
2017-03-02 21:33   ` Alex Kost
2017-03-02 21:30 ` Alex Kost
2017-03-02 23:49   ` Catonano

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).