* lisp/gnus/gnus.el (gnus-info): Define with cl-defstruct
This makes the accessors into (inlined) functions (instead of macros), which simplifies some uses, and it makes the gnus-info-set-<foo> macros redundant since we can use `setf` instead. Remove them and update all users. (gnus-info-group, gnus-info-rank, gnus-info-read, gnus-info-marks) (gnus-info-method, gnus-info-params): Auto-defined by defstruct. (gnus-info-level, gnus-info-score): Define as a function. Add gv-setter. (gnus-info-set-group, gnus-info-set-rank, gnus-info-set-read): Remove, use `setf` instead. (gnus-info-set-marks, gnus-info-set-method, gnus-info-set-params): Define as a function. (gnus-info-set-entry): Delete function. (gnus-info--grow-entry): New function, extracted from it. (gnus-info--set-level, gnus-info--set-score): New functions, extracted from the `gnus-info-set-level` and `gnus-info-set-score` which they replace. (gnus-get-info): Define as a function. * lisp/gnus/gnus-group.el (gnus-group-edit-group-done): Use the `extend` arg of `gnus-info-set-method`. (gnus-group-sort-selected-flat): eta-reduce.
This commit is contained in:
parent
7fff418edf
commit
b1a6950584
15 changed files with 143 additions and 171 deletions
|
@ -6367,7 +6367,7 @@ The resulting hash table is returned, or nil if no Xrefs were found."
|
|||
(gnus-undo-register
|
||||
`(progn
|
||||
(gnus-info-set-marks ',info ',(gnus-info-marks info) t)
|
||||
(gnus-info-set-read ',info ',(gnus-info-read info))
|
||||
(setf (gnus-info-read ',info) ',(gnus-info-read info))
|
||||
(gnus-get-unread-articles-in-group ',info (gnus-active ,group))
|
||||
(when ,set-marks
|
||||
(gnus-request-set-mark
|
||||
|
@ -6375,7 +6375,7 @@ The resulting hash table is returned, or nil if no Xrefs were found."
|
|||
(gnus-group-jump-to-group ,group)
|
||||
(gnus-group-update-group ,group t))))
|
||||
;; Add the read articles to the range.
|
||||
(gnus-info-set-read info range)
|
||||
(setf (gnus-info-read info) range)
|
||||
(when set-marks
|
||||
(gnus-request-set-mark group (list (list range 'add '(read)))))
|
||||
;; Then we have to re-compute how many unread
|
||||
|
@ -10283,8 +10283,8 @@ ACTION can be either `move' (the default), `crosspost' or `copy'."
|
|||
(when (and (not (memq article gnus-newsgroup-unreads))
|
||||
(cdr art-group))
|
||||
(push 'read to-marks)
|
||||
(gnus-info-set-read
|
||||
info (gnus-add-to-range (gnus-info-read info)
|
||||
(setf (gnus-info-read info)
|
||||
(gnus-add-to-range (gnus-info-read info)
|
||||
(list (cdr art-group)))))
|
||||
|
||||
;; See whether the article is to be put in the cache.
|
||||
|
@ -12891,14 +12891,14 @@ UNREAD is a sorted list."
|
|||
(gnus-undo-register
|
||||
`(progn
|
||||
(gnus-info-set-marks ',info ',(gnus-info-marks info) t)
|
||||
(gnus-info-set-read ',info ',(gnus-info-read info))
|
||||
(setf (gnus-info-read ',info) ',(gnus-info-read info))
|
||||
(gnus-group-jump-to-group ,group)
|
||||
(gnus-get-unread-articles-in-group ',info
|
||||
(gnus-active ,group))
|
||||
(gnus-group-update-group ,group t)
|
||||
,setmarkundo))))
|
||||
;; Enter this list into the group info.
|
||||
(gnus-info-set-read info read)
|
||||
(setf (gnus-info-read info) read)
|
||||
;; Set the number of unread articles in gnus-newsrc-hashtb.
|
||||
(gnus-get-unread-articles-in-group info (gnus-active group))
|
||||
t))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue