Skip to content

Commit bd93bcb

Browse files
committed
Don't check for group existence in gnus-group-goto-group
* lisp/gnus/gnus-group.el (gnus-group-goto-group): Just look for the string.
1 parent 9e4bb0d commit bd93bcb

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

lisp/gnus/gnus-group.el

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2549,37 +2549,33 @@ If PROMPT (the prefix) is a number, use the prompt specified in
25492549
(gnus-group-position-point)))
25502550

25512551
(defun gnus-group-goto-group (group &optional far test-marked)
2552-
"Goto to newsgroup GROUP.
2552+
"Go to newsgroup GROUP.
25532553
If FAR, it is likely that the group is not on the current line.
2554-
If TEST-MARKED, the line must be marked."
2554+
If TEST-MARKED, the line must be marked.
2555+
2556+
Return nil if GROUP is not found."
25552557
(when group
2556-
(let ((start (point))
2557-
(active (and (or
2558-
;; Some kind of group may be only there.
2559-
(gnus-active group)
2560-
;; All groups (but with exception) are there.
2561-
(gnus-group-entry group))
2562-
group)))
2558+
(let ((start (point)))
25632559
(beginning-of-line)
25642560
(cond
25652561
;; It's quite likely that we are on the right line, so
25662562
;; we check the current line first.
25672563
((and (not far)
2568-
(equal (get-text-property (point) 'gnus-group) active)
2564+
(equal (get-text-property (point) 'gnus-group) group)
25692565
(or (not test-marked) (gnus-group-mark-line-p)))
25702566
(point))
25712567
;; Previous and next line are also likely, so we check them as well.
25722568
((and (not far)
25732569
(save-excursion
25742570
(forward-line -1)
2575-
(and (equal (get-text-property (point) 'gnus-group) active)
2571+
(and (equal (get-text-property (point) 'gnus-group) group)
25762572
(or (not test-marked) (gnus-group-mark-line-p)))))
25772573
(forward-line -1)
25782574
(point))
25792575
((and (not far)
25802576
(save-excursion
25812577
(forward-line 1)
2582-
(and (equal (get-text-property (point) 'gnus-group) active)
2578+
(and (equal (get-text-property (point) 'gnus-group) group)
25832579
(or (not test-marked) (gnus-group-mark-line-p)))))
25842580
(forward-line 1)
25852581
(point))
@@ -2588,15 +2584,15 @@ If TEST-MARKED, the line must be marked."
25882584
(let (found)
25892585
(while (and (not found)
25902586
(gnus-text-property-search
2591-
'gnus-group active 'forward 'goto))
2587+
'gnus-group group 'forward 'goto))
25922588
(if (gnus-group-mark-line-p)
25932589
(setq found t)
25942590
(forward-line 1)))
25952591
found))
25962592
(t
25972593
;; Search through the entire buffer.
25982594
(if (gnus-text-property-search
2599-
'gnus-group active nil 'goto)
2595+
'gnus-group group nil 'goto)
26002596
(point)
26012597
(goto-char start)
26022598
nil))))))

0 commit comments

Comments
 (0)