Lisp HUG Maillist Archive

sys::open-url doesn't check $PATH

Hi.

Is the code for #'sys::open-url available anywhere?

I'm running lw-7.1, x86-64 on a linux machine here.  It seems #'open-url
doesn't do what the docs suggest, checking for candidate executables
(browsers) in $PATH.

firefox is installed as /usr/local/bin/firefox

   CL-USER> (sys::open-url "file:///usr/lib64/LispWorks/lib/7-1-0-0/manual/online/LW/html/lw-736.htm#77892")

shows a gui window with an error message:

 "Error running browser.  Not an executable to call-process: /usr/bin/firefox"

and the set of hardcoded alternatives of standard browsers to choose from.

Some more info:

   (setq sys::*browser-location*  :unset)  ;; same behavior if set to nil
   :UNSET
   CL-USER> (sys::getenv "PATH")
   "/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/home/andersvi/.local/bin:/home/andersvi/bin"
   CL-USER> (sys::call-system-showing-output "which firefox")
   ; which firefox
   ; /usr/local/bin/firefox

Using #'sys::call-system or #'sys::open-pipe work as expected:

   CL-USER> (sys::call-system "firefox file:///usr/lib64/LispWorks/lib/7-1-0-0/manual/online/LW/html/lw-736.htm#77892")
   0

I can't find any sources for the hqn-web module referred to in the docs,

Any suggestions?

-anders

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Re: sys::open-url doesn't check $PATH

Hi,

try (setf (HQN-WEB::DB-BROWSER-LOCATION) "/usr/local/bin/")

Best regards,

Leif Hammarström


On 5.1.2018 12:27, anders.vinjar@bek.no wrote:
> Hi.
>
> Is the code for #'sys::open-url available anywhere?
>
> I'm running lw-7.1, x86-64 on a linux machine here.  It seems #'open-url
> doesn't do what the docs suggest, checking for candidate executables
> (browsers) in $PATH.
>
> firefox is installed as /usr/local/bin/firefox
>
>     CL-USER> (sys::open-url "file:///usr/lib64/LispWorks/lib/7-1-0-0/manual/online/LW/html/lw-736.htm#77892")
>
> shows a gui window with an error message:
>
>   "Error running browser.  Not an executable to call-process: /usr/bin/firefox"
>
> and the set of hardcoded alternatives of standard browsers to choose from.
>
> Some more info:
>
>     (setq sys::*browser-location*  :unset)  ;; same behavior if set to nil
>     :UNSET
>     CL-USER> (sys::getenv "PATH")
>     "/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/home/andersvi/.local/bin:/home/andersvi/bin"
>     CL-USER> (sys::call-system-showing-output "which firefox")
>     ; which firefox
>     ; /usr/local/bin/firefox
>
> Using #'sys::call-system or #'sys::open-pipe work as expected:
>
>     CL-USER> (sys::call-system "firefox file:///usr/lib64/LispWorks/lib/7-1-0-0/manual/online/LW/html/lw-736.htm#77892")
>     0
>
> I can't find any sources for the hqn-web module referred to in the docs,
>
> Any suggestions?
>
> -anders
>
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> lisp-hug@lispworks.com
> http://www.lispworks.com/support/lisp-hug.html


---
This email has been checked for viruses by AVG.
http://www.avg.com


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Re: sys::open-url doesn't check $PATH

Hei Leif.

    L> try (setf (HQN-WEB::DB-BROWSER-LOCATION) "/usr/local/bin/")

Thanks for this suggestion, but this seems more like a hack.

I'm making software for others to run, so would prefer open-url to do
what it says in its docs, to check for browser candidates in the users
PATH environment variable.

Cheers,

-anders

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Re: sys::open-url doesn't check $PATH

Unable to parse email body. Email id is 14708

Re: sys::open-url doesn't check $PATH

    M> The problem is that the location is cached when you call
    M> sys:open-url for the first time.  If you set
    M> lw:*browser-location* to nil before the first call to
    M> sys:open-url then it should work as documented.

Right, that did the job for me locally.  Thanks.

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Updated at: 2020-12-10 08:30 UTC