commit 54791ec9c83e7faecf515079c1d78374f343e23c
parent 44336aa8ce39ea0769ad03ec3fac483ddc0e855b
Author: Peter Harkins <ph@malaprop.org>
Date: Wed, 11 Nov 2009 12:40:20 -0600
issue6: Added ask_for_to to match _cc, _bcc, and _subject.
The user who sets these all to false will move directly to editing
headers in their $EDITOR when composing or forwarding.
Diffstat:
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/sup.rb b/lib/sup.rb
@@ -221,6 +221,7 @@ else
:editor => ENV["EDITOR"] || "/usr/bin/vim -f -c 'setlocal spell spelllang=en_us' -c 'set filetype=mail'",
:thread_by_subject => false,
:edit_signature => false,
+ :ask_for_to => true,
:ask_for_cc => true,
:ask_for_bcc => false,
:ask_for_subject => true,
diff --git a/lib/sup/modes/compose-mode.rb b/lib/sup/modes/compose-mode.rb
@@ -21,7 +21,7 @@ class ComposeMode < EditMessageMode
end
def self.spawn_nicely opts={}
- to = opts[:to] || BufferManager.ask_for_contacts(:people, "To: ", [opts[:to_default]]) or return
+ to = opts[:to] || (BufferManager.ask_for_contacts(:people, "To: ", [opts[:to_default]]) or return if $config[:ask_for_to])
cc = opts[:cc] || (BufferManager.ask_for_contacts(:people, "Cc: ") or return if $config[:ask_for_cc])
bcc = opts[:bcc] || (BufferManager.ask_for_contacts(:people, "Bcc: ") or return if $config[:ask_for_bcc])
subj = opts[:subj] || (BufferManager.ask(:subject, "Subject: ") or return if $config[:ask_for_subject])
diff --git a/lib/sup/modes/forward-mode.rb b/lib/sup/modes/forward-mode.rb
@@ -29,7 +29,7 @@ class ForwardMode < EditMessageMode
end
def self.spawn_nicely opts={}
- to = opts[:to] || BufferManager.ask_for_contacts(:people, "To: ") or return
+ to = opts[:to] || BufferManager.ask_for_contacts(:people, "To: ") or return if $config[:ask_for_to]
cc = opts[:cc] || BufferManager.ask_for_contacts(:people, "Cc: ") or return if $config[:ask_for_cc]
bcc = opts[:bcc] || BufferManager.ask_for_contacts(:people, "Bcc: ") or return if $config[:ask_for_bcc]