Hello,
Recently, activating attachments has stopped working. (I can''t be more
specific about when this started; it could have been at the upgrade to
0.4, or weeks after, I''m not sure.) I get a message like
"Couldn''t view
the attachment, opening as text", which obviously doesn''t work
well for
a large variety of attachments.
I verified that sup is detecting the correct mime-type, and that saving
the file to disk and manually running "see" did the Right Thing. I
also
tried adding a hook; the contents of my ~/.sup/hooks/mime-view.rb:
system "xmessage -default okay In the hook."
system "see #{content_type}:#{filename}"
return true
The xmessage window appears. Still, this is pieced together from the
examples on the wiki and the comments in message-chunks.rb; I have no
real knowledge of Ruby. Please let me know if I''ve written nonsense.
In any case, still no luck.
Any clues on what I should do? Thanks.
~d
Reformatted excerpts from Daniel Wagner''s message of 2008-02-18:> Recently, activating attachments has stopped working.You know, in reexamining this code, I think there is a silly bug here, and I think it also caused the weirdness that John Bent was experiencing a few weeks ago. Can you try the latest (master/next) from git, or apply the following patch: diff --git a/lib/sup/message-chunks.rb b/lib/sup/message-chunks.rb index 0606395..ba8b846 100644 --- a/lib/sup/message-chunks.rb +++ b/lib/sup/message-chunks.rb @@ -126,7 +126,7 @@ EOS path = write_to_disk ret = HookManager.run "mime-view", :content_type => @content_type, :filename => path - view_default! path unless ret + ret || view_default!(path) end def write_to_disk> system "xmessage -default okay In the hook." > system "see #{content_type}:#{filename}" > return trueThis looks fine, though I would change the last line to just $?.success? which will evaluate to true iff the see command was successful. With the above change, everything should Just Work (tm). -- William <wmorgan-sup at masanjin.net>
Excerpts from William Morgan''s message of Tue Feb 19 10:32:57 -0700 2008:> Reformatted excerpts from Daniel Wagner''s message of 2008-02-18: > > Recently, activating attachments has stopped working. > > You know, in reexamining this code, I think there is a silly bug here, > and I think it also caused the weirdness that John Bent was experiencing > a few weeks ago. >That''s a relief. I thought I was the cause of the weirdness. This works great; thanks. Now my hooks/mime-view.rb (for a mac) is: ########################### system "open ''#{filename}''" ########################### Thanks all! John
Reformatted excerpts from John Bent''s message of 2008-02-19:> That''s a relief. I thought I was the cause of the weirdness. This > works great; thanks.Good to hear. Stupidest bug evar. Don''t know how I missed it before. -- William <wmorgan-sup at masanjin.net>
Reformatted excerpts from William Morgan''s message of 2008-02-19:> Reformatted excerpts from Daniel Wagner''s message of 2008-02-18: > > system "xmessage -default okay In the hook." > > system "see #{content_type}:#{filename}" > > return true > > This looks fine, though I would change the last line to just > $?.success?Never mind that. Remove the last (and first!) line completely. Kernel#system returns true iff the command is successful. -- William <wmorgan-sup at masanjin.net>
Excerpts from William Morgan''s message of Tue Feb 19 09:32:57 -0800 2008:> Reformatted excerpts from Daniel Wagner''s message of 2008-02-18: > > Recently, activating attachments has stopped working. > > You know, in reexamining this code, I think there is a silly bug here, > and I think it also caused the weirdness that John Bent was experiencing > a few weeks ago. > > Can you try the latest (master/next) from git, or apply the following > patch:Applied it (by hand), still no joy. BUT! On a little more digging, it looks like the #{} syntax wasn''t properly escaping spaces in the filename. A few \" later, I''m back in business. system "see #{content_type}:\"#{filename}\"" Thanks, ~d