From mboxrd@z Thu Jan 1 00:00:00 1970 From: wmorgan-sup@masanjin.net (William Morgan) Date: Tue, 15 Jan 2008 20:06:01 -0800 Subject: [sup-talk] mailcap for os x In-Reply-To: <1200453317-sup-5958@south> References: <1196351498-sup-4803@spooky.local> <1198781360-sup-2193@south> <1200414674-sup-1175@spooky.local> <1200453317-sup-5958@south> Message-ID: <1200456328-sup-4928@south> Reformatted excerpts from William Morgan's message of 2008-01-15: > That's not a problem. There are plenty of hooks that override default > behavior if they're present, but do nothing if not. The quoteline one > Marcus just submitted is a good example. Something like this. Then you can move all the quick_look and explicit_view stuff in your original email into a mime-view.rb hook. diff --git a/lib/sup/message-chunks.rb b/lib/sup/message-chunks.rb index 08dcf27..8e5def9 100644 --- a/lib/sup/message-chunks.rb +++ b/lib/sup/message-chunks.rb @@ -53,6 +53,16 @@ Variables: Return value: The decoded text of the attachment, or nil if not decoded. EOS + + HookManager.register "mime-view", < /dev/null 2> /dev/null" $? == 0 end + def view! + path = write_to_disk + ret = HookManager.run "mime-view", :content_type => @content_type, + :filename => path + view_default! path unless ret + end + def write_to_disk file = Tempfile.new(@filename || "sup-attachment") file.print @raw_content -- William