all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: emacs-devel@gnu.org
Subject: Gnus nnir patch for Emacs 26?
Date: Wed, 12 Jun 2019 14:46:14 -0700	[thread overview]
Message-ID: <87tvcuscih.fsf@ericabrahamsen.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 697 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: nnir-imap-fix.diff --]
[-- Type: text/x-patch, Size: 2964 bytes --]

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)

             reply	other threads:[~2019-06-12 21:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-12 21:46 Eric Abrahamsen [this message]
2019-06-13  7:02 ` Gnus nnir patch for Emacs 26? Robert Pluim
2019-06-13 10:04 ` Eli Zaretskii
2019-06-13 22:20   ` Eric Abrahamsen
2019-06-14  6:03     ` Eli Zaretskii
2019-06-14  8:18       ` Eric Abrahamsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tvcuscih.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.