aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Abrahamsen2019-04-19 09:07:59 -0700
committerEric Abrahamsen2019-04-19 09:09:15 -0700
commitbd93bcb078f29e9b5fa127d6cef0bdeeab5c2285 (patch)
tree67a1f3f6c77d3e8f442ff64f58248d39f9806fbe
parent9e4bb0d221bbd97f9318bacba0650d93708f0290 (diff)
downloademacs-bd93bcb078f29e9b5fa127d6cef0bdeeab5c2285.tar.gz
emacs-bd93bcb078f29e9b5fa127d6cef0bdeeab5c2285.zip
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.
-rw-r--r--lisp/gnus/gnus-group.el24
1 files changed, 10 insertions, 14 deletions
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index b1e4091c975..c757c82fbc8 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -2549,37 +2549,33 @@ If PROMPT (the prefix) is a number, use the prompt specified in
2549 (gnus-group-position-point))) 2549 (gnus-group-position-point)))
2550 2550
2551(defun gnus-group-goto-group (group &optional far test-marked) 2551(defun gnus-group-goto-group (group &optional far test-marked)
2552 "Goto to newsgroup GROUP. 2552 "Go to newsgroup GROUP.
2553If FAR, it is likely that the group is not on the current line. 2553If FAR, it is likely that the group is not on the current line.
2554If TEST-MARKED, the line must be marked." 2554If TEST-MARKED, the line must be marked.
2555
2556Return nil if GROUP is not found."
2555 (when group 2557 (when group
2556 (let ((start (point)) 2558 (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)))
2563 (beginning-of-line) 2559 (beginning-of-line)
2564 (cond 2560 (cond
2565 ;; It's quite likely that we are on the right line, so 2561 ;; It's quite likely that we are on the right line, so
2566 ;; we check the current line first. 2562 ;; we check the current line first.
2567 ((and (not far) 2563 ((and (not far)
2568 (equal (get-text-property (point) 'gnus-group) active) 2564 (equal (get-text-property (point) 'gnus-group) group)
2569 (or (not test-marked) (gnus-group-mark-line-p))) 2565 (or (not test-marked) (gnus-group-mark-line-p)))
2570 (point)) 2566 (point))
2571 ;; Previous and next line are also likely, so we check them as well. 2567 ;; Previous and next line are also likely, so we check them as well.
2572 ((and (not far) 2568 ((and (not far)
2573 (save-excursion 2569 (save-excursion
2574 (forward-line -1) 2570 (forward-line -1)
2575 (and (equal (get-text-property (point) 'gnus-group) active) 2571 (and (equal (get-text-property (point) 'gnus-group) group)
2576 (or (not test-marked) (gnus-group-mark-line-p))))) 2572 (or (not test-marked) (gnus-group-mark-line-p)))))
2577 (forward-line -1) 2573 (forward-line -1)
2578 (point)) 2574 (point))
2579 ((and (not far) 2575 ((and (not far)
2580 (save-excursion 2576 (save-excursion
2581 (forward-line 1) 2577 (forward-line 1)
2582 (and (equal (get-text-property (point) 'gnus-group) active) 2578 (and (equal (get-text-property (point) 'gnus-group) group)
2583 (or (not test-marked) (gnus-group-mark-line-p))))) 2579 (or (not test-marked) (gnus-group-mark-line-p)))))
2584 (forward-line 1) 2580 (forward-line 1)
2585 (point)) 2581 (point))
@@ -2588,7 +2584,7 @@ If TEST-MARKED, the line must be marked."
2588 (let (found) 2584 (let (found)
2589 (while (and (not found) 2585 (while (and (not found)
2590 (gnus-text-property-search 2586 (gnus-text-property-search
2591 'gnus-group active 'forward 'goto)) 2587 'gnus-group group 'forward 'goto))
2592 (if (gnus-group-mark-line-p) 2588 (if (gnus-group-mark-line-p)
2593 (setq found t) 2589 (setq found t)
2594 (forward-line 1))) 2590 (forward-line 1)))
@@ -2596,7 +2592,7 @@ If TEST-MARKED, the line must be marked."
2596 (t 2592 (t
2597 ;; Search through the entire buffer. 2593 ;; Search through the entire buffer.
2598 (if (gnus-text-property-search 2594 (if (gnus-text-property-search
2599 'gnus-group active nil 'goto) 2595 'gnus-group group nil 'goto)
2600 (point) 2596 (point)
2601 (goto-char start) 2597 (goto-char start)
2602 nil)))))) 2598 nil))))))