diff options
| author | Eric Abrahamsen | 2017-12-16 14:03:18 -0800 |
|---|---|---|
| committer | Eric Abrahamsen | 2017-12-18 10:10:52 -0800 |
| commit | 5f17472574565ac10bfcacb7058f3684296c8e7d (patch) | |
| tree | 43d70f651b3bec3bba50c9559b47ea9949406ea2 | |
| parent | 5959b48ece0abe4639667c023da6363859088676 (diff) | |
| download | emacs-5f17472574565ac10bfcacb7058f3684296c8e7d.tar.gz emacs-5f17472574565ac10bfcacb7058f3684296c8e7d.zip | |
Fix Gnus registry header extraction
* 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.
| -rw-r--r-- | lisp/gnus/gnus-registry.el | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/lisp/gnus/gnus-registry.el b/lisp/gnus/gnus-registry.el index 466238d2523..7345c084db3 100644 --- a/lisp/gnus/gnus-registry.el +++ b/lisp/gnus/gnus-registry.el | |||
| @@ -844,21 +844,17 @@ Addresses without a name will say \"noname\"." | |||
| 844 | nil)) | 844 | nil)) |
| 845 | 845 | ||
| 846 | (defun gnus-registry-fetch-sender-fast (article) | 846 | (defun gnus-registry-fetch-sender-fast (article) |
| 847 | (gnus-registry-fetch-header-fast "from" article)) | 847 | (when-let* ((data (and (numberp article) |
| 848 | (assoc article (gnus-data-list nil))))) | ||
| 849 | (mail-header-from (gnus-data-header data)))) | ||
| 848 | 850 | ||
| 849 | (defun gnus-registry-fetch-recipients-fast (article) | 851 | (defun gnus-registry-fetch-recipients-fast (article) |
| 850 | (gnus-registry-sort-addresses | 852 | (when-let* ((data (and (numberp article) |
| 851 | (or (ignore-errors (gnus-registry-fetch-header-fast "Cc" article)) "") | 853 | (assoc article (gnus-data-list nil)))) |
| 852 | (or (ignore-errors (gnus-registry-fetch-header-fast "To" article)) ""))) | 854 | (extra (mail-header-extra (gnus-data-header data)))) |
| 853 | 855 | (gnus-registry-sort-addresses | |
| 854 | (defun gnus-registry-fetch-header-fast (article header) | 856 | (or (cdr (assq 'Cc extra)) "") |
| 855 | "Fetch the HEADER quickly, using the internal gnus-data-list function." | 857 | (or (cdr (assq 'To extra)) "")))) |
| 856 | (if (and (numberp article) | ||
| 857 | (assoc article (gnus-data-list nil))) | ||
| 858 | (gnus-string-remove-all-properties | ||
| 859 | (cdr (assq header (gnus-data-header | ||
| 860 | (assoc article (gnus-data-list nil)))))) | ||
| 861 | nil)) | ||
| 862 | 858 | ||
| 863 | ;; registry marks glue | 859 | ;; registry marks glue |
| 864 | (defun gnus-registry-do-marks (type function) | 860 | (defun gnus-registry-do-marks (type function) |