Gnus development mailing list
 help / color / mirror / Atom feed
* Missing first group in group list
@ 2021-01-21 11:13 Juan José García-Ripoll
  2021-01-21 11:58 ` Andreas Schwab
  0 siblings, 1 reply; 5+ messages in thread
From: Juan José García-Ripoll @ 2021-01-21 11:13 UTC (permalink / raw)
  To: ding

Hi,

I have been tracking a problem when using my own backends, which
actually seems to be a bug in Gnus. Any help in determining this would
be appreciated.

Essentially the problem is in this function

(defun gnus-group-prepare-flat (level &optional predicate lowest regexp)
 ...
      ;; List living groups, according to order in `gnus-group-list'.
      (dolist (g (cdr gnus-group-list))
        (setq info (gnus-get-info g)
	      group (gnus-info-group info)

This function drops the first group in the list, probably because it
assumes it is the dummy.group, but in my system it is never so. In my
working machine I have

  (setq gnus-select-method '(nnnil ""))
  (setq gnus-secondary-select-methods
        '((nnmaild "archived"
                  (nnmaild-directory "/path/to/Maildir"))))

In this order the list of groups luckily ends up being

   ("nnimap+work:Trash" ... "dummy.group" "nndraft:drafts")

so that the group that is lost is trivial.

However if I add one more backend

  (setq gnus-secondary-select-methods
        '((nnmaild "archived"
                  (nnmaild-directory "/path/to/Maildir"))
          (nnimap "work"
                   (nnimap-address "mail.server.at.work")
                   (nnimap-server-port 993)
                   (nnimap-stream ssl)
                   (nnimap-fetch-partial-articles t)
                   (nnmail-expiry-target "nnimap+work:Trash")
                   (nnir-search-engine imap))))

the group that is lost is my last archive folder in /path/to/Maildir

Is this a typo, or is there some sorting logic in gnus-group-list that
is being messed up?

Cheers

Juanjo

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



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

* Re: Missing first group in group list
  2021-01-21 11:13 Missing first group in group list Juan José García-Ripoll
