Commit 784f3a5c authored by David Byers's avatar David Byers
Browse files

Added new URL manager 'windows' that is suitable for MS Windows users

(and for most Unix users.)
Protect lyskom-ispell-dictionary-widget from ispell failing to load.
parent cb50cdf1
2000-02-26 <davby@ida.liu.se>
* option-edit.el (lyskom-ispell-dictionary-widget): Protect this
agains ispell not being available or failing to load.
2000-02-21 <davby@ida.liu.se>
* vars.el.in (kom-url-managers): Added "windows" url manager.
(kom-url-viewer-preferences): Use "windows" instead of "netscape"
as default url manager.
2000-02-20 <davby@ida.liu.se>
* lyskom-buttons.el (lyskom-view-url-netscape): Added more
......
......@@ -2143,6 +2143,7 @@ Select whether to execute command or keyboard macro.")
(no-viewer . "(ingenting valt)")
(default-viewer . "Browse-URL (all)")
(netscape-viewer . "Netscape Navigator (all)")
(windows-viewer . "Windows default or Netscape (all)")
(emacs-w3-viewer . "Emacs W3-mode (HTTP, Goper, FTP)")
(emacs-general-viewer . "Emacs (FTP, Telnet, Mail)")
(emacs-dired-viewer . "Emacs Dired (FTP)")
......
......@@ -821,6 +821,30 @@ This is a LysKOM button action."
(mail nil (substring url (match-beginning 1) (match-end 1))))
(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 ((or (eq window-system 'win32)
(eq window-system 'mswindows)
(eq window-system '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))))
(defun lyskom-view-url-netscape (url manager)
"View the URL URL using Netscape Navigator. The second argument
MANAGER is the URL manager that started Netscape.
......
......@@ -827,27 +827,42 @@ customize buffer but do not save them to the server."
propl))
(defun lyskom-ispell-dictionary-widget (type &optional args propl)
(require 'ispell)
(lyskom-build-simple-widget-spec
'menu-choice
(list ':format "%[%t%] %v"
':case-fold nil
':args
(cons (list 'item
':tag "ispell-dictionary"
':format "%t"
':value nil)
(delq nil
(mapcar
(function
(lambda (x)
(and (car x)
(list 'item
':tag (car x)
':format "%t"
':value (car x)))))
ispell-dictionary-alist))))
propl))
(let ((tmp-dictionary-alist nil))
(condition-case nil
(require 'ispell)
(setq tmp-dictionary-alist ispell-dictionary-alist)
(error (if (null ispell-dictionary-alist)
(setq tmp-dictionary-alist '("american" "brasiliano"
"british" "castellano"
"castellano8" "czech"
"dansk" "deutsch"
"deutsch8" "english"
"esperanto" "esperanto-tex"
"francais7" "francais"
"francais-tex" "nederlands"
"nederlands8" "norsk"
"norsk7-tex" "polish"
"russian" "svenska")))))
(lyskom-build-simple-widget-spec
'menu-choice
(list ':format "%[%t%] %v"
':case-fold nil
':args
(cons (list 'item
':tag "ispell-dictionary"
':format "%t"
':value nil)
(delq nil
(mapcar
(function
(lambda (x)
(and (car x)
(list 'item
':tag (car x)
':format "%t"
':value (car x)))))
tmp-dictionary-alist))))
propl)))
(defun lyskom-url-viewer-widget (type &optional args propl)
(lyskom-build-simple-widget-spec
......@@ -864,6 +879,10 @@ customize buffer but do not save them to the server."
':tag (lyskom-custom-string 'default-viewer)
':format "%t"
':value "default")
(list 'item
':tag (lyskom-custom-string 'windows-viewer)
':format "%t"
':value "windows")
(list 'item
':tag (lyskom-custom-string 'netscape-viewer)
':format "%t"
......
......@@ -2200,6 +2200,7 @@ Du m
(no-viewer . "(ingenting valt)")
(default-viewer . "Browse-URL (alla)")
(netscape-viewer . "Netscape Navigator (alla)")
(windows-viewer . "Windows standard eller Netscape (alla)")
(emacs-w3-viewer . "Emacs W3-mode (HTTP, Goper, FTP)")
(emacs-general-viewer . "Emacs (FTP, Telnet, Mail)")
(emacs-dired-viewer . "Emacs Dired (FTP)")
......
......@@ -720,8 +720,8 @@ BUTTON-ARG-MATCH is the number of the expression to used as the button argument.
FACE is the text face to apply to the button, or nil to use the default face.")
(def-kom-var kom-url-viewer-preferences '("emacs"
"netscape"
"w3")
"windows"
"w3")
"*LysKOM will attempt to use URL viewers in the order specified here.
kom-url-managers is a list of all available viewers. Note that the elements
......@@ -746,6 +746,10 @@ to some URL viewers."
"\\(http\\|gopher\\|ftp\\)"
"Emacs W3"
lyskom-view-url-w3)
("windows"
".*"
"Windows web brower"
lyskom-view-url-windows)
("netscape"
".*"
"Netscape Navigator"
......
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