Commit 7920f695 authored by Pontus Freyhult's avatar Pontus Freyhult
Browse files

Bugfixes for kom-list-sessions: Correct usage of sort, handle nil

entries from lyskom-list-news. Also fixed singularis for swedish
unread letter string.
parent 8c6905d4
2004-11-12 Pontus Freyhult <pont@soua.net>
* commands2.el (kom-list-sessions): Sort first on priority,
then on session name. Corrected bad usage of sort.
Handle nil entries in lyskom-list-news result.
* swedish-strings.el (local): Corrected singular form for
unread letters in session-list-unreads-in-conf.
2004-11-11 Pontus Freyhult <pont@soua.net> 2004-11-11 Pontus Freyhult <pont@soua.net>
Fix bug 279, implement list sessions (with extras): Fix bug 279, implement list sessions (with extras):
......
...@@ -764,7 +764,8 @@ send. If DONTSHOW is non-nil, don't display the sent message." ...@@ -764,7 +764,8 @@ send. If DONTSHOW is non-nil, don't display the sent message."
(texts 0) (texts 0)
(confs 0)) (confs 0))
(lyskom-traverse entry (lyskom-list-news) (lyskom-traverse entry (lyskom-list-news)
(unless (zerop (car entry)) ; Ignore confs with 0 unread (unless (or (not entry) ; Happens sometimes
(zerop (car entry))) ; Ignore confs with 0 unread
(setq texts (+ (car entry) (setq texts (+ (car entry)
texts)) texts))
(setq confs (1+ confs)) (setq confs (1+ confs))
...@@ -778,7 +779,7 @@ send. If DONTSHOW is non-nil, don't display the sent message." ...@@ -778,7 +779,7 @@ send. If DONTSHOW is non-nil, don't display the sent message."
(setq total-letters (+ letters (setq total-letters (+ letters
total-letters)) total-letters))
(setq total-confs (+ confs (setq total-confs (+ confs
total-confs)) total-confs))
(setq session-list (append (list (list (lyskom-session-nickname) (setq session-list (append (list (list (lyskom-session-nickname)
(lyskom-format "%#1P" lyskom-pers-no) (lyskom-format "%#1P" lyskom-pers-no)
...@@ -788,9 +789,15 @@ send. If DONTSHOW is non-nil, don't display the sent message." ...@@ -788,9 +789,15 @@ send. If DONTSHOW is non-nil, don't display the sent message."
kom-server-priority)) kom-server-priority))
session-list)))))) session-list))))))
(sort session-list (lambda (s1 s2) (setq session-list
(< (nth 5 s1) (sort session-list (lambda (s1 s2)
(nth 5 s2)))) (if (= (nth 5 s1) ; Same priority?
(nth 5 s2))
(string< (nth 0 s1)
(nth 0 s2)) ; Sort on name
(< (nth 5 s1) ; Different priority - sort on that
(nth 5 s2))))))
(lyskom-traverse session session-list (lyskom-traverse session session-list
(lyskom-format-insert 'session-list-unreads-in-confs (lyskom-format-insert 'session-list-unreads-in-confs
(nth 0 session) (nth 0 session)
......
...@@ -775,7 +775,7 @@ Meddelandet du f ...@@ -775,7 +775,7 @@ Meddelandet du f
(lp--only-last . "Antal texter att lsa: ") (lp--only-last . "Antal texter att lsa: ")
(session-list-unreads-in-confs . (session-list-unreads-in-confs .
"Du har %#2?z%[%#2d olsta brev och totalt %]%[%]%#3d olst%#3?d%[%]%[a%] i %#4d mte%#4?d%[%]%[n%] i %#1s.\n") "Du har %#2?z%[%#2d olst%#2?d%[%]%[a%] brev och totalt %]%[%]%#3d olst%#3?d%[%]%[a%] i %#4d mte%#4?d%[%]%[n%] i %#1s.\n")
(you-have-unreads . "Du har %#1d olst%#1?d%[%]%[a%] inlgg i %#2M\n") (you-have-unreads . "Du har %#1d olst%#1?d%[%]%[a%] inlgg i %#2M\n")
(you-have-unreads-special . "Du har %#1d okommentera%#1?d%[t%]%[de%] inlgg i %#2M\n") (you-have-unreads-special . "Du har %#1d okommentera%#1?d%[t%]%[de%] inlgg i %#2M\n")
......
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