>>>> (SJ)Simon Josefsson <jas(a)extundo.com> Sep/13/01
05:01pm:
SJ> So, is this OK? (CVS history seem to be limited so I couldn't check
SJ> the copyright situation, I simply copied it from menubar-items.el.)
On a slightly different note, several of these browsers I've never
heard of and certainly do not have on my machine. (I have
netscape/lynx/w3 on unix and IE/lynx/w3 on windows).
So, my suggestion is to change the browse-url-menu to something that
checks for which browsers are installed on the machine.
(defvar browse-url-menu
'("%_Open URLs With"
[w3...]
[netscape ...]
,@(if (and mosaic-program (executable-find mosaic-program))
`([mosaic ...]))
,@(if (and grail-program (executable-find grail-program))
`([grail ...]))
,@(if (and kde-program (executable-find kde-program))
`([kde ...]))
...))
-jeff
SJ> (cond ((featurep 'xemacs)
SJ> (defvar browse-url-menu
SJ> '("%_Open URLs With"
SJ> ["%_Emacs-W3"
SJ> (customize-set-variable 'browse-url-browser-function
'browse-url-w3)
SJ> :style radio
SJ> :selected (eq browse-url-browser-function 'browse-url-w3)
SJ> :active (and (fboundp 'browse-url-w3)
SJ> (fboundp 'w3-fetch))]...
SJ> ["%_Netscape"
SJ> (customize-set-variable 'browse-url-browser-function
SJ> 'browse-url-netscape)
SJ> :style radio
SJ> :selected (eq browse-url-browser-function 'browse-url-netscape)
SJ> :active (fboundp 'browse-url-netscape)]
SJ> ["%_Mosaic"
SJ> (customize-set-variable 'browse-url-browser-function
SJ> 'browse-url-mosaic)
SJ> :style radio
SJ> :selected (eq browse-url-browser-function 'browse-url-mosaic)
SJ> :active (fboundp 'browse-url-mosaic)] ...
SJ> ["%_Lynx (xterm)"
SJ> (customize-set-variable 'browse-url-browser-function
SJ> 'browse-url-lynx-xterm)
SJ> :style radio
SJ> :selected (eq browse-url-browser-function 'browse-url-lynx-xterm)
SJ> :active (fboundp 'browse-url-lynx-xterm)]
SJ> ["L%_ynx (xemacs)"
SJ> (customize-set-variable 'browse-url-browser-function
SJ> 'browse-url-lynx-emacs)
SJ> :style radio
SJ> :selected (eq browse-url-browser-function 'browse-url-lynx-emacs)
SJ> :active (fboundp 'browse-url-lynx-emacs)]
SJ> ["%_Grail"
SJ> (customize-set-variable 'browse-url-browser-function
SJ> 'browse-url-grail)
SJ> :style radio
SJ> :selected (eq browse-url-browser-function 'browse-url-grail)
SJ> :active (fboundp 'browse-url-grail)]
SJ> ["%_Kde"
SJ> (customize-set-variable 'browse-url-browser-function
SJ> 'browse-url-kde)
SJ> :style radio
SJ> :selected (eq browse-url-browser-function 'browse-url-kde)
SJ> :active (fboundp 'browse-url-kde)]
SJ> ["Mo%_zilla"
SJ> (customize-set-variable 'browse-url-browser-function
SJ> 'browse-url-gnome-moz)
SJ> :style radio
SJ> :selected (eq browse-url-browser-function 'browse-url-gnome-moz)
SJ> :active (fboundp 'browse-url-gnome-moz)]
SJ> ["G%_aleon"
SJ> (customize-set-variable 'browse-url-browser-function
SJ> 'browse-url-galeon)
SJ> :style radio
SJ> :selected (eq browse-url-browser-function 'browse-url-galeon)
SJ> :active (fboundp 'browse-url-galeon)]
SJ> ["%_MMM"
SJ> (customize-set-variable 'browse-url-browser-function
SJ> 'browse-url-mmm)
SJ> :style radio
SJ> :selected (eq browse-url-browser-function 'browse-url-mmm)
SJ> :active (fboundp 'browse-url-mmm)]
SJ> ["MS-Windows Default %_Browser"
SJ> (customize-set-variable 'browse-url-browser-function
SJ> 'browse-url-default-windows-browser)
SJ> :style radio
SJ> :selected (eq browse-url-browser-function
'browse-url-default-windows-browser)
SJ> :active (and (fboundp 'mswindows-shell-execute)
SJ> (fboundp 'browse-url-default-windows-browser))]
SJ> ["G%_eneric Browser"
SJ> (customize-set-variable 'browse-url-browser-function
SJ> 'browse-url-generic)
SJ> :style radio
SJ> :selected (eq browse-url-browser-function 'browse-url-generic)
SJ> :active (and (boundp 'browse-url-generic-program)
SJ> browse-url-generic-program
SJ> (fboundp 'browse-url-generic))]
SJ> ))
...