diff options
| author | Stefan Monnier | 2003-04-12 22:21:18 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2003-04-12 22:21:18 +0000 |
| commit | 662871dd952fdc8a84b057f7dd08715d530b2d06 (patch) | |
| tree | 83f0f0076baa9ddb29e40ed1e72c505674c8efae | |
| parent | 8898f44ea677d1fd903ea8f1e4b7b895f15cc6f0 (diff) | |
| download | emacs-662871dd952fdc8a84b057f7dd08715d530b2d06.tar.gz emacs-662871dd952fdc8a84b057f7dd08715d530b2d06.zip | |
Don't autoload all these defcustoms.
(browse-url-default-macosx-browser): New fun.
(browse-url-browser-function): Use it for system-type = darwin.
(browse-url-usr1-signal): Remove.
(browse-url-mosaic): Use SIGUSR1 directly instead.
(browse-url-gnome-moz-program): New var.
(browse-url-gnome-moz, browse-url-default-browser): Use it.
| -rw-r--r-- | lisp/net/browse-url.el | 42 |
1 files changed, 18 insertions, 24 deletions
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 0ebc41150df..f55c5559b4a 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el | |||
| @@ -50,6 +50,7 @@ | |||
| 50 | ;; browse-url-mmm MMM ? | 50 | ;; browse-url-mmm MMM ? |
| 51 | ;; browse-url-generic arbitrary | 51 | ;; browse-url-generic arbitrary |
| 52 | ;; browse-url-default-windows-browser MS-Windows browser | 52 | ;; browse-url-default-windows-browser MS-Windows browser |
| 53 | ;; browse-url-default-macosx-browser Mac OS X browser | ||
| 53 | ;; browse-url-gnome-moz GNOME interface to Mozilla | 54 | ;; browse-url-gnome-moz GNOME interface to Mozilla |
| 54 | ;; browse-url-kde KDE konqueror (kfm) | 55 | ;; browse-url-kde KDE konqueror (kfm) |
| 55 | 56 | ||
| @@ -227,9 +228,11 @@ | |||
| 227 | 228 | ||
| 228 | ;;;###autoload | 229 | ;;;###autoload |
| 229 | (defcustom browse-url-browser-function | 230 | (defcustom browse-url-browser-function |
| 230 | (if (memq system-type '(windows-nt ms-dos cygwin)) | 231 | (cond |
| 231 | 'browse-url-default-windows-browser | 232 | ((memq system-type '(windows-nt ms-dos cygwin)) |
| 232 | 'browse-url-default-browser) | 233 | 'browse-url-default-windows-browser) |
| 234 | ((memq system-type '(darwin)) 'browse-url-default-macosx-browser) | ||
| 235 | (t 'browse-url-default-browser)) | ||
| 233 | "*Function to display the current buffer in a WWW browser. | 236 | "*Function to display the current buffer in a WWW browser. |
| 234 | This is used by the `browse-url-at-point', `browse-url-at-mouse', and | 237 | This is used by the `browse-url-at-point', `browse-url-at-mouse', and |
| 235 | `browse-url-of-file' commands. | 238 | `browse-url-of-file' commands. |
| @@ -260,6 +263,8 @@ regexp should probably be \".\" to specify a default browser." | |||
| 260 | :value browse-url-generic) | 263 | :value browse-url-generic) |
| 261 | (function-item :tag "Default Windows browser" | 264 | (function-item :tag "Default Windows browser" |
| 262 | :value browse-url-default-windows-browser) | 265 | :value browse-url-default-windows-browser) |
| 266 | (function-item :tag "Default Mac OS X browser" | ||
| 267 | :value browse-url-default-macosx-browser) | ||
| 263 | (function-item :tag "GNOME invoking Mozilla" | 268 | (function-item :tag "GNOME invoking Mozilla" |
| 264 | :value browse-url-gnome-moz) | 269 | :value browse-url-gnome-moz) |
| 265 | (function-item :tag "Default browser" | 270 | (function-item :tag "Default browser" |
| @@ -294,7 +299,6 @@ Defaults to the value of `browse-url-netscape-arguments' at the time | |||
| 294 | :type '(repeat (string :tag "Argument")) | 299 | :type '(repeat (string :tag "Argument")) |
| 295 | :group 'browse-url) | 300 | :group 'browse-url) |
| 296 | 301 | ||
| 297 | ;;;###autoload | ||
| 298 | (defcustom browse-url-browser-display nil | 302 | (defcustom browse-url-browser-display nil |
| 299 | "*The X display for running the browser, if not same as Emacs'." | 303 | "*The X display for running the browser, if not same as Emacs'." |
| 300 | :type '(choice string (const :tag "Default" nil)) | 304 | :type '(choice string (const :tag "Default" nil)) |
| @@ -317,7 +321,6 @@ Defaults to the value of `browse-url-mozilla-arguments' at the time | |||
| 317 | :type '(repeat (string :tag "Argument")) | 321 | :type '(repeat (string :tag "Argument")) |
| 318 | :group 'browse-url) | 322 | :group 'browse-url) |
| 319 | 323 | ||
| 320 | ;;;###autoload | ||
| 321 | (defcustom browse-url-galeon-program "galeon" | 324 | (defcustom browse-url-galeon-program "galeon" |
| 322 | "*The name by which to invoke Galeon." | 325 | "*The name by which to invoke Galeon." |
| 323 | :type 'string | 326 | :type 'string |
| @@ -349,7 +352,6 @@ If non-nil, then open the URL in a new tab rather than a new window if | |||
| 349 | :type 'boolean | 352 | :type 'boolean |
| 350 | :group 'browse-url) | 353 | :group 'browse-url) |
| 351 | 354 | ||
| 352 | ;;;###autoload | ||
| 353 | (defcustom browse-url-new-window-flag nil | 355 | (defcustom browse-url-new-window-flag nil |
| 354 | "*If non-nil, always open a new browser window with appropriate browsers. | 356 | "*If non-nil, always open a new browser window with appropriate browsers. |
| 355 | Passing an interactive argument to \\[browse-url], or specific browser | 357 | Passing an interactive argument to \\[browse-url], or specific browser |
| @@ -408,7 +410,6 @@ address to an HTTP URL: | |||
| 408 | :version "20.3" | 410 | :version "20.3" |
| 409 | :group 'browse-url) | 411 | :group 'browse-url) |
| 410 | 412 | ||
| 411 | ;;;###autoload | ||
| 412 | (defcustom browse-url-save-file nil | 413 | (defcustom browse-url-save-file nil |
| 413 | "*If non-nil, save the buffer before displaying its file. | 414 | "*If non-nil, save the buffer before displaying its file. |
| 414 | Used by the `browse-url-of-file' command." | 415 | Used by the `browse-url-of-file' command." |
| @@ -424,15 +425,6 @@ file rather than displaying a cached copy." | |||
| 424 | :options '(browse-url-netscape-reload) | 425 | :options '(browse-url-netscape-reload) |
| 425 | :group 'browse-url) | 426 | :group 'browse-url) |
| 426 | 427 | ||
| 427 | (defvar browse-url-usr1-signal | ||
| 428 | (if (and (boundp 'emacs-major-version) | ||
| 429 | (or (> emacs-major-version 19) (>= emacs-minor-version 29))) | ||
| 430 | 'SIGUSR1 ; Why did I think this was in lower case before? | ||
| 431 | 30) ; Check /usr/include/signal.h. | ||
| 432 | "The argument to `signal-process' for sending SIGUSR1 to XMosaic. | ||
| 433 | Emacs 19.29 accepts 'SIGUSR1, earlier versions require an integer | ||
| 434 | which is 30 on SunOS and 16 on HP-UX and Solaris.") | ||
| 435 | |||
| 436 | (defcustom browse-url-CCI-port 3003 | 428 | (defcustom browse-url-CCI-port 3003 |
| 437 | "*Port to access XMosaic via CCI. | 429 | "*Port to access XMosaic via CCI. |
| 438 | This can be any number between 1024 and 65535 but must correspond to | 430 | This can be any number between 1024 and 65535 but must correspond to |
| @@ -484,7 +476,6 @@ These might set the port, for instance." | |||
| 484 | :type '(repeat (string :tag "Argument")) | 476 | :type '(repeat (string :tag "Argument")) |
| 485 | :group 'browse-url) | 477 | :group 'browse-url) |
| 486 | 478 | ||
| 487 | ;;;###autoload | ||
| 488 | (defcustom browse-url-generic-program nil | 479 | (defcustom browse-url-generic-program nil |
| 489 | "*The name of the browser program used by `browse-url-generic'." | 480 | "*The name of the browser program used by `browse-url-generic'." |
| 490 | :type '(choice string (const :tag "None" nil)) | 481 | :type '(choice string (const :tag "None" nil)) |
| @@ -731,6 +722,10 @@ to use." | |||
| 731 | (error "Browsing URLs is not supported on this system")) | 722 | (error "Browsing URLs is not supported on this system")) |
| 732 | (w32-shell-execute "open" url))) | 723 | (w32-shell-execute "open" url))) |
| 733 | 724 | ||
| 725 | (defun browse-url-default-macosx-browser (url &optional new-window) | ||
| 726 | (interactive (browse-url-interactive-arg "URL: ")) | ||
| 727 | (start-process (concat "open " url) nil "open" url)) | ||
| 728 | |||
| 734 | ;; --- Netscape --- | 729 | ;; --- Netscape --- |
| 735 | 730 | ||
| 736 | (defun browse-url-process-environment () | 731 | (defun browse-url-process-environment () |
| @@ -770,7 +765,7 @@ The order attempted is gnome-moz-remote, Mozilla, Galeon, Netscape, | |||
| 770 | Mosaic, IXI Mosaic, Lynx in an xterm, MMM, Konqueror, and then W3." | 765 | Mosaic, IXI Mosaic, Lynx in an xterm, MMM, Konqueror, and then W3." |
| 771 | (apply | 766 | (apply |
| 772 | (cond | 767 | (cond |
| 773 | ((executable-find "gnome-moz-remote") 'browse-url-gnome-moz) | 768 | ((executable-find browse-url-gnome-moz-program) 'browse-url-gnome-moz) |
| 774 | ((executable-find browse-url-mozilla-program) 'browse-url-mozilla) | 769 | ((executable-find browse-url-mozilla-program) 'browse-url-mozilla) |
| 775 | ((executable-find browse-url-galeon-program) 'browse-url-galeon) | 770 | ((executable-find browse-url-galeon-program) 'browse-url-galeon) |
| 776 | ((executable-find browse-url-kde-program) 'browse-url-kde) | 771 | ((executable-find browse-url-kde-program) 'browse-url-kde) |
| @@ -952,7 +947,7 @@ used instead of `browse-url-new-window-flag'." | |||
| 952 | (append browse-url-galeon-startup-arguments (list url)))))) | 947 | (append browse-url-galeon-startup-arguments (list url)))))) |
| 953 | 948 | ||
| 954 | ;; GNOME means of invoking either Mozilla or Netrape. | 949 | ;; GNOME means of invoking either Mozilla or Netrape. |
| 955 | 950 | (defvar browse-url-gnome-moz-program "gnome-moz-remote") | |
| 956 | (defcustom browse-url-gnome-moz-arguments '() | 951 | (defcustom browse-url-gnome-moz-arguments '() |
| 957 | "*A list of strings passed to the GNOME mozilla viewer as arguments." | 952 | "*A list of strings passed to the GNOME mozilla viewer as arguments." |
| 958 | :version "21.1" | 953 | :version "21.1" |
| @@ -975,7 +970,7 @@ used instead of `browse-url-new-window-flag'." | |||
| 975 | (interactive (browse-url-interactive-arg "URL: ")) | 970 | (interactive (browse-url-interactive-arg "URL: ")) |
| 976 | (apply 'start-process (concat "gnome-moz-remote " url) | 971 | (apply 'start-process (concat "gnome-moz-remote " url) |
| 977 | nil | 972 | nil |
| 978 | "gnome-moz-remote" | 973 | browse-url-gnome-moz-program |
| 979 | (append | 974 | (append |
| 980 | browse-url-gnome-moz-arguments | 975 | browse-url-gnome-moz-arguments |
| 981 | (if (browse-url-maybe-new-window new-window) | 976 | (if (browse-url-maybe-new-window new-window) |
| @@ -1021,7 +1016,7 @@ used instead of `browse-url-new-window-flag'." | |||
| 1021 | (kill-buffer nil) | 1016 | (kill-buffer nil) |
| 1022 | ;; Send signal SIGUSR to Mosaic | 1017 | ;; Send signal SIGUSR to Mosaic |
| 1023 | (message "Signalling Mosaic...") | 1018 | (message "Signalling Mosaic...") |
| 1024 | (signal-process pid browse-url-usr1-signal) | 1019 | (signal-process pid 'SIGUSR1) |
| 1025 | ;; Or you could try: | 1020 | ;; Or you could try: |
| 1026 | ;; (call-process "kill" nil 0 nil "-USR1" (int-to-string pid)) | 1021 | ;; (call-process "kill" nil 0 nil "-USR1" (int-to-string pid)) |
| 1027 | (message "Signalling Mosaic...done") | 1022 | (message "Signalling Mosaic...done") |
| @@ -1034,7 +1029,6 @@ used instead of `browse-url-new-window-flag'." | |||
| 1034 | 1029 | ||
| 1035 | ;; --- Grail --- | 1030 | ;; --- Grail --- |
| 1036 | 1031 | ||
| 1037 | ;;;###autoload | ||
| 1038 | (defvar browse-url-grail | 1032 | (defvar browse-url-grail |
| 1039 | (concat (or (getenv "GRAILDIR") "~/.grail") "/user/rcgrail.py") | 1033 | (concat (or (getenv "GRAILDIR") "~/.grail") "/user/rcgrail.py") |
| 1040 | "Location of Grail remote control client script `rcgrail.py'. | 1034 | "Location of Grail remote control client script `rcgrail.py'. |
| @@ -1280,8 +1274,8 @@ don't offer a form of remote control." | |||
| 1280 | Default to the URL around or before point." | 1274 | Default to the URL around or before point." |
| 1281 | (interactive (browse-url-interactive-arg "KDE URL: ")) | 1275 | (interactive (browse-url-interactive-arg "KDE URL: ")) |
| 1282 | (message "Sending URL to KDE...") | 1276 | (message "Sending URL to KDE...") |
| 1283 | (apply #'start-process `(,(concat "KDE" url) nil ,browse-url-kde-program | 1277 | (apply #'start-process (concat "KDE " url) nil browse-url-kde-program |
| 1284 | ,@browse-url-kde-args ,url))) | 1278 | (append browse-url-kde-args (list url)))) |
| 1285 | 1279 | ||
| 1286 | (provide 'browse-url) | 1280 | (provide 'browse-url) |
| 1287 | 1281 | ||