commit 6a07133ba73393c4f0c05b1e067fef8dd2f595a2
parent 7e5ce394774ae31db65122314c48e51eb5e8b076
Author: William Morgan <wmorgan-sup@masanjin.net>
Date: Mon, 14 Jan 2008 21:04:58 -0800
Merge branch 'master' into next
Diffstat:
4 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/HACKING b/HACKING
@@ -20,9 +20,8 @@ the installed gem before submitting any bug reports.
Coding standards
----------------
-- Don't wrap code unless it really benefits from it. The days of 80-column
- displays are long over. But do wrap comments and other text at whatever vi
- gq<region> does.
+- Don't wrap code unless it really benefits from it.
+- Do wrap comments at 72 characters.
- Old lisp-style comment differentiations:
# one for comments on the same line as a line of code
## two for comments on their own line, except:
@@ -32,7 +31,12 @@ Coding standards
- The one exception to poetry mode is if-statements that have an assignment in
the condition. To make it clear this is not a comparison, surround the
condition by parentheses. E.g.:
-
- if a == b BUT if(a = some.computation)
- ... ... something with a
- end end
+ if a == b if(a = some.computation)
+ ... BUT ... something with a
+ end end
+- 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"
diff --git 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/file-browser-mode.rb b/lib/sup/modes/file-browser-mode.rb
@@ -38,6 +38,7 @@ protected
def reload
regen_text
+ jump_to_start
buffer.mark_dirty
end
diff --git 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?