diff options
| author | Basil L. Contovounesios | 2019-03-25 02:15:10 +0000 |
|---|---|---|
| committer | Basil L. Contovounesios | 2019-04-09 21:29:38 +0100 |
| commit | 6cb49922e63c2523ccdd6e0a6bd72bcfa72c50c6 (patch) | |
| tree | 649f97b28fdf8b3706af15e1c8c7856904cea868 | |
| parent | 4f19bbb125a706f9657a299df1c5f03c81ed4a71 (diff) | |
| download | emacs-6cb49922e63c2523ccdd6e0a6bd72bcfa72c50c6.tar.gz emacs-6cb49922e63c2523ccdd6e0a6bd72bcfa72c50c6.zip | |
Fix Gnus duplicate suppression guards (bug#34987)
* lisp/gnus/gnus-dup.el (gnus-dup-enter-articles)
(gnus-dup-suppress-articles): Use gnus-dup-hashtb as an indicator of
initialization instead of gnus-dup-list, which may happen to be nil.
(gnus-dup-unsuppress-article): Do nothing if gnus-dup-hashtb is
uninitialized.
| -rw-r--r-- | lisp/gnus/gnus-dup.el | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/gnus/gnus-dup.el b/lisp/gnus/gnus-dup.el index 49022124e97..4981614a17f 100644 --- a/lisp/gnus/gnus-dup.el +++ b/lisp/gnus/gnus-dup.el | |||
| @@ -107,7 +107,7 @@ seen in the same session." | |||
| 107 | 107 | ||
| 108 | (defun gnus-dup-enter-articles () | 108 | (defun gnus-dup-enter-articles () |
| 109 | "Enter articles from the current group for future duplicate suppression." | 109 | "Enter articles from the current group for future duplicate suppression." |
| 110 | (unless gnus-dup-list | 110 | (unless gnus-dup-hashtb |
| 111 | (gnus-dup-open)) | 111 | (gnus-dup-open)) |
| 112 | (setq gnus-dup-list-dirty t) ; mark list for saving | 112 | (setq gnus-dup-list-dirty t) ; mark list for saving |
| 113 | (let (msgid) | 113 | (let (msgid) |
| @@ -133,7 +133,7 @@ seen in the same session." | |||
| 133 | 133 | ||
| 134 | (defun gnus-dup-suppress-articles () | 134 | (defun gnus-dup-suppress-articles () |
| 135 | "Mark duplicate articles as read." | 135 | "Mark duplicate articles as read." |
| 136 | (unless gnus-dup-list | 136 | (unless gnus-dup-hashtb |
| 137 | (gnus-dup-open)) | 137 | (gnus-dup-open)) |
| 138 | (gnus-message 8 "Suppressing duplicates...") | 138 | (gnus-message 8 "Suppressing duplicates...") |
| 139 | (let ((auto (and gnus-newsgroup-auto-expire | 139 | (let ((auto (and gnus-newsgroup-auto-expire |
| @@ -152,9 +152,10 @@ seen in the same session." | |||
| 152 | 152 | ||
| 153 | (defun gnus-dup-unsuppress-article (article) | 153 | (defun gnus-dup-unsuppress-article (article) |
| 154 | "Stop suppression of ARTICLE." | 154 | "Stop suppression of ARTICLE." |
| 155 | (let* ((header (gnus-data-header (gnus-data-find article))) | 155 | (let (header id) |
| 156 | (id (when header (mail-header-id header)))) | 156 | (when (and gnus-dup-hashtb |
| 157 | (when id | 157 | (setq header (gnus-data-header (gnus-data-find article))) |
| 158 | (setq id (mail-header-id header))) | ||
| 158 | (setq gnus-dup-list-dirty t) | 159 | (setq gnus-dup-list-dirty t) |
| 159 | (setq gnus-dup-list (delete id gnus-dup-list)) | 160 | (setq gnus-dup-list (delete id gnus-dup-list)) |
| 160 | (remhash id gnus-dup-hashtb)))) | 161 | (remhash id gnus-dup-hashtb)))) |