Commit 4c2743b1 authored by Joel Rosdahl's avatar Joel Rosdahl
Browse files

* lyskom-buttons.el (lyskom-view-url-windows): Rewritten (based on

work by Klaus Zeuge).

* compatibility.el (w32-shell-execute): New dummy function.

* vars.el.in (kom-windows-browser-command): New variable.

* option-edit.el (lyskom-customize-buffer-format): Added
kom-windows-browser-command.
(lyskom-custom-variables): Added kom-windows-browser-command.

* english-strings.el (lyskom-custom-strings): Added
kom-windows-browser-command-doc.
(lyskom-custom-strings): Added kom-windows-browser-command-tag.

* swedish-strings.el (lyskom-custom-strings): Added
kom-windows-browser-command-doc.
(lyskom-custom-strings): Added kom-windows-browser-command-tag.
parent 8e1fdf3c
2002-03-02 Joel Rosdahl <joel@lysator.liu.se>
* lyskom-buttons.el (lyskom-view-url-windows): Rewritten (based on
work by Klaus Zeuge).
* compatibility.el (w32-shell-execute): New dummy function.
* vars.el.in (kom-windows-browser-command): New variable.
* option-edit.el (lyskom-customize-buffer-format): Added
kom-windows-browser-command.
(lyskom-custom-variables): Added kom-windows-browser-command.
* english-strings.el (lyskom-custom-strings): Added
kom-windows-browser-command-doc.
(lyskom-custom-strings): Added kom-windows-browser-command-tag.
* swedish-strings.el (lyskom-custom-strings): Added
kom-windows-browser-command-doc.
(lyskom-custom-strings): Added kom-windows-browser-command-tag.
2002-02-28 Joel Rosdahl <joel@lysator.liu.se>
Made it possible to run the client uncompiled.
......
......@@ -565,6 +565,14 @@ Otherwise treat \\ in NEWTEXT string as special:
(and (bufferp object)
(buffer-name object)))
;;; ======================================================================
;;; Platform-specific stuff
(lyskom-provide-function w32-shell-execute (&rest args)
"Dummy function that raises an error."
(error "w32-shell-execute undefined"))
;;; Local Variables:
;;; eval: (put 'lyskom-provide-macro 'lisp-indent-hook 2)
;;; eval: (put 'lyskom-provide-function 'lisp-indent-hook 2)
......
......@@ -3071,6 +3071,11 @@ be saved in the server. Otherwise it will be saved in your .emacs.")
found in LysKOM. If the first browser in the list cannot handle the type
of URL being opened, then the next browser is tried, and so on.")
(kom-windows-browser-command-doc . "\
This setting specifies the command to use to start a web browser
under Windows. If empty, a couple of commands that are likely the
work on Windows will be tried.")
(kom-mosaic-command-doc . "\
This setting specifies the command to use to start NCSA Mosaic.")
......@@ -3444,6 +3449,7 @@ be saved in the server. Otherwise it will be saved in your .emacs.")
(kom-friends-tag . "Friends and other special people:")
(kom-morons-tag . "Morons and other \"special\" people:")
(kom-url-viewer-preferences-tag . "Open URLs using the following program:")
(kom-windows-browser-command-tag . "Command to start a web browser on Windows:")
(kom-mosaic-command-tag . "Command to start NCSA Mosaic:")
(kom-netscape-command-tag . "Command to start Netscape Navigator:")
(kom-galeon-command-tag . "Command to start Galeon:")
......
......@@ -921,23 +921,53 @@ after formating it as time. This is a LysKOM button action."
(defun lyskom-view-url-windows (url manager)
"View the URL URL in Microsoft Windows. MANGER is the URL manager.
Fall back on Netscape if not running in Microsoft Windows."
(cond ((memq window-system '(win32 mswindows w32))
(let ((programs '("start"
"explorer"
"C:\\Program Files\\Netscape\\Communicator\\Program\\netscape.exe"
"C:\\Program Files\\Netscape\\Navigator\\Program\\netscape.exe")))
(while programs
(condition-case nil
(progn
(start-process (car programs)
nil
(car programs)
url)
(lyskom-url-manager-starting manager)
(setq programs nil))
(error (setq programs (cdr programs)))))))
(t (lyskom-view-url-netscape url manager))))
(cond
((memq window-system '(win32 mswindows w32))
(cond
((and (boundp 'kom-windows-browser-command)
(and (not (null kom-windows-browser-command))
(not (eq (length kom-windows-browser-command) 0))))
;; Explicit given file name of browser, so complain to user if
;; the value is bad.
(if (not (file-executable-p kom-windows-browser-command))
(error (concat "Not an executable file: %s;"
" kom-windows-browser-command has a bad value")
kom-windows-browser-command))
(condition-case nil
(progn
(start-process "Browser"
nil
kom-windows-browser-command
url)
(lyskom-url-manager-starting manager))
(error (error (concat "Failed starting browser using"
" kom-windows-browser-command"
" (%s)")
kom-windows-browser-command))))
((not (memq 'w32-shell-execute lyskom-compatibility-definitions))
(w32-shell-execute "open" url)
(lyskom-url-manager-starting manager))
;;(lyskom-message "Webb via [%s \"%s\" \"%s\"] ..."
;; "w32-shell-execute" "open" url))
(t (let ((programs (list
"start"
"explorer"
(concat "C:\\Program Files\\Netscape"
"\\Communicator\\Program\\netscape.exe")
(concat "C:\\Program Files\\Netscape"
"\\Navigator\\Program\\netscape.exe"))))
(while programs
(condition-case nil
(progn
(start-process (car programs)
nil
(car programs)
url)
(lyskom-url-manager-starting manager)
(setq programs nil))
(error (setq programs (cdr programs)))))))))
(t (lyskom-view-url-netscape url manager))))
(defun lyskom-view-url-netscape (url manager)
......
......@@ -212,6 +212,7 @@
section
"\n"
[kom-url-viewer-preferences]
[kom-windows-browser-command]
[kom-mosaic-command]
[kom-netscape-command]
[kom-galeon-command]
......@@ -605,6 +606,7 @@ customize buffer but do not save them to the server."
(kom-morons (repeat (person nil :tag name) :indent 4))
(kom-url-viewer-preferences (repeat (url-viewer nil :tag viewer-program)
:indent 4))
(kom-windows-browser-command (file))
(kom-mosaic-command (file))
(kom-netscape-command (file))
(kom-galeon-command (file))
......
......@@ -3522,6 +3522,11 @@ i servern. Annars sparas det i din .emacs.")
i listan inte klarar den typ av URL som man frsker ppna s anvnds nsta
lsare och s vidare.")
(kom-windows-browser-command-doc . "\
Denna instllning talar om vilket kommando som skall anvndas fr att starta
en WWW-lsare i Windows. Om fltet r tomt testas ett antal kommandon som
typiskt brukar fungera i Windows.")
(kom-mosaic-command-doc . "\
Denna instllning talar om vilket kommando som skall anvndas fr att starta
Mosaic.")
......@@ -3893,6 +3898,7 @@ i servern. Annars sparas det i din .emacs.")
(kom-friends-tag . "Vnner och bekanta:")
(kom-morons-tag . "Idioter och knppskallar:")
(kom-url-viewer-preferences-tag . "ppna URLer med fljande program:")
(kom-windows-browser-command-tag . "Kommando fr att starta en WWW-lsare i Windows:")
(kom-mosaic-command-tag . "Kommando fr att starta NCSA Mosaic:")
(kom-netscape-command-tag . "Kommando fr att starta Netscape Navigator:")
(kom-galeon-command-tag . "Kommando fr att starta Galeon:")
......
......@@ -870,6 +870,12 @@ kom-url-viewer-preferences and whose PROTOCOLS matches the protocol of
the selected URL is used to view the URL by calling its VIEW-FUNCTION
with the URL and the manager entry as arguments.")
(def-kom-var kom-windows-browser-command ""
"*Program to run to open a URL in Windows. If it is the empty
string, a couple of commands that are likely the work on Windows will
be tried."
server)
(def-kom-var kom-mosaic-command "/usr/local/bin/mosaic"
"*Command to run to start Mosaic."
server)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment