Commit 430bd7ac authored by Johan Sundström's avatar Johan Sundström
Browse files

I have wanted this in kom-go-to-next-conf ever since kom-list-news started taking prefix arguments.

parent 71c9a5b2
2002-07-16 Johan Sundström <jhs@lysator.liu.se>
* lyskom-rest.el (kom-go-to-next-conf): Treat prefix arguments as
kom-list-news does, giving upper/lower bounds for the number of
unread messages you want in the conference you go to.
2002-07-15 Per Cederqvist <ceder@ingate.com> 2002-07-15 Per Cederqvist <ceder@ingate.com>
* utilities.el (lyskom-evaluate-text-no-strategy): first, second * utilities.el (lyskom-evaluate-text-no-strategy): first, second
......
...@@ -502,15 +502,43 @@ lyskom-mark-as-read." ...@@ -502,15 +502,43 @@ lyskom-mark-as-read."
;;; Go to next conf. ;;; Go to next conf.
(def-kom-command kom-go-to-next-conf () (def-kom-command kom-go-to-next-conf (&optional num)
"Go to next conf. "Go to next conf.
Take first conf from lyskom-to-do-list and copy it to lyskom-reading-list. Take first conf from lyskom-to-do-list and copy it to lyskom-reading-list.
Tell server what the user is doing. If the user is reading a conf it is Tell server what the user is doing. If the user is reading a conf it is
moved last on lyskom-to-do-list, with priority 0." moved last on lyskom-to-do-list, with priority 0. When a prefix argument
(interactive) is given, it is interpreted as for kom-list-news; positive numbers set a
(when (lyskom-check-go-to-conf) lower bound for how many unreads you want in the conference to move to,
(lyskom-maybe-move-unread t) a negative argument sets a lower bound instead. You end up in the first
(lyskom-go-to-next-conf))) conference in your lyskom-to-do-list that matches the given bounds."
(interactive "P")
(let ((conf-stat nil)
(num-arg (cond
((numberp num) num)
((and (listp num)
(numberp (car num))) (car num))
(t nil))))
(when num-arg
(let ((read-list (cdr (lyskom-list-news)))
(msgs-conf nil)
(unreads nil)
(at-least (if (< num-arg 0) 1 num-arg))
(at-most (and (< num-arg 0) (- num-arg))))
(while (and read-list (null conf-stat))
(setq msgs-conf (car read-list))
(setq read-list (cdr read-list))
(setq unreads (car msgs-conf))
(when (and (>= unreads at-least) ; unreads within lower bound
(or (not at-most)
(<= unreads at-most))) ; unreads within upper bound
(setq conf-stat (cdr msgs-conf))))))
(if (and num-arg (null conf-stat))
(lyskom-insert-string 'no-unreads-shown)
(when (lyskom-check-go-to-conf conf-stat)
(lyskom-maybe-move-unread t)
(if conf-stat
(lyskom-go-to-conf conf-stat)
(lyskom-go-to-next-conf))))))
(defun lyskom-go-to-pri-conf () (defun lyskom-go-to-pri-conf ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment