annotate lisp/browse-url.el @ 16255:dcde843403a3

(display_mode_line): Use faces for inverse video mode line whenever possible. (echo_area_display): Shift display_string past a left-side scroll bar. (redisplay_window): Likewise. (redisplay_internal): Shift cursor past a left-side scroll bar. (redisplay_window): Likewise. (try_window_id): Likewise. (display_text_line): Likewise. (redisplay_internal): Shift charstarts past a left-side scroll bar. (display_text_line): Likewise. (redisplay_internal): Use new macro WINDOW_FULL_WIDTH_P. (redisplay_window): Likewise. (display_text_line): Likewise. (display_text_line): Shift output past left-side scroll bar. (display_text_line): Use new WINDOW_RIGHTMOST_P macro. (display_text_line): Don't pad right columns unless using a right-side scroll bar. Don't draw vertical bars unless there isn't any kind of scroll bar. (display_string): Likewise. (display_mode_line): Use new macros WINDOW_LEFT_MARGIN, WINDOW_RIGHT_MARGIN, and WINDOW_FULL_WIDTH_P. (display_string): Use new macro WINDOW_RIGHTMOST_P.
author Richard M. Stallman <rms@gnu.org>
date Sat, 21 Sep 1996 01:16:33 +0000
parents 0a03d2b02ba1
children e25afe6ea4d6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13208
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1 ;;; browse-url.el --- ask a WWW browser to load a URL
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13938
diff changeset
2
14734
20f4c4a078b2 Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 14368
diff changeset
3 ;; Copyright 1995, 1996 Free Software Foundation, Inc.
13208
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5 ;; Author: Denis Howe <dbh@doc.ic.ac.uk>
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6 ;; Maintainer: Denis Howe <dbh@doc.ic.ac.uk>
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
7 ;; Created: 03 Apr 1995
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
8 ;; Keywords: hypertext
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
9 ;; X-Home page: http://wombat.doc.ic.ac.uk/
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
10
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
11 ;; This file is part of GNU Emacs.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
12
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
13 ;; GNU Emacs is free software; you can redistribute it and/or modify
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13938
diff changeset
14 ;; it under the terms of the GNU General Public License as published by
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13938
diff changeset
15 ;; the Free Software Foundation; either version 2, or (at your option)
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13938
diff changeset
16 ;; any later version.
13208
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
17
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13938
diff changeset
18 ;; GNU Emacs is distributed in the hope that it will be useful,
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13938
diff changeset
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13938
diff changeset
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13938
diff changeset
21 ;; GNU General Public License for more details.
13208
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
22
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
23 ;; You should have received a copy of the GNU General Public License
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
24 ;; along with GNU Emacs; see the file COPYING. If not, write to the
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13938
diff changeset
25 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13938
diff changeset
26 ;; Boston, MA 02111-1307, USA.
13208
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
27
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
28 ;;; Commentary:
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
29
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
30 ;; The latest version of this package should be available from
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
31 ;; <URL:http://wombat.doc.ic.ac.uk/emacs/browse-url.el>.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
32
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
33 ;; This package provides functions which read a URL (Uniform Resource
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
34 ;; Locator) from the minibuffer, defaulting to the URL around point,
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
35 ;; and ask a World-Wide Web browser to load it. It can also load the
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
36 ;; URL associated with the current buffer. Different browsers use
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
37 ;; different methods of remote control so there is one function for
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
38 ;; each supported browser. If the chosen browser is not running, it
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
39 ;; is started. Currently there is support for:
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
40
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
41 ;; Function Browser Earliest version
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
42 ;; browse-url-netscape Netscape 1.1b1
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
43 ;; browse-url-mosaic XMosaic <= 2.4
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
44 ;; browse-url-cci XMosaic 2.5
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
45 ;; browse-url-w3 w3 0
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
46 ;; browse-url-iximosaic IXI Mosaic ?
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
47
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
48 ;; Note that versions of Netscape before 1.1b1 did not have remote
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
49 ;; control. <URL:http://home.netscape.com/newsref/std/x-remote.html>
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
50 ;; and <URL:http://home.netscape.com/info/APIs/>.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
51
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
52 ;; Netscape can cache Web pages so it may be necessary to tell it to
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
53 ;; reload the current page if it has changed (eg. if you have edited
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
54 ;; it). There is currently no perfect automatic solution to this.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
55
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
56 ;; Netscape allows you to specify the id of the window you want to
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
57 ;; control but which window DO you want to control and how do you
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
58 ;; discover its id?
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
59
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
60 ;; If using XMosaic before version 2.5, check the definition of
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
61 ;; browse-url-usr1-signal below.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
62 ;; <URL:http://www.ncsa.uiuc.edu/SDG/Software/XMosaic/remote-control.html>
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
63
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
64 ;; XMosaic version 2.5 introduced Common Client Interface allowing you
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
65 ;; to control mosaic through Unix sockets.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
66 ;; <URL:http://www.ncsa.uiuc.edu/SDG/Software/XMosaic/CCI/cci-spec.html>
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
67
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
68 ;; William M. Perry's excellent "w3" WWW browser for
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
69 ;; Emacs <URL:ftp://cs.indiana.edu/pub/elisp/w3/>
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
70 ;; has a function w3-follow-url-at-point, but that
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
71 ;; doesn't let you edit the URL like browse-url.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
72
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
73 ;; I recommend Nelson Minar <nelson@santafe.edu>'s excellent
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
74 ;; html-helper-mode.el for editing HTML and thank Nelson for
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
75 ;; his many useful comments on this code.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
76 ;; <URL:http://www.santafe.edu/~nelson/hhm-beta/>
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
77
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
78 ;; This package generalises function html-previewer-process in Marc
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
79 ;; Andreessen <marca@ncsa.uiuc.edu>'s html-mode (LCD
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
80 ;; modes/html-mode.el.Z) and provides better versions of the URL
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
81 ;; functions in Michelangelo Grigni <mic@cs.ucsd.edu>'s ffap.el
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
82 ;; (find-file-at-point) <URL:ftp://cs.ucsd.edu:/pub/mic/>. The huge
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
83 ;; hyperbole package also contains similar functions.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
84
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
85 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
86 ;; Help!
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
87
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
88 ;; Can you write and test some code for the Macintrash and Windoze
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
89 ;; Netscape remote control APIs? (See the URL above).
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
90
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
91 ;; Do any other browsers have remote control?
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
92
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
93 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
94 ;; Usage
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
95
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
96 ;; To display the URL at or before point:
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
97 ;; M-x browse-url-at-point RET
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
98
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
99 ;; To display a URL by shift-clicking on it, put this in your ~/.emacs
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
100 ;; file:
13933
efd6ce432dc5 (browse-url-mosaic): Print "done" message
Richard M. Stallman <rms@gnu.org>
parents: 13224
diff changeset
101 ;; (global-set-key [S-mouse-2] 'browse-url-at-mouse)
efd6ce432dc5 (browse-url-mosaic): Print "done" message
Richard M. Stallman <rms@gnu.org>
parents: 13224
diff changeset
102 ;; (Note that using Shift-mouse-1 is not desirable because
efd6ce432dc5 (browse-url-mosaic): Print "done" message
Richard M. Stallman <rms@gnu.org>
parents: 13224
diff changeset
103 ;; that event has a standard meaning in Emacs.)
13208
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
104
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
105 ;; To display the current buffer in a web browser:
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
106 ;; M-x browse-url-of-buffer RET
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
107
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
108 ;; In Dired, to display the file named on the current line:
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
109 ;; M-x browse-url-of-dired-file RET
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
110
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
111 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
112 ;; Customisation (~/.emacs)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
113
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
114 ;; To see what variables are available for customization, type `M-x
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
115 ;; set-variable browse-url TAB'.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
116
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
117 ;; To bind the browse-url commands to keys with the `C-c u' prefix:
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
118 ;; (global-set-key "\C-cu." 'browse-url-at-point)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
119 ;; (global-set-key "\C-cub" 'browse-url-of-buffer)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
120 ;; (global-set-key "\C-cuf" 'browse-url-of-file)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
121 ;; (add-hook 'dired-mode-hook
13224
e19603a14c3f Repair line wrapping damage.
Erik Naggum <erik@naggum.no>
parents: 13208
diff changeset
122 ;; (lambda ()
e19603a14c3f Repair line wrapping damage.
Erik Naggum <erik@naggum.no>
parents: 13208
diff changeset
123 ;; (local-set-key "\C-cuf" 'browse-url-of-dired-file))))
13208
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
124 ;; (if (boundp 'browse-url-browser-function)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
125 ;; (global-set-key "\C-cuu" browse-url-browser-function)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
126 ;; (eval-after-load
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
127 ;; "browse-url"
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
128 ;; '(global-set-key "\C-cuu" browse-url-browser-function)))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
129
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
130 ;; To use the Emacs w3 browser when not running under X11:
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
131 ;; (if (not (eq window-system 'x))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
132 ;; (setq browse-url-browser-function 'browse-url-w3))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
133
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
134 ;; To always save modified buffers before displaying the file in a browser:
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
135 ;; (setq browse-url-save-file t)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
136
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
137 ;; To get round the Netscape caching problem, you could try either of
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
138 ;; the following (but not both). EITHER write-file in
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
139 ;; html-helper-mode makes Netscape reload document:
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
140 ;;
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
141 ;; (autoload 'browse-url-netscape-reload "browse-url"
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
142 ;; "Ask a WWW browser to redisplay the current file." t)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
143 ;; (add-hook 'html-helper-mode-hook
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
144 ;; (function (lambda ()
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
145 ;; (add-hook 'local-write-file-hooks
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
146 ;; (function (lambda ()
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
147 ;; (let ((local-write-file-hooks))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
148 ;; (save-buffer))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
149 ;; (browse-url-netscape-reload)
13224
e19603a14c3f Repair line wrapping damage.
Erik Naggum <erik@naggum.no>
parents: 13208
diff changeset
150 ;; t)) ; => file written by hook
e19603a14c3f Repair line wrapping damage.
Erik Naggum <erik@naggum.no>
parents: 13208
diff changeset
151 ;; t)))) ; append to l-w-f-hooks
13208
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
152 ;;
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
153 ;; [Does this work for html-mode too?]
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
154 ;;
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
155 ;; OR browse-url-of-file ask Netscape to load and then reload the
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
156 ;; file:
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
157 ;;
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
158 ;; (add-hook 'browse-url-of-file-hook 'browse-url-netscape-reload)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
159
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
160 ;; You may also want to customise browse-url-netscape-arguments, eg.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
161 ;;
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
162 ;; (setq browse-url-netscape-arguments '("-install"))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
163 ;;
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
164 ;; or similarly for the other browsers.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
165
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
166 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
167 ;;; Change Log:
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
168
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
169 ;; 0.00 03 Apr 1995 Denis Howe <dbh@doc.ic.ac.uk>
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
170 ;; Created.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
171
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
172 ;; 0.01 04 Apr 1995
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
173 ;; All names start with "browse-url-". Added provide.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
174
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
175 ;; 0.02 05 Apr 1995
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
176 ;; Save file at start of browse-url-of-file.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
177 ;; Use start-process instead of start-process-shell-command.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
178
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
179 ;; 0.03 06 Apr 1995
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
180 ;; Add browse-url-netscape-reload, browse-url-netscape-command.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
181 ;; browse-url-of-file save file option.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
182
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
183 ;; 0.04 08 Apr 1995
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
184 ;; b-u-file-url separate function. Change b-u-filename-alist
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
185 ;; default.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
186
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
187 ;; 0.05 09 Apr 1995
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
188 ;; Added b-u-of-file-hook.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
189
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
190 ;; 0.06 11 Apr 1995
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
191 ;; Improved .emacs suggestions and documentation.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
192
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
193 ;; 0.07 13 Apr 1995
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
194 ;; Added browse-url-interactive-arg optional prompt.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
195
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
196 ;; 0.08 18 Apr 1995
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
197 ;; Exclude final "." from browse-url-regexp.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
198
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
199 ;; 0.09 21 Apr 1995
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
200 ;; Added mouse-set-point to browse-url-interactive-arg.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
201
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
202 ;; 0.10 24 Apr 1995
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
203 ;; Added Mosaic signal sending variations.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
204 ;; Thanks Brian K Servis <servis@ecn.purdue.edu>.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
205 ;; Don't use xprop for Netscape.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
206
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
207 ;; 0.11 25 Apr 1995
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
208 ;; Fix reading of ~/.mosaicpid. Thanks Dag.H.Wanvik@kvatro.no.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
209
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
210 ;; 0.12 27 Apr 1995
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
211 ;; Interactive prefix arg => URL *after* point.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
212 ;; Thanks Michelangelo Grigni <mic@cs.ucsd.edu>.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
213 ;; Added IXI Mosaic support.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
214 ;; Thanks David Karr <dkarr@nmo.gtegsc.com>.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
215
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
216 ;; 0.13 28 Apr 1995
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
217 ;; Exclude final [,;] from browse-url-regexp.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
218
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
219 ;; 0.14 02 May 1995
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
220 ;; Provide browser argument variables.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
221
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
222 ;; 0.15 07 May 1995
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
223 ;; More Netscape options. Thanks Peter Arius
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
224 ;; <arius@immd2.informatik.uni-erlangen.de>.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
225
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
226 ;; 0.16 17 May 1995
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
227 ;; Added browse-url-at-mouse.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
228 ;; Thanks Wayne Mesard <wmesard@sgi.com>
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
229
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
230 ;; 0.17 27 Jun 1995
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
231 ;; Renamed browse-url-at-point to browse-url-url-at-point.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
232 ;; Added browse-url-at-point.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
233 ;; Thanks Jonathan Cano <cano@patch.tandem.com>.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
234
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
235 ;; 0.18 16 Aug 1995
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
236 ;; Fixed call to browse-url-url-at-point in browse-url-at-point.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
237 ;; Thanks Eric Ding <ericding@San-Jose.ate.slb.com>.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
238
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
239 ;; 0.19 24 Aug 1995
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
240 ;; Improved documentation.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
241 ;; Thanks Kevin Rodgers <kevin.rodgers@ihs.com>.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
242
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
243 ;; 0.20 31 Aug 1995
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
244 ;; browse-url-of-buffer to handle file-less buffers.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
245 ;; browse-url-of-dired-file browses current file in dired.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
246 ;; Thanks Kevin Rodgers <kevin.rodgers@ihs.com>.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
247
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
248 ;; 0.21 09 Sep 1995
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
249 ;; XMosaic CCI functions.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
250 ;; Thanks Marc Furrer <Marc.Furrer@di.epfl.ch>.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
251
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
252 ;; 0.22 13 Sep 1995
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
253 ;; Fixed new-window documentation and added to browse-url-cci.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
254 ;; Thanks Dilip Sequeira <djs@dcs.ed.ac.uk>.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
255
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
256 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
257 ;;; Code:
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
258
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
259 (defvar browse-url-regexp
13224
e19603a14c3f Repair line wrapping damage.
Erik Naggum <erik@naggum.no>
parents: 13208
diff changeset
260 "\\(https?://\\|ftp://\\|gopher://\\|telnet://\\|wais://\\|file:/\\|s?news:\\|mailto:\\)[^]\t\n \"'()<>[^`{}]*[^]\t\n \"'()<>[^`{}.,;]+"
13208
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
261 "A regular expression probably matching a URL.")
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
262
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
263 (defvar browse-url-browser-function
15780
0a03d2b02ba1 (browse-url-choose-browser): New function.
Richard M. Stallman <rms@gnu.org>
parents: 15656
diff changeset
264 'browse-url-choose-browser
13208
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
265 "*Function to display the current buffer in a WWW browser.
15780
0a03d2b02ba1 (browse-url-choose-browser): New function.
Richard M. Stallman <rms@gnu.org>
parents: 15656
diff changeset
266 This is used by the `browse-url-at-point', `browse-url-at-mouse', and
0a03d2b02ba1 (browse-url-choose-browser): New function.
Richard M. Stallman <rms@gnu.org>
parents: 15656
diff changeset
267 `browse-url-of-file' commands.
0a03d2b02ba1 (browse-url-choose-browser): New function.
Richard M. Stallman <rms@gnu.org>
parents: 15656
diff changeset
268 The function should take one argument, an URL.")
13208
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
269
15656
e73cd7ff1d4a (browse-url-netscape-program): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 14734
diff changeset
270 (defvar browse-url-netscape-program "netscape"
e73cd7ff1d4a (browse-url-netscape-program): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 14734
diff changeset
271 "*The name for invoking Netscape.")
e73cd7ff1d4a (browse-url-netscape-program): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 14734
diff changeset
272
13208
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
273 (defvar browse-url-netscape-arguments nil
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
274 "*A list of strings to pass to Netscape as arguments.")
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
275
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
276 (defvar browse-url-new-window-p nil
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
277 "*If non-nil, always open a new browser window.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
278 Passing an interactive argument to \\[browse-url-netscape] or
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
279 \\[browse-url-cci] reverses the effect of this variable. Requires
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
280 Netscape version 1.1N or later or XMosaic version 2.5 or later.")
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
281
15656
e73cd7ff1d4a (browse-url-netscape-program): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 14734
diff changeset
282 (defvar browse-url-mosaic-program "xmosaic"
e73cd7ff1d4a (browse-url-netscape-program): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 14734
diff changeset
283 "*The name for invoking Mosaic.")
e73cd7ff1d4a (browse-url-netscape-program): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 14734
diff changeset
284
13208
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
285 (defvar browse-url-mosaic-arguments nil
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
286 "*A list of strings to pass to Mosaic as arguments.")
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
287
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
288 (defvar browse-url-filename-alist
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
289 '(("^/+" . "file:/"))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
290 "An alist of (REGEXP . STRING) pairs.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
291 Any substring of a filename matching one of the REGEXPs is replaced by
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
292 the corresponding STRING. All pairs are applied in the order given.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
293 Used by the `browse-url-of-file' command.")
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
294
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
295 (defvar browse-url-save-file nil
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
296 "If non-nil, save the buffer before displaying its file.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
297 Used by the `browse-url-of-file' command.")
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
298
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
299 (defvar browse-url-of-file-hook nil
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
300 "A hook to be run with run-hook after `browse-url-of-file' has asked
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
301 a browser to load a file.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
302
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
303 Set this to `browse-url-netscape-reload' to force Netscape to load the
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
304 file rather than displaying a cached copy.")
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
305
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
306 (defvar browse-url-usr1-signal
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
307 (if (and (boundp 'emacs-major-version)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
308 (or (> emacs-major-version 19) (>= emacs-minor-version 29)))
13933
efd6ce432dc5 (browse-url-mosaic): Print "done" message
Richard M. Stallman <rms@gnu.org>
parents: 13224
diff changeset
309 'SIGUSR1
13208
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
310 30) ; Check /usr/include/signal.h.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
311 "The argument to `signal-process' for sending SIGUSR1 to XMosaic.
13938
3e0b6a3707bd (browse-url-usr1-signal): Doc fix.
Karl Heuer <kwzh@gnu.org>
parents: 13933
diff changeset
312 Emacs 19.29 accepts 'SIGUSR1, earlier versions require an integer
13208
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
313 which is 30 on SunOS and 16 on HP-UX and Solaris.")
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
314
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
315 (defvar browse-url-CCI-port 3003
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
316 "Port to access XMosaic via CCI.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
317 This can be any number between 1024 and 65535 but must correspond to
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
318 the value set in the browser.")
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
319
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
320 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
321 ;; URL input
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
322
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
323 ;; thingatpt.el doesn't work for complex regexps.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
324
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
325 (defun browse-url-url-at-point ()
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
326 "Return the URL around or before point.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
327 Then search backwards for the start of a URL. If no URL found, return
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
328 the empty string."
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
329 (if (or (looking-at browse-url-regexp) ; Already at start
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
330 (let ((eol (save-excursion (end-of-line) (point))))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
331 ;; Search forwards for the next URL or end of line in case
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
332 ;; we're in the middle of one.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
333 (and (re-search-forward browse-url-regexp eol 'lim)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
334 (goto-char (match-beginning 0)))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
335 ;; Now back to where we started or earlier.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
336 (re-search-backward browse-url-regexp nil t)))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
337 (buffer-substring (match-beginning 0) (match-end 0))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
338 "")) ; No match
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
339
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
340 ;; Todo: restrict to around or immediately before point. Expand bare
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
341 ;; hostname to URL.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
342
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
343 (defun browse-url-interactive-arg (&optional prompt)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
344 "Read a URL from the minibuffer, optionally prompting with PROMPT.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
345 Default to the URL at or before point. If bound to a mouse button,
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
346 set point to the position clicked. Return the result as a list for
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
347 use in `interactive'."
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
348 (let ((event (elt (this-command-keys) 0)))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
349 (and (listp event) (mouse-set-point event)))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
350 (list (read-string (or prompt "URL: ") (browse-url-url-at-point))))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
351
13933
efd6ce432dc5 (browse-url-mosaic): Print "done" message
Richard M. Stallman <rms@gnu.org>
parents: 13224
diff changeset
352 ;;;###autoload
13208
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
353 (defun browse-url-at-point ()
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
354 "Ask a WWW browser to load the URL at or before point.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
355 The URL is loaded according to the value of `browse-url-browser-function'."
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
356 (interactive)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
357 (funcall browse-url-browser-function (browse-url-url-at-point)))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
358
13933
efd6ce432dc5 (browse-url-mosaic): Print "done" message
Richard M. Stallman <rms@gnu.org>
parents: 13224
diff changeset
359 ;;;###autoload
13208
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
360 (defun browse-url-at-mouse (event)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
361 "Ask a WWW browser to load a URL clicked with the mouse.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
362 The URL is the one around or before the position of the mouse click
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
363 but point is not changed. The URL is loaded according to the value of
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
364 `browse-url-browser-function'."
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
365 (interactive "e")
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
366 (save-excursion
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
367 (let ((posn (event-start event)))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
368 (set-buffer (window-buffer (posn-window posn)))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
369 (goto-char (posn-point posn))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
370 (let ((url (browse-url-url-at-point)))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
371 (if (string-equal url "")
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
372 (error "No URL found"))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
373 (funcall browse-url-browser-function url)))))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
374
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
375 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
376 ;; Browse current buffer
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
377
13933
efd6ce432dc5 (browse-url-mosaic): Print "done" message
Richard M. Stallman <rms@gnu.org>
parents: 13224
diff changeset
378 ;;;###autoload
13208
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
379 (defun browse-url-of-file (&optional file)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
380 "Ask a WWW browser to display FILE.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
381 Display the current buffer's file if FILE is nil or if called
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
382 interactively. Turn the filename into a URL by performing
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
383 replacements given in variable `browse-url-filename-alist'. Pass the
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
384 URL to a browser using variable `browse-url-browser-function' then run
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
385 `browse-url-of-file-hook'."
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
386 (interactive)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
387 (setq file
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
388 (or file
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
389 (buffer-file-name)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
390 (error "Current buffer has no file")))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
391 (let ((buf (get-file-buffer file)))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
392 (if buf
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
393 (save-excursion
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
394 (set-buffer buf)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
395 (cond ((not (buffer-modified-p)))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
396 (browse-url-save-file (save-buffer))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
397 (t (message "%s modified since last save" file))))))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
398 (funcall browse-url-browser-function (browse-url-file-url file))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
399 (run-hooks 'browse-url-of-file-hook))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
400
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
401 (defun browse-url-file-url (file)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
402 "Return the URL corresponding to FILE.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
403 Uses variable `browse-url-filename-alist' to map filenames to URLs."
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
404 (let ((maps browse-url-filename-alist))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
405 (while maps
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
406 (let* ((map (car maps))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
407 (from-re (car map))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
408 (to-string (cdr map)))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
409 (setq maps (cdr maps))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
410 (if (string-match from-re file)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
411 (setq file (concat (substring file 0 (match-beginning 0))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
412 to-string
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
413 (substring file (match-end 0))))))))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
414 file)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
415
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
416 (defvar browse-url-temp-file-name nil)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
417 (make-variable-buffer-local 'browse-url-temp-file-name)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
418
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
419 (defvar browse-url-temp-file-list '())
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
420
13933
efd6ce432dc5 (browse-url-mosaic): Print "done" message
Richard M. Stallman <rms@gnu.org>
parents: 13224
diff changeset
421 ;;;###autoload
13208
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
422 (defun browse-url-of-buffer (&optional buffer)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
423 "Ask a WWW browser to display BUFFER.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
424 Display the current buffer if BUFFER is nil."
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
425 (interactive)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
426 (save-excursion
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
427 (set-buffer (or buffer (current-buffer)))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
428 (let ((file-name
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
429 (or buffer-file-name
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
430 (and (boundp 'dired-directory) dired-directory))))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
431 (if (null file-name)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
432 (progn
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
433 (if (null browse-url-temp-file-name)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
434 (progn
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
435 (setq browse-url-temp-file-name
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
436 (make-temp-name
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
437 (expand-file-name (buffer-name)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
438 (or (getenv "TMPDIR") "/tmp"))))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
439 (setq browse-url-temp-file-list
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
440 (cons browse-url-temp-file-name
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
441 browse-url-temp-file-list))))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
442 (write-region (point-min) (point-max) browse-url-temp-file-name
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
443 nil 'no-message)))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
444 (browse-url-of-file (or file-name browse-url-temp-file-name)))))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
445
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
446 (defun browse-url-delete-temp-file (&optional temp-file-name)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
447 ;; Delete browse-url-temp-file-name from the file system and from
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
448 ;; browse-url-temp-file-list. If optional arg TEMP-FILE-NAME is
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
449 ;; non-nil, delete it instead, but only from the file system --
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
450 ;; browse-url-temp-file-list is not affected.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
451 (let ((file-name (or temp-file-name browse-url-temp-file-name)))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
452 (if (and file-name (file-exists-p file-name))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
453 (progn
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
454 (delete-file file-name)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
455 (if (null temp-file-name)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
456 (setq browse-url-temp-file-list
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
457 (delete browse-url-temp-file-name
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
458 browse-url-temp-file-list)))))))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
459
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
460 (defun browse-url-delete-temp-file-list ()
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
461 ;; Delete all elements of browse-url-temp-file-list.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
462 (while browse-url-temp-file-list
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
463 (browse-url-delete-temp-file (car browse-url-temp-file-list))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
464 (setq browse-url-temp-file-list
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
465 (cdr browse-url-temp-file-list))))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
466
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
467 (add-hook 'kill-buffer-hook 'browse-url-delete-temp-file)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
468 (add-hook 'kill-emacs-hook 'browse-url-delete-temp-file-list)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
469
13933
efd6ce432dc5 (browse-url-mosaic): Print "done" message
Richard M. Stallman <rms@gnu.org>
parents: 13224
diff changeset
470 ;;;###autoload
13208
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
471 (defun browse-url-of-dired-file ()
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
472 "In Dired, ask a WWW browser to display the file named on this line."
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
473 (interactive)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
474 (browse-url-of-file (dired-get-filename)))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
475
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
476 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
477 ;; Browser-specific functions
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
478
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
479 (defun browse-url-netscape (url &optional new-window)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
480 "Ask the Netscape WWW browser to load URL.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
481
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
482 Default to the URL around or before point. The strings in variable
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
483 `browse-url-netscape-arguments' are also passed to Netscape.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
484
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
485 When called interactively, if variable `browse-url-new-window-p' is
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
486 non-nil, load the document in a new Netscape window, otherwise use a
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
487 random existing one. A non-nil interactive prefix argument reverses
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
488 the effect of browse-url-new-window-p.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
489
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
490 When called non-interactively, optional second argument NEW-WINDOW is
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
491 used instead of browse-url-new-window-p."
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
492
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
493 (interactive (append (browse-url-interactive-arg "Netscape URL: ")
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
494 (list (not (eq (null browse-url-new-window-p)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
495 (null current-prefix-arg))))))
14368
861f51e090d4 (browse-url-netscape): Check for call-process returning a string.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
496 (let ((res
15656
e73cd7ff1d4a (browse-url-netscape-program): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 14734
diff changeset
497 (apply 'call-process browse-url-netscape-program nil nil nil
14368
861f51e090d4 (browse-url-netscape): Check for call-process returning a string.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
498 (append browse-url-netscape-arguments
861f51e090d4 (browse-url-netscape): Check for call-process returning a string.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
499 (if new-window '("-noraise"))
861f51e090d4 (browse-url-netscape): Check for call-process returning a string.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
500 (list "-remote"
861f51e090d4 (browse-url-netscape): Check for call-process returning a string.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
501 (concat "openURL(" url
861f51e090d4 (browse-url-netscape): Check for call-process returning a string.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
502 (if new-window ",new-window")
861f51e090d4 (browse-url-netscape): Check for call-process returning a string.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
503 ")"))))
861f51e090d4 (browse-url-netscape): Check for call-process returning a string.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
504 ))
861f51e090d4 (browse-url-netscape): Check for call-process returning a string.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
505 (if (stringp res)
861f51e090d4 (browse-url-netscape): Check for call-process returning a string.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
506 (error "netscape got signal: %s" res)
861f51e090d4 (browse-url-netscape): Check for call-process returning a string.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
507 (or (zerop res)
861f51e090d4 (browse-url-netscape): Check for call-process returning a string.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
508 (progn ; Netscape not running - start it
861f51e090d4 (browse-url-netscape): Check for call-process returning a string.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
509 (message "Starting Netscape...")
15656
e73cd7ff1d4a (browse-url-netscape-program): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 14734
diff changeset
510 (apply 'start-process "netscape" nil browse-url-netscape-program
14368
861f51e090d4 (browse-url-netscape): Check for call-process returning a string.
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
511 (append browse-url-netscape-arguments (list url))))))))
13208
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
512
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
513 (defun browse-url-netscape-reload ()
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
514 "Ask Netscape to reload its current document."
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
515 (interactive)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
516 (browse-url-netscape-command "reload"))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
517
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
518 (defun browse-url-netscape-command (command)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
519 "Send a remote control command to Netscape."
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
520 (apply 'start-process "netscape" nil "netscape"
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
521 (append browse-url-netscape-arguments
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
522 (list "-remote" command))))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
523
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
524 (defun browse-url-mosaic (url)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
525 "Ask the XMosaic WWW browser to load URL.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
526 Default to the URL around or before point."
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
527 (interactive (browse-url-interactive-arg "Mosaic URL: "))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
528 (let ((pidfile (expand-file-name "~/.mosaicpid"))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
529 pid pidbuf)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
530 (if (file-readable-p pidfile)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
531 (save-excursion
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
532 (find-file pidfile)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
533 (goto-char (point-min))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
534 (setq pid (read (current-buffer)))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
535 (kill-buffer nil)))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
536 (if (and pid (zerop (signal-process pid 0))) ; Mosaic running
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
537 (save-excursion
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
538 (find-file (format "/tmp/Mosaic.%d" pid))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
539 (erase-buffer)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
540 (insert "goto\n" url "\n")
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
541 (save-buffer)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
542 (kill-buffer nil)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
543 ;; Send signal SIGUSR to Mosaic
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
544 (signal-process pid browse-url-usr1-signal)
13933
efd6ce432dc5 (browse-url-mosaic): Print "done" message
Richard M. Stallman <rms@gnu.org>
parents: 13224
diff changeset
545 (message "Signal sent to Mosaic")
13208
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
546 ;; Or you could try:
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
547 ;; (call-process "kill" nil 0 nil "-USR1" (int-to-string pid))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
548 )
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
549 ;; Mosaic not running - start it
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
550 (message "Starting Mosaic...")
15656
e73cd7ff1d4a (browse-url-netscape-program): New variable.
Karl Heuer <kwzh@gnu.org>
parents: 14734
diff changeset
551 (apply 'start-process "xmosaic" nil browse-url-mosaic-program
13933
efd6ce432dc5 (browse-url-mosaic): Print "done" message
Richard M. Stallman <rms@gnu.org>
parents: 13224
diff changeset
552 (append browse-url-mosaic-arguments (list url)))
efd6ce432dc5 (browse-url-mosaic): Print "done" message
Richard M. Stallman <rms@gnu.org>
parents: 13224
diff changeset
553 (message "Starting Mosaic...done"))))
13208
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
554
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
555 (defun browse-url-cci (url &optional new-window)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
556 "Ask the XMosaic WWW browser to load URL.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
557 Default to the URL around or before point.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
558
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
559 This function only works for XMosaic version 2.5 or later. You must
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
560 select `CCI' from XMosaic's File menu, set the CCI Port Address to the
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
561 value of variable `browse-url-CCI-port', and enable `Accept requests'.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
562
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
563 When called interactively, if variable `browse-url-new-window-p' is
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
564 non-nil, load the document in a new browser window, otherwise use a
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
565 random existing one. A non-nil interactive prefix argument reverses
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
566 the effect of browse-url-new-window-p.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
567
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
568 When called non-interactively, optional second argument NEW-WINDOW is
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
569 used instead of browse-url-new-window-p."
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
570 (interactive (append (browse-url-interactive-arg "Mosaic URL: ")
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
571 (list (not (eq (null browse-url-new-window-p)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
572 (null current-prefix-arg))))))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
573 (open-network-stream "browse-url" " *browse-url*"
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
574 "localhost" browse-url-CCI-port)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
575 ;; Todo: start browser if fails
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
576 (process-send-string "browse-url"
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
577 (concat "get url (" url ") output "
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
578 (if new-window "new" "current") "\r\n"))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
579 (process-send-string "browse-url" "disconnect\r\n")
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
580 (delete-process "browse-url"))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
581
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
582 (defun browse-url-iximosaic (url)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
583 "Ask the IXIMosaic WWW browser to load URL.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
584 Default to the URL around or before point."
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
585 (interactive (browse-url-interactive-arg "IXI Mosaic URL: "))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
586 (start-process "tellw3b" nil "tellw3b"
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
587 "-service WWW_BROWSER ixi_showurl " url))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
588
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
589 (defun browse-url-w3 (url)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
590 "Ask the w3 WWW browser to load URL.
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
591 Default to the URL around or before point."
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
592 (interactive (browse-url-interactive-arg "W3 URL: "))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
593 (w3-fetch url))
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
594
15780
0a03d2b02ba1 (browse-url-choose-browser): New function.
Richard M. Stallman <rms@gnu.org>
parents: 15656
diff changeset
595 (defun browse-url-choose-browser (argument)
0a03d2b02ba1 (browse-url-choose-browser): New function.
Richard M. Stallman <rms@gnu.org>
parents: 15656
diff changeset
596 "Decide which browser to use, then invoke it.
0a03d2b02ba1 (browse-url-choose-browser): New function.
Richard M. Stallman <rms@gnu.org>
parents: 15656
diff changeset
597 This is the default value of `browse-url-browser-function'."
0a03d2b02ba1 (browse-url-choose-browser): New function.
Richard M. Stallman <rms@gnu.org>
parents: 15656
diff changeset
598 (if (fboundp 'w3-fetch)
0a03d2b02ba1 (browse-url-choose-browser): New function.
Richard M. Stallman <rms@gnu.org>
parents: 15656
diff changeset
599 (setq browse-url-browser-function 'browse-url-w3)
0a03d2b02ba1 (browse-url-choose-browser): New function.
Richard M. Stallman <rms@gnu.org>
parents: 15656
diff changeset
600 (setq browse-url-browser-function 'browse-url-netscape))
0a03d2b02ba1 (browse-url-choose-browser): New function.
Richard M. Stallman <rms@gnu.org>
parents: 15656
diff changeset
601 (funcall browse-url-browser-function argument))
0a03d2b02ba1 (browse-url-choose-browser): New function.
Richard M. Stallman <rms@gnu.org>
parents: 15656
diff changeset
602
13208
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
603 (provide 'browse-url)
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
604
7a20f2bb5ac9 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
605 ;;; browse-url.el ends here