]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix Gnus registry header extraction
authorEric Abrahamsen <eric@ericabrahamsen.net>
Sat, 16 Dec 2017 22:03:18 +0000 (14:03 -0800)
committerEric Abrahamsen <eric@ericabrahamsen.net>
Mon, 18 Dec 2017 18:10:52 +0000 (10:10 -0800)
* lisp/gnus/gnus-registry.el (gnus-registry-fetch-recipients-fast,
  gnus-registry-fetch-sender-fast): First, delete
  `gnus-registry-fetch-header-fast'. It was being called with reversed
  arguments, and thus always returned nil, but even if the argument
  order was correct it would have raised an error, as it was trying to
  `assq' a string in a vector. Instead, just have these two functions
  do their own work, as they're doing fairly different things.

lisp/gnus/gnus-registry.el

index 466238d25231315b4980cbc3e90f9d688023ca56..7345c084db37aed6022eed0ba0d5bc21bd01650c 100644 (file)
@@ -844,21 +844,17 @@ Addresses without a name will say \"noname\"."
     nil))
 
 (defun gnus-registry-fetch-sender-fast (article)
-  (gnus-registry-fetch-header-fast "from" article))
+  (when-let* ((data (and (numberp article)
+                        (assoc article (gnus-data-list nil)))))
+    (mail-header-from (gnus-data-header data))))
 
 (defun gnus-registry-fetch-recipients-fast (article)
-  (gnus-registry-sort-addresses
-   (or (ignore-errors (gnus-registry-fetch-header-fast "Cc" article)) "")
-   (or (ignore-errors (gnus-registry-fetch-header-fast "To" article)) "")))
-
-(defun gnus-registry-fetch-header-fast (article header)
-  "Fetch the HEADER quickly, using the internal gnus-data-list function."
-  (if (and (numberp article)
-           (assoc article (gnus-data-list nil)))
-      (gnus-string-remove-all-properties
-       (cdr (assq header (gnus-data-header
-                          (assoc article (gnus-data-list nil))))))
-    nil))
+  (when-let* ((data (and (numberp article)
+                        (assoc article (gnus-data-list nil))))
+             (extra (mail-header-extra (gnus-data-header data))))
+    (gnus-registry-sort-addresses
+     (or (cdr (assq 'Cc extra)) "")
+     (or (cdr (assq 'To extra)) ""))))
 
 ;; registry marks glue
 (defun gnus-registry-do-marks (type function)