From: Andrew G Cohen Date: Tue, 10 Nov 2020 00:19:43 +0000 (+0800) Subject: Remove ephemeral group on error or null result X-Git-Tag: emacs-28.0.90~5199 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ee11a68320eeb8bb90ded9773c02d7863abca3d7;p=emacs.git Remove ephemeral group on error or null result * lisp/gnus/nnselect.el (nnselect-request-group): If an ephemeral group is empty, there is nothing to see, so remove the group. (nnselect-run): Catch and return an empty artlist on error. --- diff --git a/lisp/gnus/nnselect.el b/lisp/gnus/nnselect.el index ce2e99de05a..e4753fe95c8 100644 --- a/lisp/gnus/nnselect.el +++ b/lisp/gnus/nnselect.el @@ -295,6 +295,10 @@ If this variable is nil, or if the provided function returns nil, (if (zerop (setq length (nnselect-artlist-length nnselect-artlist))) (progn (nnheader-report 'nnselect "Selection produced empty results.") + (when (gnus-ephemeral-group-p group) + (gnus-kill-ephemeral-group group) + (setq gnus-ephemeral-servers + (assq-delete-all 'nnselect gnus-ephemeral-servers))) (nnheader-insert "")) (with-current-buffer nntp-server-buffer (nnheader-insert "211 %d %d %d %s\n" @@ -769,8 +773,10 @@ If this variable is nil, or if the provided function returns nil, Return an article list." (let ((func (alist-get 'nnselect-function specs)) (args (alist-get 'nnselect-args specs))) - (funcall func args))) - + (condition-case err + (funcall func args) + (error (gnus-error 3 "nnselect-run: %s on %s gave error %s" func args err) + [])))) (defun nnselect-search-thread (header) "Make an nnselect group containing the thread with article HEADER.