Mercurial > emacs
comparison lisp/browse-url.el @ 19442:5b3f4890f757
Minor doc fixes.
(browse-url-temp-dir): New variable.
(browse-url-of-buffer): Use browse-url-temp-dir. Don't construct
a temporary file name which includes an arbitrary buffer name to
avoid losing on non-unixy systems.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 20 Aug 1997 17:22:42 +0000 |
parents | a3267de991c3 |
children | 39815ec1b9f8 |
comparison
equal
deleted
inserted
replaced
19441:2e2b54ae9b9d | 19442:5b3f4890f757 |
---|---|
92 | 92 |
93 ;; Lynx is now distributed by the FSF. See also | 93 ;; Lynx is now distributed by the FSF. See also |
94 ;; <URL:http://lynx.browser.org/>. | 94 ;; <URL:http://lynx.browser.org/>. |
95 | 95 |
96 ;; Free graphical browsers that could be used by `browse-url-generic' | 96 ;; Free graphical browsers that could be used by `browse-url-generic' |
97 ;; include Chimera <URL:ftp://ftp.cs.unlv.edu/pub/chimera>, Arena | 97 ;; include Chimera <URL:ftp://ftp.cs.unlv.edu/pub/chimera> and |
98 ;; <URL:http://www.unlv.edu/chimera/>, Arena | |
98 ;; <URL:ftp://ftp.yggdrasil.com/pub/dist/web/arena>, Amaya | 99 ;; <URL:ftp://ftp.yggdrasil.com/pub/dist/web/arena>, Amaya |
99 ;; <URL:ftp://ftp.w3.org/pub/amaya>, mMosaic | 100 ;; <URL:ftp://ftp.w3.org/pub/amaya>, mMosaic |
100 ;; <URL:ftp://sig.enst.fr/pub/multicast/mMosaic/> (the latter with | 101 ;; <URL:ftp://sig.enst.fr/pub/multicast/mMosaic/> (the latter with |
101 ;; development support for Java applets). | 102 ;; development support for Java applets). |
102 | 103 |
259 :type 'boolean | 260 :type 'boolean |
260 :group 'browse-url) | 261 :group 'browse-url) |
261 | 262 |
262 (defcustom browse-url-netscape-display nil | 263 (defcustom browse-url-netscape-display nil |
263 "*The X display on which Netscape is running if different from | 264 "*The X display on which Netscape is running if different from |
264 Emacs's display." | 265 Emacs's display." |
265 :type 'string | 266 :type 'string |
266 :group 'browse-url) | 267 :group 'browse-url) |
267 | 268 |
268 (defcustom browse-url-mosaic-arguments nil | 269 (defcustom browse-url-mosaic-arguments nil |
269 "*A list of strings to pass to Mosaic as arguments." | 270 "*A list of strings to pass to Mosaic as arguments." |
371 (defcustom browse-url-generic-args nil | 372 (defcustom browse-url-generic-args nil |
372 "*A list of strings defining options for `browse-url-generic-program'." | 373 "*A list of strings defining options for `browse-url-generic-program'." |
373 :type '(repeat (string :tag "Argument")) | 374 :type '(repeat (string :tag "Argument")) |
374 :group 'browse-url) | 375 :group 'browse-url) |
375 | 376 |
377 (defcustom browse-url-temp-dir | |
378 (or (getenv "TMPDIR") "/tmp") | |
379 "*The name of a directory in which to store temporary files | |
380 generated by functions like `browse-url-of-region'. You might want to | |
381 set this to somewhere with restricted read permissions for privacy's sake." | |
382 :type 'string | |
383 :group 'browse-url) | |
384 | |
376 (defvar browse-url-temp-file-list '()) | 385 (defvar browse-url-temp-file-list '()) |
377 | 386 |
378 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 387 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
379 ;; URL input | 388 ;; URL input |
380 | 389 |
387 ;; functions allows them to be stand-alone commands, making it easier | 396 ;; functions allows them to be stand-alone commands, making it easier |
388 ;; to switch between browsers. | 397 ;; to switch between browsers. |
389 | 398 |
390 (defun browse-url-interactive-arg (prompt) | 399 (defun browse-url-interactive-arg (prompt) |
391 "Read a URL from the minibuffer, prompting with PROMPT. | 400 "Read a URL from the minibuffer, prompting with PROMPT. |
392 Default to the URL at or before point. If invoke with a mouse button, | 401 Default to the URL at or before point. If invoked with a mouse button, |
393 set point to the position clicked first. Return a list for use in | 402 set point to the position clicked first. Return a list for use in |
394 `interactive' containing the URL and `browse-url-new-window-p' or its | 403 `interactive' containing the URL and `browse-url-new-window-p' or its |
395 negation if a prefix argument was given." | 404 negation if a prefix argument was given." |
396 (let ((event (elt (this-command-keys) 0))) | 405 (let ((event (elt (this-command-keys) 0))) |
397 (and (listp event) (mouse-set-point event))) | 406 (and (listp event) (mouse-set-point event))) |
466 (and (boundp 'dired-directory) dired-directory))))) | 475 (and (boundp 'dired-directory) dired-directory))))) |
467 (or file-name | 476 (or file-name |
468 (progn | 477 (progn |
469 (or browse-url-temp-file-name | 478 (or browse-url-temp-file-name |
470 (setq browse-url-temp-file-name | 479 (setq browse-url-temp-file-name |
471 (make-temp-name | 480 (convert-standard-filename |
472 (expand-file-name (buffer-name) | 481 (make-temp-name |
473 (or (getenv "TMPDIR") "/tmp"))) | 482 (expand-file-name "burl" browse-url-temp-dir))))) |
474 browse-url-temp-file-list | |
475 (cons browse-url-temp-file-name | |
476 browse-url-temp-file-list))) | |
477 (setq file-name browse-url-temp-file-name) | 483 (setq file-name browse-url-temp-file-name) |
478 (write-region (point-min) (point-max) file-name nil 'no-message))) | 484 (write-region (point-min) (point-max) file-name nil 'no-message))) |
479 (browse-url-of-file file-name)))) | 485 (browse-url-of-file file-name)))) |
480 | 486 |
481 (defun browse-url-delete-temp-file (&optional temp-file-name) | 487 (defun browse-url-delete-temp-file (&optional temp-file-name) |