commit 1c1abdb1bc3e16010dac849787b28afecef3876d
parent 6b3162ec19be5eacf5e84e8022215340bbf0015e
Author: Gaute Hope <eg@gaute.vetsj.com>
Date: Sat, 5 Jul 2014 12:46:49 +0200
Merge branch 'develop'
Diffstat:
9 files changed, 68 insertions(+), 29 deletions(-)
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
@@ -16,12 +16,13 @@ Ben Walton <bwalton at the artsci.utoronto dot cas>
Mike Stipicevic <stipim at the rpi dot edus>
Martin Bähr <mbaehr at the societyserver dot orgs>
Clint Byrum <clint at the ubuntu dot coms>
+Wael M. Nasreddine <wael.nasreddine at the gmail dot coms>
Marcus Williams <marcus-sup at the bar-coded dot nets>
+Matthieu Rakotojaona <matthieu.rakotojaona at the gmail dot coms>
Lionel Ott <white.magic at the gmx dot des>
Gaudenz Steinlin <gaudenz at the soziologie dot chs>
-Matthieu Rakotojaona <matthieu.rakotojaona at the gmail dot coms>
-Mark Alexander <marka at the pobox dot coms>
Ingmar Vanhassel <ingmar at the exherbo dot orgs>
+Mark Alexander <marka at the pobox dot coms>
Edward Z. Yang <ezyang at the mit dot edus>
Timon Vonk <timonv at the gmail dot coms>
julien@macbook <julien.stechele at the gmail dot coms>
@@ -36,46 +37,48 @@ Markus Klinik <mkl at the lambdanaut dot nets>
Bo Borgerson <gigabo at the gmail dot coms>
Atte Kojo <atte.kojo at the reaktor dot fis>
Michael Hamann <michael at the content-space dot des>
-Jonathan Lassoff <jof at the thejof dot coms>
William Erik Baxter <web at the superscript dot coms>
+Jonathan Lassoff <jof at the thejof dot coms>
Grant Hollingworth <grant at the antiflux dot orgs>
-Adeodato Simó <dato at the net.com.org dot ess>
Ico Doornekamp <ico at the pruts dot nls>
+Adeodato Simó <dato at the net.com.org dot ess>
Daniel Schoepe <daniel.schoepe at the googlemail dot coms>
-Jason Petsod <jason at the petsod dot orgs>
James Taylor <james at the jamestaylor dot orgs>
+Jason Petsod <jason at the petsod dot orgs>
Robin Burchell <viroteck at the viroteck dot nets>
Steve Goldman <sgoldman at the tower-research dot coms>
Peter Harkins <ph at the malaprop dot orgs>
Decklin Foster <decklin at the red-bean dot coms>
Cameron Matheson <cam+sup at the cammunism dot orgs>
-Alex Vandiver <alex at the chmrr dot nets>
Carl Worth <cworth at the cworth dot orgs>
+Alex Vandiver <alex at the chmrr dot nets>
Andrew Pimlott <andrew at the pimlott dot nets>
Jeff Balogh <its.jeff.balogh at the gmail dot coms>
Matías Aguirre <matiasaguirre at the gmail dot coms>
+PaulSmecker <paul.smecker at the gmail dot coms>
Kornilios Kourtis <kkourt at the cslab.ece.ntua dot grs>
Lars Fischer <fischer at the wiwi.uni-siegen dot des>
+madhat2r <MaDhAt2r at the dukefoo dot coms>
Giorgio Lando <patroclo7 at the gmail dot coms>
Kevin Riggle <kevinr at the free-dissociation dot coms>
Benoît PIERRE <benoit.pierre at the gmail dot coms>
-Steven Lawrance <stl at the koffein dot nets>
Alvaro Herrera <alvherre at the alvh.no-ip dot orgs>
+Steven Lawrance <stl at the koffein dot nets>
Jonah <Jonah at the GoodCoffee dot cas>
ian <itaylor at the uark dot edus>
-Gregor Hoffleit <gregor at the sam.mediasupervision dot des>
-Per Andersson <avtobiff at the gmail dot coms>
Adam Lloyd <adam at the alloy-d dot nets>
-Todd Eisenberger <teisenbe at the andrew.cmu dot edus>
MichaelRevell <mikearevell at the gmail dot coms>
+Gregor Hoffleit <gregor at the sam.mediasupervision dot des>
+Todd Eisenberger <teisenbe at the andrew.cmu dot edus>
+Per Andersson <avtobiff at the gmail dot coms>
0xACE <0xACE at the users.noreply.github dot coms>
-Steven Walter <swalter at the monarch.(none)>
Steven Schmeiser <steven at the schmeiser dot orgs>
-Stefan Lundström <lundst at the snabb.(none)>
-William A. Kennington III <william at the wkennington dot coms>
+Steven Walter <swalter at the monarch.(none)>
+Jon M. Dugan <jdugan at the es dot nets>
akojo <atte.kojo at the gmail dot coms>
-Horacio Sanson <horacio at the skillupjapan.co dot jps>
Matthias Vallentin <vallentin at the icir dot orgs>
-Jon M. Dugan <jdugan at the es dot nets>
+William A. Kennington III <william at the wkennington dot coms>
+Horacio Sanson <horacio at the skillupjapan.co dot jps>
+Stefan Lundström <lundst at the snabb.(none)>
Johannes Larsen <johs.a.larsen at the gmail dot coms>
Kirill Smelkov <kirr at the landau.phys.spbu dot rus>
diff --git a/History.txt b/History.txt
@@ -1,3 +1,9 @@
+== 0.19.0 / 2014-07-05
+
+* new check-attachment hook
+* configure times to be seen in 24h format
+* new mailinglist: supmua@googlegroups.com
+
== 0.18.0 / 2014-05-19
* new color option, :with_attachment for defining colors for the
diff --git a/README.md b/README.md
@@ -38,7 +38,7 @@ Please report bugs to the [Github issue tracker](https://github.com/sup-heliotro
* [Code repository](https://github.com/sup-heliotrope/sup)
* [Wiki](https://github.com/sup-heliotrope/sup/wiki)
* IRC: [#sup @ freenode.net](http://webchat.freenode.net/?channels=#sup)
-* Mailing list: [sup-talk] and [sup-devel]
+* Mailing list: supmua@googlegroups.com (subscribe: supmua+subscribe@googlegroups.com, archive: https://groups.google.com/d/forum/supmua )
## License
@@ -67,6 +67,4 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
[search]: https://github.com/sup-heliotrope/sup/wiki/Searching-your-mail
[Installation]: https://github.com/sup-heliotrope/sup/wiki#installation
[ruby20]: https://github.com/sup-heliotrope/sup/wiki/Development#sup-014
-[sup-talk]: http://rubyforge.org/mailman/listinfo/sup-talk
-[sup-devel]: http://rubyforge.org/mailman/listinfo/sup-devel
[maildir-syncback]: https://github.com/sup-heliotrope/sup/wiki/Using-sup-with-other-clients
diff --git a/ReleaseNotes b/ReleaseNotes
@@ -1,3 +1,9 @@
+Release 0.19.0:
+
+New hook: check-attachment and a new option to shows dates in 24h format.
+
+Our old mailinglists have been closed with the shut down of Rubyforge. Please subscribe to our new list: supmua@googlegroups.com.
+
Release 0.18.0:
sup-tweak-labels works again. new color options and some bug fixes.
diff --git a/bin/sup-config b/bin/sup-config
@@ -149,11 +149,14 @@ alts = axe("Alternate email addresses", account[:alternates].join(" ")).split(/\
sigfn = axe "What file contains your signature?", account[:signature]
editor = axe "What editor would you like to use?", $config[:editor]
+time_mode = axe "Would like to display time in 12h (type 12h) or in 24h (type 24h)?", $config[:time_mode]
+
$config[:accounts][:default][:name] = name
$config[:accounts][:default][:email] = email
$config[:accounts][:default][:alternates] = alts
$config[:accounts][:default][:signature] = sigfn
$config[:editor] = editor
+$config[:time_mode] = time_mode
done = false
until done
diff --git a/lib/sup/modes/edit_message_mode.rb b/lib/sup/modes/edit_message_mode.rb
@@ -25,6 +25,16 @@ Return value:
use the default signature, or :none for no signature.
EOS
+ HookManager.register "check-attachment", <<EOS
+Do checks on the attachment filename
+Variables:
+ filename: the name of the attachment
+Return value:
+ A String (single line) containing a message why this attachment is not optimal
+ to be attached.
+ If it is ok just return an empty string or nil
+EOS
+
HookManager.register "before-edit", <<EOS
Modifies message body and headers before editing a new message. Variables
should be modified in place.
@@ -331,6 +341,12 @@ EOS
def attach_file
fn = BufferManager.ask_for_filename :attachment, "File name (enter for browser): "
return unless fn
+ if HookManager.enabled? "check-attachment"
+ reason = HookManager.run("check-attachment", :filename => fn)
+ if reason
+ return unless BufferManager.ask_yes_or_no("#{reason} Attach anyway?")
+ end
+ end
begin
Dir[fn].each do |f|
@attachments << RMail::Message.make_file_attachment(f)
diff --git a/lib/sup/modes/thread_view_mode.rb b/lib/sup/modes/thread_view_mode.rb
@@ -10,7 +10,6 @@ class ThreadViewMode < LineCursorMode
attr_accessor :state
end
- DATE_FORMAT = "%B %e %Y %l:%M%p"
INDENT_SPACES = 2 # how many spaces to indent child messages
HookManager.register "detailed-headers", <<EOS
@@ -849,7 +848,7 @@ private
end
headers = OrderedHash.new
- headers["Date"] = "#{m.date.strftime DATE_FORMAT} (#{m.date.to_nice_distance_s})"
+ headers["Date"] = "#{m.date.to_message_nice_s} (#{m.date.to_nice_distance_s})"
headers["Subject"] = m.subj
show_labels = @thread.labels - LabelManager::HIDDEN_RESERVED_LABELS
@@ -857,7 +856,7 @@ private
headers["Labels"] = show_labels.map { |x| x.to_s }.sort.join(', ')
end
if parent
- headers["In reply to"] = "#{parent.from.mediumname}'s message of #{parent.date.strftime DATE_FORMAT}"
+ headers["In reply to"] = "#{parent.from.mediumname}'s message of #{parent.date.to_message_nice_s}"
end
HookManager.run "detailed-headers", :message => m, :headers => headers
diff --git a/lib/sup/time.rb b/lib/sup/time.rb
@@ -60,6 +60,8 @@ EOS
end
TO_NICE_S_MAX_LEN = 9 # e.g. "Yest.10am"
+
+ ## This is how a thread date is displayed in thread-index-mode
def to_nice_s from=Time.now
Redwood::HookManager.run("time-to-nice-string", :time => self, :from => from) || default_to_nice_s(from)
end
@@ -71,13 +73,21 @@ EOS
strftime "%b %e"
else
if is_the_same_day? from
- strftime("%l:%M%p").downcase # emulate %P (missing on ruby 1.8 darwin)
+ format = $config[:time_mode] == "24h" ? "%k:%M" : "%l:%M%p"
+ strftime(format).downcase
elsif is_the_day_before? from
- "Yest." + nearest_hour.strftime("%l%p").downcase # emulate %P
+ format = $config[:time_mode] == "24h" ? "%kh" : "%l%p"
+ "Yest." + nearest_hour.strftime(format).downcase
else
strftime "%b %e"
end
end
end
+
+ ## This is how a message date is displayed in thread-view-mode
+ def to_message_nice_s from=Time.now
+ format = $config[:time_mode] == "24h" ? "%B %e %Y %k:%M" : "%B %e %Y %l:%M%p"
+ strftime format
+ end
end
diff --git a/sup.gemspec b/sup.gemspec
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
s.version = ENV["REL"] || (::Redwood::VERSION == "git" ? "999" : ::Redwood::VERSION)
s.date = Time.now.strftime "%Y-%m-%d"
s.authors = ["William Morgan", "Gaute Hope", "Hamish Downer", "Matthieu Rakotojaona"]
- s.email = "sup-talk@rubyforge.org"
+ s.email = "supmua@googlegroups.com"
s.summary = "A console-based email client with the best features of GMail, mutt and Emacs"
s.homepage = "http://supmua.org"
s.license = 'GPL-2'
@@ -22,11 +22,9 @@ Gem::Specification.new do |s|
* Automatically tracking recent contacts
DESC
s.post_install_message = <<-EOF
-SUP: If you are upgrading Sup from before version 0.14.0: Please
- run `sup-psych-ify-config-files` to migrate from 0.13.
-
- Check https://github.com/sup-heliotrope/sup/wiki/Migration-0.13-to-0.14
- for more detailed and up-to-date instructions.
+SUP: please note that our old mailing lists have been shut down,
+ re-subscribe to supmua@googlegroups.com to discuss and follow
+ updates on sup (send email to: supmua+subscribe@googlegroups.com).
EOF
s.files = `git ls-files -z`.split("\x0")