From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#33653: 27.0.50; Change Gnus obarrays-as-hash-tables into real hash tables Date: Sun, 31 Mar 2019 15:55:15 -0700 Message-ID: <874l7i3b8s.fsf@ericabrahamsen.net> References: <8736raz3ec.fsf@ericabrahamsen.net> <87y392xoht.fsf@ericabrahamsen.net> <87imxzxa4s.fsf@ericabrahamsen.net> <87a7hn3h3w.fsf@ericabrahamsen.net> <87a7hhtinz.fsf@ericabrahamsen.net> <87imw4f1oo.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="108328"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Bastien Guerry , Adam =?UTF-8?Q?Sj=C3=B8gren?= , 33653@debbugs.gnu.org To: Katsumi Yamaoka Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Apr 01 01:30:14 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 1hAju1-000S1h-Jq for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Apr 2019 01:30:13 +0200 Original-Received: from localhost ([127.0.0.1]:51334 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hAju0-0002QK-FY for geb-bug-gnu-emacs@m.gmane.org; Sun, 31 Mar 2019 19:30:12 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39968) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hAjts-0002OE-3m for bug-gnu-emacs@gnu.org; Sun, 31 Mar 2019 19:30:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hAjtq-000816-LX for bug-gnu-emacs@gnu.org; Sun, 31 Mar 2019 19:30:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53325) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hAjtq-0007zy-FY for bug-gnu-emacs@gnu.org; Sun, 31 Mar 2019 19:30:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hAjtq-00086I-5p for bug-gnu-emacs@gnu.org; Sun, 31 Mar 2019 19:30:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 31 Mar 2019 23:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33653 X-GNU-PR-Package: emacs Original-Received: via spool by 33653-submit@debbugs.gnu.org id=B33653.155407496031062 (code B ref 33653); Sun, 31 Mar 2019 23:30:02 +0000 Original-Received: (at 33653) by debbugs.gnu.org; 31 Mar 2019 23:29:20 +0000 Original-Received: from localhost ([127.0.0.1]:38633 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hAjt9-00084r-Cq for submit@debbugs.gnu.org; Sun, 31 Mar 2019 19:29:19 -0400 Original-Received: from ericabrahamsen.net ([52.70.2.18]:55776 helo=mail.ericabrahamsen.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hAjt7-00084c-2U for 33653@debbugs.gnu.org; Sun, 31 Mar 2019 19:29:18 -0400 Original-Received: from localhost (unknown [172.58.41.175]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 70CB5FA02A; Sun, 31 Mar 2019 23:29:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ericabrahamsen.net; s=mail; t=1554074951; bh=xxUJrPrCuX6VFtPl3e9CgMRDiOsizKqidAE0vUZM1G4=; h=From:To:Cc:Subject:In-Reply-To:Date:References:From; b=J4XIi6EPL1GAS+5kASiwnm9wmARmG22gmpUkyDRuqZSbGPb6DbCI/UdX3FeCTRfjh ogToR/yNohYHMyFgKLPrkgf7bz2SsxHzBj+1WvOhWp0fa6rI2cIT82hkNR2Aexdq52 f34Ys87sTRRh0UcHfjJTqDhXfLcnS57DXRBaHMds= In-Reply-To: <87imw4f1oo.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Wed, 27 Mar 2019 14:27:19 -0700") 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:156999 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 03/27/19 14:27 PM, Eric Abrahamsen wrote: > On 03/27/19 13:54 PM, Katsumi Yamaoka wrote: >> On Tue, 26 Mar 2019 14:44:32 -0700, Eric Abrahamsen wrote: >>> Thanks for this report. When you have a moment will you please try the >>> attached patch and see if it fixes the problem? >> >> Works great. Now I can enter and read the nnml:=E3=83=86=E3=82=B9=E3=83= =88 group. >> Thank you. But there seem to be some more fix needed. >> >> The group level of nnml:=E3=83=86=E3=82=B9=E3=83=88 is 1 and there are s= ome unread >> articles in it, however the group is not listed in the Group >> buffer when I launch Gnus by `C-u 1 M-x gnus RET' (it also >> happened when I worked on non-ASCII group names years ago, but >> I don't recall how I fixed it, sorry). Typing L helps it. > > I think I've found the source of the problem. The error you and others > are seeing comes when the group has an entry in gnus-newsrc-hashtb (ie, > you're subscribed to the group) but not in gnus-active-hashtb (Gnus > can't tell if the group has articles). Okay, it might be as simple as the attached patch, applied to current master. Basically this forces nnmail to always write the group names as strings, which are then read correctly later on. Also cc'ing Bastien and Adam, who have been very helpful with road-testing. Thanks to all, Eric --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-WIP-on-nnmail-group-names.patch >From 05c5d299fa4342cce6c4921b5c5387d6be07c89a Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Sun, 31 Mar 2019 09:09:18 -0700 Subject: [PATCH 1/2] WIP on nnmail group names --- lisp/gnus/nnmail.el | 2 +- lisp/gnus/nnml.el | 16 ++++++++-------- lisp/gnus/nnrss.el | 18 +++++++++--------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el index a95cdb4a4f..a84830b48d 100644 --- a/lisp/gnus/nnmail.el +++ b/lisp/gnus/nnmail.el @@ -691,7 +691,7 @@ nnmail-generate-active (erase-buffer) (let (group) (while (setq group (pop alist)) - (insert (format "%S %d %d y\n" (intern (car group)) (cdadr group) + (insert (format "\"%s\" %d %d y\n" (car group) (cdadr group) (caadr group)))) (goto-char (point-max)) (while (search-backward "\\." nil t) diff --git a/lisp/gnus/nnml.el b/lisp/gnus/nnml.el index 5770777ad4..205e9e4803 100644 --- a/lisp/gnus/nnml.el +++ b/lisp/gnus/nnml.el @@ -259,7 +259,7 @@ nnml-request-group (t (nnheader-re-read-dir nnml-current-directory) (nnmail-activate 'nnml) - (let ((active (nth 1 (assoc group nnml-group-alist)))) + (let ((active (nth 1 (assoc-string group nnml-group-alist)))) (if (not active) (nnheader-report 'nnml "No such group: %s" decoded) (nnheader-report 'nnml "Selected group %s" decoded) @@ -295,7 +295,7 @@ nnml-request-create-group (nnheader-report 'nnml "%s is a file" (directory-file-name (nnml-group-pathname group nil server)))) - ((assoc group nnml-group-alist) + ((assoc-string group nnml-group-alist) t) (t (let (active) @@ -379,7 +379,7 @@ nnml-request-expire-articles (nnml-nov-delete-article group number)) (push number rest))) (push number rest))) - (let ((active (nth 1 (assoc group nnml-group-alist)))) + (let ((active (nth 1 (assoc-string group nnml-group-alist)))) (when active (setcar active (or (and active-articles (apply 'min active-articles)) @@ -520,7 +520,7 @@ nnml-request-delete-group (nnheader-report 'nnml "No such directory: %s/" file)) ;; Remove the group from all structures. (setq nnml-group-alist - (delq (assoc group nnml-group-alist) nnml-group-alist) + (delq (assoc-string group nnml-group-alist) nnml-group-alist) nnml-current-group nil nnml-current-directory nil) ;; Save the active file. @@ -549,7 +549,7 @@ nnml-request-rename-group (when (<= (length (directory-files old-dir)) 2) (ignore-errors (delete-directory old-dir))) ;; That went ok, so we change the internal structures. - (let ((entry (assoc group nnml-group-alist))) + (let ((entry (assoc-string group nnml-group-alist))) (when entry (setcar entry new-name)) (setq nnml-current-directory nil @@ -597,7 +597,7 @@ nnml-deletable-article-p (when (setq path (nnml-article-to-file article)) (when (file-writable-p path) (or (not nnmail-keep-last-article) - (not (eq (cdr (nth 1 (assoc group nnml-group-alist))) + (not (eq (cdr (nth 1 (assoc-string group nnml-group-alist))) article))))))) ;; Find an article number in the current group given the Message-ID. @@ -742,7 +742,7 @@ nnml-active-number "Compute the next article number in GROUP on SERVER." (let* ((encoded (if nnmail-group-names-not-encoded-p (nnml-encoded-group-name group server))) - (active (cadr (assoc (or encoded group) nnml-group-alist)))) + (active (cadr (assoc-string (or encoded group) nnml-group-alist)))) ;; The group wasn't known to nnml, so we just create an active ;; entry for it. (unless active @@ -783,7 +783,7 @@ nnml-save-incremental-nov (cdr nnml-incremental-nov-buffer-alist))))) (defun nnml-open-incremental-nov (group) - (or (cdr (assoc group nnml-incremental-nov-buffer-alist)) + (or (cdr (assoc-string group nnml-incremental-nov-buffer-alist)) (let ((buffer (nnml-get-nov-buffer group t))) (push (cons group buffer) nnml-incremental-nov-buffer-alist) buffer))) diff --git a/lisp/gnus/nnrss.el b/lisp/gnus/nnrss.el index 7f2accc2b6..0bfecb28e0 100644 --- a/lisp/gnus/nnrss.el +++ b/lisp/gnus/nnrss.el @@ -340,10 +340,10 @@ nnrss-request-delete-group (let (elem) ;; There may be two or more entries in `nnrss-group-alist' since ;; this function didn't delete them formerly. - (while (setq elem (assoc group nnrss-group-alist)) + (while (setq elem (assoc-string group nnrss-group-alist)) (setq nnrss-group-alist (delq elem nnrss-group-alist)))) (setq nnrss-server-data - (delq (assoc group nnrss-server-data) nnrss-server-data)) + (delq (assoc-string group nnrss-server-data) nnrss-server-data)) (nnrss-save-server-data server) (ignore-errors (let ((file-name-coding-system nnmail-pathname-coding-system)) @@ -367,7 +367,7 @@ nnrss-retrieve-groups (with-current-buffer nntp-server-buffer (erase-buffer) (dolist (group groups) - (let ((elem (assoc (gnus-group-decoded-name group) nnrss-server-data))) + (let ((elem (assoc-string (gnus-group-decoded-name group) nnrss-server-data))) (insert (format "%S %s 1 y\n" group (or (cadr elem) 0))))) 'active)) @@ -539,7 +539,7 @@ nnrss-read-group-data (if (hash-table-p nnrss-group-hashtb) (clrhash nnrss-group-hashtb) (setq nnrss-group-hashtb (make-hash-table :test 'equal))) - (let ((pair (assoc group nnrss-server-data))) + (let ((pair (assoc-string group nnrss-server-data))) (setq nnrss-group-max (or (cadr pair) 0)) (setq nnrss-group-min (+ nnrss-group-max 1))) (let ((file (nnrss-make-filename group server)) @@ -644,8 +644,8 @@ nnrss-check-group (concat group ".xml")) nnrss-directory)))) (setq xml (nnrss-fetch file t)) - (setq url (or (nth 2 (assoc group nnrss-server-data)) - (cadr (assoc group nnrss-group-alist)))) + (setq url (or (nth 2 (assoc-string group nnrss-server-data)) + (cadr (assoc-string group nnrss-group-alist)))) (unless url (setq url (cdr @@ -653,7 +653,7 @@ nnrss-check-group (nnrss-discover-feed (read-string (format "URL to search for %s: " group) "http://"))))) - (let ((pair (assoc group nnrss-server-data))) + (let ((pair (assoc-string group nnrss-server-data))) (if pair (setcdr (cdr pair) (list url)) (push (list group nnrss-group-max url) nnrss-server-data))) @@ -721,7 +721,7 @@ nnrss-check-group (setq extra nil)) (when changed (nnrss-save-group-data group server) - (let ((pair (assoc group nnrss-server-data))) + (let ((pair (assoc-string group nnrss-server-data))) (if pair (setcar (cdr pair) nnrss-group-max) (push (list group nnrss-group-max) nnrss-server-data))) @@ -792,7 +792,7 @@ nnrss-generate-download-script (insert "RSSDIR='" (expand-file-name nnrss-directory) "'\n") (dolist (elem nnrss-server-data) (let ((url (or (nth 2 elem) - (cadr (assoc (car elem) nnrss-group-alist))))) + (cadr (assoc-string (car elem) nnrss-group-alist))))) (insert "$WGET -q -O \"$RSSDIR\"/'" (nnrss-translate-file-chars (concat (car elem) ".xml")) "' '" url "'\n")))) -- 2.21.0 --=-=-=--