Subject: [clisp-list] [clisp-lisp] clhs -> browse-url

From: lin8080 <[email-masked]>
Date: Fri Apr 12 17:23:08 2002

Thank you very much. It is good to have some light in the darkside deeps
of the pc-internals.

.............................
> Arseny Slobodjuck wrote: 

I copy the lines in here.

[59]> (apropos 'browser)
*BROWSER*                                  variable
*BROWSERS*                                 variable
*INSPECT-BROWSER*                          variable
:BROWSER                                   constant
SYSTEM::BROWSER
BROWSER

[60]> *browser*
NIL

[61]> *browsers*
((:NETSCAPE "netscape" "-remote" "openURL(~a,new-window)")
 (:KONQUEROR "kfmclient" "openURL" "~a") (:LYNX "xterm" "-e" "lynx"
"~a")
 (:W3M "xterm" "-e" "w3m" "~a") (:MMM "mmm" "-external" "~a")
 (:MOSAIC "xmosaic" "~a") (:EMACS-W3 "gnudoit" "-q" "(w3-fetch
\"~a\")"))

[62]> (setf *browser* :netscape)
:NETSCAPE

[63]> (clhs 'apropos)
;; running ["netscape" "-remote"
"openURL(file://C|/LISP/HYPER1/Front/X_Master.h
tm/Body/fun_aproposcm_apropos-list.html,new-window)"]...
[pathname.d:10275]
*** - Win32 error 2 (ERROR_FILE_NOT_FOUND): The system cannot find the
file spec
ified.

1. Break [64]> abort

[65]> (push '(:netscape
"c:\prgra~1\netscape\commun~1\program\netscape.exe"
) *browsers*)
((:NETSCAPE "c:prgra~1netscapecommun~1programnetscape.exe" "~A")
 (:NETSCAPE "netscape" "-remote" "openURL(~a,new-window)")
 (:KONQUEROR "kfmclient" "openURL" "~a") (:LYNX "xterm" "-e" "lynx"
"~a")
 (:W3M "xterm" "-e" "w3m" "~a") (:MMM "mmm" "-external" "~a")
 (:MOSAIC "xmosaic" "~a") (:EMACS-W3 "gnudoit" "-q" "(w3-fetch
\"~a\")"))

[66]> (clhs 'apropos)
;; running ["c:prgra~1netscapecommun~1programnetscape.exe"
"file://C|/LISP/HYPER
1/Front/X_Master.htm/Body/fun_aproposcm_apropos-list.html"]...
[pathname.d:10275]
*** - Win32 error 2 (ERROR_FILE_NOT_FOUND): The system cannot find the
file spec
ified.
1. Break [67]>

I see there is the "\" not work so I do change this to [shift + 7] "/" :

[68]> (push '(:netscape
"C:/Progra~1/netscape/commun~1/program/netscape.exe" "~A
") *browsers*)
((:NETSCAPE "C:/Progra~1/netscape/commun~1/program/netscape.exe" "~A")
 (:NETSCAPE "c:prgra~1netscapecommun~1programnetscape.exe" "~A")
 (:NETSCAPE "netscape" "-remote" "openURL(~a,new-window)")
 (:KONQUEROR "kfmclient" "openURL" "~a") (:LYNX "xterm" "-e" "lynx"
"~a")
 (:W3M "xterm" "-e" "w3m" "~a") (:MMM "mmm" "-external" "~a")
 (:MOSAIC "xmosaic" "~a") (:EMACS-W3 "gnudoit" "-q" "(w3-fetch
\"~a\")"))

[69]> (clhs 'apropos)
;; running ["C:/Progra~1/netscape/commun~1/program/netscape.exe"
"file://C|/LISP
/HYPER1/Front/X_Master.htm/Body/fun_aproposcm_apropos-list.html"]...done
NIL
[70]>

Wow. Now the Netscape-Browser-Window opens and a little nice message
appears: Could not find file... Hm. I gues this is the "file://C..."
error from config.lisp. But I will check this later. (maybe
"local://..." works?)

The other (new) problem is now: In [68] you can see 3 lines with
:Netscape. How can I delete the wrong 2 lines in the *browsers* variable
? (and the rest-browsers that are not on my system (:konqueror, :w3m,
:mosaik). 

More and more I saw CLisp is something very fine.

...............................
> Hoehle, Joerg-Cyril wrote :

> The first place to look for is the CLISP implementation notes. 

Yes. Thank you. Most I looked in the clhs are the definitions to the
commands. Is there a version-number ? copyright 1996. (19-08-96; the
xanalys: 03-01-02)

> My opinion: starting a program is highly dependent on OS and
> user configuration. A hook should be provided for this purpose,
> not a hard coded run-program with non-standard keywords.

Not quite sure for that. The thing is named "portable" and I mean this
should work without big differences made by/to the OS (why is there a
config.lisp shipped? or why is sometimes the ./clsrc (?do not know the
exact name) for additional user demands?)

But don't worry. I assembled an old P75 on Monday (till Wednesday) and I
installed SCO UnixWare 7.0.1 in a 60 day trail-version. So I hope I find
the time (and some luck of course) to run clisp there. (It installed the
netscape gold 3.0.2 (Jan/99).)

> More portable code would query the registry for the application
> associated with ".html" or ".htm"). Who wants to write that?
>   (:default ... sys::registry or new dir-key code ...)
> (setq *browser* :default)

in *.pseudo-code it sounds like this:
{try or test
 browser ... netscape 
 execute netscape (get-response)
on error
 browser ... ie
 execute ie (get-respons)
on error
 print-line ("please enter the path to your Internet-Browser :")
 (setf *browser* (read-line ...)
 (+ win-friendly checkbox: remind me later :))
}
something like this ? 

Maybe a big config-file with readme to change things as you need/want is
a better solution? 
(print (actual-settings)) 
> WARNING: could be large file [continue?]

The other thing is, that many Win-User will not like programs who write
something into the registry. This is someway a kind of distrust. (Think
about a good slogan to the marketing-peoples).

> 4) ext:*browser[s]* (or custom:*) should be mentioned in config.lisp
> That's the file that users are supposed to look at. (not clhs.lisp)

aha - yes. I read the readme file. Last week I post the list of
error-messages while trying to compile-file src/config.lisp and I report
the win32-error while running (saveinitmem). Therefore I can not say
something about the status of my clisp 2.28, but it seems to work ok. 

Therefor I have a similar problem with pathname:
On suse 7.3 I did:

 (setf user-homedir-pathname 
             "/home/meiner/lisp/metest/")
 (setf metest (make-pathname :name "test" :type "lisp"))

and I want to have :type "lis" + :type "lsp". Since I ended that night
with that I do not try some more to this, like :type "lisp,lis,lsp" or
something else.

.........................................
sam wrote:

(yes I browse to the online impnotes. Big : a h a)

> if dir-key is made into a module, we will have to stick to
> sys::registry which looks only under one root.
> is this browser setting there?
> I don't have a w32 box to check.

> actually, this is not even necessary.
> IIUC, if you tell w32 to "run" an HTML file, it will start a browser.
> (cf. Emacs `w32-shell-execute').

Here I list some possible entries to the win98 registry.

in:

HKEY_CLASSES_ROOT\ .htm
 bzw.
HKEY_CLASSES_ROOT\ .html

If this entry is "htmlfile" the win32 starts the ie-browser. Otherwise
you can set "NetscapeMarkup" as value, then win32 runs the
netscape-browser when a htm-file is doubleclicked/called.

The Internet-Options are in "Extras" -> "Internetoptionen" and goes to
the registry-key :

HKEY_CURRENT_USER\ Software\ Policies\ Microsoft\ Internet Explorer\
Control Panel
(there is an option:)

"Auf Internet Explorer als Standardbrowser überprüfen" (check if ie is
standart-browser)
 Check_If_Default	REG_DWORD	Boolean	0
(if set to 1 this could be no longer changed!)

and in :

HKEY_LOCAL_MACHINE\ SOFTWARE\ Microsoft\ Windows\ CurrentVersion

there are 3 entries:

ProgramFilesDir [with Dat-type] REG_SZ

ProgramFilesPath [with Dat-type] REG_EXPAND_SZ
 (usualy the instal-path for new programs)

CommonFilesDir [with Dat-type] REG_SZ 
 (these are the common-files)
  most software ask this during the install-process or setup routine.

The other way is (on NT, not win98, 2000?, ME?) from the command-prompt
(start ->run-program : command.com ; opens a dos-box) (to link the
*.ending with a programm) :

ASSOC shows the actuel extension
FTYPE shows the link to an application

example:

ASSOC .ME=READMEDatei
FTYPE READMEDatei=winnt\system32\notepad.exe %1 

But one can add these to the registry, HKEY_CLASSES_ROOT\ newValue... or
via menue/file/associate :) why clisp opens when I click on an
*.lisp-file. btw I add the domino-icon to my desktop for clisp.
--------------------

Now typing and searching and testing about 3 houers :) bed is calling.
(bye)

stefan