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.help Subject: Re: nnir problem with mailboxes with umlauts (oh sorry, the last mail was HTML) Date: Tue, 11 Jun 2019 14:30:17 -0700 Message-ID: <87tvcvyfme.fsf@ericabrahamsen.net> References: <1225074402.30.1560266049169@webmail-ng.in-berlin.de> <8736kg5ej7.fsf@ericabrahamsen.net> <87y327yfvi.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="175163"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jun 11 23:31:11 2019 Return-path: Envelope-to: geh-help-gnu-emacs@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 1haoME-000jMR-IB for geh-help-gnu-emacs@m.gmane.org; Tue, 11 Jun 2019 23:31:06 +0200 Original-Received: from localhost ([::1]:55530 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1haoMD-0000Q2-Br for geh-help-gnu-emacs@m.gmane.org; Tue, 11 Jun 2019 17:31:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36157) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1haoLq-0000Ok-Gm for help-gnu-emacs@gnu.org; Tue, 11 Jun 2019 17:30:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1haoLo-0001kO-2g for help-gnu-emacs@gnu.org; Tue, 11 Jun 2019 17:30:42 -0400 Original-Received: from [195.159.176.226] (port=60768 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1haoLn-0001ZX-O8 for help-gnu-emacs@gnu.org; Tue, 11 Jun 2019 17:30:39 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1haoLX-000iXP-Od for help-gnu-emacs@gnu.org; Tue, 11 Jun 2019 23:30:23 +0200 X-Injected-Via-Gmane: http://gmane.org/ Cancel-Lock: sha1:n4YA8Gkt3kLKTBRkuZQw7eiD/KQ= 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: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:120916 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Eric Abrahamsen writes: > Eric Abrahamsen writes: > >> Robert Pluim writes: >> >>>>>>>> On Tue, 11 Jun 2019 17:14:09 +0200 (CEST), postmaster@faulbaum.in-berlin.de said: >>> >>> postmaster> It seems that nnir has problems with mailboxes which have umlauts in >>> postmaster> there names. >>> >>> postmaster> Am I right that this is a bug? >>> >>> Yes. You should do 'M-x report-emacs-bug' which will gather >>> information about your emacs, and create a bug report containing this >>> info. >>> >>> Robert >>> >>> PS There have been some changes in the latest master branch of Emacs >>> to better handle non-ascii group names, that might function better >>> (but you didnʼt tell us which version of emacs youʼre using :-) ) >> >> Right, this sounds like the stuff I've been working on/breaking. Do tell >> us your Emacs version, and in the meantime I'll check the relevant areas >> of the code. > > Looks like the attached diff is all we need. Please give this a whirl, > and I'll open a bug report for it. I think there's just better than a > snowball's chance in hell we could squeeze this into the next Emacs 26 > bugfix release. Whoops, I meant this one. I wonder why that worked... --=-=-= 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..2fb64c3d33 100644 --- a/lisp/gnus/nnir.el +++ b/lisp/gnus/nnir.el @@ -977,7 +977,7 @@ nnir-run-imap (save-excursion (let ((qstring (cdr (assq 'query query))) (server (cadr (gnus-server-to-method srv))) -;; (defs (nth 2 (gnus-server-to-method srv))) + ;; (defs (nth 2 (gnus-server-to-method srv))) (criteria (or (cdr (assq 'criteria query)) (cdr (assoc nnir-imap-default-search-key nnir-imap-search-arguments)))) @@ -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) --=-=-=--