all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Gnus nnir patch for Emacs 26?
@ 2019-06-12 21:46 Eric Abrahamsen
  2019-06-13  7:02 ` Robert Pluim
  2019-06-13 10:04 ` Eli Zaretskii
  0 siblings, 2 replies; 6+ messages in thread
From: Eric Abrahamsen @ 2019-06-12 21:46 UTC (permalink / raw)
  To: emacs-devel

[-- 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)

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-06-14  8:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-12 21:46 Gnus nnir patch for Emacs 26? Eric Abrahamsen
2019-06-13  7:02 ` 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

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.