diff options
| author | Dave Love | 1997-11-21 23:57:48 +0000 |
|---|---|---|
| committer | Dave Love | 1997-11-21 23:57:48 +0000 |
| commit | 09d8b0bc6cd8acd0d4e112fb6e3f16363b582d9f (patch) | |
| tree | fc993efd52395376db76848e6689a40c003a4989 | |
| parent | 69248761c151c715109ad584d5283141ed1aacf9 (diff) | |
| download | emacs-09d8b0bc6cd8acd0d4e112fb6e3f16363b582d9f.tar.gz emacs-09d8b0bc6cd8acd0d4e112fb6e3f16363b582d9f.zip | |
Doc fixes and extra customization.
(browse-url): Quote browse-url-choose-browser in application.
| -rw-r--r-- | lisp/browse-url.el | 67 |
1 files changed, 44 insertions, 23 deletions
diff --git a/lisp/browse-url.el b/lisp/browse-url.el index 967b1abebbc..9140770a34b 100644 --- a/lisp/browse-url.el +++ b/lisp/browse-url.el | |||
| @@ -6,7 +6,6 @@ | |||
| 6 | ;; Maintainer: Dave Love <d.love@dl.ac.uk> | 6 | ;; Maintainer: Dave Love <d.love@dl.ac.uk> |
| 7 | ;; Created: 03 Apr 1995 | 7 | ;; Created: 03 Apr 1995 |
| 8 | ;; Keywords: hypertext, hypermedia, mouse | 8 | ;; Keywords: hypertext, hypermedia, mouse |
| 9 | ;; X-Home page: http://wombat.doc.ic.ac.uk/ | ||
| 10 | 9 | ||
| 11 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 12 | 11 | ||
| @@ -156,7 +155,8 @@ | |||
| 156 | ;; Customisation (~/.emacs) | 155 | ;; Customisation (~/.emacs) |
| 157 | 156 | ||
| 158 | ;; To see what variables are available for customization, type | 157 | ;; To see what variables are available for customization, type |
| 159 | ;; `M-x set-variable browse-url TAB'. | 158 | ;; `M-x set-variable browse-url TAB'. Better, use |
| 159 | ;; `M-x customize-group browse-url'. | ||
| 160 | 160 | ||
| 161 | ;; Bind the browse-url commands to keys with the `C-c C-z' prefix | 161 | ;; Bind the browse-url commands to keys with the `C-c C-z' prefix |
| 162 | ;; (as used by html-helper-mode): | 162 | ;; (as used by html-helper-mode): |
| @@ -227,6 +227,7 @@ | |||
| 227 | 227 | ||
| 228 | (defgroup browse-url nil | 228 | (defgroup browse-url nil |
| 229 | "Use a web browser to look at a URL." | 229 | "Use a web browser to look at a URL." |
| 230 | :prefix "browse-url-" | ||
| 230 | :group 'hypermedia) | 231 | :group 'hypermedia) |
| 231 | 232 | ||
| 232 | ;;;###autoload | 233 | ;;;###autoload |
| @@ -306,9 +307,9 @@ Hostname matching is stricter in this case than for | |||
| 306 | "A regular expression matching a URL marked up per RFC1738. | 307 | "A regular expression matching a URL marked up per RFC1738. |
| 307 | This may be broken across lines.") | 308 | This may be broken across lines.") |
| 308 | 309 | ||
| 309 | (defvar browse-url-filename-alist | 310 | (defcustom browse-url-filename-alist |
| 310 | '(("^/+" . "file:/")) | 311 | '(("^/+" . "file:/")) |
| 311 | "An alist of (REGEXP . STRING) pairs. | 312 | "*An alist of (REGEXP . STRING) pairs. |
| 312 | Any substring of a filename matching one of the REGEXPs is replaced by | 313 | Any substring of a filename matching one of the REGEXPs is replaced by |
| 313 | the corresponding STRING. All pairs are applied in the order given. | 314 | the corresponding STRING. All pairs are applied in the order given. |
| 314 | The default value prepends `file:' to any path beginning with `/'. | 315 | The default value prepends `file:' to any path beginning with `/'. |
| @@ -320,17 +321,25 @@ For example, to map EFS filenames to URLs: | |||
| 320 | '((\"/webmaster@webserver:/home/www/html/\" . | 321 | '((\"/webmaster@webserver:/home/www/html/\" . |
| 321 | \"http://www.acme.co.uk/\") | 322 | \"http://www.acme.co.uk/\") |
| 322 | (\"^/+\" . \"file:/\"))) | 323 | (\"^/+\" . \"file:/\"))) |
| 323 | ") | 324 | " |
| 325 | :type '(repeat (cons :format "%v" | ||
| 326 | (string :tag "Regexp") | ||
| 327 | (string :tag "Replacement"))) | ||
| 328 | :group 'browse-url) | ||
| 324 | 329 | ||
| 325 | (defvar browse-url-save-file nil | 330 | (defcustom browse-url-save-file nil |
| 326 | "If non-nil, save the buffer before displaying its file. | 331 | "*If non-nil, save the buffer before displaying its file. |
| 327 | Used by the `browse-url-of-file' command.") | 332 | Used by the `browse-url-of-file' command." |
| 333 | :type 'boolean | ||
| 334 | :group 'browse-url) | ||
| 328 | 335 | ||
| 329 | (defvar browse-url-of-file-hook nil | 336 | (defcustom browse-url-of-file-hook nil |
| 330 | "Run after `browse-url-of-file' has asked a browser to load a file. | 337 | "*Run after `browse-url-of-file' has asked a browser to load a file. |
| 331 | 338 | ||
| 332 | Set this to `browse-url-netscape-reload' to force Netscape to load the | 339 | Set this to `browse-url-netscape-reload' to force Netscape to load the |
| 333 | file rather than displaying a cached copy.") | 340 | file rather than displaying a cached copy." |
| 341 | :type 'hook | ||
| 342 | :group 'browse-url) | ||
| 334 | 343 | ||
| 335 | (defvar browse-url-usr1-signal | 344 | (defvar browse-url-usr1-signal |
| 336 | (if (and (boundp 'emacs-major-version) | 345 | (if (and (boundp 'emacs-major-version) |
| @@ -341,15 +350,19 @@ file rather than displaying a cached copy.") | |||
| 341 | Emacs 19.29 accepts 'SIGUSR1, earlier versions require an integer | 350 | Emacs 19.29 accepts 'SIGUSR1, earlier versions require an integer |
| 342 | which is 30 on SunOS and 16 on HP-UX and Solaris.") | 351 | which is 30 on SunOS and 16 on HP-UX and Solaris.") |
| 343 | 352 | ||
| 344 | (defvar browse-url-CCI-port 3003 | 353 | (defcustom browse-url-CCI-port 3003 |
| 345 | "Port to access XMosaic via CCI. | 354 | "*Port to access XMosaic via CCI. |
| 346 | This can be any number between 1024 and 65535 but must correspond to | 355 | This can be any number between 1024 and 65535 but must correspond to |
| 347 | the value set in the browser.") | 356 | the value set in the browser." |
| 357 | :type 'integer | ||
| 358 | :group 'browse-url) | ||
| 348 | 359 | ||
| 349 | (defvar browse-url-CCI-host "localhost" | 360 | (defcustom browse-url-CCI-host "localhost" |
| 350 | "*Host to access XMosaic via CCI. | 361 | "*Host to access XMosaic via CCI. |
| 351 | This should be the host name of the machine running XMosaic with CCI | 362 | This should be the host name of the machine running XMosaic with CCI |
| 352 | enabled. The port number should be set in `browse-url-CCI-port'.") | 363 | enabled. The port number should be set in `browse-url-CCI-port'." |
| 364 | :type 'string | ||
| 365 | :group 'browse-url) | ||
| 353 | 366 | ||
| 354 | (defvar browse-url-temp-file-name nil) | 367 | (defvar browse-url-temp-file-name nil) |
| 355 | (make-variable-buffer-local 'browse-url-temp-file-name) | 368 | (make-variable-buffer-local 'browse-url-temp-file-name) |
| @@ -404,20 +417,28 @@ incompatibly at version 4." | |||
| 404 | :type 'number | 417 | :type 'number |
| 405 | :group 'browse-url) | 418 | :group 'browse-url) |
| 406 | 419 | ||
| 407 | (defvar browse-url-lynx-input-field 'avoid | 420 | (defcustom browse-url-lynx-input-field 'avoid |
| 408 | "*Action on selecting an existing Lynx buffer at an input field. | 421 | "*Action on selecting an existing Lynx buffer at an input field. |
| 409 | What to do when sending a new URL to an existing Lynx buffer in Emacs | 422 | What to do when sending a new URL to an existing Lynx buffer in Emacs |
| 410 | if the Lynx cursor is on an input field (in which case the `g' command | 423 | if the Lynx cursor is on an input field (in which case the `g' command |
| 411 | would be entered as data). Such fields are recognized by the | 424 | would be entered as data). Such fields are recognized by the |
| 412 | underlines ____. Allowed values: nil: disregard it, 'warn: warn the | 425 | underlines ____. Allowed values: nil: disregard it, 'warn: warn the |
| 413 | user and don't emit the URL, 'avoid: try to avoid the field by moving | 426 | user and don't emit the URL, 'avoid: try to avoid the field by moving |
| 414 | down (this *won't* always work).") | 427 | down (this *won't* always work)." |
| 428 | :type '(choice (const :tag "Move to try to avoid field" :value avoid) | ||
| 429 | (const :tag "Disregard" :value nil) | ||
| 430 | (const :tag "Warn, don't emit URL" :value warn)) | ||
| 431 | :group 'browse-url) | ||
| 415 | 432 | ||
| 416 | (defvar browse-url-lynx-input-attempts 10 | 433 | (defcustom browse-url-lynx-input-attempts 10 |
| 417 | "*How many times to try to move down from a series of lynx input fields.") | 434 | "*How many times to try to move down from a series of lynx input fields." |
| 435 | :type 'integer | ||
| 436 | :group 'browse-url) | ||
| 418 | 437 | ||
| 419 | (defvar browse-url-lynx-input-delay 0.2 | 438 | (defcustom browse-url-lynx-input-delay 0.2 |
| 420 | "*How many seconds to wait for lynx between moves down from an input field.") | 439 | "*How many seconds to wait for lynx between moves down from an input field." |
| 440 | :type 'number | ||
| 441 | :group 'browse-url) | ||
| 421 | 442 | ||
| 422 | (defvar browse-url-temp-file-list '()) | 443 | (defvar browse-url-temp-file-list '()) |
| 423 | 444 | ||
| @@ -577,7 +598,7 @@ Prompts for a URL, defaulting to the URL at or before point. Variable | |||
| 577 | `browse-url-browser-function' says which browser to use." | 598 | `browse-url-browser-function' says which browser to use." |
| 578 | (interactive (browse-url-interactive-arg "URL: ")) | 599 | (interactive (browse-url-interactive-arg "URL: ")) |
| 579 | (if (consp browse-url-browser-function) | 600 | (if (consp browse-url-browser-function) |
| 580 | (apply browse-url-choose-browser args) | 601 | (apply 'browse-url-choose-browser args) |
| 581 | (apply browse-url-browser-function args))) | 602 | (apply browse-url-browser-function args))) |
| 582 | 603 | ||
| 583 | (defun browse-url-choose-browser (url &rest args) | 604 | (defun browse-url-choose-browser (url &rest args) |