From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.86.87.8 with SMTP id k8cs76348fgb; Thu, 11 Mar 2010 20:26:07 -0800 (PST) Received: by 10.229.117.199 with SMTP id s7mr656126qcq.49.1268367966598; Thu, 11 Mar 2010 20:26:06 -0800 (PST) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id 26si1909365qwa.38.2010.03.11.20.26.06; Thu, 11 Mar 2010 20:26:06 -0800 (PST) Received-SPF: pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) client-ip=205.234.109.19; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) smtp.mail=sup-devel-bounces@rubyforge.org Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id F41CE18582E3; Thu, 11 Mar 2010 23:26:05 -0500 (EST) Received: from pion.club.cc.cmu.edu (PION.CLUB.CC.cmu.edu [128.237.157.88]) by rubyforge.org (Postfix) with ESMTP id 1DB7918582DE for ; Thu, 11 Mar 2010 23:20:53 -0500 (EST) Received: from rlane by pion.club.cc.cmu.edu with local (Exim 4.69) (envelope-from ) id 1NpwMm-0007vq-Mb; Thu, 11 Mar 2010 23:20:52 -0500 From: Rich Lane To: Michael Stapelberg In-reply-to: <1268175393-sup-8314@midna.zekjur.net> References: <1264026370-sup-8092@midna.zekjur.net> <1267295207-sup-7090@zyrg.net> <1268175393-sup-8314@midna.zekjur.net> Date: Thu, 11 Mar 2010 23:20:52 -0500 Message-Id: <1268366964-sup-2310@zyrg.net> User-Agent: Sup/git Cc: sup-devel Subject: Re: [sup-devel] [PATCH] Use multiple body arrays when calling before-edit for each reply type X-BeenThere: sup-devel@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Sup developer discussion List-Id: Sup developer discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: sup-devel-bounces@rubyforge.org Errors-To: sup-devel-bounces@rubyforge.org lib/sup/modes/reply-mode.rb: > + @bodies[k] = Array.new(body) Why is the body in an array? lib/sup/modes/reply-mode.rb: > + if !@edited > + self.body = @bodies[@type_selector.val] > + end The idiomatic way to write this is: self.body = @bodies[@type_selector.val] unless @edited The EditMessageMode constructor also calls the before-edit hook, but I guess if it wasn't broken before it won't be now. lib/sup/modes/reply-mode.rb: > + if new_body != @bodies[@type_selector.val] > + @bodies[@type_selector.val] = new_body > + @edited = true > + end Is there a reason we can't do this unconditionally? _______________________________________________ Sup-devel mailing list Sup-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-devel