From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.42.228.134 with SMTP id je6cs372167icb; Mon, 10 Jan 2011 13:25:15 -0800 (PST) Received: by 10.90.133.11 with SMTP id g11mr6718859agd.169.1294694715382; Mon, 10 Jan 2011 13:25:15 -0800 (PST) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id z7si385001vch.98.2011.01.10.13.25.15; Mon, 10 Jan 2011 13:25:15 -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 C59931678320; Mon, 10 Jan 2011 16:25:14 -0500 (EST) X-Greylist: delayed 301 seconds by postgrey-1.31 at rubyforge.org; Mon, 10 Jan 2011 16:05:13 EST Received: from zucker.schokokeks.org (zucker.schokokeks.org [178.63.68.96]) by rubyforge.org (Postfix) with ESMTP id B0AE2185835E for ; Mon, 10 Jan 2011 16:05:13 -0500 (EST) Received: from localhost ([2002:5842:89ff:0:e936:5859:bc21:862a]) (AUTH: PLAIN michael@content-space.de, TLS: TLSv1/SSLv3, 128bits, AES128-SHA) by zucker.schokokeks.org with ESMTPSA; Mon, 10 Jan 2011 22:00:04 +0100 id 0000000000000031.000000004D2B7354.00004F1D From: Michael Hamann To: Steve In-reply-to: References: Date: Mon, 10 Jan 2011 21:48:05 +0100 Message-Id: <1294691658-sup-2474@mithink> User-Agent: Sup/git Mime-Version: 1.0 X-Mime-Autoconverted: from 8bit to 7bit by courier 0.65 Cc: sup-devel Subject: Re: [sup-devel] Bug report: temp file commit breaks my emacs hook 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: sup-devel-bounces@rubyforge.org Errors-To: sup-devel-bounces@rubyforge.org Hi, Excerpts from Steve's message of 2011-01-10 21:11:35 +0100: > This commit has broken part of the interaction between sup and my emacs. > > commit 60573298a2258c101a85b3de8121f73d7aec2d51 > Author: Michael Hamann > Date: Fri Oct 8 10:03:36 2010 -0400 > > Fix monkey-patching of Tempfile > > > Did you change the name of the temp file that gets passed to emacs? Yes. Now sup can and must use the syntax for Tempfile creation that is available in Ruby version 1.8.7 and newer. It allows to set both a prefix and a suffix. I didn't care about the filename because I had the experience that with the old filename my Vim didn't recognize the content as email and without the extension it recognizes it which gives me nice syntax highlighting even without configuring anything. > My emacs hook looks like this. > > (add-to-list 'auto-mode-alist > '("sup\\.\\(compose\\|forward\\|reply\\|resume\\)-mode$" . mail-mode)) The string you are looking for is now at the beginning of the filename so you could change your hook to match the beginning of the filename instead of the end. The following simple change will change the end of the filenames to .EXTENSION, so if you think it makes sense to add an extension again I could provide a proper patch. diff --git a/lib/sup/modes/edit-message-mode.rb b/lib/sup/modes/edit-message-mode.rb index 86aef4b..052421d 100644 --- a/lib/sup/modes/edit-message-mode.rb +++ b/lib/sup/modes/edit-message-mode.rb @@ -162,7 +162,7 @@ EOS def edit_subject; edit_field "Subject" end def edit_message - @file = Tempfile.new "sup.#{self.class.name.gsub(/.*::/, '').camel_to_hyphy}" + @file = Tempfile.new ["sup.#{self.class.name.gsub(/.*::/, '').camel_to_hyphy}", ".EXTENSION"] @file.puts format_headers(@header - NON_EDITABLE_HEADERS).first @file.puts @file.puts @body.join("\n") Regards, Michael Hamann _______________________________________________ Sup-devel mailing list Sup-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-devel