sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 617bcfe12e8c98a9b924f656215383d4d5ecb743
parent 580b56e751e56e3d7cec197badbf18425e698112
Author: Nicolas Pouillard <nicolas.pouillard@gmail.com>
Date:   Mon, 10 Mar 2008 09:11:17 +0100

sort contacts when saving contacts.txt

This makes sup behave more nicely when contacts.txt is under version
control.

Diffstat:
M lib/sup/contact.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/sup/contact.rb b/lib/sup/contact.rb
@@ -51,7 +51,7 @@ class ContactManager
 
   def save
     File.open(@fn, "w") do |f|
-      @p2a.each do |p, a|
+      @p2a.sort_by { |(p, a)| [p.full_address, a] }.each do |(p, a)|
         f.puts "#{a || ''}: #{p.full_address}"
       end
     end