On Thu, 25 Jun 2009, Sherlock Ric wrote:
> As Devon suggests the problem is because no PDF reader has been
> specified.  However looking at the code, the only way the line
> causing the error can run is if Harvey is actually running the
> commands in jwdw. I suspect the error is caused because the
> resulting wd call is "bad": wd 'winexec * "some file.pdf"'
> 
> This is probably a bug that needs fixing - i.e. add an extra check
> before trying to display the file to make sure that 0 <
> #PDFREADER_j_.
> 
> Additionally it would be nice to be able to optionally suppress the
> display of the file in the viewer even if one is specified.  This is
> possible when writing to other file formats by preventing the
> display of the isigraph window using the "visible 0" option and then
> using one of the copy commands (clip, print, save, get) to work with
> the plot.  Perhaps the "visible" option could be reused here too?

In your patch I notice plot use hostcmd (based on 2!:0) to display
pdf.  This is not an issue of this patch itself.  The window
counter-part use winexec which should behave like spawn so it will not
wait for child process to terminate.  I suggest it would be more
sensible to use a hostcmd that based on 2!:1, Similarly for browser
command, but wait, how to get help inside jconsole?
 

Index: plot/out/pdf/util.ijs
===================================================================
--- plot/out/pdf/util.ijs       (revision 532)
+++ plot/out/pdf/util.ijs       (working copy)
@@ -73,11 +73,13 @@
   else.
     info msg,'The file name is invalid.' return. end.
 end.
-if. 0 = 4!:0 <'PDFREADER_j_' do.
-  if. IFUNIX do.
-    hostcmd (dquote PDFREADER_j_),' ',dquote file
-  else.
-    wd 'winexec *',PDFREADER_j_,' ',dquote file
+if. VISIBLE *. 0 = 4!:0 <'PDFREADER_j_' do.
+  if. #PDFREADER_j_ do.
+    if. IFUNIX do.
+      hostcmd (dquote PDFREADER_j_),' ',dquote file
+    else.
+      wd 'winexec *',PDFREADER_j_,' ',dquote file
+    end.
   end.
 end.
 )

-- 
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to