From mboxrd@z Thu Jan 1 00:00:00 1970 From: johnbent@lanl.gov (John Bent) Date: Wed, 30 Jan 2008 10:54:22 -0700 Subject: [sup-talk] missing run-mailcap In-Reply-To: <1201714011-sup-6178@south> References: <1201019996-sup-8960@tangerine.lanl.gov> <1201041081-sup-6034@tangerine.lanl.gov> <1201210323-sup-6116@tangerine.lanl.gov> <1201216741-sup-4105@south> <1201218489-sup-3542@tangerine.lanl.gov> <1201220092-sup-8263@south> <1201222453-sup-1190@spooky.local> <1201235901-sup-7426@tangerine.lanl.gov> <1201307667-sup-2659@tangerine.lanl.gov> <1201714011-sup-6178@south> Message-ID: <1201715536-sup-6254@tangerine.lanl.gov> Excerpts from William Morgan's message of Wed Jan 30 10:29:30 -0700 2008: > Reformatted excerpts from John Bent's message of 2008-01-25: > > The hook works (system "open \'#{filename}\'"), but sup thinks it is > > failing. I get a message saying view failed, displaying as text. > > Maybe it should be (! system "open \'#{filename}\'") ? > > Weird. Kernel#system returns true if the command succeeded and false > otherwise, so it should work as is. > > You could try: > system "open '#{filename}'" > $?.success? > same problem. the attachment is successfully opened but sup thinks it failed and sup displays it as text. > But there's no reason that should work and the original shouldn't. You > don't have a debugging print statement or anything like that as the > final line of the hook, do you? > nope, just the exact two lines you supplied above. I wonder if the problem is that system isn't correctly understanding the return value from open? tangerine:~>open K.png tangerine:~>echo $? 0 hmmm, I would think 0 is the expected success value? How could I reverse true and false? I'm curious to try that but ! $?.success? $?.success?true:false don't work, they error out and sup defaults to run-mailcap. John