Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* use-package :custom causes gnus to load
@ 2023-10-28  9:53 Juan José García-Ripoll
  2023-10-28 11:37 ` Bartosz Kaczyński
  0 siblings, 1 reply; 6+ messages in thread
From: Juan José García-Ripoll @ 2023-10-28  9:53 UTC (permalink / raw)
  To: info-gnus-english

Hi,

I have a stupid peeve with my current configuration, which relies on
`use-package` to defer loading of `gnus`, but still configuring relevant
parameters.

I have found that all of the :custom statements are fine, except for

:custom
(gnus-select-method '(nnnil ""))

It seems this custom statement triggers loading of gnus. I found this
can be used by replacing this statement with

:config
(setq gnus-select-method '(nnnil ""))

However, it is less than satisfactory.

Any clue about this?

-- 
Juan José García Ripoll
http://juanjose.garciaripoll.com
http://quinfog.hbar.es



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

* Re: use-package :custom causes gnus to load
  2023-10-28  9:53 use-package :custom causes gnus to load Juan José García-Ripoll
@ 2023-10-28 11:37 ` Bartosz Kaczyński
  2023-10-28 13:39   ` Björn Bidar
  2023-10-28 14:40   ` Juan José García-Ripoll
  0 siblings, 2 replies; 6+ messages in thread
From: Bartosz Kaczyński @ 2023-10-28 11:37 UTC (permalink / raw)
  To: Juan José García-Ripoll; +Cc: info-gnus-english

Juan José García-Ripoll <juanjose.garciaripoll@gmail.com> writes:

> Hi,

Hi,

>
> I have a stupid peeve with my current configuration, which relies on
> `use-package` to defer loading of `gnus`, but still configuring relevant
> parameters.
>
> I have found that all of the :custom statements are fine, except for
>
> :custom
> (gnus-select-method '(nnnil ""))
>
> It seems this custom statement triggers loading of gnus. I found this
> can be used by replacing this statement with
>
> :config
> (setq gnus-select-method '(nnnil ""))
>
> However, it is less than satisfactory.

Why is that?

(use-package gnus
  :init
  (add-hook 'gnus-group-mode-hook 'gnus-topic-mode)

  :config
  (setq gnus-select-method '(nnnil ""))
    (setq gnus-secondary-select-methods
        '((nntp "news.gmane.io")
  --snip--

I don't have any issues with this configuration.

>
> Any clue about this?


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

* Re: use-package :custom causes gnus to load
  2023-10-28 11:37 ` Bartosz Kaczyński
@ 2023-10-28 13:39   ` Björn Bidar
  2023-10-28 14:40   ` Juan José García-Ripoll
  1 sibling, 0 replies; 6+ messages in thread
From: Björn Bidar @ 2023-10-28 13:39 UTC (permalink / raw)
  To: Bartosz Kaczyński
  Cc: Juan José García-Ripoll, info-gnus-english


I also configure gnus with a similar use-package block.
No issue here, Gnus isn't loaded.
Even when I use setopt.


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

* Re: use-package :custom causes gnus to load
  2023-10-28 11:37 ` Bartosz Kaczyński
  2023-10-28 13:39   ` Björn Bidar
@ 2023-10-28 14:40   ` Juan José García-Ripoll
  2023-10-28 15:33     ` Björn Bidar
  2023-10-28 15:38     ` Bartosz Kaczyński
  1 sibling, 2 replies; 6+ messages in thread
From: Juan José García-Ripoll @ 2023-10-28 14:40 UTC (permalink / raw)
  To: info-gnus-english

Your below example shows using :config and an explicit setq statement to
change the value of that variable. I found that this approach *does not*
trigger loading gnus, but using the :custom field of use-package does. I
cannot really fathom why.

Bartosz Kaczyński <bkaczynski@posteo.net> writes:
> Juan José García-Ripoll <juanjose.garciaripoll@gmail.com> writes:
>
>> Hi,
>
> Hi,
>
>>
>> I have a stupid peeve with my current configuration, which relies on
>> `use-package` to defer loading of `gnus`, but still configuring relevant
>> parameters.
>>
>> I have found that all of the :custom statements are fine, except for
>>
>> :custom
>> (gnus-select-method '(nnnil ""))
>>
>> It seems this custom statement triggers loading of gnus. I found this
>> can be used by replacing this statement with
>>
>> :config
>> (setq gnus-select-method '(nnnil ""))
>>
>> However, it is less than satisfactory.
>
> Why is that?
>
> (use-package gnus
>   :init
>   (add-hook 'gnus-group-mode-hook 'gnus-topic-mode)
>
>   :config
>   (setq gnus-select-method '(nnnil ""))
>     (setq gnus-secondary-select-methods
>         '((nntp "news.gmane.io")
>   --snip--
>
> I don't have any issues with this configuration.
>
>>
>> Any clue about this?
>
>

-- 
Juan José García Ripoll
http://juanjose.garciaripoll.com
http://quinfog.hbar.es



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

* Re: use-package :custom causes gnus to load
  2023-10-28 14:40   ` Juan José García-Ripoll
@ 2023-10-28 15:33     ` Björn Bidar
  2023-10-28 15:38     ` Bartosz Kaczyński
  1 sibling, 0 replies; 6+ messages in thread
From: Björn Bidar @ 2023-10-28 15:33 UTC (permalink / raw)
  To: Juan José García-Ripoll; +Cc: info-gnus-english


While setopt also uses custom but still doesn't trigger the loading
of gnus.


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

* Re: use-package :custom causes gnus to load
  2023-10-28 14:40   ` Juan José García-Ripoll
  2023-10-28 15:33     ` Björn Bidar
@ 2023-10-28 15:38     ` Bartosz Kaczyński
  1 sibling, 0 replies; 6+ messages in thread
From: Bartosz Kaczyński @ 2023-10-28 15:38 UTC (permalink / raw)
  To: info-gnus-english

Juan José García-Ripoll <juanjose.garciaripoll@gmail.com> writes:

> Your below example shows using :config and an explicit setq statement to
> change the value of that variable. I found that this approach *does not*
> trigger loading gnus, but using the :custom field of use-package does. I
> cannot really fathom why.

So you want the variable set, but without invoking Gnus? What's your
purpose in doing so?

According to documentation:

>:config can be used to execute code after a package is loaded.

So, the `:custom` option executes code before the package is loaded.


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

end of thread, other threads:[~2023-10-28 15:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-28  9:53 use-package :custom causes gnus to load Juan José García-Ripoll
2023-10-28 11:37 ` Bartosz Kaczyński
2023-10-28 13:39   ` Björn Bidar
2023-10-28 14:40   ` Juan José García-Ripoll
2023-10-28 15:33     ` Björn Bidar
2023-10-28 15:38     ` Bartosz Kaczyński

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 NNTP newsgroup(s).