diff options
| author | Richard M. Stallman | 1996-01-04 08:32:49 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-01-04 08:32:49 +0000 |
| commit | a5f6b207ff9be0e40261e498457a1c88945bd006 (patch) | |
| tree | 2fc739f7d838beba0e59ffa0abbbba540c227812 | |
| parent | 03e123e7383ccd70f910a8176e11e965bf6860d4 (diff) | |
| download | emacs-a5f6b207ff9be0e40261e498457a1c88945bd006.tar.gz emacs-a5f6b207ff9be0e40261e498457a1c88945bd006.zip | |
(browse-url-mosaic): Print "done" message
after starting mosaic. Change the message about sending a signal.
(browse-url-netscape): Print "done" message after starting.
(browse-url-usr1-signal): Use SIGUSR1 in upper case.
(browse-url-at-point, browse-url-at-mouse, browse-url-of-buffer)
(browse-url-of-file, browse-url-of-dired-file): Add autoload cookies.
| -rw-r--r-- | lisp/browse-url.el | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/lisp/browse-url.el b/lisp/browse-url.el index 2a8072f508f..29673c448b1 100644 --- a/lisp/browse-url.el +++ b/lisp/browse-url.el | |||
| @@ -90,22 +90,6 @@ | |||
| 90 | ;; Do any other browsers have remote control? | 90 | ;; Do any other browsers have remote control? |
| 91 | 91 | ||
| 92 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 92 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 93 | ;; Installation | ||
| 94 | |||
| 95 | ;; Put the following in your ~/.emacs file: | ||
| 96 | ;; | ||
| 97 | ;; (autoload 'browse-url-at-point "browse-url" | ||
| 98 | ;; "Ask a WWW browser to load the URL at or before point." t) | ||
| 99 | ;; (autoload 'browse-url-at-mouse "browse-url" | ||
| 100 | ;; "Ask a WWW browser to load a URL clicked with the mouse." t) | ||
| 101 | ;; (autoload 'browse-url-of-buffer "browse-url" | ||
| 102 | ;; "Ask a WWW browser to display BUFFER." t) | ||
| 103 | ;; (autoload 'browse-url-of-file "browse-url" | ||
| 104 | ;; "Ask a WWW browser to display FILE." t) | ||
| 105 | ;; (autoload 'browse-url-of-dired-file "browse-url" | ||
| 106 | ;; "In Dired, ask a WWW browser to display the file named on this line." t) | ||
| 107 | |||
| 108 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
| 109 | ;; Usage | 93 | ;; Usage |
| 110 | 94 | ||
| 111 | ;; To display the URL at or before point: | 95 | ;; To display the URL at or before point: |
| @@ -113,7 +97,9 @@ | |||
| 113 | 97 | ||
| 114 | ;; To display a URL by shift-clicking on it, put this in your ~/.emacs | 98 | ;; To display a URL by shift-clicking on it, put this in your ~/.emacs |
| 115 | ;; file: | 99 | ;; file: |
| 116 | ;; (global-set-key [S-mouse-1] 'browse-url-at-mouse) | 100 | ;; (global-set-key [S-mouse-2] 'browse-url-at-mouse) |
| 101 | ;; (Note that using Shift-mouse-1 is not desirable because | ||
| 102 | ;; that event has a standard meaning in Emacs.) | ||
| 117 | 103 | ||
| 118 | ;; To display the current buffer in a web browser: | 104 | ;; To display the current buffer in a web browser: |
| 119 | ;; M-x browse-url-of-buffer RET | 105 | ;; M-x browse-url-of-buffer RET |
| @@ -312,7 +298,7 @@ file rather than displaying a cached copy.") | |||
| 312 | (defvar browse-url-usr1-signal | 298 | (defvar browse-url-usr1-signal |
| 313 | (if (and (boundp 'emacs-major-version) | 299 | (if (and (boundp 'emacs-major-version) |
| 314 | (or (> emacs-major-version 19) (>= emacs-minor-version 29))) | 300 | (or (> emacs-major-version 19) (>= emacs-minor-version 29))) |
| 315 | 'sigusr1 | 301 | 'SIGUSR1 |
| 316 | 30) ; Check /usr/include/signal.h. | 302 | 30) ; Check /usr/include/signal.h. |
| 317 | "The argument to `signal-process' for sending SIGUSR1 to XMosaic. | 303 | "The argument to `signal-process' for sending SIGUSR1 to XMosaic. |
| 318 | Emacs 19.29 accepts 'sigusr1, earlier versions require an integer | 304 | Emacs 19.29 accepts 'sigusr1, earlier versions require an integer |
| @@ -355,12 +341,14 @@ use in `interactive'." | |||
| 355 | (and (listp event) (mouse-set-point event))) | 341 | (and (listp event) (mouse-set-point event))) |
| 356 | (list (read-string (or prompt "URL: ") (browse-url-url-at-point)))) | 342 | (list (read-string (or prompt "URL: ") (browse-url-url-at-point)))) |
| 357 | 343 | ||
| 344 | ;;;###autoload | ||
| 358 | (defun browse-url-at-point () | 345 | (defun browse-url-at-point () |
| 359 | "Ask a WWW browser to load the URL at or before point. | 346 | "Ask a WWW browser to load the URL at or before point. |
| 360 | The URL is loaded according to the value of `browse-url-browser-function'." | 347 | The URL is loaded according to the value of `browse-url-browser-function'." |
| 361 | (interactive) | 348 | (interactive) |
| 362 | (funcall browse-url-browser-function (browse-url-url-at-point))) | 349 | (funcall browse-url-browser-function (browse-url-url-at-point))) |
| 363 | 350 | ||
| 351 | ;;;###autoload | ||
| 364 | (defun browse-url-at-mouse (event) | 352 | (defun browse-url-at-mouse (event) |
| 365 | "Ask a WWW browser to load a URL clicked with the mouse. | 353 | "Ask a WWW browser to load a URL clicked with the mouse. |
| 366 | The URL is the one around or before the position of the mouse click | 354 | The URL is the one around or before the position of the mouse click |
| @@ -379,6 +367,7 @@ but point is not changed. The URL is loaded according to the value of | |||
| 379 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 367 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 380 | ;; Browse current buffer | 368 | ;; Browse current buffer |
| 381 | 369 | ||
| 370 | ;;;###autoload | ||
| 382 | (defun browse-url-of-file (&optional file) | 371 | (defun browse-url-of-file (&optional file) |
| 383 | "Ask a WWW browser to display FILE. | 372 | "Ask a WWW browser to display FILE. |
| 384 | Display the current buffer's file if FILE is nil or if called | 373 | Display the current buffer's file if FILE is nil or if called |
| @@ -421,6 +410,7 @@ Uses variable `browse-url-filename-alist' to map filenames to URLs." | |||
| 421 | 410 | ||
| 422 | (defvar browse-url-temp-file-list '()) | 411 | (defvar browse-url-temp-file-list '()) |
| 423 | 412 | ||
| 413 | ;;;###autoload | ||
| 424 | (defun browse-url-of-buffer (&optional buffer) | 414 | (defun browse-url-of-buffer (&optional buffer) |
| 425 | "Ask a WWW browser to display BUFFER. | 415 | "Ask a WWW browser to display BUFFER. |
| 426 | Display the current buffer if BUFFER is nil." | 416 | Display the current buffer if BUFFER is nil." |
| @@ -469,6 +459,7 @@ Display the current buffer if BUFFER is nil." | |||
| 469 | (add-hook 'kill-buffer-hook 'browse-url-delete-temp-file) | 459 | (add-hook 'kill-buffer-hook 'browse-url-delete-temp-file) |
| 470 | (add-hook 'kill-emacs-hook 'browse-url-delete-temp-file-list) | 460 | (add-hook 'kill-emacs-hook 'browse-url-delete-temp-file-list) |
| 471 | 461 | ||
| 462 | ;;;###autoload | ||
| 472 | (defun browse-url-of-dired-file () | 463 | (defun browse-url-of-dired-file () |
| 473 | "In Dired, ask a WWW browser to display the file named on this line." | 464 | "In Dired, ask a WWW browser to display the file named on this line." |
| 474 | (interactive) | 465 | (interactive) |
| @@ -505,7 +496,8 @@ used instead of browse-url-new-window-p." | |||
| 505 | (progn ; Netscape not running - start it | 496 | (progn ; Netscape not running - start it |
| 506 | (message "Starting Netscape...") | 497 | (message "Starting Netscape...") |
| 507 | (apply 'start-process "netscape" nil "netscape" | 498 | (apply 'start-process "netscape" nil "netscape" |
| 508 | (append browse-url-netscape-arguments (list url)))))) | 499 | (append browse-url-netscape-arguments (list url))) |
| 500 | (message "Starting Netscape...done")))) | ||
| 509 | 501 | ||
| 510 | (defun browse-url-netscape-reload () | 502 | (defun browse-url-netscape-reload () |
| 511 | "Ask Netscape to reload its current document." | 503 | "Ask Netscape to reload its current document." |
| @@ -538,15 +530,16 @@ Default to the URL around or before point." | |||
| 538 | (save-buffer) | 530 | (save-buffer) |
| 539 | (kill-buffer nil) | 531 | (kill-buffer nil) |
| 540 | ;; Send signal SIGUSR to Mosaic | 532 | ;; Send signal SIGUSR to Mosaic |
| 541 | (message "Signalling Mosaic...") | ||
| 542 | (signal-process pid browse-url-usr1-signal) | 533 | (signal-process pid browse-url-usr1-signal) |
| 534 | (message "Signal sent to Mosaic") | ||
| 543 | ;; Or you could try: | 535 | ;; Or you could try: |
| 544 | ;; (call-process "kill" nil 0 nil "-USR1" (int-to-string pid)) | 536 | ;; (call-process "kill" nil 0 nil "-USR1" (int-to-string pid)) |
| 545 | ) | 537 | ) |
| 546 | ;; Mosaic not running - start it | 538 | ;; Mosaic not running - start it |
| 547 | (message "Starting Mosaic...") | 539 | (message "Starting Mosaic...") |
| 548 | (apply 'start-process "xmosaic" nil "xmosaic" | 540 | (apply 'start-process "xmosaic" nil "xmosaic" |
| 549 | (append browse-url-mosaic-arguments (list url)))))) | 541 | (append browse-url-mosaic-arguments (list url))) |
| 542 | (message "Starting Mosaic...done")))) | ||
| 550 | 543 | ||
| 551 | (defun browse-url-cci (url &optional new-window) | 544 | (defun browse-url-cci (url &optional new-window) |
| 552 | "Ask the XMosaic WWW browser to load URL. | 545 | "Ask the XMosaic WWW browser to load URL. |