Dev #13
|
@ -17,12 +17,12 @@ Scenario: gnus-demon-scan-news while summary buffer open, then auto-rescore upon
|
|||
And prospective unreads for "nnhackernews:news" is 93
|
||||
And I press "q"
|
||||
Then I should be in buffer "*Group*"
|
||||
And I dump buffer
|
||||
Then of-record unreads for "nnhackernews:news" is 186
|
||||
And I scan news
|
||||
Then of-record unreads for "nnhackernews:news" is 280
|
||||
When I go to word "nnhackernews:news"
|
||||
And I press "RET"
|
||||
Then I should be in buffer "*Summary nnhackernews:news*"
|
||||
And I go to word "DoreenMich"
|
||||
And I press "C-k"
|
||||
And prospective unreads for "nnhackernews:news" is 273
|
||||
|
@ -52,7 +52,6 @@ Scenario: delete
|
|||
When I switch to buffer "*Summary nnhackernews:news*"
|
||||
And I press "c y"
|
||||
Then I should be in buffer "*Group*"
|
||||
And I dump buffer
|
||||
And I scan news
|
||||
When I go to word "nnhackernews:news"
|
||||
And I press "RET"
|
||||
|
@ -87,7 +86,6 @@ Scenario: submit a text which must be titled
|
|||
And I type "test baby test baby 123"
|
||||
And I press "M->"
|
||||
And I type "this is a test"
|
||||
And I dump buffer
|
||||
And I press "C-c C-c"
|
||||
When I switch to buffer "*Messages*"
|
||||
Then I should not see "Couldn't send message via news"
|
||||
|
|
|
@ -91,7 +91,7 @@ Do not set this to \"localhost\" as a numeric IP is required for the oauth hands
|
|||
|
||||
(defvar nnhackernews--debug-request-items nil "Keep track of ids to re-request for testing.")
|
||||
|
||||
(defvar nnhackernews--last-scan-time (truncate (float-time))
|
||||
(defvar nnhackernews--last-scan-time (- (truncate (float-time)) 100)
|
||||
"Don't scan more than once every few seconds.")
|
||||
|
||||
(defmacro nnhackernews--callback (result &optional callback)
|
||||
|
@ -426,8 +426,10 @@ If GROUP classification omitted, figure it out."
|
|||
(defun nnhackernews-vote-current-article (vote)
|
||||
"VOTE is +1, -1, 0."
|
||||
(unless gnus-newsgroup-name (error "No current newgroup"))
|
||||
(if-let ((article-number (or (cdr gnus-article-current)
|
||||
(gnus-summary-article-number))))
|
||||
(if-let ((article-number (or (with-current-buffer gnus-article-buffer
|
||||
(cdr gnus-article-current))
|
||||
(with-current-buffer gnus-summary-buffer
|
||||
(gnus-summary-article-number)))))
|
||||
(let* ((header (nnhackernews--get-header article-number
|
||||
(gnus-group-real-name gnus-newsgroup-name)))
|
||||
(orig-score (format "%s" (plist-get header :score)))
|
||||
|
@ -553,9 +555,12 @@ Originally written by Paul Issartel."
|
|||
"Call `gnus-summary-exit' without the hackery."
|
||||
(remove-function (symbol-function 'gnus-summary-exit)
|
||||
(symbol-function 'nnhackernews--score-pending))
|
||||
(gnus-summary-exit nil t)
|
||||
(unwind-protect
|
||||
(progn
|
||||
(gnus-summary-exit t t)
|
||||
(gnus-kill-buffer gnus-summary-buffer))
|
||||
(add-function :after (symbol-function 'gnus-summary-exit)
|
||||
(symbol-function 'nnhackernews--score-pending)))
|
||||
(symbol-function 'nnhackernews--score-pending))))
|
||||
|
||||
(defsubst nnhackernews--ensure-score-files (group)
|
||||
"File I/O remains a perennial problem for score files for GROUP."
|
||||
|
@ -596,18 +601,21 @@ FORCE is generally t unless coming from `nnhackernews--score-pending'."
|
|||
(unless (zerop seen)
|
||||
(when (or force (> num-headers seen))
|
||||
(save-window-excursion
|
||||
(let ((gnus-auto-select-subject nil)
|
||||
(gnus-summary-next-group-on-exit nil)
|
||||
(let (gnus-auto-select-subject
|
||||
gnus-summary-next-group-on-exit
|
||||
(unread (length (gnus-list-of-unread-articles group))))
|
||||
(if (zerop unread)
|
||||
(gnus-message 7 "nnhackernews--rescore: skipping %s no unread"
|
||||
group)
|
||||
(nnhackernews--with-mutex nnhackernews--mutex-display-article
|
||||
(gnus-summary-read-group group nil t)
|
||||
(nnhackernews--summary-exit))))))))))
|
||||
(with-current-buffer (gnus-summary-buffer-name group)
|
||||
(nnhackernews--summary-exit)))))))))))
|
||||
|
||||
(defalias 'nnhackernews--score-pending
|
||||
(lambda (&rest _args) (nnhackernews--rescore (gnus-group-name-at-point))))
|
||||
(lambda (&rest _args)
|
||||
(aif (gnus-group-name-at-point)
|
||||
(nnhackernews--rescore it))))
|
||||
|
||||
(defun nnhackernews--score-unread (group)
|
||||
"Filter unread messages for GROUP now.
|
||||
|
@ -631,8 +639,9 @@ Otherwise *Group* buffer annoyingly overrepresents unread."
|
|||
(gnus-message 7 (concat preface "(extant %s)") (buffer-name extant)))
|
||||
(t
|
||||
(save-excursion
|
||||
(let ((gnus-auto-select-subject nil))
|
||||
(let (gnus-auto-select-subject)
|
||||
(gnus-summary-read-group gnus-newsgroup-name nil t)
|
||||
(with-current-buffer (gnus-summary-buffer-name gnus-newsgroup-name)
|
||||
(dolist (datum gnus-newsgroup-data)
|
||||
(-when-let* ((article (gnus-data-number datum))
|
||||
(plst (nnhackernews--get-header article))
|
||||
|
@ -641,7 +650,7 @@ Otherwise *Group* buffer annoyingly overrepresents unread."
|
|||
(gnus-message 7 "nnhackernews--mark-scored-as-read: %s (%s %s)"
|
||||
(plist-get plst :title) group article)
|
||||
(gnus-summary-mark-as-read article)))
|
||||
(nnhackernews--summary-exit))))))))
|
||||
(nnhackernews--summary-exit)))))))))
|
||||
|
||||
(deffoo nnhackernews-request-group-scan (group &optional server info)
|
||||
"M-g from *Group* calls this."
|
||||
|
@ -1545,6 +1554,7 @@ Written by John Wiegley (https://github.com/jwiegley/dot-emacs).")
|
|||
(if (nnhackernews--gate) nil
|
||||
gnus-summary-next-group-on-exit)))
|
||||
(apply f args))))
|
||||
|
||||
(add-function :after (symbol-function 'gnus-summary-exit)
|
||||
(symbol-function 'nnhackernews--score-pending))
|
||||
|
||||
|
|
Loading…
Reference in New Issue