Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] [PATCH] Avoid re-adding the signature when re-editing a draft with edit_signature: true
@ 2008-01-14  9:00 Nicolas Pouillard
  2008-01-15  5:05 ` William Morgan
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Pouillard @ 2008-01-14  9:00 UTC (permalink / raw)


---
 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..6a7f273 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] && !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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [sup-talk] [PATCH] Avoid re-adding the signature when re-editing a draft with edit_signature: true
  2008-01-14  9:00 [sup-talk] [PATCH] Avoid re-adding the signature when re-editing a draft with edit_signature: true Nicolas Pouillard
@ 2008-01-15  5:05 ` William Morgan
  0 siblings, 0 replies; 6+ messages in thread
From: William Morgan @ 2008-01-15  5:05 UTC (permalink / raw)


Applied straight to master. Thanks!

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [sup-talk] [PATCH] Avoid re-adding the signature when re-editing a draft with edit_signature: true
  2008-01-14  0:55 ` William Morgan
  2008-01-14  0:56   ` William Morgan
@ 2008-01-14  9:01   ` Nicolas Pouillard
  1 sibling, 0 replies; 6+ messages in thread
From: Nicolas Pouillard @ 2008-01-14  9:01 UTC (permalink / raw)


Excerpts from William Morgan's message of Mon Jan 14 01:55:28 +0100 2008:
> Hi Nicholas,
Hi,

> 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"
> 
> So can you change this:
> 
> > +    @body += sig_lines if $config[:edit_signature] and not
> > opts.delete(:have_signature)
> 
> To either "&& !" or to "unless".

Done.

> Other than that everything looks good.

Thanks.

-- 
Nicolas Pouillard aka Ertai


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [sup-talk] [PATCH] Avoid re-adding the signature when re-editing a draft with edit_signature: true
  2008-01-14  0:55 ` William Morgan
@ 2008-01-14  0:56   ` William Morgan
  2008-01-14  9:01   ` Nicolas Pouillard
  1 sibling, 0 replies; 6+ messages in thread
From: William Morgan @ 2008-01-14  0:56 UTC (permalink / raw)


Excerpts from William Morgan's message of Sun Jan 13 16:55:28 -0800 2008:
> Hi Nicholas,

Nicolas. Sorry!

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [sup-talk] [PATCH] Avoid re-adding the signature when re-editing a draft with edit_signature: true
  2008-01-13 14:46 Nicolas Pouillard
@ 2008-01-14  0:55 ` William Morgan
  2008-01-14  0:56   ` William Morgan
  2008-01-14  9:01   ` Nicolas Pouillard
  0 siblings, 2 replies; 6+ messages in thread
From: William Morgan @ 2008-01-14  0:55 UTC (permalink / raw)


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"

So can you change this:

> +    @body += sig_lines if $config[:edit_signature] and not
> opts.delete(:have_signature)

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

Other than that everything looks good.

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [sup-talk] [PATCH] Avoid re-adding the signature when re-editing a draft with edit_signature: true
@ 2008-01-13 14:46 Nicolas Pouillard
  2008-01-14  0:55 ` William Morgan
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Pouillard @ 2008-01-13 14:46 UTC (permalink / raw)


---
 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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-01-15  5:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-14  9:00 [sup-talk] [PATCH] Avoid re-adding the signature when re-editing a draft with edit_signature: true Nicolas Pouillard
2008-01-15  5:05 ` William Morgan
  -- strict thread matches above, loose matches on Subject: below --
2008-01-13 14:46 Nicolas Pouillard
2008-01-14  0:55 ` William Morgan
2008-01-14  0:56   ` William Morgan
2008-01-14  9:01   ` Nicolas Pouillard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox