1 ;;; browse-url.el --- ask a WWW browser to load a URL
3 ;; Copyright 1995 Free Software Foundation, Inc.
5 ;; Author: Denis Howe <dbh@doc.ic.ac.uk>
6 ;; Maintainer: Denis Howe <dbh@doc.ic.ac.uk>
7 ;; Created: 03 Apr 1995
8 ;; Version: 0.26 13 Jan 1996
10 ;; X-Home page: http://wombat.doc.ic.ac.uk/
12 ;; This file is part of GNU Emacs.
14 ;; GNU Emacs is free software; you can redistribute it and/or modify
15 ;; it under the terms of the GNU General Public License as published
16 ;; by the Free Software Foundation; either version 1, or (at your
17 ;; option) any later version.
19 ;; GNU Emacs is distributed in the hope that it will be useful, but
20 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 ;; General Public License for more details.
24 ;; You should have received a copy of the GNU General Public License
25 ;; along with GNU Emacs; see the file COPYING. If not, write to the
26 ;; Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
28 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
31 ;; The latest version of this package should be available from
32 ;; <URL:http://wombat.doc.ic.ac.uk/emacs/browse-url.el>.
34 ;; This package provides functions which read a URL (Uniform Resource
35 ;; Locator) from the minibuffer, defaulting to the URL around point,
36 ;; and ask a World-Wide Web browser to load it. It can also load the
37 ;; URL associated with the current buffer. Different browsers use
38 ;; different methods of remote control so there is one function for
39 ;; each supported browser. If the chosen browser is not running, it
40 ;; is started. Currently there is support for:
42 ;; Function Browser Earliest version
43 ;; browse-url-netscape Netscape 1.1b1
44 ;; browse-url-mosaic XMosaic <= 2.4
45 ;; browse-url-cci XMosaic 2.5
47 ;; browse-url-iximosaic IXI Mosaic ?
48 ;; browse-url-lynx-* Lynx 0
50 ;; Note that versions of Netscape before 1.1b1 did not have remote
51 ;; control. <URL:http://www.netscape.com/newsref/std/x-remote.html>
52 ;; and <URL:http://www.netscape.com/info/APIs/>.
54 ;; Netscape can cache Web pages so it may be necessary to tell it to
55 ;; reload the current page if it has changed (e.g. if you have edited
56 ;; it). There is currently no perfect automatic solution to this.
58 ;; Netscape allows you to specify the id of the window you want to
59 ;; control but which window DO you want to control and how do you
62 ;; If using XMosaic before version 2.5, check the definition of
63 ;; browse-url-usr1-signal below.
64 ;; <URL:http://www.ncsa.uiuc.edu/SDG/Software/XMosaic/remote-control.html>
66 ;; XMosaic version 2.5 introduced Common Client Interface allowing you
67 ;; to control mosaic through Unix sockets.
68 ;; <URL:http://www.ncsa.uiuc.edu/SDG/Software/XMosaic/CCI/cci-spec.html>
70 ;; William M. Perry's excellent "w3" WWW browser for
71 ;; Emacs <URL:ftp://cs.indiana.edu/pub/elisp/w3/>
72 ;; has a function w3-follow-url-at-point, but that
73 ;; doesn't let you edit the URL like browse-url.
75 ;; I recommend Nelson Minar <nelson@santafe.edu>'s excellent
76 ;; html-helper-mode.el for editing HTML and thank Nelson for
77 ;; his many useful comments on this code.
78 ;; <URL:http://www.santafe.edu/~nelson/hhm-beta/>
80 ;; This package generalises function html-previewer-process in Marc
81 ;; Andreessen <marca@ncsa.uiuc.edu>'s html-mode (LCD
82 ;; modes/html-mode.el.Z) and provides better versions of the URL
83 ;; functions in Michelangelo Grigni <mic@cs.ucsd.edu>'s ffap.el
84 ;; (find-file-at-point) <URL:ftp://cs.ucsd.edu:/pub/mic/>. The huge
85 ;; hyperbole package also contains similar functions.
87 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
90 ;; Can you write and test some code for the Macintrash and Windoze
91 ;; Netscape remote control APIs? (See the URL above).
93 ;; Do any other browsers have remote control?
95 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
98 ;; Put the following in your ~/.emacs file:
100 ;; (autoload 'browse-url-at-point "browse-url"
101 ;; "Ask a WWW browser to load the URL at or before point." t)
102 ;; (autoload 'browse-url-at-mouse "browse-url"
103 ;; "Ask a WWW browser to load a URL clicked with the mouse." t)
104 ;; (autoload 'browse-url-of-buffer "browse-url"
105 ;; "Ask a WWW browser to display BUFFER." t)
106 ;; (autoload 'browse-url-of-file "browse-url"
107 ;; "Ask a WWW browser to display FILE." t)
108 ;; (autoload 'browse-url-of-dired-file "browse-url"
109 ;; "In Dired, ask a WWW browser to display the file named on this line." t)
111 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
114 ;; To display the URL at or before point:
115 ;; M-x browse-url-at-point RET
117 ;; To display a URL by shift-clicking on it, put this in your ~/.emacs
119 ;; (global-set-key [S-mouse-1] 'browse-url-at-mouse)
121 ;; To display the current buffer in a web browser:
122 ;; M-x browse-url-of-buffer RET
124 ;; In Dired, to display the file named on the current line:
125 ;; M-x browse-url-of-dired-file RET
127 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
128 ;; Customisation (~/.emacs)
130 ;; To see what variables are available for customization, type `M-x
131 ;; set-variable browse-url TAB'.
133 ;; To bind the browse-url commands to keys with the `C-c C-z' prefix
134 ;; (as used by html-helper-mode):
135 ;; (global-set-key "\C-c\C-z." 'browse-url-at-point)
136 ;; (global-set-key "\C-c\C-zb" 'browse-url-of-buffer)
137 ;; (global-set-key "\C-c\C-zv" 'browse-url-of-file)
138 ;; (add-hook 'dired-mode-hook
139 ;; (function (lambda ()
140 ;; (local-set-key "\C-c\C-zf" 'browse-url-of-dired-file))))
141 ;; (if (boundp 'browse-url-browser-function)
142 ;; (global-set-key "\C-c\C-zu" browse-url-browser-function)
143 ;; (eval-after-load "browse-url"
144 ;; '(global-set-key "\C-c\C-zu" browse-url-browser-function)))
146 ;; To use the Emacs w3 browser when not running under X11:
147 ;; (or (eq window-system 'x)
148 ;; (setq browse-url-browser-function 'browse-url-w3))
150 ;; To always save modified buffers before displaying the file in a browser:
151 ;; (setq browse-url-save-file t)
153 ;; To get round the Netscape caching problem, you could try either of
154 ;; the following (but not both). EITHER write-file in
155 ;; html-helper-mode makes Netscape reload the document:
157 ;; (autoload 'browse-url-netscape-reload "browse-url"
158 ;; "Ask a WWW browser to redisplay the current file." t)
159 ;; (add-hook 'html-helper-mode-hook
160 ;; (function (lambda ()
161 ;; (add-hook 'local-write-file-hooks
162 ;; (function (lambda ()
163 ;; (let ((local-write-file-hooks))
165 ;; (browse-url-netscape-reload)
166 ;; t)) ; => file written by hook
167 ;; t)))) ; append to l-w-f-hooks
169 ;; [Does this work for html-mode too?]
171 ;; OR browse-url-of-file asks Netscape to load and then reload the
174 ;; (add-hook 'browse-url-of-file-hook 'browse-url-netscape-reload)
176 ;; You may also want to customise browse-url-netscape-arguments, eg.
178 ;; (setq browse-url-netscape-arguments '("-install"))
180 ;; or similarly for the other browsers.
182 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
185 ;; 0.00 03 Apr 1995 Denis Howe <dbh@doc.ic.ac.uk>
189 ;; All names start with "browse-url-". Added provide.
192 ;; Save file at start of browse-url-of-file.
193 ;; Use start-process instead of start-process-shell-command.
196 ;; Add browse-url-netscape-reload, browse-url-netscape-send.
197 ;; browse-url-of-file save file option.
200 ;; b-u-file-url separate function. Change b-u-filename-alist
204 ;; Added b-u-of-file-hook.
207 ;; Improved .emacs suggestions and documentation.
210 ;; Added browse-url-interactive-arg optional prompt.
213 ;; Exclude final "." from browse-url-regexp.
216 ;; Added mouse-set-point to browse-url-interactive-arg.
219 ;; Added Mosaic signal sending variations.
220 ;; Thanks Brian K Servis <servis@ecn.purdue.edu>.
221 ;; Don't use xprop for Netscape.
224 ;; Fix reading of ~/.mosaicpid. Thanks Dag.H.Wanvik@kvatro.no.
227 ;; Interactive prefix arg => URL *after* point.
228 ;; Thanks Michelangelo Grigni <mic@cs.ucsd.edu>.
229 ;; Added IXI Mosaic support.
230 ;; Thanks David Karr <dkarr@nmo.gtegsc.com>.
233 ;; Exclude final [,;] from browse-url-regexp.
236 ;; Provide browser argument variables.
239 ;; More Netscape options. Thanks Peter Arius
240 ;; <arius@immd2.informatik.uni-erlangen.de>.
243 ;; Added browse-url-at-mouse.
244 ;; Thanks Wayne Mesard <wmesard@sgi.com>
247 ;; Renamed browse-url-at-point to browse-url-url-at-point.
248 ;; Added browse-url-at-point.
249 ;; Thanks Jonathan Cano <cano@patch.tandem.com>.
252 ;; Fixed call to browse-url-url-at-point in browse-url-at-point.
253 ;; Thanks Eric Ding <ericding@San-Jose.ate.slb.com>.
256 ;; Improved documentation.
257 ;; Thanks Kevin Rodgers <kevin.rodgers@ihs.com>.
260 ;; browse-url-of-buffer to handle file-less buffers.
261 ;; browse-url-of-dired-file browses current file in dired.
262 ;; Thanks Kevin Rodgers <kevin.rodgers@ihs.com>.
265 ;; XMosaic CCI functions.
266 ;; Thanks Marc Furrer <Marc.Furrer@di.epfl.ch>.
269 ;; Fixed new-window documentation and added to browse-url-cci.
270 ;; Thanks Dilip Sequeira <djs@dcs.ed.ac.uk>.
273 ;; Added b-u-lynx. Thanks Steven L. Baur <steve@miranova.com>.
276 ;; Renamed b-u-netscape command to b-u-netscape-send.
277 ;; Added b-u-netscape-command variable.
280 ;; Added event-buffer and event-point for XEmacs compatibility.
281 ;; Thanks Eric Engstrom <engstrom@src.honeywell.com>
284 ;; Changed b-u-lynx to b-u-lynx-xterm, added b-u-lynx-emacs to
285 ;; run Lynx in an Emacs buffer under terminal-emulator.
286 ;; Thanks Jari Aalto <jaalto@tre.tele.nokia.fi>
288 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
291 (defvar browse-url-regexp
292 "\\(https?://\\|ftp://\\|gopher://\\|telnet://\\|wais://\\|file:/\\|s?news:\\|mailto:\\)[^]\t\n \"'()<>[^`{}]*[^]\t\n \"'()<>[^`{}.,;]+"
293 "A regular expression probably matching a URL.")
295 (defvar browse-url-browser-function
297 "*Function to display the current buffer in a WWW browser.
298 Used by the `browse-url-at-point', `browse-url-at-mouse', and
299 `browse-url-of-file' commands.")
301 (defvar browse-url-netscape-command "netscape"
302 "*The name by which to invoke Netscape.")
304 (defvar browse-url-netscape-arguments nil
305 "*A list of strings to pass to Netscape as arguments.")
307 (defvar browse-url-new-window-p nil
308 "*If non-nil, always open a new browser window.
309 Passing an interactive argument to \\[browse-url-netscape] or
310 \\[browse-url-cci] reverses the effect of this variable. Requires
311 Netscape version 1.1N or later or XMosaic version 2.5 or later.")
313 (defvar browse-url-mosaic-arguments nil
314 "*A list of strings to pass to Mosaic as arguments.")
316 (defvar browse-url-filename-alist
317 '(("^/+" . "file:/"))
318 "An alist of (REGEXP . STRING) pairs.
319 Any substring of a filename matching one of the REGEXPs is replaced by
320 the corresponding STRING. All pairs are applied in the order given.
321 Used by the `browse-url-of-file' command.")
323 (defvar browse-url-save-file nil
324 "If non-nil, save the buffer before displaying its file.
325 Used by the `browse-url-of-file' command.")
327 (defvar browse-url-of-file-hook nil
328 "A hook to be run with run-hook after `browse-url-of-file' has asked
329 a browser to load a file.
331 Set this to `browse-url-netscape-reload' to force Netscape to load the
332 file rather than displaying a cached copy.")
334 (defvar browse-url-usr1-signal
335 (if (and (boundp 'emacs-major-version)
336 (or (> emacs-major-version 19) (>= emacs-minor-version 29)))
337 'SIGUSR1 ; Why did I think this was in lower case before?
338 30) ; Check /usr/include/signal.h.
339 "The argument to `signal-process' for sending SIGUSR1 to XMosaic.
340 Emacs 19.29 accepts 'SIGUSR1, earlier versions require an integer
341 which is 30 on SunOS and 16 on HP-UX and Solaris.")
343 (defvar browse-url-CCI-port 3003
344 "Port to access XMosaic via CCI.
345 This can be any number between 1024 and 65535 but must correspond to
346 the value set in the browser.")
348 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
351 ;; thingatpt.el doesn't work for complex regexps.
353 (defun browse-url-url-at-point ()
354 "Return the URL around or before point.
355 Then search backwards for the start of a URL. If no URL found, return
357 (if (or (looking-at browse-url-regexp) ; Already at start
358 (let ((eol (save-excursion (end-of-line) (point))))
359 ;; Search forwards for the next URL or end of line in case
360 ;; we're in the middle of one.
361 (and (re-search-forward browse-url-regexp eol 'lim)
362 (goto-char (match-beginning 0)))
363 ;; Now back to where we started or earlier.
364 (re-search-backward browse-url-regexp nil t)))
365 (buffer-substring (match-beginning 0) (match-end 0))
368 ;; Todo: restrict to around or immediately before point. Expand bare
371 (defun browse-url-interactive-arg (&optional prompt)
372 "Read a URL from the minibuffer, optionally prompting with PROMPT.
373 Default to the URL at or before point. If bound to a mouse button,
374 set point to the position clicked. Return the result as a list for
375 use in `interactive'."
376 (let ((event (elt (this-command-keys) 0)))
377 (and (listp event) (mouse-set-point event)))
378 (list (read-string (or prompt "URL: ") (browse-url-url-at-point))))
380 (defun browse-url-at-point ()
381 "Ask a WWW browser to load the URL at or before point.
382 The URL is loaded according to the value of `browse-url-browser-function'."
384 (funcall browse-url-browser-function (browse-url-url-at-point)))
386 ;; Define these if not already defined (XEmacs compatibility)
388 (or (fboundp 'event-buffer)
389 (defmacro event-buffer (event)
390 `(window-buffer (posn-window (event-start ,event)))))
392 (or (fboundp 'event-point)
393 (defmacro event-point (event)
394 `(posn-point (event-start ,event))))
396 (defun browse-url-at-mouse (event)
397 "Ask a WWW browser to load a URL clicked with the mouse.
398 The URL is the one around or before the position of the mouse click
399 but point is not changed. The URL is loaded according to the value of
400 `browse-url-browser-function'."
403 (set-buffer (event-buffer event))
404 (goto-char (event-point event))
405 (let ((url (browse-url-url-at-point)))
406 (if (string-equal url "")
407 (error "No URL found"))
408 (funcall browse-url-browser-function url))))
410 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
411 ;; Browse current buffer
413 (defun browse-url-of-file (&optional file)
414 "Ask a WWW browser to display FILE.
415 Display the current buffer's file if FILE is nil or if called
416 interactively. Turn the filename into a URL by performing
417 replacements given in variable `browse-url-filename-alist'. Pass the
418 URL to a browser using variable `browse-url-browser-function' then run
419 `browse-url-of-file-hook'."
424 (error "Current buffer has no file")))
425 (let ((buf (get-file-buffer file)))
429 (cond ((not (buffer-modified-p)))
430 (browse-url-save-file (save-buffer))
431 (t (message "%s modified since last save" file))))))
432 (funcall browse-url-browser-function (browse-url-file-url file))
433 (run-hooks 'browse-url-of-file-hook))
435 (defun browse-url-file-url (file)
436 "Return the URL corresponding to FILE.
437 Uses variable `browse-url-filename-alist' to map filenames to URLs."
438 (let ((maps browse-url-filename-alist))
440 (let* ((map (car maps))
442 (to-string (cdr map)))
443 (setq maps (cdr maps))
444 (if (string-match from-re file)
445 (setq file (concat (substring file 0 (match-beginning 0))
447 (substring file (match-end 0))))))))
450 (defvar browse-url-temp-file-name nil)
451 (make-variable-buffer-local 'browse-url-temp-file-name)
453 (defvar browse-url-temp-file-list '())
455 (defun browse-url-of-buffer (&optional buffer)
456 "Ask a WWW browser to display BUFFER.
457 Display the current buffer if BUFFER is nil."
460 (set-buffer (or buffer (current-buffer)))
463 (and (boundp 'dired-directory) dired-directory))))
466 (if (null browse-url-temp-file-name)
468 (setq browse-url-temp-file-name
470 (expand-file-name (buffer-name)
471 (or (getenv "TMPDIR") "/tmp"))))
472 (setq browse-url-temp-file-list
473 (cons browse-url-temp-file-name
474 browse-url-temp-file-list))))
475 (write-region (point-min) (point-max) browse-url-temp-file-name
477 (browse-url-of-file (or file-name browse-url-temp-file-name)))))
479 (defun browse-url-delete-temp-file (&optional temp-file-name)
480 ;; Delete browse-url-temp-file-name from the file system and from
481 ;; browse-url-temp-file-list. If optional arg TEMP-FILE-NAME is
482 ;; non-nil, delete it instead, but only from the file system --
483 ;; browse-url-temp-file-list is not affected.
484 (let ((file-name (or temp-file-name browse-url-temp-file-name)))
485 (if (and file-name (file-exists-p file-name))
487 (delete-file file-name)
488 (if (null temp-file-name)
489 (setq browse-url-temp-file-list
490 (delete browse-url-temp-file-name
491 browse-url-temp-file-list)))))))
493 (defun browse-url-delete-temp-file-list ()
494 ;; Delete all elements of browse-url-temp-file-list.
495 (while browse-url-temp-file-list
496 (browse-url-delete-temp-file (car browse-url-temp-file-list))
497 (setq browse-url-temp-file-list
498 (cdr browse-url-temp-file-list))))
500 (add-hook 'kill-buffer-hook 'browse-url-delete-temp-file)
501 (add-hook 'kill-emacs-hook 'browse-url-delete-temp-file-list)
503 (defun browse-url-of-dired-file ()
504 "In Dired, ask a WWW browser to display the file named on this line."
506 (browse-url-of-file (dired-get-filename)))
508 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
509 ;; Browser-specific functions
511 (defun browse-url-netscape (url &optional new-window)
512 "Ask the Netscape WWW browser to load URL.
514 Default to the URL around or before point. The strings in variable
515 `browse-url-netscape-arguments' are also passed to Netscape.
517 When called interactively, if variable `browse-url-new-window-p' is
518 non-nil, load the document in a new Netscape window, otherwise use a
519 random existing one. A non-nil interactive prefix argument reverses
520 the effect of browse-url-new-window-p.
522 When called non-interactively, optional second argument NEW-WINDOW is
523 used instead of browse-url-new-window-p."
525 (interactive (append (browse-url-interactive-arg "Netscape URL: ")
526 (list (not (eq (null browse-url-new-window-p)
527 (null current-prefix-arg))))))
528 (let ((process (apply 'start-process
529 (concat "netscape " url) nil
530 browse-url-netscape-command
531 (append browse-url-netscape-arguments
532 (if new-window '("-noraise"))
534 (concat "openURL(" url
535 (if new-window ",new-window")
537 (set-process-sentinel
539 `(lambda (process change)
540 (or (eq (process-exit-status process) 0)
542 ;; Netscape not running - start it
543 (message "Starting Netscape...")
544 (apply 'start-process (concat "netscape" ,url) nil
545 browse-url-netscape-command
546 (append browse-url-netscape-arguments (list ,url)))))))))
548 (defun browse-url-netscape-reload ()
549 "Ask Netscape to reload its current document."
551 (browse-url-netscape-send "reload"))
553 (defun browse-url-netscape-send (command)
554 "Send a remote control command to Netscape."
555 (apply 'start-process "netscape" nil
556 browse-url-netscape-command
557 (append browse-url-netscape-arguments
558 (list "-remote" command))))
561 (defun browse-url-mosaic (url)
562 "Ask the XMosaic WWW browser to load URL.
563 Default to the URL around or before point."
564 (interactive (browse-url-interactive-arg "Mosaic URL: "))
565 (let ((pidfile (expand-file-name "~/.mosaicpid"))
567 (if (file-readable-p pidfile)
570 (goto-char (point-min))
571 (setq pid (read (current-buffer)))
573 (if (and pid (zerop (signal-process pid 0))) ; Mosaic running
575 (find-file (format "/tmp/Mosaic.%d" pid))
577 (insert "goto\n" url "\n")
580 ;; Send signal SIGUSR to Mosaic
581 (message "Signalling Mosaic...")
582 (signal-process pid browse-url-usr1-signal)
584 ;; (call-process "kill" nil 0 nil "-USR1" (int-to-string pid))
585 (message "Signalling Mosaic...done")
587 ;; Mosaic not running - start it
588 (message "Starting Mosaic...")
589 (apply 'start-process "xmosaic" nil "xmosaic"
590 (append browse-url-mosaic-arguments (list url)))
591 (message "Starting Mosaic...done"))))
594 (defun browse-url-cci (url &optional new-window)
595 "Ask the XMosaic WWW browser to load URL.
596 Default to the URL around or before point.
598 This function only works for XMosaic version 2.5 or later. You must
599 select `CCI' from XMosaic's File menu, set the CCI Port Address to the
600 value of variable `browse-url-CCI-port', and enable `Accept requests'.
602 When called interactively, if variable `browse-url-new-window-p' is
603 non-nil, load the document in a new browser window, otherwise use a
604 random existing one. A non-nil interactive prefix argument reverses
605 the effect of browse-url-new-window-p.
607 When called non-interactively, optional second argument NEW-WINDOW is
608 used instead of browse-url-new-window-p."
609 (interactive (append (browse-url-interactive-arg "Mosaic URL: ")
610 (list (not (eq (null browse-url-new-window-p)
611 (null current-prefix-arg))))))
612 (open-network-stream "browse-url" " *browse-url*"
613 "localhost" browse-url-CCI-port)
614 ;; Todo: start browser if fails
615 (process-send-string "browse-url"
616 (concat "get url (" url ") output "
617 (if new-window "new" "current") "\r\n"))
618 (process-send-string "browse-url" "disconnect\r\n")
619 (delete-process "browse-url"))
622 (defun browse-url-iximosaic (url)
623 "Ask the IXIMosaic WWW browser to load URL.
624 Default to the URL around or before point."
625 (interactive (browse-url-interactive-arg "IXI Mosaic URL: "))
626 (start-process "tellw3b" nil "tellw3b"
627 "-service WWW_BROWSER ixi_showurl " url))
630 (defun browse-url-w3 (url)
631 "Ask the w3 WWW browser to load URL.
632 Default to the URL around or before point."
633 (interactive (browse-url-interactive-arg "W3 URL: "))
636 (defun browse-url-lynx-xterm (url)
637 "Ask the Lynx WWW browser to load URL.
638 Default to the URL around or before point. A new Lynx process is run
640 (interactive (browse-url-interactive-arg "Lynx URL: "))
641 (start-process (concat "lynx" url) nil "xterm" "-e" "lynx" url))
643 (defun browse-url-lynx-emacs (url)
644 "Ask the Lynx WWW browser to load URL.
645 Default to the URL around or before point. A new Lynx process is run
646 in an Emacs buffer using terminal-emulator."
647 (interactive (browse-url-interactive-arg "Lynx URL: "))
648 (let ((system-uses-terminfo t)) ; Lynx uses terminfo
649 (terminal-emulator "*browse-url*" "lynx" (list url))))
651 (provide 'browse-url)
653 ;;; browse-url.el ends here