Commit cb28a3cf authored by David Kågedal's avatar David Kågedal
Browse files

* commands2.el (kom-next-kom,kom-previous-kom): Ta bort döda

buffertar ur lyskom-sessions-with-unread(-letters).
(kom-next-unread-kom): Använd lyskom-buffer istället för
lyskom-proc.

* commands2.el (kom-next-unread-kom): Fungerade inte om
current-buffer inte var en LysKOM-buffert, och det inte fanns
några olästa.
parent afb70fcf
......@@ -1356,7 +1356,8 @@ membership info."
(defun kom-next-kom ()
"Pop up the next lyskom-session."
(interactive)
(lyskom-tell-internat 'kom-tell-next-lyskom)
(if (lyskom-buffer-p (current-buffer))
(lyskom-tell-internat 'kom-tell-next-lyskom))
(if lyskom-buffer-list
(progn
(if (lyskom-buffer-p (car lyskom-buffer-list))
......@@ -1373,7 +1374,13 @@ membership info."
(nconc (cdr lyskom-buffer-list)
(list (car lyskom-buffer-list)))))
;; The "active" lyskom buffer is dead, so we remove it from
;; the list.
;; some lists.
(setq lyskom-sessions-with-unread
(delq (car lyskom-buffer-list)
lyskom-sessions-with-unread))
(setq lyskom-sessions-with-unread-letters
(delq (car lyskom-buffer-list)
lyskom-sessions-with-unread-letters))
(setq lyskom-buffer-list (cdr lyskom-buffer-list)))
;; Don't switch to dead sessions.
(if (lyskom-buffer-p (car lyskom-buffer-list))
......@@ -1385,7 +1392,8 @@ membership info."
(defun kom-previous-kom ()
"Pop up the previous lyskom-session."
(interactive)
(lyskom-tell-internat 'kom-tell-next-lyskom)
(if (lyskom-buffer-p (current-buffer))
(lyskom-tell-internat 'kom-tell-next-lyskom))
(if (> (length lyskom-buffer-list) 1)
(let (lastbuf
(last-but-one lyskom-buffer-list))
......@@ -1405,7 +1413,13 @@ membership info."
(setq lyskom-buffer-list (cons lastbuf lyskom-buffer-list))
(rplacd last-but-one nil))
;; The "active" lyskom buffer is dead, so we remove it from
;; the list.
;; some lists.
(setq lyskom-sessions-with-unread
(delq (cdr last-but-one)
lyskom-sessions-with-unread))
(setq lyskom-sessions-with-unread-letters
(delq (cdr last-but-one)
lyskom-sessions-with-unread-letters))
(rplacd last-but-one nil))
(if (lyskom-buffer-p (car last-but-one))
(switch-to-buffer lastbuf)
......@@ -1417,10 +1431,12 @@ membership info."
(defun kom-next-unread-kom ()
"Pop up the next LysKOM session with unread texts in."
(interactive)
(if (not (lyskom-buffer-p (current-buffer)))
(kom-next-kom))
(let ((thisbuf (current-buffer)))
(kom-next-kom)
(while (and (not (eq thisbuf (current-buffer)))
(not (memq lyskom-proc lyskom-sessions-with-unread)))
(not (memq lyskom-buffer lyskom-sessions-with-unread)))
(kom-next-kom))))
......
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