mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 17:24:23 +00:00
Fixes to gnus-agent-retrieve-headers
* lisp/gnus/gnus-agent.el (gnus-agent-retrieve-headers): The sort->append call was altering fetched-headers in-place. Also, we should explicitly sort-numeric-fields in this function. gnus-agent-check-overview-buffer will do this, but treats it as a failure mode and will make a backup of the overview file.
This commit is contained in:
parent
84e8037642
commit
943011de8e
1 changed files with 7 additions and 1 deletions
|
|
@ -3627,7 +3627,7 @@ has been fetched."
|
|||
(when fetched-headers
|
||||
(setq headers
|
||||
(delete-dups
|
||||
(sort (append headers fetched-headers)
|
||||
(sort (append headers (copy-sequence fetched-headers))
|
||||
(lambda (l r)
|
||||
(< (mail-header-number l)
|
||||
(mail-header-number r))))))
|
||||
|
|
@ -3636,8 +3636,14 @@ has been fetched."
|
|||
(let ((coding-system-for-write
|
||||
gnus-agent-file-coding-system))
|
||||
(with-current-buffer gnus-agent-overview-buffer
|
||||
;; We stick the new headers in at the end, then
|
||||
;; re-sort the whole buffer with
|
||||
;; `sort-numeric-fields'. If this turns out to be
|
||||
;; slow, we could consider a loop to add the headers
|
||||
;; in sorted order to begin with.
|
||||
(goto-char (point-max))
|
||||
(mapc #'nnheader-insert-nov fetched-headers)
|
||||
(sort-numeric-fields 1 (point-min) (point-max))
|
||||
(gnus-agent-check-overview-buffer)
|
||||
(write-region (point-min) (point-max) file nil 'silent)
|
||||
(gnus-agent-update-view-total-fetched-for group t)
|
||||
|
|
|
|||
Loading…
Reference in a new issue