* bug#67445: Likely Gnus bracketing mistake
@ 2023-11-25 14:50 Mattias Engdegård
2023-11-25 15:52 ` Eli Zaretskii
2023-11-25 17:27 ` Eric Abrahamsen
0 siblings, 2 replies; 8+ messages in thread
From: Mattias Engdegård @ 2023-11-25 14:50 UTC (permalink / raw)
To: 67445
This looks like a bracketing mistake (gnus-group.el line 1758):
> (if (and backward (progn (beginning-of-line)) (bobp))
especially considering `beginning-of-line` always returns nil.
(Is there a Gnus maintainer these days?)
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#67445: Likely Gnus bracketing mistake
2023-11-25 14:50 bug#67445: Likely Gnus bracketing mistake Mattias Engdegård
@ 2023-11-25 15:52 ` Eli Zaretskii
2023-11-25 21:19 ` Eric Abrahamsen
2023-11-25 17:27 ` Eric Abrahamsen
1 sibling, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2023-11-25 15:52 UTC (permalink / raw)
To: Mattias Engdegård, Eric Abrahamsen; +Cc: 67445
> From: Mattias Engdegård <mattias.engdegard@gmail.com>
> Date: Sat, 25 Nov 2023 15:50:59 +0100
>
> This looks like a bracketing mistake (gnus-group.el line 1758):
>
> > (if (and backward (progn (beginning-of-line)) (bobp))
>
> especially considering `beginning-of-line` always returns nil.
>
> (Is there a Gnus maintainer these days?)
Yes, Eric (CC'ed).
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#67445: Likely Gnus bracketing mistake
2023-11-25 14:50 bug#67445: Likely Gnus bracketing mistake Mattias Engdegård
2023-11-25 15:52 ` Eli Zaretskii
@ 2023-11-25 17:27 ` Eric Abrahamsen
2023-11-26 8:59 ` Mattias Engdegård
1 sibling, 1 reply; 8+ messages in thread
From: Eric Abrahamsen @ 2023-11-25 17:27 UTC (permalink / raw)
To: Mattias Engdegård; +Cc: 67445
Mattias Engdegård <mattias.engdegard@gmail.com> writes:
> This looks like a bracketing mistake (gnus-group.el line 1758):
>
>> (if (and backward (progn (beginning-of-line)) (bobp))
>
> especially considering `beginning-of-line` always returns nil.
Yes, it looks like you're right. Let me test a bit.
> (Is there a Gnus maintainer these days?)
It has a janitor :)
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#67445: Likely Gnus bracketing mistake
2023-11-25 15:52 ` Eli Zaretskii
@ 2023-11-25 21:19 ` Eric Abrahamsen
2023-11-25 21:43 ` Andreas Schwab
0 siblings, 1 reply; 8+ messages in thread
From: Eric Abrahamsen @ 2023-11-25 21:19 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Mattias Engdegård, 67445
[-- Attachment #1: Type: text/plain, Size: 599 bytes --]
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Mattias Engdegård <mattias.engdegard@gmail.com>
>> Date: Sat, 25 Nov 2023 15:50:59 +0100
>>
>> This looks like a bracketing mistake (gnus-group.el line 1758):
>>
>> > (if (and backward (progn (beginning-of-line)) (bobp))
>>
>> especially considering `beginning-of-line` always returns nil.
That whole special-case test doesn't seem necessary, I think the
attached patch is sufficient. I've tested it lightly, does it look okay?
>> (Is there a Gnus maintainer these days?)
>
> Yes, Eric (CC'ed).
Hey, I've been promoted!
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gnus-search-articles.diff --]
[-- Type: text/x-patch, Size: 2685 bytes --]
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index 01e6a8f317f..41d92e715ee 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -1745,45 +1745,43 @@ gnus-group-level
gnus-level-killed))
(defun gnus-group-search-forward (&optional backward all level first-too)
- "Find the next newsgroup with unread articles.
-If BACKWARD is non-nil, find the previous newsgroup instead.
-If ALL is non-nil, just find any newsgroup.
-If LEVEL is non-nil, find group with level LEVEL, or higher if no such
-group exists.
-If FIRST-TOO, the current line is also eligible as a target."
+ "Move point to the next newsgroup with unread articles.
+If BACKWARD is non-nil, move to the previous newsgroup instead.
+If ALL is non-nil, consider any newsgroup, not only those with
+unread articles. If LEVEL is non-nil, find group with level
+LEVEL, or higher if no such group exists. If FIRST-TOO, the
+current line is also eligible as a target."
(let ((way (if backward -1 1))
(low gnus-level-killed)
(beg (point))
pos found lev)
- (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)))))
+ (unless first-too
+ (forward-line way))
+ (while (and
+ (not (if (> 0 way) (eobp) (bobp)))
+ (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))
^ permalink raw reply related [flat|nested] 8+ messages in thread
* bug#67445: Likely Gnus bracketing mistake
2023-11-25 21:19 ` Eric Abrahamsen
@ 2023-11-25 21:43 ` Andreas Schwab
2023-11-25 21:58 ` Eric Abrahamsen
0 siblings, 1 reply; 8+ messages in thread
From: Andreas Schwab @ 2023-11-25 21:43 UTC (permalink / raw)
To: Eric Abrahamsen; +Cc: Eli Zaretskii, Mattias Engdegård, 67445
On Nov 25 2023, Eric Abrahamsen wrote:
> + (not (if (> 0 way) (eobp) (bobp)))
(not (if backward (bobp) (eobp))))
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#67445: Likely Gnus bracketing mistake
2023-11-25 21:43 ` Andreas Schwab
@ 2023-11-25 21:58 ` Eric Abrahamsen
0 siblings, 0 replies; 8+ messages in thread
From: Eric Abrahamsen @ 2023-11-25 21:58 UTC (permalink / raw)
To: Andreas Schwab; +Cc: Eli Zaretskii, Mattias Engdegård, 67445
On November 25, 2023 1:43:37 PM PST, Andreas Schwab <schwab@linux-m68k.org> wrote:
>On Nov 25 2023, Eric Abrahamsen wrote:
>
>> + (not (if (> 0 way) (eobp) (bobp)))
>
> (not (if backward (bobp) (eobp))))
Ah, good point! Thanks.
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#67445: Likely Gnus bracketing mistake
2023-11-25 17:27 ` Eric Abrahamsen
@ 2023-11-26 8:59 ` Mattias Engdegård
2023-11-26 15:29 ` Eric Abrahamsen
0 siblings, 1 reply; 8+ messages in thread
From: Mattias Engdegård @ 2023-11-26 8:59 UTC (permalink / raw)
To: Eric Abrahamsen; +Cc: 67445
25 nov. 2023 kl. 18.27 skrev Eric Abrahamsen <eric@ericabrahamsen.net>:
> It has a janitor :)
The usual reward for diligence!
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#67445: Likely Gnus bracketing mistake
2023-11-26 8:59 ` Mattias Engdegård
@ 2023-11-26 15:29 ` Eric Abrahamsen
0 siblings, 0 replies; 8+ messages in thread
From: Eric Abrahamsen @ 2023-11-26 15:29 UTC (permalink / raw)
To: Mattias Engdegård; +Cc: 67445-done
Mattias Engdegård <mattias.engdegard@gmail.com> writes:
> 25 nov. 2023 kl. 18.27 skrev Eric Abrahamsen <eric@ericabrahamsen.net>:
>
>> It has a janitor :)
>
> The usual reward for diligence!
I can always put "maintainer" on my business cards, tho :)
I'm closing this bug, thanks for the report!
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2023-11-26 15:29 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-25 14:50 bug#67445: Likely Gnus bracketing mistake Mattias Engdegård
2023-11-25 15:52 ` Eli Zaretskii
2023-11-25 21:19 ` Eric Abrahamsen
2023-11-25 21:43 ` Andreas Schwab
2023-11-25 21:58 ` Eric Abrahamsen
2023-11-25 17:27 ` Eric Abrahamsen
2023-11-26 8:59 ` Mattias Engdegård
2023-11-26 15:29 ` Eric Abrahamsen
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.