1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-06 11:55:48 +00:00

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.
This commit is contained in:
Stefan Monnier 2003-04-12 22:21:18 +00:00
parent 8898f44ea6
commit 662871dd95

View File

@ -50,6 +50,7 @@
;; browse-url-mmm MMM ?
;; browse-url-generic arbitrary
;; browse-url-default-windows-browser MS-Windows browser
;; browse-url-default-macosx-browser Mac OS X browser
;; browse-url-gnome-moz GNOME interface to Mozilla
;; browse-url-kde KDE konqueror (kfm)
@ -227,9 +228,11 @@
;;;###autoload
(defcustom browse-url-browser-function
(if (memq system-type '(windows-nt ms-dos cygwin))
'browse-url-default-windows-browser
'browse-url-default-browser)
(cond
((memq system-type '(windows-nt ms-dos cygwin))
'browse-url-default-windows-browser)
((memq system-type '(darwin)) 'browse-url-default-macosx-browser)
(t 'browse-url-default-browser))
"*Function to display the current buffer in a WWW browser.
This is used by the `browse-url-at-point', `browse-url-at-mouse', and
`browse-url-of-file' commands.
@ -260,6 +263,8 @@ regexp should probably be \".\" to specify a default browser."
:value browse-url-generic)
(function-item :tag "Default Windows browser"
:value browse-url-default-windows-browser)
(function-item :tag "Default Mac OS X browser"
:value browse-url-default-macosx-browser)
(function-item :tag "GNOME invoking Mozilla"
:value browse-url-gnome-moz)
(function-item :tag "Default browser"
@ -294,7 +299,6 @@ Defaults to the value of `browse-url-netscape-arguments' at the time
:type '(repeat (string :tag "Argument"))
:group 'browse-url)
;;;###autoload
(defcustom browse-url-browser-display nil
"*The X display for running the browser, if not same as Emacs'."
:type '(choice string (const :tag "Default" nil))
@ -317,7 +321,6 @@ Defaults to the value of `browse-url-mozilla-arguments' at the time
:type '(repeat (string :tag "Argument"))
:group 'browse-url)
;;;###autoload
(defcustom browse-url-galeon-program "galeon"
"*The name by which to invoke Galeon."
:type 'string
@ -349,7 +352,6 @@ If non-nil, then open the URL in a new tab rather than a new window if
:type 'boolean
:group 'browse-url)
;;;###autoload
(defcustom browse-url-new-window-flag nil
"*If non-nil, always open a new browser window with appropriate browsers.
Passing an interactive argument to \\[browse-url], or specific browser
@ -408,7 +410,6 @@ address to an HTTP URL:
:version "20.3"
:group 'browse-url)
;;;###autoload
(defcustom browse-url-save-file nil
"*If non-nil, save the buffer before displaying its file.
Used by the `browse-url-of-file' command."
@ -424,15 +425,6 @@ file rather than displaying a cached copy."
:options '(browse-url-netscape-reload)
:group 'browse-url)
(defvar browse-url-usr1-signal
(if (and (boundp 'emacs-major-version)
(or (> emacs-major-version 19) (>= emacs-minor-version 29)))
'SIGUSR1 ; Why did I think this was in lower case before?
30) ; Check /usr/include/signal.h.
"The argument to `signal-process' for sending SIGUSR1 to XMosaic.
Emacs 19.29 accepts 'SIGUSR1, earlier versions require an integer
which is 30 on SunOS and 16 on HP-UX and Solaris.")
(defcustom browse-url-CCI-port 3003
"*Port to access XMosaic via CCI.
This can be any number between 1024 and 65535 but must correspond to
@ -484,7 +476,6 @@ These might set the port, for instance."
:type '(repeat (string :tag "Argument"))
:group 'browse-url)
;;;###autoload
(defcustom browse-url-generic-program nil
"*The name of the browser program used by `browse-url-generic'."
:type '(choice string (const :tag "None" nil))
@ -731,6 +722,10 @@ to use."
(error "Browsing URLs is not supported on this system"))
(w32-shell-execute "open" url)))
(defun browse-url-default-macosx-browser (url &optional new-window)
(interactive (browse-url-interactive-arg "URL: "))
(start-process (concat "open " url) nil "open" url))
;; --- Netscape ---
(defun browse-url-process-environment ()
@ -770,7 +765,7 @@ The order attempted is gnome-moz-remote, Mozilla, Galeon, Netscape,
Mosaic, IXI Mosaic, Lynx in an xterm, MMM, Konqueror, and then W3."
(apply
(cond
((executable-find "gnome-moz-remote") 'browse-url-gnome-moz)
((executable-find browse-url-gnome-moz-program) 'browse-url-gnome-moz)
((executable-find browse-url-mozilla-program) 'browse-url-mozilla)
((executable-find browse-url-galeon-program) 'browse-url-galeon)
((executable-find browse-url-kde-program) 'browse-url-kde)
@ -952,7 +947,7 @@ used instead of `browse-url-new-window-flag'."
(append browse-url-galeon-startup-arguments (list url))))))
;; GNOME means of invoking either Mozilla or Netrape.
(defvar browse-url-gnome-moz-program "gnome-moz-remote")
(defcustom browse-url-gnome-moz-arguments '()
"*A list of strings passed to the GNOME mozilla viewer as arguments."
:version "21.1"
@ -975,7 +970,7 @@ used instead of `browse-url-new-window-flag'."
(interactive (browse-url-interactive-arg "URL: "))
(apply 'start-process (concat "gnome-moz-remote " url)
nil
"gnome-moz-remote"
browse-url-gnome-moz-program
(append
browse-url-gnome-moz-arguments
(if (browse-url-maybe-new-window new-window)
@ -1021,7 +1016,7 @@ used instead of `browse-url-new-window-flag'."
(kill-buffer nil)
;; Send signal SIGUSR to Mosaic
(message "Signalling Mosaic...")
(signal-process pid browse-url-usr1-signal)
(signal-process pid 'SIGUSR1)
;; Or you could try:
;; (call-process "kill" nil 0 nil "-USR1" (int-to-string pid))
(message "Signalling Mosaic...done")
@ -1034,7 +1029,6 @@ used instead of `browse-url-new-window-flag'."
;; --- Grail ---
;;;###autoload
(defvar browse-url-grail
(concat (or (getenv "GRAILDIR") "~/.grail") "/user/rcgrail.py")
"Location of Grail remote control client script `rcgrail.py'.
@ -1280,8 +1274,8 @@ don't offer a form of remote control."
Default to the URL around or before point."
(interactive (browse-url-interactive-arg "KDE URL: "))
(message "Sending URL to KDE...")
(apply #'start-process `(,(concat "KDE" url) nil ,browse-url-kde-program
,@browse-url-kde-args ,url)))
(apply #'start-process (concat "KDE " url) nil browse-url-kde-program
(append browse-url-kde-args (list url))))
(provide 'browse-url)