From: danielf
Subject: setting up inspector via browser in clips 2.30 under windows
Date: 
Message-ID: <AmMba.624$w7.4727@newsfep4-glfd.server.ntli.net>
I've been checking the web for this, but have found very little.

I am trying to set up the browser inspector for CLISP 2.30 under windows
(XP). CLISP runs under EMACS, as explained in the common LISP cookbook. All
works fine, except that the default inspector only allows me to inspect very
small objects. Since I am using relatively large objects, I was hoping the
browser facility would give me more info.

I haved tried to get it to work under Netscape and Explorer. Netscape is
featured in the list *browsers*, Explorer isn't, so I added that,conforming
to the syntax used in *browsers*

If I type (inspect object :frontend :http :browser :explorer), explorer
starts, but the explorer page tells me that I either have an old window, or
there is a bug. CLISP now hangs in the inspector loop.

If I try to Netscape (7.02), I get: - Win32 error 2 (ERROR_FILE_NOT_FOUND):
The system cannot find the file specified.
(by the way, Netscape (7.02) is freshly installed

Is this browser inspector supposed to work under Windows? If so, what could
be the source of this problem?

Any ideas would be appreciated, especially when in terms that can be
understood by someone who does not have a degree in Computer Science.

Thanks,

Daniel
From: Joerg Hoehle
Subject: Re: setting up inspector via browser in clips 2.30 under windows
Date: 
Message-ID: <uk7f2t413.fsf@dont.t-systems.UCE.spam.no.com>
"danielf" <·······@microsoft.com> writes:
> works fine, except that the default inspector only allows me to inspect very
> small objects. Since I am using relatively large objects,

This sounds like a typical *print-length* symptom.
(apropos "-length")
CUSTOM:*INSPECT-LENGTH*                    variable
CUSTOM:*INSPECT-PRINT-LENGTH*              variable
*PRINT-LENGTH*                             variable
INTEGER-LENGTH                             function
LIST-LENGTH                                function

Looking up inspector.lisp yields:
(defvar *inspect-print-lines* 5) ; default for `*print-lines*'
(defvar *inspect-print-level* 5) ; default for `*print-level*'
(defvar *inspect-print-length* 10) ; default for `*print-length*'
(defvar *inspect-length* 5)     ; the number of sequence elements to print
The explanation of the standard *print-length* etc. variables can be
looked up in the Common Lisp Hyperspec (CLHS).

[40]> custom:*inspect-length*
5
[44]> (setq custom:*inspect-length* 300)
300
[45]> (inspect (loop for s being the symbols of *package* collect s) :frontend :http)
EXT:BROWSE-URL: no browser specified; please point your browser at
 --> <URL:http://w9f04666.dmst02.telekom.de:4117/0/:s>


Now to the Iexplorer/Netscape problem:

> I've been checking the web for this, but have found very little.
I wrote something to the clisp-users mailing list on the 12th of April
2002.  Anyway, I feel ··········@lists.sourceforge.net is the better
place for such questions, since it'll get to all people involved with
CLISP, not just those who find time to read usenet :-)

> I am trying to set up the browser inspector for CLISP 2.30 under
> windows (XP).

> I haved tried to get it to work under Netscape and Explorer. Netscape is
> featured in the list *browsers*, Explorer isn't, so I added that, conforming
> to the syntax used in *browsers*
It is always helpful to show exactly what you wrote in *browsers*.

> If I try to Netscape (7.02), I get: - Win32 error 2 (ERROR_FILE_NOT_FOUND):
You probably need a full path, not just "netscape".

Here's what I use:
(setq ext:*browsers*
      '(;; Sadly, location of iexplore.exe depends on MS-Windows-95/98/NT/2000/xy/z
        #+win32(:IE "C:\\PROGRA~1\\Internet Explorer\\IEXPLORE.EXE" "~a")
        ;; PROGRA~1 works with "Program Files", "Programme" and hopefully more
        ;; Netscape will detach (run asynchronously) by itself, IE does not.
        #+win32(:netscape "C:\\PROGRA~1\\Netscape\\Communicator\\Program\\netscape.exe" "-browser" "~a")
        #+win32(:emacs-w3 "C:\\PROGRA~1\\emacs-20.7\\gnuserv\\gnudoit.exe" "-q" "(w3-fetch \"~a\")")
        ;; gnuclient/gnudoit are semi-aynchronous
        #+win32(:emacs "C:\\PROGRA~1\\emacs-20.7\\gnuserv\\gnuclient.exe" "~a")
        ))

> Is this browser inspector supposed to work under Windows? If so, what could
> be the source of this problem?

IE can work, but AFAIK, you should not use it via :browser.
You better use :browser nil or omit that part, using
(inspect foo :frontend :http)
Then copy&paste the URL that CLISP tells you into an IE window.

The reason is that CLISP waits for IE to terminate. I don't know how
to start a process asynchronously to CLISP using MS-Windows. Since
CLISP waits for IE, it cannot enter the inspector web-server loop.

Netscape detaches and operates asynchronously to CLISP, but
unfortunately, code in clhs.lisp disturbs it, because it only works on
UNIX. Try out the code below.

> Any ideas would be appreciated, especially when in terms that can be
> understood by someone who does not have a degree in Computer Science.

I filed a bug-report to sourceforge. You should watch that.
http://sourceforge.net/tracker/index.php?func=detail&aid=703627&group_id=1355&atid=101355

Here's a function to modify, if you want to use netscape. I changed
the :WAIT in run-program.

(in-package "SYSTEM")
(defun browse-url (url &key (browser *browser*) (out *standard-output*))
  "Run the browser (a keyword in `*browsers*' or a list) on the URL."
  (let* ((command
          (etypecase browser
            (list browser)
            (symbol (or (cdr (assoc browser *browsers* :test #'eq))
                        (error "unknown browser: `~s' (must be a key in `~s')"
                               browser '*browsers*)))))
         (args (mapcar (lambda (arg) (format nil arg url)) (cdr command))))
    (cond (command
           (when out
             (format out "~&;; running [~s~{ ~s~}]..." (car command) args)
             (force-output (if (eq out t) *standard-output* out)))
           (run-program (car command) :arguments args
		:wait #+unix nil #-unix t)
           (when out
             (format out "done~%")))
          ((format t "~s: no browser specified; please point your browser at~%~
--> <URL:~a>~%" 'browse-url url)))))

Regards,
	Jorg Hohle
Telekom/T-Systems Technology Center