]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix to "Simplify gnus-group-search-forward"
authorEric Abrahamsen <eric@ericabrahamsen.net>
Sun, 3 Dec 2023 15:16:32 +0000 (07:16 -0800)
committerEric Abrahamsen <eric@ericabrahamsen.net>
Sun, 3 Dec 2023 15:17:59 +0000 (07:17 -0800)
This updates commit 7304cc8a9ca8a7d19baaa24f0a72c7ad9a6a9716.

lisp/gnus/gnus-group.el

index 9a1a6f9b27dbda4f4363eb19c3d6e201e54dd6f8..a9c38334933dd76262dd6808128e05245e03ec83 100644 (file)
@@ -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))