* [sup-talk] AM/PM display
@ 2009-12-18 20:26 Jay Mendoza
2009-12-18 21:34 ` Mike Kelly
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Jay Mendoza @ 2009-12-18 20:26 UTC (permalink / raw)
To: sup-talk
In inbox-mode, Sup seems to display all of my message as if they were
received in the PM hours. Is this a known defect, or just a
misconfiguration on my part?
--
Jay
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [sup-talk] AM/PM display
2009-12-18 20:26 [sup-talk] AM/PM display Jay Mendoza
@ 2009-12-18 21:34 ` Mike Kelly
2009-12-18 23:51 ` [sup-talk] [PATCH] Moar configurability (was: AM/PM display) Tero Tilus
2009-12-19 18:12 ` [sup-talk] AM/PM display William Morgan
2 siblings, 0 replies; 7+ messages in thread
From: Mike Kelly @ 2009-12-18 21:34 UTC (permalink / raw)
To: sup-talk
[-- Attachment #1: Type: text/plain, Size: 469 bytes --]
"Me too".
I posted about similar issues a while ago, but I don't think I got far.
"Jay Mendoza" <jayzer@gmail.com> wrote:
>In inbox-mode, Sup seems to display all of my message as if they were
>received in the PM hours. Is this a known defect, or just a
>misconfiguration on my part?
>--
>Jay
>_______________________________________________
>sup-talk mailing list
>sup-talk@rubyforge.org
>http://rubyforge.org/mailman/listinfo/sup-talk
>
--
Mike Kelly
[-- Attachment #2: Type: text/plain, Size: 140 bytes --]
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk
^ permalink raw reply [flat|nested] 7+ messages in thread
* [sup-talk] [PATCH] Moar configurability (was: AM/PM display)
2009-12-18 20:26 [sup-talk] AM/PM display Jay Mendoza
2009-12-18 21:34 ` Mike Kelly
@ 2009-12-18 23:51 ` Tero Tilus
2009-12-19 18:12 ` William Morgan
2009-12-19 18:12 ` [sup-talk] AM/PM display William Morgan
2 siblings, 1 reply; 7+ messages in thread
From: Tero Tilus @ 2009-12-18 23:51 UTC (permalink / raw)
To: sup-talk
[-- Attachment #1: Type: text/plain, Size: 708 bytes --]
Jay Mendoza, 2009-12-18 22:26:
> In inbox-mode, Sup seems to display all of my message as if they
> were received in the PM hours. Is this a known defect, or just a
> misconfiguration on my part?
I remember seeing AM hours (and see them now). I also don't see how
it possibly could be caused by configuration.
...which reminds me of a couple of configurability hacks (configurable
"missing attachment detector" and configurable thread list date
formats) I cooked together quite a while ago and don't remenber
sharing yet. Shame on me. So here they are, keep them if you like
them (if they aren't already obsoleted by something I'm not aware of)
--
Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/
[-- Attachment #2: 0006-configurable-listing-date-formats-and-attachment-det.patch --]
[-- Type: application/octet-stream, Size: 2827 bytes --]
From 6b331fbe954f085f8d0867d7881db1a45fac67a2 Mon Sep 17 00:00:00 2001
From: Tero Tilus <tero@tilus.net>
Date: Sat, 19 Dec 2009 01:31:10 +0200
Subject: [PATCH] configurable listing date formats and attachment detection
Signed-off-by: Tero Tilus <tero@tilus.net>
---
lib/sup.rb | 8 ++++++++
lib/sup/modes/edit-message-mode.rb | 2 +-
lib/sup/util.rb | 19 ++++++++++---------
3 files changed, 19 insertions(+), 10 deletions(-)
diff --git a/lib/sup.rb b/lib/sup.rb
index 7f9396c..a5cbb95 100644
--- a/lib/sup.rb
+++ b/lib/sup.rb
@@ -218,6 +218,13 @@ else
:signature => File.join(ENV["HOME"], ".signature")
}
},
+ :time_format => {
+ :same_day => "%l:%M%P",
+ :day_before => "Yest.%l%P",
+ :same_month => "%b %e",
+ :same_year => "%b %e",
+ :otherwise => "%b %Y",
+ },
:editor => ENV["EDITOR"] || "/usr/bin/vim -f -c 'setlocal spell spelllang=en_us' -c 'set filetype=mail'",
:thread_by_subject => false,
:edit_signature => false,
@@ -225,6 +232,7 @@ else
:ask_for_bcc => false,
:ask_for_subject => true,
:confirm_no_attachments => true,
+ :mentions_attachment_regex => '\battach(ment|ed|ing|)\b',
:confirm_top_posting => true,
:discard_snippets_from_encrypted_messages => false,
:default_attachment_save_dir => "",
diff --git a/lib/sup/modes/edit-message-mode.rb b/lib/sup/modes/edit-message-mode.rb
index 8849271..4e4c63f 100644
--- a/lib/sup/modes/edit-message-mode.rb
+++ b/lib/sup/modes/edit-message-mode.rb
@@ -444,7 +444,7 @@ private
end
def mentions_attachments?
- @body.any? { |l| l =~ /^[^>]/ && l =~ /\battach(ment|ed|ing|)\b/i }
+ @body.any? { |l| l =~ /^[^>]/ && l =~ /#{$config[:mentions_attachment_regexp] || '\battach(ment|ed|ing|)\b'}/i }
end
def top_posting?
diff --git a/lib/sup/util.rb b/lib/sup/util.rb
index f99e1c1..2ca9fa1 100644
--- a/lib/sup/util.rb
+++ b/lib/sup/util.rb
@@ -480,17 +480,18 @@ class Time
TO_NICE_S_MAX_LEN = 9 # e.g. "Yest.10am"
def to_nice_s from=Time.now
- if year != from.year
- strftime "%b %Y"
- elsif month != from.month
- strftime "%b %e"
+ fmt = $config[:time_format]
+ if is_the_same_day? from
+ strftime(fmt[:same_day] || "%l:%M%P")
+ elsif is_the_day_before? from
+ nearest_hour.strftime(fmt[:day_before] || "Yest.%l%P")
else
- if is_the_same_day? from
- strftime("%l:%M%P")
- elsif is_the_day_before? from
- "Yest." + nearest_hour.strftime("%l%P")
+ if year != from.year
+ strftime(fmt[:otherwise] || "%b %Y")
+ elsif month != from.month
+ strftime(fmt[:same_year] || "%b %e")
else
- strftime "%b %e"
+ strftime(fmt[:same_month] || "%b %e")
end
end
end
--
1.5.6.5
[-- Attachment #3: Type: text/plain, Size: 140 bytes --]
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [sup-talk] AM/PM display
2009-12-18 20:26 [sup-talk] AM/PM display Jay Mendoza
2009-12-18 21:34 ` Mike Kelly
2009-12-18 23:51 ` [sup-talk] [PATCH] Moar configurability (was: AM/PM display) Tero Tilus
@ 2009-12-19 18:12 ` William Morgan
2 siblings, 0 replies; 7+ messages in thread
From: William Morgan @ 2009-12-19 18:12 UTC (permalink / raw)
To: sup-talk
Reformatted excerpts from Jay Mendoza's message of 2009-12-18:
> In inbox-mode, Sup seems to display all of my message as if they were
> received in the PM hours. Is this a known defect, or just a
> misconfiguration on my part?
Weird. Are the times otherwise correct?
--
William <wmorgan-sup@masanjin.net>
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [sup-talk] [PATCH] Moar configurability (was: AM/PM display)
2009-12-18 23:51 ` [sup-talk] [PATCH] Moar configurability (was: AM/PM display) Tero Tilus
@ 2009-12-19 18:12 ` William Morgan
2009-12-20 2:31 ` Tero Tilus
0 siblings, 1 reply; 7+ messages in thread
From: William Morgan @ 2009-12-19 18:12 UTC (permalink / raw)
To: sup-talk
Reformatted excerpts from Tero Tilus's message of 2009-12-18:
> ...which reminds me of a couple of configurability hacks (configurable
> "missing attachment detector" and configurable thread list date
> formats) I cooked together quite a while ago and don't remenber
> sharing yet.
Both of these are good ideas, but I would like to add them in hook form
rather than in configuration form, please.
--
William <wmorgan-sup@masanjin.net>
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [sup-talk] [PATCH] Moar configurability (was: AM/PM display)
2009-12-19 18:12 ` William Morgan
@ 2009-12-20 2:31 ` Tero Tilus
2009-12-21 13:38 ` William Morgan
0 siblings, 1 reply; 7+ messages in thread
From: Tero Tilus @ 2009-12-20 2:31 UTC (permalink / raw)
To: sup-talk
William Morgan, 2009-12-19 20:12:
> Both of these are good ideas, but I would like to add them in hook
> form rather than in configuration form, please.
The detect-missing-attachment hook is pretty self evident but what you
had in mind for the dates? Formatter for the thread-index-mode date
widget maybe?
--
Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [sup-talk] [PATCH] Moar configurability (was: AM/PM display)
2009-12-20 2:31 ` Tero Tilus
@ 2009-12-21 13:38 ` William Morgan
0 siblings, 0 replies; 7+ messages in thread
From: William Morgan @ 2009-12-21 13:38 UTC (permalink / raw)
To: sup-talk
Reformatted excerpts from Tero Tilus's message of 2009-12-19:
> The detect-missing-attachment hook is pretty self evident but what you
> had in mind for the dates? Formatter for the thread-index-mode date
> widget maybe?
Exactly. We already have index-mode-size-widget, so
index-mode-date-widget would be analogous.
--
William <wmorgan-sup@masanjin.net>
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-12-21 13:39 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-18 20:26 [sup-talk] AM/PM display Jay Mendoza
2009-12-18 21:34 ` Mike Kelly
2009-12-18 23:51 ` [sup-talk] [PATCH] Moar configurability (was: AM/PM display) Tero Tilus
2009-12-19 18:12 ` William Morgan
2009-12-20 2:31 ` Tero Tilus
2009-12-21 13:38 ` William Morgan
2009-12-19 18:12 ` [sup-talk] AM/PM display William Morgan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox