Subject: [sup-talk] [PATCH] Avoid re-adding the signature when re-editing a draft with edit_signature: true

From: [email-masked] (Nicolas Pouillard)
Date: Sun, 13 Jan 2008 15:46:15 +0100

---
 lib/sup/modes/edit-message-mode.rb |    2 +-
 lib/sup/modes/resume-mode.rb       |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/sup/modes/edit-message-mode.rb b/lib/sup/modes/edit-message-mode.rb
index f058d03..710d390 100644
--- a/lib/sup/modes/edit-message-mode.rb
+++ b/lib/sup/modes/edit-message-mode.rb
@@ -59,7 +59,7 @@ EOS
     @header_lines = []
 
     @body = opts.delete(:body) || []
-    @body += sig_lines if $config[:edit_signature]
+    @body += sig_lines if $config[:edit_signature] and not opts.delete(:have_signature)
 
     if opts[:attachments]
       @attachments = opts[:attachments].values
diff --git a/lib/sup/modes/resume-mode.rb b/lib/sup/modes/resume-mode.rb
index 3470975..b1c69fc 100644
--- a/lib/sup/modes/resume-mode.rb
+++ b/lib/sup/modes/resume-mode.rb
@@ -8,7 +8,7 @@ class ResumeMode < EditMessageMode
     header, body = parse_file m.draft_filename
     header.delete "Date"
 
-    super :header => header, :body => body
+    super :header => header, :body => body, :have_signature => true
   end
 
   def killable?
-- 
1.5.3.1.109.gacd69

---

From: [email-masked] (William Morgan)
Date: Sun, 13 Jan 2008 16:55:28 -0800

Hi Nicholas,

Forgive me for being picky. I've just updated HACKING (on master) to
add:

+- and/or versus ||/&&. In Ruby, "and" and "or" bind very loosely---even
+  more loosely than function application. This makes them ideal for
+  end-of-line short-circuit control in poetry mode. So, use || and &&
+  for ordinary logical comparisons, and "and" and "or" for end-of-line
+  flow control. E.g.:
+    x = a || b or raise "neither is true"

> opts.delete(:have_signature)

To either "&& !" or to "unless".

Other than that everything looks good.

-- 
William <wmorgan-sup at masanjin.net>

---

From: [email-masked] (William Morgan)
Date: Sun, 13 Jan 2008 16:56:00 -0800

> Hi Nicholas,

Nicolas. Sorry!

---

From: [email-masked] (Nicolas Pouillard)
Date: Mon, 14 Jan 2008 10:01:58 +0100

> Hi Nicholas,
Hi,

> To either "&& !" or to "unless".

Done.

> Other than that everything looks good.

Thanks.

-- 
Nicolas Pouillard aka Ertai