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.devel Subject: Gnus nnir patch for Emacs 26? Date: Wed, 12 Jun 2019 14:46:14 -0700 Message-ID: <87tvcuscih.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="250304"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 12 23:49:15 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.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 1hbB7L-0012zn-1A for ged-emacs-devel@m.gmane.org; Wed, 12 Jun 2019 23:49:15 +0200 Original-Received: from localhost ([::1]:35138 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbB7K-0007Us-2C for ged-emacs-devel@m.gmane.org; Wed, 12 Jun 2019 17:49:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39487) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbB4v-00071A-FI for emacs-devel@gnu.org; Wed, 12 Jun 2019 17:46:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hbB4r-0002LG-Mc for emacs-devel@gnu.org; Wed, 12 Jun 2019 17:46:44 -0400 Original-Received: from [195.159.176.226] (port=35372 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hbB4n-0002ER-TE for emacs-devel@gnu.org; Wed, 12 Jun 2019 17:46:39 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1hbB4Y-000zeP-Bs for emacs-devel@gnu.org; Wed, 12 Jun 2019 23:46:22 +0200 X-Injected-Via-Gmane: http://gmane.org/ Cancel-Lock: sha1:a/9Dg0gTnxrYBWbvY5gowZyxbWc= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:237462 Archived-At: --=-=-= Content-Type: text/plain Someone recently reported a bug in Gnus for searching IMAP groups when the group has a non-ascii name. The bug has been there a while, at least as far back as Emacs 26. I've attached the diff, which looks large only because of indentation changes, it boils down to adding the line: (setq group (nnimap-decode-gnus-group group)) Is it too late/too intrusive for Emacs 26? This is the first time anyone's reported the bug, so it's obviously not super pressing. Another odd thing is that this fix will be unnecessary once the scratch/gnus-decoded branch lands, so this change shouldn't go into master, but I gather that's possible with a dontmerge cookie or something. Anyway, just asking! Eric --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=nnir-imap-fix.diff diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el index 9d59a4db0d..73d851c395 100644 --- a/lisp/gnus/nnir.el +++ b/lisp/gnus/nnir.el @@ -988,34 +988,36 @@ nnir-run-imap 'vconcat (catch 'found (mapcar - #'(lambda (group) + (lambda (group) (let (artlist) - (condition-case () - (when (nnimap-change-group - (gnus-group-short-name group) server) - (with-current-buffer (nnimap-buffer) - (message "Searching %s..." group) - (let ((arts 0) - (result (nnimap-command "UID SEARCH %s" - (if (string= criteria "") - qstring - (nnir-imap-make-query - criteria qstring))))) - (mapc - (lambda (artnum) - (let ((artn (string-to-number artnum))) - (when (> artn 0) - (push (vector group artn 100) - artlist) - (when (assq 'shortcut query) - (throw 'found (list artlist))) - (setq arts (1+ arts))))) - (and (car result) - (cdr (assoc "SEARCH" (cdr result))))) - (message "Searching %s... %d matches" group arts))) - (message "Searching %s...done" group)) + (condition-case () + (progn + (setq group (nnimap-decode-gnus-group group)) + (when (nnimap-change-group + (gnus-group-short-name group) server) + (with-current-buffer (nnimap-buffer) + (message "Searching %s..." group) + (let ((arts 0) + (result (nnimap-command "UID SEARCH %s" + (if (string= criteria "") + qstring + (nnir-imap-make-query + criteria qstring))))) + (mapc + (lambda (artnum) + (let ((artn (string-to-number artnum))) + (when (> artn 0) + (push (vector group artn 100) + artlist) + (when (assq 'shortcut query) + (throw 'found (list artlist))) + (setq arts (1+ arts))))) + (and (car result) + (cdr (assoc "SEARCH" (cdr result))))) + (message "Searching %s... %d matches" group arts))) + (message "Searching %s...done" group))) (quit nil)) - (nreverse artlist))) + (nreverse artlist))) groups)))))) (defun nnir-imap-make-query (criteria qstring) --=-=-=--