From: Eric Abrahamsen Date: Sun, 3 Dec 2023 15:16:32 +0000 (-0800) Subject: Fix to "Simplify gnus-group-search-forward" X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a42e0c6918e905e10dbfcf74b39426b8250f160d;p=emacs.git Fix to "Simplify gnus-group-search-forward" This updates commit 7304cc8a9ca8a7d19baaa24f0a72c7ad9a6a9716. --- diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index 9a1a6f9b27d..a9c38334933 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -1755,33 +1755,35 @@ current line is also eligible as a target." (low gnus-level-killed) (beg (point)) pos found lev) - (unless first-too - (forward-line way)) - (while (and - (not (if backward (bobp) (eobp))) - (not (setq - found - (and - (get-text-property (point) 'gnus-group) - (or all - (and - (let ((unread - (get-text-property (point) 'gnus-unread))) - (and (numberp unread) (> unread 0))) - (setq lev (get-text-property (point) - 'gnus-level)) - (<= lev gnus-level-subscribed))) - (or (not level) - (and (setq lev (get-text-property (point) - 'gnus-level)) - (or (= lev level) - (and (< lev low) - (< level lev) - (progn - (setq low lev) - (setq pos (point)) - nil)))))))) - (zerop (forward-line way)))) + (if (and backward (progn (beginning-of-line) (bobp))) + nil + (unless first-too + (forward-line way)) + (while (and + (not (eobp)) + (not (setq + found + (and + (get-text-property (point) 'gnus-group) + (or all + (and + (let ((unread + (get-text-property (point) 'gnus-unread))) + (and (numberp unread) (> unread 0))) + (setq lev (get-text-property (point) + 'gnus-level)) + (<= lev gnus-level-subscribed))) + (or (not level) + (and (setq lev (get-text-property (point) + 'gnus-level)) + (or (= lev level) + (and (< lev low) + (< level lev) + (progn + (setq low lev) + (setq pos (point)) + nil)))))))) + (zerop (forward-line way))))) (if found (progn (gnus-group-position-point) t) (goto-char (or pos beg))