GNU bug report logs - #39026
27.0.50; gnus-group-decoded-name needs running gnus

Previous Next

Package: emacs;

Reported by: Deus Max <deusmax <at> gmx.com>

Date: Wed, 8 Jan 2020 02:48:02 UTC

Severity: minor

Found in version 27.0.50

Done: Eric Abrahamsen <eric <at> ericabrahamsen.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: Deus Max <deusmax <at> gmx.com>
Cc: 39026 <at> debbugs.gnu.org
Subject: bug#39026: 27.0.50; gnus-group-decoded-name needs running gnus
Date: Wed, 08 Jan 2020 11:09:21 -0800
Deus Max <deusmax <at> gmx.com> writes:

> Before starting gnus, running:
>    (gnus-group-decoded-name  group-name) ; ex: "nnimap+myserver:GroupName"
>
> Gives the error:
>    ** Eval error ***  Wrong type argument: hash-table-p, nil
>
> Tracking this down the path:
>    - (gnus-group-decoded-name group-name)
>      - (gnus-group-name-charset  nil group-name)
>        - (gnus-find-method-for-group group-name)
>          - (gnus-group-entry group-name)
>
> The tiny macro gnus-group-entry, simply does a:
>     (gethash group-name gnus-newsrc-hashtb)
>
> The variable gnus-newsrc-hashtb is not a hashtable when gnus is not
> running. Logical, it has not been assinged yet.
>
> To me, it seems unnecessary to require a running gnus for a simple group
> name decoding. It is overkill, that loses a lot of offline functinality
> and possibilities.

In theory, the only way we can know how to decode a group name for sure
is by asking its method for the appropriate charset to use, and we can
only reasonably do that if Gnus is loaded.

In practice, the same changes that put in the hash table also resulted
in Gnus group names being always decoded, at least within a running Gnus
system, so the call to `gnus-group-decoded-name' is usually unnecessary
(the only time the server/method charset comes into play is when we're
requesting the group names from the server).

Of course if you're trying to do things with groups outside of a running
Gnus system, you might be manually reading the group names from
the.newsrc.eld file, in which case non-ASCII group names will be in an
encoded format, using 'utf-8-emacs.

What I'm saying is, depending on how you're using the group names and
where you're getting them from, you should be safe simply running them
through a 'utf-8-emacs decode.

Eric




This bug report was last modified 5 years and 125 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.