Gnus development mailing list
 help / color / mirror / Atom feed
* How to setup new nnselect group from init file?
@ 2020-11-05 10:27 Pankaj Jangid
  2020-11-06  2:13 ` Eric Abrahamsen
  0 siblings, 1 reply; 3+ messages in thread
From: Pankaj Jangid @ 2020-11-05 10:27 UTC (permalink / raw)
  To: Gnus Users

I have specified messages for an nnselect group in the configuration in
~/.gnus.el. Like this,

--8<---------------cut here---------------start------------->8---
(setq gnus-parameters
      '(("nnselect:emacs"
	 (nnselect-specs
	  (nnselect-function . gnus-search-run-query)
	  (nnselect-args
	   (search-query-spec
            (query . "recipient:emacs-devel@gnu.org"))
	   (search-group-spec
            ("nnimap\\+codeisgreat:INBOX")
            ))))
	("nnselect:postgress"
	 (nnselect-specs
	  (nnselect-function . gnus-search-run-query)
	  (nnselect-args
	   (search-query-spec
            (query . "recipient:pgsql-general@lists.postgresql.org")
	    (query . "recipient:pgsql-announce@lists.postgresql.org")
	    (query . "recipient:pgsql-novice@lists.postgresql.org")
	    (query . "recipient:pgsql-sql@lists.postgresql.org"))
	   (search-group-spec
            ("nnimap\\+codeisgreat:INBOX")
            ))))
	("nnselect:cron"
	 (nnselect-specs
	  (nnselect-function . gnus-search-run-query)
	  (nnselect-args
	   (search-query-spec
            (query . "from:Cron? Daemon")
	   (search-group-spec
            ("nnml:mail.misc")
	    ("nnimap\\+otp:INBOX")
            )))))))
--8<---------------cut here---------------end--------------->8---

Now how to make these groups visible in the group-buffer? I don't want
to do it in the UI. I want to set them up in the init file only.

Other groups, like nnimap+... are automatically created once I set it up
using select method. What is the method for nnselect groups?


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

* Re: How to setup new nnselect group from init file?
  2020-11-05 10:27 How to setup new nnselect group from init file? Pankaj Jangid
@ 2020-11-06  2:13 ` Eric Abrahamsen
  2020-11-06  5:13   ` Pankaj Jangid
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Abrahamsen @ 2020-11-06  2:13 UTC (permalink / raw)
  To: Gnus Users

Pankaj Jangid <pankaj@codeisgreat.org> writes:

> I have specified messages for an nnselect group in the configuration in
> ~/.gnus.el. Like this,
>
> (setq gnus-parameters
>       '(("nnselect:emacs"
> 	 (nnselect-specs
> 	  (nnselect-function . gnus-search-run-query)
> 	  (nnselect-args
> 	   (search-query-spec
>             (query . "recipient:emacs-devel@gnu.org"))
> 	   (search-group-spec
>             ("nnimap\\+codeisgreat:INBOX")
>             ))))
> 	("nnselect:postgress"
> 	 (nnselect-specs
> 	  (nnselect-function . gnus-search-run-query)
> 	  (nnselect-args
> 	   (search-query-spec
>             (query . "recipient:pgsql-general@lists.postgresql.org")
> 	    (query . "recipient:pgsql-announce@lists.postgresql.org")
> 	    (query . "recipient:pgsql-novice@lists.postgresql.org")
> 	    (query . "recipient:pgsql-sql@lists.postgresql.org"))

This isn't going to behave the way you want. There can be only one
"query" key, and the query itself will look like
"recipient:pgsql-general@lists.postgresql.org or
recipient:pgsql-announce@lists.postgresql.org or
recipient:pgsql-novice@lists.postgresql.org..."

> (search-group-spec
>             ("nnimap\\+codeisgreat:INBOX")
>             ))))
> 	("nnselect:cron"
> 	 (nnselect-specs
> 	  (nnselect-function . gnus-search-run-query)
> 	  (nnselect-args
> 	   (search-query-spec
>             (query . "from:Cron? Daemon")

You'll probably want quotes around that value "from:\"Cron? Daemon\"".

> 	   (search-group-spec
>             ("nnml:mail.misc")
> 	    ("nnimap\\+otp:INBOX")
>             )))))))
>
> Now how to make these groups visible in the group-buffer? I don't want
> to do it in the UI. I want to set them up in the init file only.
>
> Other groups, like nnimap+... are automatically created once I set it up
> using select method. What is the method for nnselect groups?

I don't believe there's any way to create and subscribe to a group from
your init files. You can certainly set parameters as above, but you'll
need to create the groups from the Group buffer before the parameters
take effect. That would also prevent the above incorrect search queries,
since the group creation would be prompting you directly.


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

* Re: How to setup new nnselect group from init file?
  2020-11-06  2:13 ` Eric Abrahamsen
@ 2020-11-06  5:13   ` Pankaj Jangid
  0 siblings, 0 replies; 3+ messages in thread
From: Pankaj Jangid @ 2020-11-06  5:13 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: Gnus Users

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> This isn't going to behave the way you want. There can be only one
> "query" key, and the query itself will look like
> "recipient:pgsql-general@lists.postgresql.org or
> recipient:pgsql-announce@lists.postgresql.org or
> recipient:pgsql-novice@lists.postgresql.org..."
>
>
> You'll probably want quotes around that value "from:\"Cron? Daemon\"".

Thanks worked.


> I don't believe there's any way to create and subscribe to a group
> from your init files. You can certainly set parameters as above, but
> you'll need to create the groups from the Group buffer before the
> parameters take effect. That would also prevent the above incorrect
> search queries, since the group creation would be prompting you
> directly.

Ok. But I went into trouble. That I think needs to be fixed.

I made the above settings in the .gnus.el and probably these got saved
into my .newsrc.eld and probably did few more experiments that I don't
remember exactly what. I did it to make it work from the init file. And
Gnus wasn't starting then. Group buffer wasn't coming up. I had to
manually delete nnselect sexps to bring it back.

But after creating groups from group buffer I am loving it. Really
changed the whole experience.


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

end of thread, other threads:[~2020-11-06  5:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-05 10:27 How to setup new nnselect group from init file? Pankaj Jangid
2020-11-06  2:13 ` Eric Abrahamsen
2020-11-06  5:13   ` Pankaj Jangid

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