From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Deus Max Newsgroups: gmane.emacs.bugs Subject: bug#39026: 27.0.50; gnus-group-decoded-name needs running gnus Date: Thu, 09 Jan 2020 15:22:17 +0200 Message-ID: <87muaw229i.fsf@aia00054aia.gr> References: <871rsaoe9u.fsf@aia00054aia.gr> <87woa1bw9q.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="18062"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 39026@debbugs.gnu.org To: Eric Abrahamsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 09 14:24:28 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ipXmo-000cjb-0B for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 09 Jan 2020 14:23:42 +0100 Original-Received: from localhost ([::1]:60332 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipXmm-0002Mv-DF for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 09 Jan 2020 08:23:40 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57967) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipXmB-0002Ki-BU for bug-gnu-emacs@gnu.org; Thu, 09 Jan 2020 08:23:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipXmA-0001UR-0v for bug-gnu-emacs@gnu.org; Thu, 09 Jan 2020 08:23:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45973) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ipXm9-0001Tp-Nl for bug-gnu-emacs@gnu.org; Thu, 09 Jan 2020 08:23:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ipXm9-00052b-LM for bug-gnu-emacs@gnu.org; Thu, 09 Jan 2020 08:23:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Deus Max Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 09 Jan 2020 13:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39026 X-GNU-PR-Package: emacs Original-Received: via spool by 39026-submit@debbugs.gnu.org id=B39026.157857616219324 (code B ref 39026); Thu, 09 Jan 2020 13:23:01 +0000 Original-Received: (at 39026) by debbugs.gnu.org; 9 Jan 2020 13:22:42 +0000 Original-Received: from localhost ([127.0.0.1]:51946 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ipXlq-00051c-Ai for submit@debbugs.gnu.org; Thu, 09 Jan 2020 08:22:42 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]:49509) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ipXln-00051H-MT for 39026@debbugs.gnu.org; Thu, 09 Jan 2020 08:22:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1578576144; bh=1thjdJGnT8bg0lcQG8WgyQ6C4hVQw5019lez7WB99cQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=P7IPIb4aYiw5gp63y5J4ClImx0mHxVLGWz1sp495O1+gvX86XxNGeC7WlXScVpuLB iLaOE3M1UtmHLBtGY36hzIUWqh7U09TaHxmjH8aqWepHOz2ma4hsfH2QY+Q3uE2G4a eNiACLmQbsKvVJ8MHnIZkOcGqKFqcglo96STj1o4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from dellcorei5dias ([46.176.253.164]) by mail.gmx.com (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1M72oB-1ilQtk3E47-008e81; Thu, 09 Jan 2020 14:22:24 +0100 In-Reply-To: <87woa1bw9q.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Wed, 08 Jan 2020 11:09:21 -0800") X-Provags-ID: V03:K1:mCjDCefxBkUelTCnYFC06GnbIDkDRFNpUqwSDI/5Y9nXAVhGuZs mRUo2uul+Y4Rt158Dx+1tJwdxTBNdflGkUYwXcR4O23vcWVXTY14pAHfa8uS+j1TXXOKgmS fmlmptlclwtyvu5S2uu67HbigWGL8ziZ/m6KN6TcIc8gGlQ4aWOf6drhiiLXIe8IocDsw1G biL0sMOmpWEu+gcfgNM1A== X-UI-Out-Filterresults: notjunk:1;V03:K0:o/RZ6iT21xI=:IMj54D2ykUHg+RldhqQa4J kHb/FjLhrxM83gR/McfgQiTcWbbckFei2H9R16Kqmpvmh0skatYRB7TcLrrF6Gf3CStCvoS9p u4Fo2emU0e1knMAUuPZn7RyL67Zi9drrJR6v68WjF9MpRm45TNuQdvcBTQB323XtibOX2BUeq HPcA52eqxJ2uO9u9XCSqRqiZbgfukovQ9bjYnMKo66ZzEc5EKaczJEN7mCnl1h1Y9Iz6zBcTa uHNLsZN0DPKeZ9asQIueKCl7njVkcmNR9LVmcZtI2gkQvRzaeEAH96FimIZENX/czfxiYnJi2 l/qHe7SaQp/4ct3eAUyPT0oPMR85Zw0hKvrjTwcz6BbQ/HOIVdST/epD/1FLby/v3dcfa1vad ACDccWoRIkYv2WzQJHz4A7+npXoqmvJgfLQ9LLLLc1iV2NrTMcgTNubuCf3QOSLNS0nCQtihH GoyRlAK3594S9Cn4QBwjcARmQMWJ8troocEjXjqa4zYzbtNHEeSrZJFRfKAq/jNUH4hg2gaqN 4VxVknK7AhIsCBOznStRQsrCYQ44FoR44TjLYGMBZvcCdvh4lzWT15Fe0KShfivIv4DGhcYeT LG9qWgK+4Nd4D2FLx1DCA7pgcwkfGLCF2qVS4r88/19VdO3Ic15R8+lec0KWy/w+oBzcKdiqp AWq2MCvlKWBQEcRrHrA0gtxSufY6rsw/O4e2YHjJqTiFqiIZ0XudaSTm+ELhKRwZHMhiLZWAn rdM09IzOObAytzeCQEJ85+06Gx+OgxkwpoPtjUgDPyC6mJEwoO8AdC22VvFmoSk4EMfqi7n9 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:174407 Archived-At: On Wed, Jan 08 2020, Eric Abrahamsen wrote: > Deus Max 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 Yes, that's mostly how I'm using it, i.e. by reading group names from .newsrc, but sometimes directly from a gnus group or article. So, it would be nice to do some things independent of a running gnus and in a consistent way. I didn't see any charset info returned by querying the server (with gnus-find-method-for-group, gnus-group-entry). Logically, the method should be provided in the group name, except for the primary method (gnus-select-method, perhaps another good reason to get rid of this distinction among groups, but I digress, sorry). It seems that all the real work (in gnus-group-name-charset), for finding the charset, comes from the variables gnus-group-name-charset-group-alist and gnus-group-name-charset-method-alist which are defined at startup and don't need a running gnus. DeusM