From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Andy Moreton Newsgroups: gmane.emacs.bugs Subject: bug#33653: 27.0.50; Change Gnus obarrays-as-hash-tables into real hash tables Date: Mon, 25 Mar 2019 14:45:24 +0000 Message-ID: References: <8736raz3ec.fsf@ericabrahamsen.net> <87y392xoht.fsf@ericabrahamsen.net> <87imxzxa4s.fsf@ericabrahamsen.net> <87a7hn3h3w.fsf@ericabrahamsen.net> <87woknisuu.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="219927"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (windows-nt) To: 33653@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 25 15:46:11 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h8Qrb-000v6B-8A for geb-bug-gnu-emacs@m.gmane.org; Mon, 25 Mar 2019 15:46:11 +0100 Original-Received: from localhost ([127.0.0.1]:43663 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h8Qra-0001fQ-A3 for geb-bug-gnu-emacs@m.gmane.org; Mon, 25 Mar 2019 10:46:10 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:46314) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h8QrT-0001fH-Gd for bug-gnu-emacs@gnu.org; Mon, 25 Mar 2019 10:46:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h8QrS-0008Cl-EB for bug-gnu-emacs@gnu.org; Mon, 25 Mar 2019 10:46:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44975) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h8QrS-0008CW-9L for bug-gnu-emacs@gnu.org; Mon, 25 Mar 2019 10:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h8QrS-0000jw-2c for bug-gnu-emacs@gnu.org; Mon, 25 Mar 2019 10:46:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <8736raz3ec.fsf@ericabrahamsen.net> Resent-From: Andy Moreton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Mar 2019 14:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33653 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15535251422814 (code B ref -1); Mon, 25 Mar 2019 14:46:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 25 Mar 2019 14:45:42 +0000 Original-Received: from localhost ([127.0.0.1]:58519 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h8Qr8-0000jJ-CH for submit@debbugs.gnu.org; Mon, 25 Mar 2019 10:45:42 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:60113) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h8Qr7-0000j1-6g for submit@debbugs.gnu.org; Mon, 25 Mar 2019 10:45:41 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:36041) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h8Qr1-00085i-Uy for submit@debbugs.gnu.org; Mon, 25 Mar 2019 10:45:35 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:46261) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h8Qr0-0001aw-Qk for bug-gnu-emacs@gnu.org; Mon, 25 Mar 2019 10:45:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h8Qqz-000849-Ot for bug-gnu-emacs@gnu.org; Mon, 25 Mar 2019 10:45:34 -0400 Original-Received: from [195.159.176.226] (port=34658 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h8Qqz-00083A-GQ for bug-gnu-emacs@gnu.org; Mon, 25 Mar 2019 10:45:33 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1h8Qqw-000uHP-3S for bug-gnu-emacs@gnu.org; Mon, 25 Mar 2019 15:45:30 +0100 X-Injected-Via-Gmane: http://gmane.org/ Cancel-Lock: sha1:xJIWzZxR+LERAFPi4vHzmEBMPYA= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:156755 Archived-At: On Sun 24 Mar 2019, Eric Abrahamsen wrote: > Katsumi Yamaoka writes: > >> Hi, >> >> Gnus got not to work for groups of which the group name contains >> non-ASCII letters. For instance, I got this error when trying >> to update the "nnml:テスト" group using `M-g'[1]: >> >> nnml:\343\203\206\343\202\271\343\203\210 error: No such group: テスト >> >> When trying to enter the group using `0 RET'[2] I got: >> >> Group nnml:\343\203\206\343\202\271\343\203\210 couldn't be activated >> >> Those raw bytes are utf-8 encoded "テスト", that is also used in >> the group entry in gnus-newsrc-alist saved in the ~/.newsrc.eld >> file as follows: >> >> ("nnml:\343\203\206\343\202\271\343\203\210" 1 nil ((unexist) (seen (1 >> . 5))) "nnml:" ((timestamp 23704 11958))) > > Yes, this is something I screwed up in c1b63af445. Gnus has always > stored group names as raw bytes in.newsrc.eld (at least I believe it > has, you probably know better than I do, it does in my experiments with > Emacs 26, anyway), and only encodes during display. But obviously I've > messed something up between file persistence and display, and I'm > working on sorting it out. Perhaps it would be better to revert and reintroduce your changes after further testing ? Taking time over this is better than causing data loss for gnus users. Other notes from reading the code: 1) In `gnus-gnus-to-quick-newsrc-format' you ignore the contents of `gnus-newsrc-alist' when saving "newsrc.eld", and replace it with the details from `gnus-newsrc-hashtb'. Why ? The rest of the gnus code appears to treat `gnus-newsrc-alist' as the single source of truth, with the hash tables being used only for faster access to it. 2) In `gnus-gnus-to-quick-newsrc-format' you dropped the code to remove the dummy group from `gnus-newsrc-alist'. Why ? This internal dummy group is now saved in "newsrc.eld", which is not needed. 3) The format of the entries in `gnus-newsrc-hashtb' has changed, removing the second element. Why ? 4) You changed several hash tale sizesfrom 4096 to 4000, and 1024 to 1000. Why ? Your patch contains several logical changes that would be easier to understand (and bisect) as a series of patches with one logical change in each patch: - code layout changes - add missing doc strings and code comments - change hash table implementation - change format of `gnus-newsrc-hashtb' entries - change usage of `gnus-group-change-level' - change coding of group names While it can take extra work to split things up, the end result is much easier to understand. Thanks for working on gnus, AndyM