@ 2021-01-21 11:58 ` Andreas Schwab
  2021-01-21 13:23   ` Juan José García-Ripoll
  2021-01-21 17:02   ` Juan José García-Ripoll
  0 siblings, 2 replies; 5+ messages in thread
From: Andreas Schwab @ 2021-01-21 11:58 UTC (permalink / raw)
  To: Juan José García-Ripoll; +Cc: ding

On Jan 21 2021, Juan José García-Ripoll wrote:

> Essentially the problem is in this function
>
> (defun gnus-group-prepare-flat (level &optional predicate lowest regexp)
>  ...
>       ;; List living groups, according to order in `gnus-group-list'.
>       (dolist (g (cdr gnus-group-list))
>         (setq info (gnus-get-info g)
> 	      group (gnus-info-group info)
>
> This function drops the first group in the list, probably because it
> assumes it is the dummy.group, but in my system it is never so.

It looks like Gnus always tries to keep dummy.group at the head of the
group list, see the various references in gnus-start.el or
gnus-group.el.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


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

* Re: Missing first group in group list
  2021-01-21 11:58 ` Andreas Schwab
@ 2021-01-21 13:23   ` Juan José García-Ripoll
  2021-01-21 17:02   ` Juan José García-Ripoll
  1 sibling, 0 replies; 5+ messages in thread
From: Juan José García-Ripoll @ 2021-01-21 13:23 UTC (permalink / raw)
  To: ding

Andreas Schwab <schwab@linux-m68k.org> writes:
> It looks like Gnus always tries to keep dummy.group at the head of the
> group list, see the various references in gnus-start.el or
> gnus-group.el.

Interesting. I suspected so, but it seems to be failing at the sorting
somewhere in Emacs 27.1. I will report it as a bug.

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



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

* Re: Missing first group in group list
  2021-01-21 11:58 ` Andreas Schwab
  2021-01-21 13:23   ` Juan José García-Ripoll
@ 2021-01-21 17:02   ` Juan José García-Ripoll
  2021-01-21 17:12     ` Eric Abrahamsen
  1 sibling, 1 reply; 5+ messages in thread
From: Juan José García-Ripoll @ 2021-01-21 17:02 UTC (permalink / raw)
  To: ding

Andreas Schwab <schwab@linux-m68k.org> writes:
> On Jan 21 2021, Juan José García-Ripoll wrote:
>
>> Essentially the problem is in this function
>>
>> (defun gnus-group-prepare-flat (level &optional predicate lowest regexp)
>>  ...
>>       ;; List living groups, according to order in `gnus-group-list'.
>>       (dolist (g (cdr gnus-group-list))
>>         (setq info (gnus-get-info g)
>> 	      group (gnus-info-group info)
>>
>> This function drops the first group in the list, probably because it
>> assumes it is the dummy.group, but in my system it is never so.
>
> It looks like Gnus always tries to keep dummy.group at the head of the
> group list, see the various references in gnus-start.el or
> gnus-group.el.

Hmmm, not really. I've debugged the gnus-group-list variable and it is
changed twice: once to add dummy.group, and another one to add the
subsequent group, in a chain of calls that starts in
gnus-subscribe-group.

The problem is this code:

(defun gnus-subscribe-newsgroup (newsgroup &optional next)
  "Subscribe new NEWSGROUP.
If NEXT is non-nil, it is inserted before NEXT.  Otherwise it is made
the first newsgroup."
  (save-excursion
    (goto-char (point-min))
    ;; We subscribe the group by changing its level to `subscribed'.
    (gnus-group-change-level
     newsgroup gnus-level-default-subscribed
     gnus-level-killed (or next "dummy.group"))

It is called like (gnus-subscribe-newsgroup "The-new-group"
"dummy.group") Note that by default NEXT is nil. This means that the
next group that is inserted will be injected _before_ dummy.group and
the order is destroyed.

Cheers,

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



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

* Re: Missing first group in group list
  2021-01-21 17:02   ` Juan José García-Ripoll
@ 2021-01-21 17:12     ` Eric Abrahamsen
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Abrahamsen @ 2021-01-21 17:12 UTC (permalink / raw)
  To: ding

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

> Andreas Schwab <schwab@linux-m68k.org> writes:
>> On Jan 21 2021, Juan José García-Ripoll wrote:
>>
>>> Essentially the problem is in this function
>>>
>>> (defun gnus-group-prepare-flat (level &optional predicate lowest regexp)
>>>  ...
>>>       ;; List living groups, according to order in `gnus-group-list'.
>>>       (dolist (g (cdr gnus-group-list))
>>>         (setq info (gnus-get-info g)
>>> 	      group (gnus-info-group info)
>>>
>>> This function drops the first group in the list, probably because it
>>> assumes it is the dummy.group, but in my system it is never so.
>>
>> It looks like Gnus always tries to keep dummy.group at the head of the
>> group list, see the various references in gnus-start.el or
>> gnus-group.el.
>
> Hmmm, not really. I've debugged the gnus-group-list variable and it is
> changed twice: once to add dummy.group, and another one to add the
> subsequent group, in a chain of calls that starts in
> gnus-subscribe-group.
>
> The problem is this code:
>
> (defun gnus-subscribe-newsgroup (newsgroup &optional next)
>   "Subscribe new NEWSGROUP.
> If NEXT is non-nil, it is inserted before NEXT.  Otherwise it is made
> the first newsgroup."
>   (save-excursion
>     (goto-char (point-min))
>     ;; We subscribe the group by changing its level to `subscribed'.
>     (gnus-group-change-level
>      newsgroup gnus-level-default-subscribed
>      gnus-level-killed (or next "dummy.group"))
>
> It is called like (gnus-subscribe-newsgroup "The-new-group"
> "dummy.group") Note that by default NEXT is nil. This means that the
> next group that is inserted will be injected _before_ dummy.group and
> the order is destroyed.

Thanks for debugging! This is probably an error I introduced, and I'll
try to fix it this weekend. I appreciate this leg up.

Eric



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

end of thread, other threads:[~2021-01-21 17:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-21 11:13 Missing first group in group list Juan José García-Ripoll
2021-01-21 11:58 ` Andreas Schwab
2021-01-21 13:23   ` Juan José García-Ripoll
2021-01-21 17:02   ` Juan José García-Ripoll
2021-01-21 17:12     ` Eric Abrahamsen

Gnus development mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/ding

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 ding ding/ http://inbox.vuxu.org/ding \
		ding@inbox.vuxu.org
	public-inbox-index ding

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.emacs.gnus.general


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git