2001-07-16 12:23:00 +00:00
|
|
|
;;; browse-url.el --- pass a URL to a WWW browser
|
2000-03-20 13:12:14 +00:00
|
|
|
|
2017-01-01 03:14:01 +00:00
|
|
|
;; Copyright (C) 1995-2017 Free Software Foundation, Inc.
|
2000-03-20 13:12:14 +00:00
|
|
|
|
|
|
|
;; Author: Denis Howe <dbh@doc.ic.ac.uk>
|
2014-02-10 01:34:22 +00:00
|
|
|
;; Maintainer: emacs-devel@gnu.org
|
2000-03-20 13:12:14 +00:00
|
|
|
;; Created: 03 Apr 1995
|
|
|
|
;; Keywords: hypertext, hypermedia, mouse
|
|
|
|
|
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
|
2008-05-06 07:31:51 +00:00
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
2000-03-20 13:12:14 +00:00
|
|
|
;; it under the terms of the GNU General Public License as published by
|
2008-05-06 07:31:51 +00:00
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
2000-03-20 13:12:14 +00:00
|
|
|
|
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
2008-05-06 07:31:51 +00:00
|
|
|
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
|
2000-03-20 13:12:14 +00:00
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
;; This package provides functions which read a URL (Uniform Resource
|
|
|
|
;; Locator) from the minibuffer, defaulting to the URL around point,
|
|
|
|
;; and ask a World-Wide Web browser to load it. It can also load the
|
|
|
|
;; URL associated with the current buffer. Different browsers use
|
|
|
|
;; different methods of remote control so there is one function for
|
|
|
|
;; each supported browser. If the chosen browser is not running, it
|
2000-08-15 11:17:17 +00:00
|
|
|
;; is started. Currently there is support for the following browsers,
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
;; as well as some other obsolete ones:
|
2000-08-15 11:17:17 +00:00
|
|
|
|
|
|
|
;; Function Browser Earliest version
|
2001-11-19 19:12:31 +00:00
|
|
|
;; browse-url-mozilla Mozilla Don't know
|
2005-06-18 10:36:11 +00:00
|
|
|
;; browse-url-firefox Firefox Don't know (tried with 1.0.1)
|
2016-01-24 19:37:38 +00:00
|
|
|
;; browse-url-chrome Chrome 47.0.2526.111
|
2011-10-19 09:03:39 +00:00
|
|
|
;; browse-url-chromium Chromium 3.0
|
2003-07-07 20:54:56 +00:00
|
|
|
;; browse-url-epiphany Epiphany Don't know
|
2015-03-18 00:09:34 +00:00
|
|
|
;; browse-url-conkeror Conkeror Don't know
|
2000-08-15 11:17:17 +00:00
|
|
|
;; browse-url-w3 w3 0
|
2007-10-29 13:56:39 +00:00
|
|
|
;; browse-url-text-* Any text browser 0
|
2000-08-15 11:17:17 +00:00
|
|
|
;; browse-url-generic arbitrary
|
|
|
|
;; browse-url-default-windows-browser MS-Windows browser
|
2016-11-06 07:33:43 +00:00
|
|
|
;; browse-url-default-macosx-browser macOS browser
|
2017-03-10 03:01:19 +00:00
|
|
|
;; browse-url-xdg-open freedesktop.org xdg-open
|
2001-05-18 11:27:38 +00:00
|
|
|
;; browse-url-kde KDE konqueror (kfm)
|
2007-09-07 04:37:01 +00:00
|
|
|
;; browse-url-elinks Elinks Don't know (tried with 0.12.GIT)
|
2000-03-20 13:12:14 +00:00
|
|
|
|
|
|
|
;; Browsers can cache Web pages so it may be necessary to tell them to
|
2015-03-18 00:09:34 +00:00
|
|
|
;; reload the current page if it has changed (e.g., if you have edited
|
2000-03-20 13:12:14 +00:00
|
|
|
;; it). There is currently no perfect automatic solution to this.
|
|
|
|
|
2011-11-18 08:31:02 +00:00
|
|
|
;; This package generalizes function html-previewer-process in Marc
|
2000-03-20 13:12:14 +00:00
|
|
|
;; Andreessen's html-mode (LCD modes/html-mode.el.Z). See also the
|
|
|
|
;; ffap.el package. The huge hyperbole package also contains similar
|
|
|
|
;; functions.
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; Usage
|
|
|
|
|
|
|
|
;; To display the URL at or before point:
|
|
|
|
;; M-x browse-url-at-point RET
|
|
|
|
;; or, similarly but with the opportunity to edit the URL extracted from
|
|
|
|
;; the buffer, use:
|
|
|
|
;; M-x browse-url
|
|
|
|
|
2012-09-17 05:41:04 +00:00
|
|
|
;; To display a URL by shift-clicking on it, put this in your init file:
|
2000-03-20 13:12:14 +00:00
|
|
|
;; (global-set-key [S-mouse-2] 'browse-url-at-mouse)
|
|
|
|
;; (Note that using Shift-mouse-1 is not desirable because
|
|
|
|
;; that event has a standard meaning in Emacs.)
|
|
|
|
|
|
|
|
;; To display the current buffer in a web browser:
|
|
|
|
;; M-x browse-url-of-buffer RET
|
|
|
|
|
|
|
|
;; To display the current region in a web browser:
|
|
|
|
;; M-x browse-url-of-region RET
|
|
|
|
|
|
|
|
;; In Dired, to display the file named on the current line:
|
|
|
|
;; M-x browse-url-of-dired-file RET
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
2011-11-20 02:29:42 +00:00
|
|
|
;; Customization (~/.emacs)
|
2000-03-20 13:12:14 +00:00
|
|
|
|
|
|
|
;; To see what variables are available for customization, type
|
|
|
|
;; `M-x set-variable browse-url TAB'. Better, use
|
|
|
|
;; `M-x customize-group browse-url'.
|
|
|
|
|
|
|
|
;; Bind the browse-url commands to keys with the `C-c C-z' prefix
|
|
|
|
;; (as used by html-helper-mode):
|
|
|
|
;; (global-set-key "\C-c\C-z." 'browse-url-at-point)
|
|
|
|
;; (global-set-key "\C-c\C-zb" 'browse-url-of-buffer)
|
|
|
|
;; (global-set-key "\C-c\C-zr" 'browse-url-of-region)
|
|
|
|
;; (global-set-key "\C-c\C-zu" 'browse-url)
|
|
|
|
;; (global-set-key "\C-c\C-zv" 'browse-url-of-file)
|
|
|
|
;; (add-hook 'dired-mode-hook
|
|
|
|
;; (lambda ()
|
|
|
|
;; (local-set-key "\C-c\C-zf" 'browse-url-of-dired-file)))
|
|
|
|
|
2000-08-15 11:17:17 +00:00
|
|
|
;; Browse URLs in mail messages under RMAIL by clicking mouse-2:
|
2000-03-20 13:12:14 +00:00
|
|
|
;; (add-hook 'rmail-mode-hook (lambda () ; rmail-mode startup
|
|
|
|
;; (define-key rmail-mode-map [mouse-2] 'browse-url-at-mouse)))
|
2000-08-15 11:17:17 +00:00
|
|
|
;; Alternatively, add `goto-address' to `rmail-show-message-hook'.
|
2000-03-20 13:12:14 +00:00
|
|
|
|
2000-08-15 11:17:17 +00:00
|
|
|
;; Gnus provides a standard feature to activate URLs in article
|
|
|
|
;; buffers for invocation of browse-url.
|
2000-03-20 13:12:14 +00:00
|
|
|
|
|
|
|
;; Use the Emacs w3 browser when not running under X11:
|
|
|
|
;; (or (eq window-system 'x)
|
|
|
|
;; (setq browse-url-browser-function 'browse-url-w3))
|
|
|
|
|
|
|
|
;; To always save modified buffers before displaying the file in a browser:
|
|
|
|
;; (setq browse-url-save-file t)
|
|
|
|
|
|
|
|
;; To invoke different browsers for different URLs:
|
|
|
|
;; (setq browse-url-browser-function '(("^mailto:" . browse-url-mail)
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
;; ("." . browse-url-firefox)))
|
2000-03-20 13:12:14 +00:00
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;;; Code:
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; Variables
|
|
|
|
|
|
|
|
(defgroup browse-url nil
|
|
|
|
"Use a web browser to look at a URL."
|
|
|
|
:prefix "browse-url-"
|
2000-03-26 18:34:30 +00:00
|
|
|
:link '(emacs-commentary-link "browse-url")
|
2010-03-12 17:47:22 +00:00
|
|
|
:group 'external
|
2010-03-12 19:13:38 +00:00
|
|
|
:group 'comm)
|
2000-03-20 13:12:14 +00:00
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
(defcustom browse-url-browser-function
|
2011-07-13 13:49:55 +00:00
|
|
|
'browse-url-default-browser
|
2007-08-23 18:41:14 +00:00
|
|
|
"Function to display the current buffer in a WWW browser.
|
2000-03-20 13:12:14 +00:00
|
|
|
This is used by the `browse-url-at-point', `browse-url-at-mouse', and
|
|
|
|
`browse-url-of-file' commands.
|
|
|
|
|
|
|
|
If the value is not a function it should be a list of pairs
|
2000-03-26 18:34:30 +00:00
|
|
|
\(REGEXP . FUNCTION). In this case the function called will be the one
|
2000-03-20 13:12:14 +00:00
|
|
|
associated with the first REGEXP which matches the current URL. The
|
|
|
|
function is passed the URL and any other args of `browse-url'. The last
|
|
|
|
regexp should probably be \".\" to specify a default browser."
|
|
|
|
:type '(choice
|
2000-03-26 18:34:30 +00:00
|
|
|
(function-item :tag "Emacs W3" :value browse-url-w3)
|
2013-12-17 21:17:05 +00:00
|
|
|
(function-item :tag "eww" :value eww-browse-url)
|
2001-11-19 19:12:31 +00:00
|
|
|
(function-item :tag "Mozilla" :value browse-url-mozilla)
|
2005-06-18 10:36:11 +00:00
|
|
|
(function-item :tag "Firefox" :value browse-url-firefox)
|
2016-01-25 16:49:09 +00:00
|
|
|
(function-item :tag "Google Chrome" :value browse-url-chrome)
|
2011-10-19 09:03:39 +00:00
|
|
|
(function-item :tag "Chromium" :value browse-url-chromium)
|
2003-07-07 20:54:56 +00:00
|
|
|
(function-item :tag "Epiphany" :value browse-url-epiphany)
|
2015-03-16 23:57:23 +00:00
|
|
|
(function-item :tag "Conkeror" :value browse-url-conkeror)
|
2007-10-29 13:56:39 +00:00
|
|
|
(function-item :tag "Text browser in an xterm window"
|
|
|
|
:value browse-url-text-xterm)
|
|
|
|
(function-item :tag "Text browser in an Emacs window"
|
|
|
|
:value browse-url-text-emacs)
|
2001-05-18 11:27:38 +00:00
|
|
|
(function-item :tag "KDE" :value browse-url-kde)
|
2007-09-07 04:37:01 +00:00
|
|
|
(function-item :tag "Elinks" :value browse-url-elinks)
|
2000-03-26 18:34:30 +00:00
|
|
|
(function-item :tag "Specified by `Browse Url Generic Program'"
|
|
|
|
:value browse-url-generic)
|
|
|
|
(function-item :tag "Default Windows browser"
|
2000-10-07 18:05:28 +00:00
|
|
|
:value browse-url-default-windows-browser)
|
2016-11-06 07:33:43 +00:00
|
|
|
(function-item :tag "Default macOS browser"
|
2003-04-12 22:21:18 +00:00
|
|
|
:value browse-url-default-macosx-browser)
|
2001-11-19 19:12:31 +00:00
|
|
|
(function-item :tag "Default browser"
|
|
|
|
:value browse-url-default-browser)
|
2000-03-26 18:34:30 +00:00
|
|
|
(function :tag "Your own function")
|
|
|
|
(alist :tag "Regexp/function association list"
|
|
|
|
:key-type regexp :value-type function))
|
2010-11-10 22:27:02 +00:00
|
|
|
:version "24.1"
|
2000-03-20 13:12:14 +00:00
|
|
|
:group 'browse-url)
|
|
|
|
|
2010-11-24 06:29:06 +00:00
|
|
|
(defcustom browse-url-mailto-function 'browse-url-mail
|
|
|
|
"Function to display mailto: links.
|
|
|
|
This variable uses the same syntax as the
|
|
|
|
`browse-url-browser-function' variable. If the
|
|
|
|
`browse-url-mailto-function' variable is nil, that variable will
|
|
|
|
be used instead."
|
|
|
|
:type '(choice
|
|
|
|
(function-item :tag "Emacs Mail" :value browse-url-mail)
|
|
|
|
(function-item :tag "None" nil))
|
|
|
|
:version "24.1"
|
|
|
|
:group 'browse-url)
|
|
|
|
|
2016-10-21 15:23:39 +00:00
|
|
|
(defcustom browse-url-man-function 'browse-url-man
|
|
|
|
"Function to display man: links."
|
|
|
|
:type '(radio
|
|
|
|
(function-item :tag "Emacs Man" :value browse-url-man)
|
|
|
|
(const :tag "None" nil)
|
|
|
|
(function :tag "Other function"))
|
|
|
|
:version "26.1"
|
|
|
|
:group 'browse-url)
|
|
|
|
|
2000-03-20 13:12:14 +00:00
|
|
|
(defcustom browse-url-netscape-program "netscape"
|
|
|
|
;; Info about netscape-remote from Karl Berry.
|
2007-08-23 18:41:14 +00:00
|
|
|
"The name by which to invoke Netscape.
|
2000-03-20 13:12:14 +00:00
|
|
|
|
|
|
|
The free program `netscape-remote' from
|
|
|
|
<URL:http://home.netscape.com/newsref/std/remote.c> is said to start
|
|
|
|
up very much quicker than `netscape'. Reported to compile on a GNU
|
|
|
|
system, given vroot.h from the same directory, with cc flags
|
|
|
|
-DSTANDALONE -L/usr/X11R6/lib -lXmu -lX11."
|
|
|
|
:type 'string
|
|
|
|
:group 'browse-url)
|
|
|
|
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
(make-obsolete-variable 'browse-url-netscape-program nil "25.1")
|
|
|
|
|
2000-03-20 13:12:14 +00:00
|
|
|
(defcustom browse-url-netscape-arguments nil
|
2007-08-23 18:41:14 +00:00
|
|
|
"A list of strings to pass to Netscape as arguments."
|
2000-03-20 13:12:14 +00:00
|
|
|
:type '(repeat (string :tag "Argument"))
|
|
|
|
:group 'browse-url)
|
|
|
|
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
(make-obsolete-variable 'browse-url-netscape-arguments nil "25.1")
|
|
|
|
|
2000-03-20 13:12:14 +00:00
|
|
|
(defcustom browse-url-netscape-startup-arguments browse-url-netscape-arguments
|
2007-08-23 18:41:14 +00:00
|
|
|
"A list of strings to pass to Netscape when it starts up.
|
2000-03-20 13:12:14 +00:00
|
|
|
Defaults to the value of `browse-url-netscape-arguments' at the time
|
|
|
|
`browse-url' is loaded."
|
|
|
|
:type '(repeat (string :tag "Argument"))
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
|
2000-03-20 13:12:14 +00:00
|
|
|
:group 'browse-url)
|
|
|
|
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
(make-obsolete-variable 'browse-url-netscape-startup-arguments nil "25.1")
|
|
|
|
|
2001-11-19 19:12:31 +00:00
|
|
|
(defcustom browse-url-browser-display nil
|
2012-02-28 08:17:21 +00:00
|
|
|
"The X display for running the browser, if not same as Emacs's."
|
2001-11-19 19:12:31 +00:00
|
|
|
:type '(choice string (const :tag "Default" nil))
|
|
|
|
:group 'browse-url)
|
|
|
|
|
|
|
|
(defcustom browse-url-mozilla-program "mozilla"
|
2007-08-23 18:41:14 +00:00
|
|
|
"The name by which to invoke Mozilla."
|
2001-11-19 19:12:31 +00:00
|
|
|
:type 'string
|
|
|
|
:group 'browse-url)
|
|
|
|
|
|
|
|
(defcustom browse-url-mozilla-arguments nil
|
2007-08-23 18:41:14 +00:00
|
|
|
"A list of strings to pass to Mozilla as arguments."
|
2001-11-19 19:12:31 +00:00
|
|
|
:type '(repeat (string :tag "Argument"))
|
|
|
|
:group 'browse-url)
|
|
|
|
|
|
|
|
(defcustom browse-url-mozilla-startup-arguments browse-url-mozilla-arguments
|
2007-08-23 18:41:14 +00:00
|
|
|
"A list of strings to pass to Mozilla when it starts up.
|
2001-11-19 19:12:31 +00:00
|
|
|
Defaults to the value of `browse-url-mozilla-arguments' at the time
|
|
|
|
`browse-url' is loaded."
|
|
|
|
:type '(repeat (string :tag "Argument"))
|
|
|
|
:group 'browse-url)
|
|
|
|
|
2010-04-29 14:04:33 +00:00
|
|
|
(defcustom browse-url-firefox-program
|
2015-03-22 07:39:21 +00:00
|
|
|
(let ((candidates '("icecat" "iceweasel" "firefox")))
|
2010-04-29 14:04:33 +00:00
|
|
|
(while (and candidates (not (executable-find (car candidates))))
|
|
|
|
(setq candidates (cdr candidates)))
|
|
|
|
(or (car candidates) "firefox"))
|
2015-03-22 07:39:21 +00:00
|
|
|
"The name by which to invoke Firefox or a variant of it."
|
2005-06-18 10:36:11 +00:00
|
|
|
:type 'string
|
|
|
|
:group 'browse-url)
|
|
|
|
|
|
|
|
(defcustom browse-url-firefox-arguments nil
|
2015-03-22 07:39:21 +00:00
|
|
|
"A list of strings to pass to Firefox (or variant) as arguments."
|
2005-06-18 10:36:11 +00:00
|
|
|
:type '(repeat (string :tag "Argument"))
|
|
|
|
:group 'browse-url)
|
|
|
|
|
|
|
|
(defcustom browse-url-firefox-startup-arguments browse-url-firefox-arguments
|
2015-03-22 07:39:21 +00:00
|
|
|
"A list of strings to pass to Firefox (or variant) when it starts up.
|
2005-06-18 10:36:11 +00:00
|
|
|
Defaults to the value of `browse-url-firefox-arguments' at the time
|
|
|
|
`browse-url' is loaded."
|
|
|
|
:type '(repeat (string :tag "Argument"))
|
|
|
|
:group 'browse-url)
|
|
|
|
|
2015-02-24 23:02:11 +00:00
|
|
|
(make-obsolete-variable 'browse-url-firefox-startup-arguments
|
|
|
|
"it no longer has any effect." "24.5")
|
|
|
|
|
2016-01-24 19:37:38 +00:00
|
|
|
(defcustom browse-url-chrome-program
|
|
|
|
(let ((candidates '("google-chrome-stable" "google-chrome")))
|
|
|
|
(while (and candidates (not (executable-find (car candidates))))
|
|
|
|
(setq candidates (cdr candidates)))
|
|
|
|
(or (car candidates) "chromium"))
|
2016-01-25 16:49:09 +00:00
|
|
|
"The name by which to invoke the Chrome browser."
|
2016-01-24 19:37:38 +00:00
|
|
|
:type 'string
|
2016-01-25 16:49:09 +00:00
|
|
|
:version "25.1"
|
2016-01-24 19:37:38 +00:00
|
|
|
:group 'browse-url)
|
|
|
|
|
|
|
|
(defcustom browse-url-chrome-arguments nil
|
|
|
|
"A list of strings to pass to Google Chrome as arguments."
|
|
|
|
:type '(repeat (string :tag "Argument"))
|
2016-01-25 16:49:09 +00:00
|
|
|
:version "25.1"
|
2016-01-24 19:37:38 +00:00
|
|
|
:group 'browse-url)
|
|
|
|
|
2011-10-19 09:03:39 +00:00
|
|
|
(defcustom browse-url-chromium-program
|
|
|
|
(let ((candidates '("chromium" "chromium-browser")))
|
|
|
|
(while (and candidates (not (executable-find (car candidates))))
|
|
|
|
(setq candidates (cdr candidates)))
|
|
|
|
(or (car candidates) "chromium"))
|
|
|
|
"The name by which to invoke Chromium."
|
|
|
|
:type 'string
|
|
|
|
:version "24.1"
|
|
|
|
:group 'browse-url)
|
|
|
|
|
|
|
|
(defcustom browse-url-chromium-arguments nil
|
|
|
|
"A list of strings to pass to Chromium as arguments."
|
|
|
|
:type '(repeat (string :tag "Argument"))
|
|
|
|
:version "24.1"
|
|
|
|
:group 'browse-url)
|
|
|
|
|
2010-04-29 14:04:33 +00:00
|
|
|
(defcustom browse-url-galeon-program "galeon"
|
2007-08-23 18:41:14 +00:00
|
|
|
"The name by which to invoke Galeon."
|
2001-11-19 19:12:31 +00:00
|
|
|
:type 'string
|
|
|
|
:group 'browse-url)
|
|
|
|
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
(make-obsolete-variable 'browse-url-galeon-program nil "25.1")
|
|
|
|
|
2001-11-19 19:12:31 +00:00
|
|
|
(defcustom browse-url-galeon-arguments nil
|
2007-08-23 18:41:14 +00:00
|
|
|
"A list of strings to pass to Galeon as arguments."
|
2001-11-19 19:12:31 +00:00
|
|
|
:type '(repeat (string :tag "Argument"))
|
|
|
|
:group 'browse-url)
|
|
|
|
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
(make-obsolete-variable 'browse-url-galeon-arguments nil "25.1")
|
|
|
|
|
2001-11-19 19:12:31 +00:00
|
|
|
(defcustom browse-url-galeon-startup-arguments browse-url-galeon-arguments
|
2007-08-23 18:41:14 +00:00
|
|
|
"A list of strings to pass to Galeon when it starts up.
|
2001-11-19 19:12:31 +00:00
|
|
|
Defaults to the value of `browse-url-galeon-arguments' at the time
|
|
|
|
`browse-url' is loaded."
|
|
|
|
:type '(repeat (string :tag "Argument"))
|
|
|
|
:group 'browse-url)
|
|
|
|
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
(make-obsolete-variable 'browse-url-galeon-startup-arguments nil "25.1")
|
|
|
|
|
2003-07-07 20:54:56 +00:00
|
|
|
(defcustom browse-url-epiphany-program "epiphany"
|
2007-08-23 18:41:14 +00:00
|
|
|
"The name by which to invoke Epiphany."
|
2003-07-07 20:54:56 +00:00
|
|
|
:type 'string
|
|
|
|
:group 'browse-url)
|
|
|
|
|
|
|
|
(defcustom browse-url-epiphany-arguments nil
|
2007-08-23 18:41:14 +00:00
|
|
|
"A list of strings to pass to Epiphany as arguments."
|
2003-07-07 20:54:56 +00:00
|
|
|
:type '(repeat (string :tag "Argument"))
|
|
|
|
:group 'browse-url)
|
|
|
|
|
|
|
|
(defcustom browse-url-epiphany-startup-arguments browse-url-epiphany-arguments
|
2007-08-23 18:41:14 +00:00
|
|
|
"A list of strings to pass to Epiphany when it starts up.
|
2003-07-07 20:54:56 +00:00
|
|
|
Defaults to the value of `browse-url-epiphany-arguments' at the time
|
|
|
|
`browse-url' is loaded."
|
|
|
|
:type '(repeat (string :tag "Argument"))
|
|
|
|
:group 'browse-url)
|
|
|
|
|
2011-11-14 06:27:12 +00:00
|
|
|
;; GNOME means of invoking either Mozilla or Netscape.
|
2004-11-07 04:00:18 +00:00
|
|
|
(defvar browse-url-gnome-moz-program "gnome-moz-remote")
|
|
|
|
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
(make-obsolete-variable 'browse-url-gnome-moz-program nil "25.1")
|
|
|
|
|
2004-11-07 04:00:18 +00:00
|
|
|
(defcustom browse-url-gnome-moz-arguments '()
|
2007-08-23 18:41:14 +00:00
|
|
|
"A list of strings passed to the GNOME mozilla viewer as arguments."
|
2004-11-07 04:00:18 +00:00
|
|
|
:version "21.1"
|
|
|
|
:type '(repeat (string :tag "Argument"))
|
|
|
|
:group 'browse-url)
|
|
|
|
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
(make-obsolete-variable 'browse-url-gnome-moz-arguments nil "25.1")
|
|
|
|
|
2002-10-11 17:17:10 +00:00
|
|
|
(defcustom browse-url-mozilla-new-window-is-tab nil
|
2007-08-23 18:41:14 +00:00
|
|
|
"Whether to open up new windows in a tab or a new window.
|
2002-10-11 17:17:10 +00:00
|
|
|
If non-nil, then open the URL in a new tab rather than a new window if
|
|
|
|
`browse-url-mozilla' is asked to open it in a new window."
|
|
|
|
:type 'boolean
|
|
|
|
:group 'browse-url)
|
|
|
|
|
2005-06-18 10:36:11 +00:00
|
|
|
(defcustom browse-url-firefox-new-window-is-tab nil
|
2007-08-23 18:41:14 +00:00
|
|
|
"Whether to open up new windows in a tab or a new window.
|
2005-06-18 10:36:11 +00:00
|
|
|
If non-nil, then open the URL in a new tab rather than a new window if
|
2016-11-04 09:24:21 +00:00
|
|
|
`browse-url-firefox' is asked to open it in a new window."
|
2005-06-18 10:36:11 +00:00
|
|
|
:type 'boolean
|
|
|
|
:group 'browse-url)
|
|
|
|
|
2015-03-16 23:57:23 +00:00
|
|
|
(defcustom browse-url-conkeror-new-window-is-buffer nil
|
|
|
|
"Whether to open up new windows in a buffer or a new window.
|
2015-03-18 00:09:34 +00:00
|
|
|
If non-nil, then open the URL in a new buffer rather than a new window if
|
|
|
|
`browse-url-conkeror' is asked to open it in a new window."
|
2016-01-13 01:06:49 +00:00
|
|
|
:version "25.1"
|
2015-03-16 23:57:23 +00:00
|
|
|
:type 'boolean
|
|
|
|
:group 'browse-url)
|
|
|
|
|
2001-11-25 00:04:41 +00:00
|
|
|
(defcustom browse-url-galeon-new-window-is-tab nil
|
2007-08-23 18:41:14 +00:00
|
|
|
"Whether to open up new windows in a tab or a new window.
|
2001-11-25 00:04:41 +00:00
|
|
|
If non-nil, then open the URL in a new tab rather than a new window if
|
|
|
|
`browse-url-galeon' is asked to open it in a new window."
|
|
|
|
:type 'boolean
|
|
|
|
:group 'browse-url)
|
|
|
|
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
(make-obsolete-variable 'browse-url-galeon-new-window-is-tab nil "25.1")
|
|
|
|
|
2003-07-07 20:54:56 +00:00
|
|
|
(defcustom browse-url-epiphany-new-window-is-tab nil
|
2007-08-23 18:41:14 +00:00
|
|
|
"Whether to open up new windows in a tab or a new window.
|
2003-07-07 20:54:56 +00:00
|
|
|
If non-nil, then open the URL in a new tab rather than a new window if
|
|
|
|
`browse-url-epiphany' is asked to open it in a new window."
|
|
|
|
:type 'boolean
|
|
|
|
:group 'browse-url)
|
|
|
|
|
2005-02-22 14:11:48 +00:00
|
|
|
(defcustom browse-url-netscape-new-window-is-tab nil
|
2007-08-23 18:41:14 +00:00
|
|
|
"Whether to open up new windows in a tab or a new window.
|
2005-02-22 14:11:48 +00:00
|
|
|
If non-nil, then open the URL in a new tab rather than a new
|
|
|
|
window if `browse-url-netscape' is asked to open it in a new
|
|
|
|
window."
|
|
|
|
:type 'boolean
|
|
|
|
:group 'browse-url)
|
|
|
|
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
(make-obsolete-variable 'browse-url-netscape-new-window-is-tab nil "25.1")
|
|
|
|
|
2001-04-18 12:48:36 +00:00
|
|
|
(defcustom browse-url-new-window-flag nil
|
2007-09-17 15:59:55 +00:00
|
|
|
"Non-nil means always open a new browser window with appropriate browsers.
|
2000-03-20 13:12:14 +00:00
|
|
|
Passing an interactive argument to \\[browse-url], or specific browser
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
commands reverses the effect of this variable."
|
2000-03-20 13:12:14 +00:00
|
|
|
:type 'boolean
|
|
|
|
:group 'browse-url)
|
|
|
|
|
|
|
|
(defcustom browse-url-mosaic-program "xmosaic"
|
2007-08-23 18:41:14 +00:00
|
|
|
"The name by which to invoke Mosaic (or mMosaic)."
|
2000-03-20 13:12:14 +00:00
|
|
|
:type 'string
|
|
|
|
:version "20.3"
|
|
|
|
:group 'browse-url)
|
|
|
|
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
(make-obsolete-variable 'browse-url-mosaic-program nil "25.1")
|
|
|
|
|
2000-03-20 13:12:14 +00:00
|
|
|
(defcustom browse-url-mosaic-arguments nil
|
2007-08-23 18:41:14 +00:00
|
|
|
"A list of strings to pass to Mosaic as arguments."
|
2000-03-20 13:12:14 +00:00
|
|
|
:type '(repeat (string :tag "Argument"))
|
|
|
|
:group 'browse-url)
|
|
|
|
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
(make-obsolete-variable 'browse-url-mosaic-arguments nil "25.1")
|
|
|
|
|
2002-03-18 04:24:09 +00:00
|
|
|
(defcustom browse-url-mosaic-pidfile "~/.mosaicpid"
|
2007-08-23 18:41:14 +00:00
|
|
|
"The name of the pidfile created by Mosaic."
|
2002-03-18 04:24:09 +00:00
|
|
|
:type 'string
|
|
|
|
:group 'browse-url)
|
|
|
|
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
(make-obsolete-variable 'browse-url-mosaic-pidfile nil "25.1")
|
|
|
|
|
2015-03-16 23:57:23 +00:00
|
|
|
(defcustom browse-url-conkeror-program "conkeror"
|
|
|
|
"The name by which to invoke Conkeror."
|
|
|
|
:type 'string
|
|
|
|
:version "25.1"
|
|
|
|
:group 'browse-url)
|
|
|
|
|
|
|
|
(defcustom browse-url-conkeror-arguments nil
|
|
|
|
"A list of strings to pass to Conkeror as arguments."
|
2016-01-13 01:06:49 +00:00
|
|
|
:version "25.1"
|
2015-03-16 23:57:23 +00:00
|
|
|
:type '(repeat (string :tag "Argument"))
|
|
|
|
:group 'browse-url)
|
|
|
|
|
2000-03-20 13:12:14 +00:00
|
|
|
(defcustom browse-url-filename-alist
|
2015-12-25 22:32:55 +00:00
|
|
|
`(("^/\\(ftp@\\|anonymous@\\)?\\([^:/]+\\):/*" . "ftp://\\2/")
|
2000-03-20 13:12:14 +00:00
|
|
|
;; The above loses the username to avoid the browser prompting for
|
|
|
|
;; it in anonymous cases. If it's not anonymous the next regexp
|
|
|
|
;; applies.
|
2015-12-25 22:32:55 +00:00
|
|
|
("^/\\([^:@/]+@\\)?\\([^:/]+\\):/*" . "ftp://\\1\\2/")
|
2012-04-13 15:15:42 +00:00
|
|
|
,@(if (memq system-type '(windows-nt ms-dos))
|
2009-11-23 20:58:55 +00:00
|
|
|
'(("^\\([a-zA-Z]:\\)[\\/]" . "file:///\\1/")
|
2007-08-23 18:41:14 +00:00
|
|
|
("^[\\/][\\/]+" . "file://")))
|
2009-04-15 22:51:26 +00:00
|
|
|
("^/+" . "file:///"))
|
2007-08-23 18:41:14 +00:00
|
|
|
"An alist of (REGEXP . STRING) pairs used by `browse-url-of-file'.
|
2000-03-20 13:12:14 +00:00
|
|
|
Any substring of a filename matching one of the REGEXPs is replaced by
|
|
|
|
the corresponding STRING using `replace-match', not treating STRING
|
|
|
|
literally. All pairs are applied in the order given. The default
|
2003-01-14 22:34:20 +00:00
|
|
|
value converts ange-ftp/EFS-style file names into ftp URLs and prepends
|
|
|
|
`file:' to any file name beginning with `/'.
|
2000-03-20 13:12:14 +00:00
|
|
|
|
|
|
|
For example, adding to the default a specific translation of an ange-ftp
|
|
|
|
address to an HTTP URL:
|
|
|
|
|
|
|
|
(setq browse-url-filename-alist
|
2015-09-03 22:31:12 +00:00
|
|
|
\\='((\"/webmaster@webserver:/home/www/html/\" .
|
2000-03-20 13:12:14 +00:00
|
|
|
\"http://www.acme.co.uk/\")
|
2015-12-25 22:32:55 +00:00
|
|
|
(\"^/\\(ftp@\\|anonymous@\\)?\\([^:/]+\\):/*\" . \"ftp://\\2/\")
|
|
|
|
(\"^/\\([^:@/]+@\\)?\\([^:/]+\\):/*\" . \"ftp://\\1\\2/\")
|
2007-08-23 18:41:14 +00:00
|
|
|
(\"^/+\" . \"file:/\")))"
|
2000-03-20 13:12:14 +00:00
|
|
|
:type '(repeat (cons :format "%v"
|
|
|
|
(regexp :tag "Regexp")
|
|
|
|
(string :tag "Replacement")))
|
2015-12-25 22:32:55 +00:00
|
|
|
:version "25.1"
|
2000-03-20 13:12:14 +00:00
|
|
|
:group 'browse-url)
|
|
|
|
|
|
|
|
(defcustom browse-url-save-file nil
|
2007-08-23 18:41:14 +00:00
|
|
|
"If non-nil, save the buffer before displaying its file.
|
2000-03-20 13:12:14 +00:00
|
|
|
Used by the `browse-url-of-file' command."
|
|
|
|
:type 'boolean
|
|
|
|
:group 'browse-url)
|
|
|
|
|
|
|
|
(defcustom browse-url-of-file-hook nil
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
"Hook run after `browse-url-of-file' has asked a browser to load a file."
|
2000-03-20 13:12:14 +00:00
|
|
|
:type 'hook
|
|
|
|
:group 'browse-url)
|
|
|
|
|
|
|
|
(defcustom browse-url-CCI-port 3003
|
2007-08-23 18:41:14 +00:00
|
|
|
"Port to access XMosaic via CCI.
|
2000-03-20 13:12:14 +00:00
|
|
|
This can be any number between 1024 and 65535 but must correspond to
|
|
|
|
the value set in the browser."
|
|
|
|
:type 'integer
|
|
|
|
:group 'browse-url)
|
|
|
|
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
(make-obsolete-variable 'browse-url-CCI-port nil "25.1")
|
|
|
|
|
2000-03-20 13:12:14 +00:00
|
|
|
(defcustom browse-url-CCI-host "localhost"
|
2007-08-23 18:41:14 +00:00
|
|
|
"Host to access XMosaic via CCI.
|
2000-03-20 13:12:14 +00:00
|
|
|
This should be the host name of the machine running XMosaic with CCI
|
|
|
|
enabled. The port number should be set in `browse-url-CCI-port'."
|
|
|
|
:type 'string
|
|
|
|
:group 'browse-url)
|
|
|
|
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
(make-obsolete-variable 'browse-url-CCI-host nil "25.1")
|
|
|
|
|
2000-03-20 13:12:14 +00:00
|
|
|
(defvar browse-url-temp-file-name nil)
|
|
|
|
(make-variable-buffer-local 'browse-url-temp-file-name)
|
2008-07-08 14:45:36 +00:00
|
|
|
|
2000-03-20 13:12:14 +00:00
|
|
|
(defcustom browse-url-xterm-program "xterm"
|
2007-10-29 13:56:39 +00:00
|
|
|
"The name of the terminal emulator used by `browse-url-text-xterm'.
|
2005-06-10 14:13:42 +00:00
|
|
|
This might, for instance, be a separate color version of xterm."
|
2000-03-20 13:12:14 +00:00
|
|
|
:type 'string
|
|
|
|
:group 'browse-url)
|
|
|
|
|
|
|
|
(defcustom browse-url-xterm-args nil
|
2007-08-23 18:41:14 +00:00
|
|
|
"A list of strings defining options for `browse-url-xterm-program'.
|
2000-03-20 13:12:14 +00:00
|
|
|
These might set its size, for instance."
|
|
|
|
:type '(repeat (string :tag "Argument"))
|
|
|
|
:group 'browse-url)
|
|
|
|
|
|
|
|
(defcustom browse-url-gnudoit-program "gnudoit"
|
2007-08-23 18:41:14 +00:00
|
|
|
"The name of the `gnudoit' program used by `browse-url-w3-gnudoit'."
|
2000-03-20 13:12:14 +00:00
|
|
|
:type 'string
|
|
|
|
:group 'browse-url)
|
|
|
|
|
|
|
|
(defcustom browse-url-gnudoit-args '("-q")
|
2007-08-23 18:41:14 +00:00
|
|
|
"A list of strings defining options for `browse-url-gnudoit-program'.
|
2000-03-20 13:12:14 +00:00
|
|
|
These might set the port, for instance."
|
|
|
|
:type '(repeat (string :tag "Argument"))
|
|
|
|
:group 'browse-url)
|
|
|
|
|
|
|
|
(defcustom browse-url-generic-program nil
|
2007-08-23 18:41:14 +00:00
|
|
|
"The name of the browser program used by `browse-url-generic'."
|
2000-03-20 13:12:14 +00:00
|
|
|
:type '(choice string (const :tag "None" nil))
|
|
|
|
:group 'browse-url)
|
|
|
|
|
|
|
|
(defcustom browse-url-generic-args nil
|
2007-08-23 18:41:14 +00:00
|
|
|
"A list of strings defining options for `browse-url-generic-program'."
|
2000-03-20 13:12:14 +00:00
|
|
|
:type '(repeat (string :tag "Argument"))
|
|
|
|
:group 'browse-url)
|
|
|
|
|
|
|
|
(defcustom browse-url-temp-dir temporary-file-directory
|
2007-08-23 18:41:14 +00:00
|
|
|
"The name of a directory for browse-url's temporary files.
|
2000-03-20 13:12:14 +00:00
|
|
|
Such files are generated by functions like `browse-url-of-region'.
|
|
|
|
You might want to set this to somewhere with restricted read permissions
|
|
|
|
for privacy's sake."
|
|
|
|
:type 'string
|
|
|
|
:group 'browse-url)
|
|
|
|
|
2007-08-23 18:41:14 +00:00
|
|
|
(defcustom browse-url-netscape-version 3
|
|
|
|
"The version of Netscape you are using.
|
2000-03-20 13:12:14 +00:00
|
|
|
This affects how URL reloading is done; the mechanism changed
|
|
|
|
incompatibly at version 4."
|
|
|
|
:type 'number
|
|
|
|
:group 'browse-url)
|
|
|
|
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
(make-obsolete-variable 'browse-url-netscape-version nil "25.1")
|
|
|
|
|
2007-10-29 13:56:39 +00:00
|
|
|
(defcustom browse-url-text-browser "lynx"
|
|
|
|
"The name of the text browser to invoke."
|
|
|
|
:type 'string
|
|
|
|
:group 'browse-url
|
|
|
|
:version "23.1")
|
|
|
|
|
|
|
|
(defcustom browse-url-text-emacs-args (and (not window-system)
|
|
|
|
'("-show_cursor"))
|
|
|
|
"A list of strings defining options for a text browser in an Emacs buffer.
|
|
|
|
|
|
|
|
The default is none in a window system, otherwise `-show_cursor' to
|
|
|
|
indicate the position of the current link in the absence of
|
|
|
|
highlighting, assuming the normal default for showing the cursor."
|
|
|
|
:type '(repeat (string :tag "Argument"))
|
|
|
|
:version "23.1"
|
|
|
|
:group 'browse-url)
|
|
|
|
|
|
|
|
(defcustom browse-url-text-input-field 'avoid
|
|
|
|
"Action on selecting an existing text browser buffer at an input field.
|
|
|
|
What to do when sending a new URL to an existing text browser buffer in Emacs
|
|
|
|
if the browser cursor is on an input field (in which case the `g' command
|
2000-03-20 13:12:14 +00:00
|
|
|
would be entered as data). Such fields are recognized by the
|
2007-10-29 13:56:39 +00:00
|
|
|
underlines ____. Allowed values: nil: disregard it, `warn': warn the
|
|
|
|
user and don't emit the URL, `avoid': try to avoid the field by moving
|
2000-03-20 13:12:14 +00:00
|
|
|
down (this *won't* always work)."
|
|
|
|
:type '(choice (const :tag "Move to try to avoid field" :value avoid)
|
|
|
|
(const :tag "Disregard" :value nil)
|
|
|
|
(const :tag "Warn, don't emit URL" :value warn))
|
2007-10-29 13:56:39 +00:00
|
|
|
:version "23.1"
|
2000-03-20 13:12:14 +00:00
|
|
|
:group 'browse-url)
|
|
|
|
|
2007-10-29 13:56:39 +00:00
|
|
|
(defcustom browse-url-text-input-attempts 10
|
|
|
|
"How many times to try to move down from a series of text browser input fields."
|
2002-07-22 15:21:41 +00:00
|
|
|
:type 'integer
|
2007-10-29 13:56:39 +00:00
|
|
|
:version "23.1"
|
2002-07-22 15:21:41 +00:00
|
|
|
:group 'browse-url)
|
2000-03-20 13:12:14 +00:00
|
|
|
|
2007-10-29 13:56:39 +00:00
|
|
|
(defcustom browse-url-text-input-delay 0.2
|
|
|
|
"Seconds to wait for a text browser between moves down from an input field."
|
2002-07-22 15:21:41 +00:00
|
|
|
:type 'number
|
2007-10-29 13:56:39 +00:00
|
|
|
:version "23.1"
|
2002-07-22 15:21:41 +00:00
|
|
|
:group 'browse-url)
|
2000-03-20 13:12:14 +00:00
|
|
|
|
2001-05-18 11:27:38 +00:00
|
|
|
(defcustom browse-url-kde-program "kfmclient"
|
2007-08-23 18:41:14 +00:00
|
|
|
"The name by which to invoke the KDE web browser."
|
2001-05-18 11:27:38 +00:00
|
|
|
:type 'string
|
|
|
|
:version "21.1"
|
|
|
|
:group 'browse-url)
|
|
|
|
|
|
|
|
(defcustom browse-url-kde-args '("openURL")
|
2007-08-23 18:41:14 +00:00
|
|
|
"A list of strings defining options for `browse-url-kde-program'."
|
2001-05-18 11:27:38 +00:00
|
|
|
:type '(repeat (string :tag "Argument"))
|
|
|
|
:group 'browse-url)
|
|
|
|
|
2007-09-07 04:37:01 +00:00
|
|
|
(defcustom browse-url-elinks-wrapper '("xterm" "-e")
|
Remove leading `*' from docs of some defcustoms etc.
* emulation/crisp.el, emulation/cua-base.el, emulation/edt.el:
* emulation/pc-select.el, emulation/vip.el, international/iso-ascii.el:
* international/kkc.el, international/ogonek.el, mail/feedmail.el:
* net/browse-url.el, net/eudc-vars.el, net/net-utils.el:
* net/rcompile.el, net/rlogin.el, textmodes/enriched.el:
* textmodes/makeinfo.el, textmodes/page-ext.el, textmodes/picture.el:
* textmodes/refer.el, textmodes/spell.el, textmodes/table.el:
* textmodes/tex-mode.el, textmodes/two-column.el:
Remove leading `*' from docs of defcustoms etc.
2010-09-23 06:42:45 +00:00
|
|
|
"Wrapper command prepended to the Elinks command-line."
|
2007-09-07 04:37:01 +00:00
|
|
|
:type '(repeat (string :tag "Wrapper"))
|
|
|
|
:group 'browse-url)
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; URL encoding
|
|
|
|
|
2007-09-17 15:59:55 +00:00
|
|
|
(defun browse-url-url-encode-chars (text chars)
|
|
|
|
"URL-encode the chars in TEXT that match CHARS.
|
2010-01-02 20:14:54 +00:00
|
|
|
CHARS is a regexp-like character alternative (e.g., \"[)$]\")."
|
2007-09-19 11:22:03 +00:00
|
|
|
(let ((encoded-text (copy-sequence text))
|
2007-09-12 11:48:34 +00:00
|
|
|
(s 0))
|
2007-09-19 11:22:03 +00:00
|
|
|
(while (setq s (string-match chars encoded-text s))
|
|
|
|
(setq encoded-text
|
2012-05-09 12:39:40 +00:00
|
|
|
(replace-match (format "%%%X"
|
2007-09-19 11:22:03 +00:00
|
|
|
(string-to-char (match-string 0 encoded-text)))
|
|
|
|
t t encoded-text)
|
2007-09-12 11:48:34 +00:00
|
|
|
s (1+ s)))
|
2007-09-19 11:22:03 +00:00
|
|
|
encoded-text))
|
2007-09-07 04:37:01 +00:00
|
|
|
|
2007-09-17 15:59:55 +00:00
|
|
|
(defun browse-url-encode-url (url)
|
|
|
|
"Escape annoying characters in URL.
|
2010-01-02 20:14:54 +00:00
|
|
|
The annoying characters are those that can mislead a web browser
|
|
|
|
regarding its parameter treatment."
|
|
|
|
;; FIXME: Is there an actual example of a web browser getting
|
|
|
|
;; confused? (This used to encode commas, but at least Firefox
|
|
|
|
;; handles commas correctly and doesn't accept encoded commas.)
|
2012-05-09 12:39:40 +00:00
|
|
|
(browse-url-url-encode-chars url "[\")$] "))
|
2007-09-17 15:59:55 +00:00
|
|
|
|
2000-03-20 13:12:14 +00:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; URL input
|
|
|
|
|
|
|
|
(defun browse-url-url-at-point ()
|
2013-05-08 15:13:25 +00:00
|
|
|
(or (thing-at-point 'url t)
|
|
|
|
;; assume that the user is pointing at something like gnu.org/gnu
|
|
|
|
(let ((f (thing-at-point 'filename t)))
|
|
|
|
(and f (concat "http://" f)))))
|
2000-03-20 13:12:14 +00:00
|
|
|
|
|
|
|
;; Having this as a separate function called by the browser-specific
|
|
|
|
;; functions allows them to be stand-alone commands, making it easier
|
|
|
|
;; to switch between browsers.
|
|
|
|
|
2015-02-01 19:39:36 +00:00
|
|
|
(defun browse-url-interactive-arg (prompt)
|
2000-03-20 13:12:14 +00:00
|
|
|
"Read a URL from the minibuffer, prompting with PROMPT.
|
2004-05-23 22:38:30 +00:00
|
|
|
If `transient-mark-mode' is non-nil and the mark is active,
|
2004-05-29 15:34:50 +00:00
|
|
|
it defaults to the current region, else to the URL at or before
|
|
|
|
point. If invoked with a mouse button, it moves point to the
|
|
|
|
position clicked before acting.
|
|
|
|
|
|
|
|
This function returns a list (URL NEW-WINDOW-FLAG)
|
|
|
|
for use in `interactive'."
|
2000-03-20 13:12:14 +00:00
|
|
|
(let ((event (elt (this-command-keys) 0)))
|
|
|
|
(and (listp event) (mouse-set-point event)))
|
2004-05-23 22:38:30 +00:00
|
|
|
(list (read-string prompt (or (and transient-mark-mode mark-active
|
|
|
|
;; rfc2396 Appendix E.
|
|
|
|
(replace-regexp-in-string
|
|
|
|
"[\t\r\f\n ]+" ""
|
|
|
|
(buffer-substring-no-properties
|
|
|
|
(region-beginning) (region-end))))
|
2015-02-01 19:39:36 +00:00
|
|
|
(browse-url-url-at-point)))
|
2001-04-18 12:48:36 +00:00
|
|
|
(not (eq (null browse-url-new-window-flag)
|
2000-03-20 13:12:14 +00:00
|
|
|
(null current-prefix-arg)))))
|
|
|
|
|
2004-11-04 10:15:37 +00:00
|
|
|
;; called-interactive-p needs to be called at a function's top-level, hence
|
|
|
|
;; this macro. We use that rather than interactive-p because
|
|
|
|
;; use in a keyboard macro should not change this behavior.
|
2000-03-22 23:06:18 +00:00
|
|
|
(defmacro browse-url-maybe-new-window (arg)
|
2009-10-02 00:02:02 +00:00
|
|
|
`(if (or noninteractive (not (called-interactively-p 'any)))
|
2000-03-22 23:06:18 +00:00
|
|
|
,arg
|
2001-04-18 12:48:36 +00:00
|
|
|
browse-url-new-window-flag))
|
2000-03-22 23:06:18 +00:00
|
|
|
|
2000-03-20 13:12:14 +00:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; Browse current buffer
|
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
(defun browse-url-of-file (&optional file)
|
|
|
|
"Ask a WWW browser to display FILE.
|
|
|
|
Display the current buffer's file if FILE is nil or if called
|
|
|
|
interactively. Turn the filename into a URL with function
|
|
|
|
`browse-url-file-url'. Pass the URL to a browser using the
|
|
|
|
`browse-url' function then run `browse-url-of-file-hook'."
|
|
|
|
(interactive)
|
|
|
|
(or file
|
|
|
|
(setq file (buffer-file-name))
|
|
|
|
(error "Current buffer has no file"))
|
|
|
|
(let ((buf (get-file-buffer file)))
|
|
|
|
(if buf
|
2007-08-22 18:52:59 +00:00
|
|
|
(with-current-buffer buf
|
2000-03-20 13:12:14 +00:00
|
|
|
(cond ((not (buffer-modified-p)))
|
|
|
|
(browse-url-save-file (save-buffer))
|
|
|
|
(t (message "%s modified since last save" file))))))
|
|
|
|
(browse-url (browse-url-file-url file))
|
|
|
|
(run-hooks 'browse-url-of-file-hook))
|
|
|
|
|
|
|
|
(defun browse-url-file-url (file)
|
|
|
|
"Return the URL corresponding to FILE.
|
|
|
|
Use variable `browse-url-filename-alist' to map filenames to URLs."
|
2013-12-03 12:21:13 +00:00
|
|
|
(let ((coding (if (equal system-type 'windows-nt)
|
|
|
|
;; W32 pretends that file names are UTF-8 encoded.
|
|
|
|
'utf-8
|
|
|
|
(and (default-value 'enable-multibyte-characters)
|
|
|
|
(or file-name-coding-system
|
|
|
|
default-file-name-coding-system)))))
|
2006-05-20 04:29:38 +00:00
|
|
|
(if coding (setq file (encode-coding-string file coding))))
|
2007-09-17 15:59:55 +00:00
|
|
|
(setq file (browse-url-url-encode-chars file "[*\"()',=;?% ]"))
|
2000-09-26 13:05:29 +00:00
|
|
|
(dolist (map browse-url-filename-alist)
|
|
|
|
(when (and map (string-match (car map) file))
|
|
|
|
(setq file (replace-match (cdr map) t nil file))))
|
2000-03-20 13:12:14 +00:00
|
|
|
file)
|
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
(defun browse-url-of-buffer (&optional buffer)
|
|
|
|
"Ask a WWW browser to display BUFFER.
|
|
|
|
Display the current buffer if BUFFER is nil. Display only the
|
|
|
|
currently visible part of BUFFER (from a temporary file) if buffer is
|
|
|
|
narrowed."
|
|
|
|
(interactive)
|
|
|
|
(save-excursion
|
|
|
|
(and buffer (set-buffer buffer))
|
|
|
|
(let ((file-name
|
|
|
|
;; Ignore real name if restricted
|
2012-09-07 08:58:31 +00:00
|
|
|
(and (not (buffer-narrowed-p))
|
2000-03-20 13:12:14 +00:00
|
|
|
(or buffer-file-name
|
|
|
|
(and (boundp 'dired-directory) dired-directory)))))
|
|
|
|
(or file-name
|
|
|
|
(progn
|
|
|
|
(or browse-url-temp-file-name
|
|
|
|
(setq browse-url-temp-file-name
|
|
|
|
(convert-standard-filename
|
|
|
|
(make-temp-file
|
2005-10-25 13:18:52 +00:00
|
|
|
(expand-file-name "burl" browse-url-temp-dir)
|
|
|
|
nil ".html"))))
|
2000-03-20 13:12:14 +00:00
|
|
|
(setq file-name browse-url-temp-file-name)
|
|
|
|
(write-region (point-min) (point-max) file-name nil 'no-message)))
|
|
|
|
(browse-url-of-file file-name))))
|
|
|
|
|
|
|
|
(defun browse-url-delete-temp-file (&optional temp-file-name)
|
|
|
|
;; Delete browse-url-temp-file-name from the file system
|
|
|
|
;; If optional arg TEMP-FILE-NAME is non-nil, delete it instead
|
|
|
|
(let ((file-name (or temp-file-name browse-url-temp-file-name)))
|
|
|
|
(if (and file-name (file-exists-p file-name))
|
|
|
|
(delete-file file-name))))
|
|
|
|
|
|
|
|
(add-hook 'kill-buffer-hook 'browse-url-delete-temp-file)
|
|
|
|
|
2010-10-09 00:52:12 +00:00
|
|
|
(declare-function dired-get-filename "dired"
|
|
|
|
(&optional localp no-error-if-not-filep))
|
|
|
|
|
2000-03-20 13:12:14 +00:00
|
|
|
;;;###autoload
|
|
|
|
(defun browse-url-of-dired-file ()
|
|
|
|
"In Dired, ask a WWW browser to display the file named on this line."
|
|
|
|
(interactive)
|
2011-05-08 18:34:51 +00:00
|
|
|
(let ((tem (dired-get-filename t t)))
|
|
|
|
(if tem
|
|
|
|
(browse-url-of-file (expand-file-name tem))
|
|
|
|
(error "No file on this line"))))
|
2000-03-20 13:12:14 +00:00
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
(defun browse-url-of-region (min max)
|
|
|
|
"Ask a WWW browser to display the current region."
|
|
|
|
(interactive "r")
|
|
|
|
(save-excursion
|
|
|
|
(save-restriction
|
|
|
|
(narrow-to-region min max)
|
|
|
|
(browse-url-of-buffer))))
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; Browser-independent commands
|
|
|
|
|
|
|
|
;; A generic command to call the current browse-url-browser-function
|
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
(defun browse-url (url &rest args)
|
|
|
|
"Ask a WWW browser to load URL.
|
2015-04-19 01:00:02 +00:00
|
|
|
Prompt for a URL, defaulting to the URL at or before point.
|
2015-12-26 18:47:42 +00:00
|
|
|
Invokes a suitable browser function which does the actual job.
|
|
|
|
The variable `browse-url-browser-function' says which browser function to
|
|
|
|
use. If the URL is a mailto: URL, consult `browse-url-mailto-function'
|
2015-04-19 01:00:02 +00:00
|
|
|
first, if that exists.
|
|
|
|
|
2015-12-26 18:47:42 +00:00
|
|
|
The additional ARGS are passed to the browser function. See the doc
|
|
|
|
strings of the actual functions, starting with `browse-url-browser-function',
|
|
|
|
for information about the significance of ARGS (most of the functions
|
|
|
|
ignore it).
|
|
|
|
If ARGS are omitted, the default is to pass `browse-url-new-window-flag'
|
|
|
|
as ARGS."
|
2000-03-20 13:12:14 +00:00
|
|
|
(interactive (browse-url-interactive-arg "URL: "))
|
2009-10-02 03:48:36 +00:00
|
|
|
(unless (called-interactively-p 'interactive)
|
2001-04-18 12:48:36 +00:00
|
|
|
(setq args (or args (list browse-url-new-window-flag))))
|
2014-05-13 08:54:08 +00:00
|
|
|
(when (and url-handler-mode (not (file-name-absolute-p url)))
|
|
|
|
(setq url (expand-file-name url)))
|
2010-11-24 06:29:06 +00:00
|
|
|
(let ((process-environment (copy-sequence process-environment))
|
|
|
|
(function (or (and (string-match "\\`mailto:" url)
|
|
|
|
browse-url-mailto-function)
|
2016-10-21 15:23:39 +00:00
|
|
|
(and (string-match "\\`man:" url)
|
|
|
|
browse-url-man-function)
|
2011-03-04 08:21:56 +00:00
|
|
|
browse-url-browser-function))
|
|
|
|
;; Ensure that `default-directory' exists and is readable (b#6077).
|
2014-05-13 08:54:08 +00:00
|
|
|
(default-directory (or (unhandled-file-name-directory default-directory)
|
|
|
|
(expand-file-name "~/"))))
|
2006-12-08 03:17:10 +00:00
|
|
|
;; When connected to various displays, be careful to use the display of
|
|
|
|
;; the currently selected frame, rather than the original start display,
|
|
|
|
;; which may not even exist any more.
|
2013-07-31 06:52:26 +00:00
|
|
|
(if (stringp (frame-parameter nil 'display))
|
|
|
|
(setenv "DISPLAY" (frame-parameter nil 'display)))
|
2010-11-24 06:29:06 +00:00
|
|
|
(if (and (consp function)
|
|
|
|
(not (functionp function)))
|
2009-10-18 23:55:16 +00:00
|
|
|
;; The `function' can be an alist; look down it for first match
|
|
|
|
;; and apply the function (which might be a lambda).
|
|
|
|
(catch 'done
|
2010-11-24 06:29:06 +00:00
|
|
|
(dolist (bf function)
|
2009-10-18 23:55:16 +00:00
|
|
|
(when (string-match (car bf) url)
|
|
|
|
(apply (cdr bf) url args)
|
|
|
|
(throw 'done t)))
|
|
|
|
(error "No browse-url-browser-function matching URL %s"
|
|
|
|
url))
|
|
|
|
;; Unbound symbols go down this leg, since void-function from
|
|
|
|
;; apply is clearer than wrong-type-argument from dolist.
|
2010-11-24 06:29:06 +00:00
|
|
|
(apply function url args))))
|
2000-03-20 13:12:14 +00:00
|
|
|
|
|
|
|
;;;###autoload
|
2000-03-22 23:06:18 +00:00
|
|
|
(defun browse-url-at-point (&optional arg)
|
2000-03-20 13:12:14 +00:00
|
|
|
"Ask a WWW browser to load the URL at or before point.
|
2015-04-19 01:00:02 +00:00
|
|
|
Variable `browse-url-browser-function' says which browser to use.
|
|
|
|
Optional prefix argument ARG non-nil inverts the value of the option
|
|
|
|
`browse-url-new-window-flag'."
|
2000-03-22 23:06:18 +00:00
|
|
|
(interactive "P")
|
2000-08-15 11:17:17 +00:00
|
|
|
(let ((url (browse-url-url-at-point)))
|
|
|
|
(if url
|
|
|
|
(browse-url url (if arg
|
2001-04-18 12:48:36 +00:00
|
|
|
(not browse-url-new-window-flag)
|
|
|
|
browse-url-new-window-flag))
|
2000-08-15 11:17:17 +00:00
|
|
|
(error "No URL found"))))
|
2000-03-20 13:12:14 +00:00
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
(defun browse-url-at-mouse (event)
|
|
|
|
"Ask a WWW browser to load a URL clicked with the mouse.
|
|
|
|
The URL is the one around or before the position of the mouse click
|
2015-03-18 03:55:02 +00:00
|
|
|
but point is not changed. Variable `browse-url-browser-function'
|
|
|
|
says which browser to use."
|
2000-03-20 13:12:14 +00:00
|
|
|
(interactive "e")
|
|
|
|
(save-excursion
|
2000-08-15 11:17:17 +00:00
|
|
|
(mouse-set-point event)
|
2002-06-21 09:58:32 +00:00
|
|
|
;; This handles browse-url-new-window-flag properly
|
|
|
|
;; when it gets no arg.
|
|
|
|
(browse-url-at-point)))
|
2000-03-20 13:12:14 +00:00
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; Browser-specific commands
|
|
|
|
|
|
|
|
;; --- Default MS-Windows browser ---
|
|
|
|
|
2005-07-03 16:31:40 +00:00
|
|
|
(defvar dos-windows-version)
|
2007-11-22 01:05:55 +00:00
|
|
|
(declare-function w32-shell-execute "w32fns.c") ;; Defined in C.
|
2005-07-03 16:31:40 +00:00
|
|
|
|
2013-09-10 21:52:26 +00:00
|
|
|
(defun browse-url-default-windows-browser (url &optional _new-window)
|
2015-12-26 18:47:42 +00:00
|
|
|
"Invoke the MS-Windows system's default Web browser.
|
|
|
|
The optional NEW-WINDOW argument is not used."
|
2000-03-20 13:12:14 +00:00
|
|
|
(interactive (browse-url-interactive-arg "URL: "))
|
2009-11-20 21:49:46 +00:00
|
|
|
(cond ((eq system-type 'ms-dos)
|
|
|
|
(if dos-windows-version
|
|
|
|
(shell-command (concat "start " (shell-quote-argument url)))
|
|
|
|
(error "Browsing URLs is not supported on this system")))
|
|
|
|
((eq system-type 'cygwin)
|
2009-11-23 20:58:55 +00:00
|
|
|
(call-process "cygstart" nil nil nil url))
|
2017-03-07 16:37:58 +00:00
|
|
|
(t (w32-shell-execute "open" (url-unhex-string url)))))
|
2000-03-20 13:12:14 +00:00
|
|
|
|
2013-09-10 21:52:26 +00:00
|
|
|
(defun browse-url-default-macosx-browser (url &optional _new-window)
|
2016-11-06 07:33:43 +00:00
|
|
|
"Invoke the macOS system's default Web browser.
|
2015-12-26 18:47:42 +00:00
|
|
|
The optional NEW-WINDOW argument is not used"
|
2003-04-12 22:21:18 +00:00
|
|
|
(interactive (browse-url-interactive-arg "URL: "))
|
|
|
|
(start-process (concat "open " url) nil "open" url))
|
|
|
|
|
2000-03-20 13:12:14 +00:00
|
|
|
;; --- Netscape ---
|
|
|
|
|
|
|
|
(defun browse-url-process-environment ()
|
2001-11-19 19:12:31 +00:00
|
|
|
"Set DISPLAY in the environment to the X display the browser will use.
|
|
|
|
This is either the value of variable `browse-url-browser-display' if
|
2000-03-20 13:12:14 +00:00
|
|
|
non-nil, or the same display as Emacs if different from the current
|
|
|
|
environment, otherwise just use the current environment."
|
2001-11-19 19:12:31 +00:00
|
|
|
(let ((display (or browse-url-browser-display (browse-url-emacs-display))))
|
2000-03-20 13:12:14 +00:00
|
|
|
(if display
|
|
|
|
(cons (concat "DISPLAY=" display) process-environment)
|
|
|
|
process-environment)))
|
|
|
|
|
|
|
|
(defun browse-url-emacs-display ()
|
|
|
|
"Return the X display Emacs is running on.
|
|
|
|
This is nil if the display is the same as the DISPLAY environment variable.
|
|
|
|
|
|
|
|
Actually Emacs could be using several displays; this just returns the
|
|
|
|
one showing the selected frame."
|
|
|
|
(let ((display (cdr-safe (assq 'display (frame-parameters)))))
|
|
|
|
(and (not (equal display (getenv "DISPLAY")))
|
|
|
|
display)))
|
|
|
|
|
2001-11-19 19:12:31 +00:00
|
|
|
(defun browse-url-default-browser (url &rest args)
|
|
|
|
"Find a suitable browser and ask it to load URL.
|
|
|
|
Default to the URL around or before point.
|
|
|
|
|
|
|
|
When called interactively, if variable `browse-url-new-window-flag' is
|
|
|
|
non-nil, load the document in a new window, if possible, otherwise use
|
|
|
|
a random existing one. A non-nil interactive prefix argument reverses
|
|
|
|
the effect of `browse-url-new-window-flag'.
|
|
|
|
|
2015-12-26 18:47:42 +00:00
|
|
|
When called non-interactively, optional second argument ARGS is used
|
|
|
|
instead of `browse-url-new-window-flag'."
|
2001-11-19 19:12:31 +00:00
|
|
|
(apply
|
2007-09-17 15:59:55 +00:00
|
|
|
(cond
|
2011-07-13 13:49:55 +00:00
|
|
|
((memq system-type '(windows-nt ms-dos cygwin))
|
|
|
|
'browse-url-default-windows-browser)
|
|
|
|
((memq system-type '(darwin))
|
|
|
|
'browse-url-default-macosx-browser)
|
2010-08-17 08:01:10 +00:00
|
|
|
((browse-url-can-use-xdg-open) 'browse-url-xdg-open)
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
;;; ((executable-find browse-url-gnome-moz-program) 'browse-url-gnome-moz)
|
2007-09-17 15:59:55 +00:00
|
|
|
((executable-find browse-url-mozilla-program) 'browse-url-mozilla)
|
|
|
|
((executable-find browse-url-firefox-program) 'browse-url-firefox)
|
2011-10-19 09:03:39 +00:00
|
|
|
((executable-find browse-url-chromium-program) 'browse-url-chromium)
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
;;; ((executable-find browse-url-galeon-program) 'browse-url-galeon)
|
2007-09-17 15:59:55 +00:00
|
|
|
((executable-find browse-url-kde-program) 'browse-url-kde)
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
;;; ((executable-find browse-url-netscape-program) 'browse-url-netscape)
|
|
|
|
;;; ((executable-find browse-url-mosaic-program) 'browse-url-mosaic)
|
2015-03-16 23:57:23 +00:00
|
|
|
((executable-find browse-url-conkeror-program) 'browse-url-conkeror)
|
2016-01-30 19:52:42 +00:00
|
|
|
((executable-find browse-url-chrome-program) 'browse-url-chrome)
|
2007-10-29 13:56:39 +00:00
|
|
|
((executable-find browse-url-xterm-program) 'browse-url-text-xterm)
|
2007-09-17 15:59:55 +00:00
|
|
|
((locate-library "w3") 'browse-url-w3)
|
|
|
|
(t
|
2013-09-10 21:52:26 +00:00
|
|
|
(lambda (&rest _ignore) (error "No usable browser found"))))
|
2007-09-17 15:59:55 +00:00
|
|
|
url args))
|
2001-11-19 19:12:31 +00:00
|
|
|
|
2010-08-17 08:01:10 +00:00
|
|
|
(defun browse-url-can-use-xdg-open ()
|
2012-02-09 03:14:22 +00:00
|
|
|
"Return non-nil if the \"xdg-open\" program can be used.
|
2017-03-10 03:01:19 +00:00
|
|
|
xdg-open is a desktop utility that calls your preferred web browser."
|
|
|
|
;; The exact set of situations where xdg-open works is complicated,
|
|
|
|
;; and it would be a pain to duplicate xdg-open's situation-specific
|
|
|
|
;; code here, as the code is a moving target. So assume that
|
|
|
|
;; xdg-open will work if there is a graphical display; this should
|
|
|
|
;; be good enough for platforms Emacs is likely to be running on.
|
|
|
|
(and (or (getenv "DISPLAY") (getenv "WAYLAND_DISPLAY"))
|
|
|
|
(executable-find "xdg-open")))
|
2010-08-17 08:01:10 +00:00
|
|
|
|
|
|
|
;;;###autoload
|
2012-02-09 03:14:22 +00:00
|
|
|
(defun browse-url-xdg-open (url &optional ignored)
|
|
|
|
"Pass the specified URL to the \"xdg-open\" command.
|
|
|
|
xdg-open is a desktop utility that calls your preferred web browser.
|
|
|
|
The optional argument IGNORED is not used."
|
2010-08-17 08:01:10 +00:00
|
|
|
(interactive (browse-url-interactive-arg "URL: "))
|
2011-06-22 16:44:53 +00:00
|
|
|
(call-process "xdg-open" nil 0 nil url))
|
2010-08-17 08:01:10 +00:00
|
|
|
|
2000-03-20 13:12:14 +00:00
|
|
|
;;;###autoload
|
|
|
|
(defun browse-url-netscape (url &optional new-window)
|
|
|
|
"Ask the Netscape WWW browser to load URL.
|
|
|
|
Default to the URL around or before point. The strings in variable
|
|
|
|
`browse-url-netscape-arguments' are also passed to Netscape.
|
|
|
|
|
2001-04-18 12:48:36 +00:00
|
|
|
When called interactively, if variable `browse-url-new-window-flag' is
|
2000-03-20 13:12:14 +00:00
|
|
|
non-nil, load the document in a new Netscape window, otherwise use a
|
|
|
|
random existing one. A non-nil interactive prefix argument reverses
|
2001-04-18 12:48:36 +00:00
|
|
|
the effect of `browse-url-new-window-flag'.
|
2000-03-20 13:12:14 +00:00
|
|
|
|
2005-02-22 14:11:48 +00:00
|
|
|
If `browse-url-netscape-new-window-is-tab' is non-nil, then
|
|
|
|
whenever a document would otherwise be loaded in a new window, it
|
|
|
|
is loaded in a new tab in an existing window instead.
|
|
|
|
|
2000-03-20 13:12:14 +00:00
|
|
|
When called non-interactively, optional second argument NEW-WINDOW is
|
2001-04-18 12:48:36 +00:00
|
|
|
used instead of `browse-url-new-window-flag'."
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
(declare (obsolete nil "25.1"))
|
2000-10-07 17:58:33 +00:00
|
|
|
(interactive (browse-url-interactive-arg "URL: "))
|
2007-09-07 04:37:01 +00:00
|
|
|
(setq url (browse-url-encode-url url))
|
2000-03-20 13:12:14 +00:00
|
|
|
(let* ((process-environment (browse-url-process-environment))
|
2005-02-22 14:11:48 +00:00
|
|
|
(process
|
|
|
|
(apply 'start-process
|
|
|
|
(concat "netscape " url) nil
|
|
|
|
browse-url-netscape-program
|
|
|
|
(append
|
|
|
|
browse-url-netscape-arguments
|
|
|
|
(if (eq window-system 'w32)
|
|
|
|
(list url)
|
|
|
|
(append
|
|
|
|
(if new-window '("-noraise"))
|
|
|
|
(list "-remote"
|
|
|
|
(concat "openURL(" url
|
|
|
|
(if (browse-url-maybe-new-window
|
|
|
|
new-window)
|
|
|
|
(if browse-url-netscape-new-window-is-tab
|
|
|
|
",new-tab"
|
|
|
|
",new-window"))
|
|
|
|
")"))))))))
|
2000-03-20 13:12:14 +00:00
|
|
|
(set-process-sentinel process
|
2000-08-15 11:17:17 +00:00
|
|
|
`(lambda (process change)
|
|
|
|
(browse-url-netscape-sentinel process ,url)))))
|
2000-03-20 13:12:14 +00:00
|
|
|
|
|
|
|
(defun browse-url-netscape-sentinel (process url)
|
|
|
|
"Handle a change to the process communicating with Netscape."
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
(declare (obsolete nil "25.1"))
|
2000-03-20 13:12:14 +00:00
|
|
|
(or (eq (process-exit-status process) 0)
|
|
|
|
(let* ((process-environment (browse-url-process-environment)))
|
|
|
|
;; Netscape not running - start it
|
2004-04-27 14:03:10 +00:00
|
|
|
(message "Starting %s..." browse-url-netscape-program)
|
2000-03-20 13:12:14 +00:00
|
|
|
(apply 'start-process (concat "netscape" url) nil
|
|
|
|
browse-url-netscape-program
|
|
|
|
(append browse-url-netscape-startup-arguments (list url))))))
|
|
|
|
|
|
|
|
(defun browse-url-netscape-reload ()
|
|
|
|
"Ask Netscape to reload its current document.
|
|
|
|
How depends on `browse-url-netscape-version'."
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
(declare (obsolete nil "25.1"))
|
2000-03-20 13:12:14 +00:00
|
|
|
(interactive)
|
|
|
|
;; Backwards incompatibility reported by
|
|
|
|
;; <peter.kruse@psychologie.uni-regensburg.de>.
|
|
|
|
(browse-url-netscape-send (if (>= browse-url-netscape-version 4)
|
|
|
|
"xfeDoCommand(reload)"
|
2007-09-17 15:59:55 +00:00
|
|
|
"reload")))
|
2000-03-20 13:12:14 +00:00
|
|
|
|
|
|
|
(defun browse-url-netscape-send (command)
|
|
|
|
"Send a remote control command to Netscape."
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
(declare (obsolete nil "25.1"))
|
2000-03-20 13:12:14 +00:00
|
|
|
(let* ((process-environment (browse-url-process-environment)))
|
|
|
|
(apply 'start-process "netscape" nil
|
|
|
|
browse-url-netscape-program
|
|
|
|
(append browse-url-netscape-arguments
|
|
|
|
(list "-remote" command)))))
|
|
|
|
|
2001-11-19 19:12:31 +00:00
|
|
|
;;;###autoload
|
|
|
|
(defun browse-url-mozilla (url &optional new-window)
|
|
|
|
"Ask the Mozilla WWW browser to load URL.
|
|
|
|
Default to the URL around or before point. The strings in variable
|
|
|
|
`browse-url-mozilla-arguments' are also passed to Mozilla.
|
|
|
|
|
|
|
|
When called interactively, if variable `browse-url-new-window-flag' is
|
|
|
|
non-nil, load the document in a new Mozilla window, otherwise use a
|
|
|
|
random existing one. A non-nil interactive prefix argument reverses
|
|
|
|
the effect of `browse-url-new-window-flag'.
|
|
|
|
|
2002-10-11 17:17:10 +00:00
|
|
|
If `browse-url-mozilla-new-window-is-tab' is non-nil, then whenever a
|
|
|
|
document would otherwise be loaded in a new window, it is loaded in a
|
|
|
|
new tab in an existing window instead.
|
|
|
|
|
2001-11-19 19:12:31 +00:00
|
|
|
When called non-interactively, optional second argument NEW-WINDOW is
|
|
|
|
used instead of `browse-url-new-window-flag'."
|
|
|
|
(interactive (browse-url-interactive-arg "URL: "))
|
2007-09-07 04:37:01 +00:00
|
|
|
(setq url (browse-url-encode-url url))
|
2001-11-19 19:12:31 +00:00
|
|
|
(let* ((process-environment (browse-url-process-environment))
|
2002-10-11 17:17:10 +00:00
|
|
|
(process
|
|
|
|
(apply 'start-process
|
|
|
|
(concat "mozilla " url) nil
|
|
|
|
browse-url-mozilla-program
|
|
|
|
(append
|
|
|
|
browse-url-mozilla-arguments
|
|
|
|
(list "-remote"
|
|
|
|
(concat "openURL("
|
|
|
|
url
|
|
|
|
(if (browse-url-maybe-new-window
|
|
|
|
new-window)
|
|
|
|
(if browse-url-mozilla-new-window-is-tab
|
2003-05-28 11:24:00 +00:00
|
|
|
",new-tab"
|
|
|
|
",new-window"))
|
2002-10-11 17:17:10 +00:00
|
|
|
")"))))))
|
2001-11-19 19:12:31 +00:00
|
|
|
(set-process-sentinel process
|
|
|
|
`(lambda (process change)
|
|
|
|
(browse-url-mozilla-sentinel process ,url)))))
|
|
|
|
|
|
|
|
(defun browse-url-mozilla-sentinel (process url)
|
|
|
|
"Handle a change to the process communicating with Mozilla."
|
|
|
|
(or (eq (process-exit-status process) 0)
|
|
|
|
(let* ((process-environment (browse-url-process-environment)))
|
|
|
|
;; Mozilla is not running - start it
|
2004-04-27 14:03:10 +00:00
|
|
|
(message "Starting %s..." browse-url-mozilla-program)
|
2001-11-19 19:12:31 +00:00
|
|
|
(apply 'start-process (concat "mozilla " url) nil
|
|
|
|
browse-url-mozilla-program
|
|
|
|
(append browse-url-mozilla-startup-arguments (list url))))))
|
2005-06-18 10:36:11 +00:00
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
(defun browse-url-firefox (url &optional new-window)
|
|
|
|
"Ask the Firefox WWW browser to load URL.
|
2015-02-24 23:02:11 +00:00
|
|
|
Defaults to the URL around or before point. Passes the strings
|
|
|
|
in the variable `browse-url-firefox-arguments' to Firefox.
|
2005-06-18 10:36:11 +00:00
|
|
|
|
2015-02-24 23:02:11 +00:00
|
|
|
Interactively, if the variable `browse-url-new-window-flag' is non-nil,
|
|
|
|
loads the document in a new Firefox window. A non-nil prefix argument
|
|
|
|
reverses the effect of `browse-url-new-window-flag'.
|
2005-06-18 10:36:11 +00:00
|
|
|
|
|
|
|
If `browse-url-firefox-new-window-is-tab' is non-nil, then
|
|
|
|
whenever a document would otherwise be loaded in a new window, it
|
|
|
|
is loaded in a new tab in an existing window instead.
|
|
|
|
|
2015-02-24 23:02:11 +00:00
|
|
|
Non-interactively, this uses the optional second argument NEW-WINDOW
|
2015-03-06 16:18:45 +00:00
|
|
|
instead of `browse-url-new-window-flag'."
|
2005-06-18 10:36:11 +00:00
|
|
|
(interactive (browse-url-interactive-arg "URL: "))
|
2007-09-07 04:37:01 +00:00
|
|
|
(setq url (browse-url-encode-url url))
|
2015-02-24 23:02:11 +00:00
|
|
|
(let* ((process-environment (browse-url-process-environment)))
|
|
|
|
(apply 'start-process
|
|
|
|
(concat "firefox " url) nil
|
|
|
|
browse-url-firefox-program
|
|
|
|
(append
|
|
|
|
browse-url-firefox-arguments
|
2015-03-06 16:18:45 +00:00
|
|
|
(if (browse-url-maybe-new-window new-window)
|
|
|
|
(if browse-url-firefox-new-window-is-tab
|
|
|
|
'("-new-tab")
|
|
|
|
'("-new-window")))
|
2015-02-24 23:02:11 +00:00
|
|
|
(list url)))))
|
2001-11-19 19:12:31 +00:00
|
|
|
|
2011-10-19 09:03:39 +00:00
|
|
|
;;;###autoload
|
2013-09-10 21:52:26 +00:00
|
|
|
(defun browse-url-chromium (url &optional _new-window)
|
2011-10-19 09:03:39 +00:00
|
|
|
"Ask the Chromium WWW browser to load URL.
|
|
|
|
Default to the URL around or before point. The strings in
|
|
|
|
variable `browse-url-chromium-arguments' are also passed to
|
2015-12-26 18:47:42 +00:00
|
|
|
Chromium.
|
|
|
|
The optional argument NEW-WINDOW is not used."
|
2011-10-19 09:03:39 +00:00
|
|
|
(interactive (browse-url-interactive-arg "URL: "))
|
|
|
|
(setq url (browse-url-encode-url url))
|
|
|
|
(let* ((process-environment (browse-url-process-environment)))
|
|
|
|
(apply 'start-process
|
|
|
|
(concat "chromium " url) nil
|
|
|
|
browse-url-chromium-program
|
|
|
|
(append
|
|
|
|
browse-url-chromium-arguments
|
|
|
|
(list url)))))
|
|
|
|
|
2016-01-24 19:37:38 +00:00
|
|
|
(defun browse-url-chrome (url &optional _new-window)
|
|
|
|
"Ask the Google Chrome WWW browser to load URL.
|
|
|
|
Default to the URL around or before point. The strings in
|
|
|
|
variable `browse-url-chrome-arguments' are also passed to
|
|
|
|
Google Chrome.
|
|
|
|
The optional argument NEW-WINDOW is not used."
|
|
|
|
(interactive (browse-url-interactive-arg "URL: "))
|
|
|
|
(setq url (browse-url-encode-url url))
|
|
|
|
(let* ((process-environment (browse-url-process-environment)))
|
|
|
|
(apply 'start-process
|
|
|
|
(concat "google-chrome " url) nil
|
|
|
|
browse-url-chrome-program
|
|
|
|
(append
|
|
|
|
browse-url-chrome-arguments
|
|
|
|
(list url)))))
|
|
|
|
|
2001-11-19 19:12:31 +00:00
|
|
|
;;;###autoload
|
|
|
|
(defun browse-url-galeon (url &optional new-window)
|
|
|
|
"Ask the Galeon WWW browser to load URL.
|
|
|
|
Default to the URL around or before point. The strings in variable
|
|
|
|
`browse-url-galeon-arguments' are also passed to Galeon.
|
|
|
|
|
|
|
|
When called interactively, if variable `browse-url-new-window-flag' is
|
|
|
|
non-nil, load the document in a new Galeon window, otherwise use a
|
|
|
|
random existing one. A non-nil interactive prefix argument reverses
|
|
|
|
the effect of `browse-url-new-window-flag'.
|
|
|
|
|
2002-03-08 09:56:30 +00:00
|
|
|
If `browse-url-galeon-new-window-is-tab' is non-nil, then whenever a
|
|
|
|
document would otherwise be loaded in a new window, it is loaded in a
|
|
|
|
new tab in an existing window instead.
|
|
|
|
|
2001-11-19 19:12:31 +00:00
|
|
|
When called non-interactively, optional second argument NEW-WINDOW is
|
|
|
|
used instead of `browse-url-new-window-flag'."
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
(declare (obsolete nil "25.1"))
|
2001-11-19 19:12:31 +00:00
|
|
|
(interactive (browse-url-interactive-arg "URL: "))
|
2007-09-08 09:53:34 +00:00
|
|
|
(setq url (browse-url-encode-url url))
|
2001-11-19 19:12:31 +00:00
|
|
|
(let* ((process-environment (browse-url-process-environment))
|
|
|
|
(process (apply 'start-process
|
2003-07-07 20:54:56 +00:00
|
|
|
(concat "galeon " url)
|
|
|
|
nil
|
2001-11-19 19:12:31 +00:00
|
|
|
browse-url-galeon-program
|
|
|
|
(append
|
|
|
|
browse-url-galeon-arguments
|
2001-11-25 00:04:41 +00:00
|
|
|
(if (browse-url-maybe-new-window new-window)
|
|
|
|
(if browse-url-galeon-new-window-is-tab
|
|
|
|
'("--new-tab")
|
2002-03-08 09:56:30 +00:00
|
|
|
'("--new-window" "--noraise"))
|
|
|
|
'("--existing"))
|
|
|
|
(list url)))))
|
2001-11-19 19:12:31 +00:00
|
|
|
(set-process-sentinel process
|
|
|
|
`(lambda (process change)
|
|
|
|
(browse-url-galeon-sentinel process ,url)))))
|
|
|
|
|
|
|
|
(defun browse-url-galeon-sentinel (process url)
|
|
|
|
"Handle a change to the process communicating with Galeon."
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
(declare (obsolete nil "25.1"))
|
2001-11-19 19:12:31 +00:00
|
|
|
(or (eq (process-exit-status process) 0)
|
|
|
|
(let* ((process-environment (browse-url-process-environment)))
|
|
|
|
;; Galeon is not running - start it
|
2004-04-27 14:03:10 +00:00
|
|
|
(message "Starting %s..." browse-url-galeon-program)
|
2001-11-19 19:12:31 +00:00
|
|
|
(apply 'start-process (concat "galeon " url) nil
|
|
|
|
browse-url-galeon-program
|
|
|
|
(append browse-url-galeon-startup-arguments (list url))))))
|
|
|
|
|
2003-07-07 20:54:56 +00:00
|
|
|
(defun browse-url-epiphany (url &optional new-window)
|
|
|
|
"Ask the Epiphany WWW browser to load URL.
|
|
|
|
Default to the URL around or before point. The strings in variable
|
|
|
|
`browse-url-galeon-arguments' are also passed to Epiphany.
|
|
|
|
|
|
|
|
When called interactively, if variable `browse-url-new-window-flag' is
|
|
|
|
non-nil, load the document in a new Epiphany window, otherwise use a
|
|
|
|
random existing one. A non-nil interactive prefix argument reverses
|
|
|
|
the effect of `browse-url-new-window-flag'.
|
|
|
|
|
2003-08-01 00:32:34 +00:00
|
|
|
If `browse-url-epiphany-new-window-is-tab' is non-nil, then whenever a
|
2003-07-07 20:54:56 +00:00
|
|
|
document would otherwise be loaded in a new window, it is loaded in a
|
|
|
|
new tab in an existing window instead.
|
|
|
|
|
|
|
|
When called non-interactively, optional second argument NEW-WINDOW is
|
|
|
|
used instead of `browse-url-new-window-flag'."
|
|
|
|
(interactive (browse-url-interactive-arg "URL: "))
|
2007-09-07 04:37:01 +00:00
|
|
|
(setq url (browse-url-encode-url url))
|
2003-07-07 20:54:56 +00:00
|
|
|
(let* ((process-environment (browse-url-process-environment))
|
|
|
|
(process (apply 'start-process
|
|
|
|
(concat "epiphany " url)
|
|
|
|
nil
|
|
|
|
browse-url-epiphany-program
|
|
|
|
(append
|
|
|
|
browse-url-epiphany-arguments
|
|
|
|
(if (browse-url-maybe-new-window new-window)
|
|
|
|
(if browse-url-epiphany-new-window-is-tab
|
|
|
|
'("--new-tab")
|
|
|
|
'("--new-window" "--noraise"))
|
|
|
|
'("--existing"))
|
|
|
|
(list url)))))
|
|
|
|
(set-process-sentinel process
|
|
|
|
`(lambda (process change)
|
|
|
|
(browse-url-epiphany-sentinel process ,url)))))
|
|
|
|
|
|
|
|
(defun browse-url-epiphany-sentinel (process url)
|
|
|
|
"Handle a change to the process communicating with Epiphany."
|
|
|
|
(or (eq (process-exit-status process) 0)
|
|
|
|
(let* ((process-environment (browse-url-process-environment)))
|
|
|
|
;; Epiphany is not running - start it
|
2004-04-27 14:03:10 +00:00
|
|
|
(message "Starting %s..." browse-url-epiphany-program)
|
2003-07-07 20:54:56 +00:00
|
|
|
(apply 'start-process (concat "epiphany " url) nil
|
|
|
|
browse-url-epiphany-program
|
|
|
|
(append browse-url-epiphany-startup-arguments (list url))))))
|
|
|
|
|
2007-10-26 22:24:14 +00:00
|
|
|
(defvar url-handler-regexp)
|
|
|
|
|
2007-08-22 18:52:59 +00:00
|
|
|
;;;###autoload
|
2013-09-10 21:52:26 +00:00
|
|
|
(defun browse-url-emacs (url &optional _new-window)
|
2007-08-22 18:52:59 +00:00
|
|
|
"Ask Emacs to load URL into a buffer and show it in another window."
|
|
|
|
(interactive (browse-url-interactive-arg "URL: "))
|
|
|
|
(require 'url-handlers)
|
|
|
|
(let ((file-name-handler-alist
|
|
|
|
(cons (cons url-handler-regexp 'url-file-handler)
|
|
|
|
file-name-handler-alist)))
|
|
|
|
;; Ignore `new-window': with all other browsers the URL is always shown
|
|
|
|
;; in another window than the current Emacs one since it's shown in
|
|
|
|
;; another application's window.
|
|
|
|
;; (if new-window (find-file-other-window url) (find-file url))
|
|
|
|
(find-file-other-window url)))
|
|
|
|
|
2000-10-07 18:05:28 +00:00
|
|
|
;;;###autoload
|
2000-10-07 17:58:33 +00:00
|
|
|
(defun browse-url-gnome-moz (url &optional new-window)
|
|
|
|
"Ask Mozilla/Netscape to load URL via the GNOME program `gnome-moz-remote'.
|
|
|
|
Default to the URL around or before point. The strings in variable
|
|
|
|
`browse-url-gnome-moz-arguments' are also passed.
|
|
|
|
|
2001-04-18 12:48:36 +00:00
|
|
|
When called interactively, if variable `browse-url-new-window-flag' is
|
2000-10-07 17:58:33 +00:00
|
|
|
non-nil, load the document in a new browser window, otherwise use an
|
|
|
|
existing one. A non-nil interactive prefix argument reverses the
|
2001-04-18 12:48:36 +00:00
|
|
|
effect of `browse-url-new-window-flag'.
|
2000-10-07 17:58:33 +00:00
|
|
|
|
|
|
|
When called non-interactively, optional second argument NEW-WINDOW is
|
2001-04-18 12:48:36 +00:00
|
|
|
used instead of `browse-url-new-window-flag'."
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
(declare (obsolete nil "25.1"))
|
2003-01-31 15:24:20 +00:00
|
|
|
(interactive (browse-url-interactive-arg "URL: "))
|
2000-10-07 17:58:33 +00:00
|
|
|
(apply 'start-process (concat "gnome-moz-remote " url)
|
|
|
|
nil
|
2003-04-12 22:21:18 +00:00
|
|
|
browse-url-gnome-moz-program
|
2000-10-07 17:58:33 +00:00
|
|
|
(append
|
|
|
|
browse-url-gnome-moz-arguments
|
|
|
|
(if (browse-url-maybe-new-window new-window)
|
2007-09-17 15:59:55 +00:00
|
|
|
'("--newwin"))
|
2000-10-07 17:58:33 +00:00
|
|
|
(list "--raise" url))))
|
|
|
|
|
2000-03-20 13:12:14 +00:00
|
|
|
;; --- Mosaic ---
|
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
(defun browse-url-mosaic (url &optional new-window)
|
|
|
|
"Ask the XMosaic WWW browser to load URL.
|
|
|
|
|
|
|
|
Default to the URL around or before point. The strings in variable
|
|
|
|
`browse-url-mosaic-arguments' are also passed to Mosaic and the
|
|
|
|
program is invoked according to the variable
|
|
|
|
`browse-url-mosaic-program'.
|
|
|
|
|
2001-04-18 12:48:36 +00:00
|
|
|
When called interactively, if variable `browse-url-new-window-flag' is
|
2000-03-20 13:12:14 +00:00
|
|
|
non-nil, load the document in a new Mosaic window, otherwise use a
|
|
|
|
random existing one. A non-nil interactive prefix argument reverses
|
2001-04-18 12:48:36 +00:00
|
|
|
the effect of `browse-url-new-window-flag'.
|
2000-03-20 13:12:14 +00:00
|
|
|
|
|
|
|
When called non-interactively, optional second argument NEW-WINDOW is
|
2001-04-18 12:48:36 +00:00
|
|
|
used instead of `browse-url-new-window-flag'."
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
(declare (obsolete nil "25.1"))
|
2000-03-20 13:12:14 +00:00
|
|
|
(interactive (browse-url-interactive-arg "Mosaic URL: "))
|
2002-03-18 04:24:09 +00:00
|
|
|
(let ((pidfile (expand-file-name browse-url-mosaic-pidfile))
|
2000-03-20 13:12:14 +00:00
|
|
|
pid)
|
|
|
|
(if (file-readable-p pidfile)
|
2014-05-08 18:10:36 +00:00
|
|
|
(with-temp-buffer
|
|
|
|
(insert-file-contents pidfile)
|
|
|
|
(setq pid (read (current-buffer)))))
|
|
|
|
(if (and (integerp pid) (zerop (signal-process pid 0))) ; Mosaic running
|
|
|
|
(progn
|
|
|
|
(with-temp-buffer
|
|
|
|
(insert (if (browse-url-maybe-new-window new-window)
|
|
|
|
"newwin\n"
|
|
|
|
"goto\n")
|
|
|
|
url "\n")
|
2014-05-14 17:15:15 +00:00
|
|
|
(with-file-modes ?\700
|
|
|
|
(if (file-exists-p
|
|
|
|
(setq pidfile (format "/tmp/Mosaic.%d" pid)))
|
|
|
|
(delete-file pidfile))
|
|
|
|
;; http://debbugs.gnu.org/17428. Use O_EXCL.
|
|
|
|
(write-region nil nil pidfile nil 'silent nil 'excl)))
|
2000-03-20 13:12:14 +00:00
|
|
|
;; Send signal SIGUSR to Mosaic
|
2005-06-21 13:45:53 +00:00
|
|
|
(message "Signaling Mosaic...")
|
2003-04-12 22:21:18 +00:00
|
|
|
(signal-process pid 'SIGUSR1)
|
2000-03-20 13:12:14 +00:00
|
|
|
;; Or you could try:
|
|
|
|
;; (call-process "kill" nil 0 nil "-USR1" (int-to-string pid))
|
2014-05-08 18:10:36 +00:00
|
|
|
(message "Signaling Mosaic...done"))
|
2000-03-20 13:12:14 +00:00
|
|
|
;; Mosaic not running - start it
|
2004-04-27 14:03:10 +00:00
|
|
|
(message "Starting %s..." browse-url-mosaic-program)
|
2000-03-20 13:12:14 +00:00
|
|
|
(apply 'start-process "xmosaic" nil browse-url-mosaic-program
|
|
|
|
(append browse-url-mosaic-arguments (list url)))
|
2004-04-27 14:03:10 +00:00
|
|
|
(message "Starting %s...done" browse-url-mosaic-program))))
|
2000-03-20 13:12:14 +00:00
|
|
|
|
|
|
|
;; --- Mosaic using CCI ---
|
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
(defun browse-url-cci (url &optional new-window)
|
|
|
|
"Ask the XMosaic WWW browser to load URL.
|
|
|
|
Default to the URL around or before point.
|
|
|
|
|
|
|
|
This function only works for XMosaic version 2.5 or later. You must
|
|
|
|
select `CCI' from XMosaic's File menu, set the CCI Port Address to the
|
|
|
|
value of variable `browse-url-CCI-port', and enable `Accept requests'.
|
|
|
|
|
2001-04-18 12:48:36 +00:00
|
|
|
When called interactively, if variable `browse-url-new-window-flag' is
|
2000-03-20 13:12:14 +00:00
|
|
|
non-nil, load the document in a new browser window, otherwise use a
|
|
|
|
random existing one. A non-nil interactive prefix argument reverses
|
2001-04-18 12:48:36 +00:00
|
|
|
the effect of `browse-url-new-window-flag'.
|
2000-03-20 13:12:14 +00:00
|
|
|
|
|
|
|
When called non-interactively, optional second argument NEW-WINDOW is
|
2001-04-18 12:48:36 +00:00
|
|
|
used instead of `browse-url-new-window-flag'."
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
(declare (obsolete nil "25.1"))
|
2000-03-20 13:12:14 +00:00
|
|
|
(interactive (browse-url-interactive-arg "Mosaic URL: "))
|
|
|
|
(open-network-stream "browse-url" " *browse-url*"
|
|
|
|
browse-url-CCI-host browse-url-CCI-port)
|
|
|
|
;; Todo: start browser if fails
|
|
|
|
(process-send-string "browse-url"
|
|
|
|
(concat "get url (" url ") output "
|
2000-03-22 23:06:18 +00:00
|
|
|
(if (browse-url-maybe-new-window new-window)
|
2000-03-20 13:12:14 +00:00
|
|
|
"new"
|
|
|
|
"current")
|
|
|
|
"\r\n"))
|
|
|
|
(process-send-string "browse-url" "disconnect\r\n")
|
|
|
|
(delete-process "browse-url"))
|
|
|
|
|
2015-03-16 23:57:23 +00:00
|
|
|
;; --- Conkeror ---
|
|
|
|
;;;###autoload
|
|
|
|
(defun browse-url-conkeror (url &optional new-window)
|
|
|
|
"Ask the Conkeror WWW browser to load URL.
|
2015-03-18 00:09:34 +00:00
|
|
|
Default to the URL around or before point. Also pass the strings
|
|
|
|
in the variable `browse-url-conkeror-arguments' to Conkeror.
|
2015-03-16 23:57:23 +00:00
|
|
|
|
2015-03-18 00:09:34 +00:00
|
|
|
When called interactively, if variable
|
|
|
|
`browse-url-new-window-flag' is non-nil, load the document in a
|
|
|
|
new Conkeror window, otherwise use a random existing one. A
|
|
|
|
non-nil interactive prefix argument reverses the effect of
|
|
|
|
`browse-url-new-window-flag'.
|
2015-03-16 23:57:23 +00:00
|
|
|
|
2015-03-18 00:09:34 +00:00
|
|
|
If variable `browse-url-conkeror-new-window-is-buffer' is
|
|
|
|
non-nil, then whenever a document would otherwise be loaded in a
|
|
|
|
new window, load it in a new buffer in an existing window instead.
|
2015-03-16 23:57:23 +00:00
|
|
|
|
2015-03-18 00:09:34 +00:00
|
|
|
When called non-interactively, use optional second argument
|
|
|
|
NEW-WINDOW instead of `browse-url-new-window-flag'."
|
2015-03-16 23:57:23 +00:00
|
|
|
(interactive (browse-url-interactive-arg "URL: "))
|
|
|
|
(setq url (browse-url-encode-url url))
|
|
|
|
(let* ((process-environment (browse-url-process-environment)))
|
|
|
|
(apply 'start-process (format "conkeror %s" url)
|
|
|
|
nil
|
|
|
|
browse-url-conkeror-program
|
|
|
|
(append
|
|
|
|
browse-url-conkeror-arguments
|
|
|
|
(list
|
|
|
|
"-e"
|
|
|
|
(format "load_url_in_new_%s('%s')"
|
|
|
|
(if (browse-url-maybe-new-window new-window)
|
|
|
|
(if browse-url-conkeror-new-window-is-buffer
|
|
|
|
"buffer"
|
|
|
|
"window")
|
|
|
|
"buffer")
|
|
|
|
url))))))
|
2000-03-20 13:12:14 +00:00
|
|
|
;; --- W3 ---
|
|
|
|
|
2007-11-29 04:26:50 +00:00
|
|
|
;; External.
|
|
|
|
(declare-function w3-fetch-other-window "ext:w3m" (&optional url))
|
|
|
|
(declare-function w3-fetch "ext:w3m" (&optional url target))
|
|
|
|
|
2000-03-20 13:12:14 +00:00
|
|
|
;;;###autoload
|
|
|
|
(defun browse-url-w3 (url &optional new-window)
|
|
|
|
"Ask the w3 WWW browser to load URL.
|
|
|
|
Default to the URL around or before point.
|
|
|
|
|
2001-04-18 12:48:36 +00:00
|
|
|
When called interactively, if variable `browse-url-new-window-flag' is
|
2000-03-20 13:12:14 +00:00
|
|
|
non-nil, load the document in a new window. A non-nil interactive
|
2001-04-18 12:48:36 +00:00
|
|
|
prefix argument reverses the effect of `browse-url-new-window-flag'.
|
2000-03-20 13:12:14 +00:00
|
|
|
|
|
|
|
When called non-interactively, optional second argument NEW-WINDOW is
|
2001-04-18 12:48:36 +00:00
|
|
|
used instead of `browse-url-new-window-flag'."
|
2000-03-20 13:12:14 +00:00
|
|
|
(interactive (browse-url-interactive-arg "W3 URL: "))
|
2007-09-17 15:59:55 +00:00
|
|
|
(require 'w3) ; w3-fetch-other-window not autoloaded
|
2000-03-22 23:06:18 +00:00
|
|
|
(if (browse-url-maybe-new-window new-window)
|
2000-03-20 13:12:14 +00:00
|
|
|
(w3-fetch-other-window url)
|
|
|
|
(w3-fetch url)))
|
|
|
|
|
|
|
|
;;;###autoload
|
2013-09-10 21:52:26 +00:00
|
|
|
(defun browse-url-w3-gnudoit (url &optional _new-window)
|
2000-03-20 13:12:14 +00:00
|
|
|
;; new-window ignored
|
|
|
|
"Ask another Emacs running gnuserv to load the URL using the W3 browser.
|
|
|
|
The `browse-url-gnudoit-program' program is used with options given by
|
|
|
|
`browse-url-gnudoit-args'. Default to the URL around or before point."
|
browse-url: mark some of the more obsolete stuff as such
* lisp/net/browse-url.el (browse-url-browser-function)
(browse-url-default-browser):
Remove obsolete items from the explicit listing.
(browse-url-new-window-flag, browse-url-of-file-hook): Doc fixes.
(browse-url-netscape-program, browse-url-netscape-arguments)
(browse-url-netscape-startup-arguments)
(browse-url-galeon-program, browse-url-galeon-arguments)
(browse-url-galeon-startup-arguments)
(browse-url-gnome-moz-program, browse-url-gnome-moz-arguments)
(browse-url-galeon-new-window-is-tab)
(browse-url-netscape-new-window-is-tab)
(browse-url-mosaic-program, browse-url-mosaic-arguments)
(browse-url-mosaic-pidfile, browse-url-CCI-port)
(browse-url-CCI-host, browse-url-netscape-version)
(browse-url-netscape, browse-url-netscape-sentinel)
(browse-url-netscape-reload, browse-url-netscape-send)
(browse-url-galeon, browse-url-galeon-sentinel)
(browse-url-gnome-moz, browse-url-mosaic, browse-url-cci)
(browse-url-w3-gnudoit): Make obsolete.
* etc/NEWS: Mention this.
* doc/misc/idlwave.texi (HTML Help Browser Tips): Remove obsolete info.
* lisp/ffap.el (ffap-url-fetcher): Simplify default and doc.
* lisp/x-dnd.el: Comment update.
2015-03-25 06:26:48 +00:00
|
|
|
(declare (obsolete nil "25.1"))
|
2000-03-20 13:12:14 +00:00
|
|
|
(interactive (browse-url-interactive-arg "W3 URL: "))
|
2007-09-17 15:59:55 +00:00
|
|
|
(apply 'start-process (concat "gnudoit:" url) nil
|
|
|
|
browse-url-gnudoit-program
|
|
|
|
(append browse-url-gnudoit-args
|
|
|
|
(list (concat "(w3-fetch \"" url "\")")
|
|
|
|
"(raise-frame)"))))
|
2000-03-20 13:12:14 +00:00
|
|
|
|
|
|
|
;; --- Lynx in an xterm ---
|
|
|
|
|
|
|
|
;;;###autoload
|
2013-09-10 21:52:26 +00:00
|
|
|
(defun browse-url-text-xterm (url &optional _new-window)
|
2000-03-20 13:12:14 +00:00
|
|
|
;; new-window ignored
|
2007-10-29 13:56:39 +00:00
|
|
|
"Ask a text browser to load URL.
|
2008-07-08 14:45:36 +00:00
|
|
|
URL defaults to the URL around or before point.
|
2007-10-29 13:56:39 +00:00
|
|
|
This runs the text browser specified by `browse-url-text-browser'.
|
2000-03-20 13:12:14 +00:00
|
|
|
in an Xterm window using the Xterm program named by `browse-url-xterm-program'
|
2015-12-26 18:47:42 +00:00
|
|
|
with possible additional arguments `browse-url-xterm-args'.
|
|
|
|
The optional argument NEW-WINDOW is not used."
|
2007-10-29 13:56:39 +00:00
|
|
|
(interactive (browse-url-interactive-arg "Text browser URL: "))
|
|
|
|
(apply #'start-process `(,(concat browse-url-text-browser url)
|
|
|
|
nil ,browse-url-xterm-program
|
2008-03-13 13:29:11 +00:00
|
|
|
,@browse-url-xterm-args "-e" ,browse-url-text-browser
|
2007-09-17 15:59:55 +00:00
|
|
|
,url)))
|
2000-03-20 13:12:14 +00:00
|
|
|
|
|
|
|
;; --- Lynx in an Emacs "term" window ---
|
|
|
|
|
2010-10-09 00:52:12 +00:00
|
|
|
(declare-function term-char-mode "term" ())
|
|
|
|
(declare-function term-send-down "term" ())
|
|
|
|
(declare-function term-send-string "term" (proc str))
|
|
|
|
|
2000-03-20 13:12:14 +00:00
|
|
|
;;;###autoload
|
2007-10-29 13:56:39 +00:00
|
|
|
(defun browse-url-text-emacs (url &optional new-buffer)
|
|
|
|
"Ask a text browser to load URL.
|
2008-07-08 14:45:36 +00:00
|
|
|
URL defaults to the URL around or before point.
|
2007-10-29 13:56:39 +00:00
|
|
|
This runs the text browser specified by `browse-url-text-browser'.
|
|
|
|
With a prefix argument, it runs a new browser process in a new buffer.
|
2000-03-20 13:12:14 +00:00
|
|
|
|
2001-04-18 12:48:36 +00:00
|
|
|
When called interactively, if variable `browse-url-new-window-flag' is
|
2007-10-29 13:56:39 +00:00
|
|
|
non-nil, load the document in a new browser process in a new term window,
|
2000-03-20 13:12:14 +00:00
|
|
|
otherwise use any existing one. A non-nil interactive prefix argument
|
2001-04-18 12:48:36 +00:00
|
|
|
reverses the effect of `browse-url-new-window-flag'.
|
2000-03-20 13:12:14 +00:00
|
|
|
|
|
|
|
When called non-interactively, optional second argument NEW-WINDOW is
|
2001-04-18 12:48:36 +00:00
|
|
|
used instead of `browse-url-new-window-flag'."
|
2007-10-29 13:56:39 +00:00
|
|
|
(interactive (browse-url-interactive-arg "Text browser URL: "))
|
2007-09-17 15:59:55 +00:00
|
|
|
(let* ((system-uses-terminfo t) ; Lynx uses terminfo
|
2000-03-20 13:12:14 +00:00
|
|
|
;; (term-term-name "vt100") ; ??
|
2007-10-29 13:56:39 +00:00
|
|
|
(buf (get-buffer "*text browser*"))
|
2000-03-20 13:12:14 +00:00
|
|
|
(proc (and buf (get-buffer-process buf)))
|
2007-10-29 13:56:39 +00:00
|
|
|
(n browse-url-text-input-attempts))
|
2010-10-09 00:52:12 +00:00
|
|
|
(require 'term)
|
2000-03-22 23:06:18 +00:00
|
|
|
(if (and (browse-url-maybe-new-window new-buffer) buf)
|
2015-03-18 00:09:34 +00:00
|
|
|
;; Rename away the OLD buffer. This isn't very polite, but
|
2000-03-20 13:12:14 +00:00
|
|
|
;; term insists on working in a buffer named *lynx* and would
|
|
|
|
;; choke on *lynx*<1>
|
|
|
|
(progn (set-buffer buf)
|
|
|
|
(rename-uniquely)))
|
2000-03-22 23:06:18 +00:00
|
|
|
(if (or (browse-url-maybe-new-window new-buffer)
|
2000-03-20 13:12:14 +00:00
|
|
|
(not buf)
|
|
|
|
(not proc)
|
|
|
|
(not (memq (process-status proc) '(run stop))))
|
2007-10-29 13:56:39 +00:00
|
|
|
;; start a new text browser
|
2000-03-20 13:12:14 +00:00
|
|
|
(progn
|
|
|
|
(setq buf
|
|
|
|
(apply #'make-term
|
2007-10-29 13:56:39 +00:00
|
|
|
`(,browse-url-text-browser
|
|
|
|
,browse-url-text-browser
|
|
|
|
nil ,@browse-url-text-emacs-args
|
2000-03-22 23:06:18 +00:00
|
|
|
,url)))
|
2000-03-20 13:12:14 +00:00
|
|
|
(switch-to-buffer buf)
|
|
|
|
(term-char-mode)
|
|
|
|
(set-process-sentinel
|
|
|
|
(get-buffer-process buf)
|
|
|
|
;; Don't leave around a dead one (especially because of its
|
|
|
|
;; munged keymap.)
|
2013-09-10 21:52:26 +00:00
|
|
|
(lambda (process _event)
|
2000-03-20 13:12:14 +00:00
|
|
|
(if (not (memq (process-status process) '(run stop)))
|
|
|
|
(let ((buf (process-buffer process)))
|
|
|
|
(if buf (kill-buffer buf)))))))
|
2007-10-29 13:56:39 +00:00
|
|
|
;; Send the url to the text browser in the old buffer
|
2000-03-20 13:12:14 +00:00
|
|
|
(let ((win (get-buffer-window buf t)))
|
|
|
|
(if win
|
|
|
|
(select-window win)
|
|
|
|
(switch-to-buffer buf)))
|
|
|
|
(if (eq (following-char) ?_)
|
2007-10-29 13:56:39 +00:00
|
|
|
(cond ((eq browse-url-text-input-field 'warn)
|
2001-07-16 12:23:00 +00:00
|
|
|
(error "Please move out of the input field first"))
|
2007-10-29 13:56:39 +00:00
|
|
|
((eq browse-url-text-input-field 'avoid)
|
2000-03-20 13:12:14 +00:00
|
|
|
(while (and (eq (following-char) ?_) (> n 0))
|
2007-09-17 15:59:55 +00:00
|
|
|
(term-send-down) ; down arrow
|
2007-10-29 13:56:39 +00:00
|
|
|
(sit-for browse-url-text-input-delay))
|
2000-03-20 13:12:14 +00:00
|
|
|
(if (eq (following-char) ?_)
|
2001-07-16 12:23:00 +00:00
|
|
|
(error "Cannot move out of the input field, sorry")))))
|
2007-09-17 15:59:55 +00:00
|
|
|
(term-send-string proc (concat "g" ; goto
|
2000-03-20 13:12:14 +00:00
|
|
|
"\C-u" ; kill default url
|
|
|
|
url
|
|
|
|
"\r")))))
|
|
|
|
|
|
|
|
;; --- mailto ---
|
|
|
|
|
2004-03-07 19:59:15 +00:00
|
|
|
(autoload 'rfc2368-parse-mailto-url "rfc2368")
|
|
|
|
|
2000-03-20 13:12:14 +00:00
|
|
|
;;;###autoload
|
|
|
|
(defun browse-url-mail (url &optional new-window)
|
2004-03-07 19:59:15 +00:00
|
|
|
"Open a new mail message buffer within Emacs for the RFC 2368 URL.
|
2000-03-20 13:12:14 +00:00
|
|
|
Default to using the mailto: URL around or before point as the
|
|
|
|
recipient's address. Supplying a non-nil interactive prefix argument
|
|
|
|
will cause the mail to be composed in another window rather than the
|
|
|
|
current one.
|
|
|
|
|
2001-04-18 12:48:36 +00:00
|
|
|
When called interactively, if variable `browse-url-new-window-flag' is
|
2000-03-20 13:12:14 +00:00
|
|
|
non-nil use `compose-mail-other-window', otherwise `compose-mail'. A
|
|
|
|
non-nil interactive prefix argument reverses the effect of
|
2001-04-18 12:48:36 +00:00
|
|
|
`browse-url-new-window-flag'.
|
2000-03-20 13:12:14 +00:00
|
|
|
|
|
|
|
When called non-interactively, optional second argument NEW-WINDOW is
|
2001-04-18 12:48:36 +00:00
|
|
|
used instead of `browse-url-new-window-flag'."
|
2000-03-20 13:12:14 +00:00
|
|
|
(interactive (browse-url-interactive-arg "Mailto URL: "))
|
|
|
|
(save-excursion
|
2004-03-07 19:59:15 +00:00
|
|
|
(let* ((alist (rfc2368-parse-mailto-url url))
|
|
|
|
(to (assoc "To" alist))
|
|
|
|
(subject (assoc "Subject" alist))
|
|
|
|
(body (assoc "Body" alist))
|
2010-11-10 00:02:44 +00:00
|
|
|
(rest (delq to (delq subject (delq body alist))))
|
2004-03-07 19:59:15 +00:00
|
|
|
(to (cdr to))
|
|
|
|
(subject (cdr subject))
|
|
|
|
(body (cdr body))
|
|
|
|
(mail-citation-hook (unless body mail-citation-hook)))
|
2000-03-22 23:06:18 +00:00
|
|
|
(if (browse-url-maybe-new-window new-window)
|
2004-03-07 19:59:15 +00:00
|
|
|
(compose-mail-other-window to subject rest nil
|
2010-11-10 00:02:44 +00:00
|
|
|
(list 'insert-buffer (current-buffer)))
|
2004-03-07 19:59:15 +00:00
|
|
|
(compose-mail to subject rest nil nil
|
2010-11-10 00:02:44 +00:00
|
|
|
(list 'insert-buffer (current-buffer))))
|
|
|
|
(when body
|
|
|
|
(goto-char (point-min))
|
|
|
|
(unless (or (search-forward (concat "\n" mail-header-separator "\n")
|
|
|
|
nil 'move)
|
|
|
|
(bolp))
|
|
|
|
(insert "\n"))
|
|
|
|
(goto-char (prog1
|
|
|
|
(point)
|
|
|
|
(insert (replace-regexp-in-string "\r\n" "\n" body))
|
|
|
|
(unless (bolp)
|
|
|
|
(insert "\n"))))))))
|
2000-03-20 13:12:14 +00:00
|
|
|
|
2016-10-21 15:23:39 +00:00
|
|
|
;; --- man ---
|
|
|
|
|
|
|
|
(defvar manual-program)
|
|
|
|
|
|
|
|
(defun browse-url-man (url &optional _new-window)
|
|
|
|
"Open a man page."
|
|
|
|
(interactive (browse-url-interactive-arg "Man page URL: "))
|
|
|
|
(require 'man)
|
|
|
|
(setq url (replace-regexp-in-string "\\`man:" "" url))
|
|
|
|
(cond
|
|
|
|
((executable-find manual-program) (man url))
|
|
|
|
(t (woman (replace-regexp-in-string "([[:alnum:]]+)" "" url)))))
|
|
|
|
|
2000-03-20 13:12:14 +00:00
|
|
|
;; --- Random browser ---
|
|
|
|
|
|
|
|
;;;###autoload
|
2013-09-10 21:52:26 +00:00
|
|
|
(defun browse-url-generic (url &optional _new-window)
|
2000-03-20 13:12:14 +00:00
|
|
|
;; new-window ignored
|
|
|
|
"Ask the WWW browser defined by `browse-url-generic-program' to load URL.
|
|
|
|
Default to the URL around or before point. A fresh copy of the
|
|
|
|
browser is started up in a new process with possible additional arguments
|
|
|
|
`browse-url-generic-args'. This is appropriate for browsers which
|
|
|
|
don't offer a form of remote control."
|
|
|
|
(interactive (browse-url-interactive-arg "URL: "))
|
|
|
|
(if (not browse-url-generic-program)
|
2007-09-17 15:59:55 +00:00
|
|
|
(error "No browser defined (`browse-url-generic-program')"))
|
2004-04-02 14:33:08 +00:00
|
|
|
(apply 'call-process browse-url-generic-program nil
|
|
|
|
0 nil
|
2000-03-20 13:12:14 +00:00
|
|
|
(append browse-url-generic-args (list url))))
|
|
|
|
|
2001-05-18 11:27:38 +00:00
|
|
|
;;;###autoload
|
2013-09-10 21:52:26 +00:00
|
|
|
(defun browse-url-kde (url &optional _new-window)
|
2001-05-18 11:27:38 +00:00
|
|
|
"Ask the KDE WWW browser to load URL.
|
2015-12-26 18:47:42 +00:00
|
|
|
Default to the URL around or before point.
|
|
|
|
The optional argument NEW-WINDOW is not used."
|
2001-05-18 11:27:38 +00:00
|
|
|
(interactive (browse-url-interactive-arg "KDE URL: "))
|
|
|
|
(message "Sending URL to KDE...")
|
2003-04-12 22:21:18 +00:00
|
|
|
(apply #'start-process (concat "KDE " url) nil browse-url-kde-program
|
2007-09-17 15:59:55 +00:00
|
|
|
(append browse-url-kde-args (list url))))
|
2001-05-18 11:27:38 +00:00
|
|
|
|
2007-09-19 11:26:57 +00:00
|
|
|
(defun browse-url-elinks-new-window (url)
|
|
|
|
"Ask the Elinks WWW browser to load URL in a new window."
|
2008-07-08 14:45:36 +00:00
|
|
|
(let ((process-environment (browse-url-process-environment)))
|
2007-09-19 11:26:57 +00:00
|
|
|
(apply #'start-process
|
|
|
|
(append (list (concat "elinks:" url)
|
|
|
|
nil)
|
|
|
|
browse-url-elinks-wrapper
|
|
|
|
(list "elinks" url)))))
|
|
|
|
|
2007-09-07 04:37:01 +00:00
|
|
|
;;;###autoload
|
2007-09-19 11:26:57 +00:00
|
|
|
(defun browse-url-elinks (url &optional new-window)
|
2007-09-07 04:37:01 +00:00
|
|
|
"Ask the Elinks WWW browser to load URL.
|
|
|
|
Default to the URL around the point.
|
|
|
|
|
|
|
|
The document is loaded in a new tab of a running Elinks or, if
|
|
|
|
none yet running, a newly started instance.
|
|
|
|
|
|
|
|
The Elinks command will be prepended by the program+arguments
|
2007-09-19 11:26:57 +00:00
|
|
|
from `browse-url-elinks-wrapper'."
|
2007-09-07 04:37:01 +00:00
|
|
|
(interactive (browse-url-interactive-arg "URL: "))
|
|
|
|
(setq url (browse-url-encode-url url))
|
2007-09-19 11:26:57 +00:00
|
|
|
(if new-window
|
|
|
|
(browse-url-elinks-new-window url)
|
|
|
|
(let ((process-environment (browse-url-process-environment))
|
|
|
|
(elinks-ping-process (start-process "elinks-ping" nil
|
|
|
|
"elinks" "-remote" "ping()")))
|
|
|
|
(set-process-sentinel elinks-ping-process
|
|
|
|
`(lambda (process change)
|
|
|
|
(browse-url-elinks-sentinel process ,url))))))
|
2007-09-07 04:37:01 +00:00
|
|
|
|
|
|
|
(defun browse-url-elinks-sentinel (process url)
|
|
|
|
"Determines if Elinks is running or a new one has to be started."
|
More CL cleanups and reduction of use of cl.el.
* woman.el, winner.el, vc/vc-rcs.el, vc/vc-hooks.el, vc/vc-hg.el:
* vc/vc-git.el, vc/vc-dir.el, vc/vc-bzr.el, vc/vc-annotate.el:
* textmodes/tex-mode.el, textmodes/sgml-mode.el, tar-mode.el:
* strokes.el, ses.el, server.el, progmodes/js.el, progmodes/gdb-mi.el:
* progmodes/flymake.el, progmodes/ebrowse.el, progmodes/compile.el:
* play/tetris.el, play/snake.el, play/pong.el, play/landmark.el:
* play/hanoi.el, play/decipher.el, play/5x5.el, nxml/nxml-mode.el:
* net/secrets.el, net/quickurl.el, midnight.el, mail/footnote.el:
* image-dired.el, ibuffer.el, ibuf-macs.el, ibuf-ext.el, hexl.el:
* eshell/eshell.el, eshell/esh-io.el, eshell/esh-ext.el:
* eshell/esh-cmd.el, eshell/em-ls.el, eshell/em-hist.el:
* eshell/em-cmpl.el, eshell/em-banner.el:
* url/url.el, url/url-queue.el, url/url-parse.el, url/url-http.el:
* url/url-future.el, url/url-dav.el, url/url-cookie.el:
* calendar/parse-time.el, test/eshell.el: Use cl-lib.
* wid-browse.el, wdired.el, vc/vc.el, vc/vc-mtn.el, vc/vc-cvs.el:
* vc/vc-arch.el, tree-widget.el, textmodes/texinfo.el:
* textmodes/refill.el, textmodes/css-mode.el, term/tvi970.el:
* term/ns-win.el, term.el, shell.el, ps-samp.el:
* progmodes/perl-mode.el, progmodes/pascal.el, progmodes/gud.el:
* progmodes/glasses.el, progmodes/etags.el, progmodes/cwarn.el:
* play/gamegrid.el, play/bubbles.el, novice.el, notifications.el:
* net/zeroconf.el, net/xesam.el, net/snmp-mode.el, net/mairix.el:
* net/ldap.el, net/eudc.el, net/browse-url.el, man.el:
* mail/mailheader.el, mail/feedmail.el:
* url/url-util.el, url/url-privacy.el, url/url-nfs.el, url/url-misc.el:
* url/url-methods.el, url/url-gw.el, url/url-file.el, url/url-expand.el:
Dont use CL.
* ibuf-ext.el (ibuffer-mark-old-buffers): Use float-time.
* eshell/esh-opt.el (eshell-eval-using-options): Quote code with
`lambda' rather than with `quote'.
(eshell-do-opt): Adjust accordingly.
(eshell-process-option): Simplify.
* eshell/esh-var.el:
* eshell/em-script.el: Require `esh-opt' for eshell-eval-using-options.
* emacs-pcase.el (pcase--dontcare-upats, pcase--let*)
(pcase--expand, pcase--u1): Rename pcase's internal `dontcare' pattern
to `pcase--dontcare'.
* emacs-cl.el (labels): Mark obsolete.
(cl--letf, letf): Move to cl-lib.
(cl--letf*, letf*): Remove.
* emacs-cl-lib.el (cl-nth-value): Use defalias.
* emacs-cl-macs.el (cl-dolist, cl-dotimes): Add indent rule.
(cl-progv): Rewrite.
(cl--letf, cl-letf): Move from cl.el.
(cl-letf*): New macro.
* emacs-cl-extra.el (cl--progv-before, cl--progv-after): Remove.
2012-07-11 23:13:41 +00:00
|
|
|
;; Try to determine if an instance is running or if we have to
|
|
|
|
;; create a new one.
|
|
|
|
(pcase (process-exit-status process)
|
|
|
|
(5
|
|
|
|
;; No instance, start a new one.
|
|
|
|
(browse-url-elinks-new-window url))
|
|
|
|
(0
|
|
|
|
;; Found an instance, open URL in new tab.
|
|
|
|
(let ((process-environment (browse-url-process-environment)))
|
|
|
|
(start-process (concat "elinks:" url) nil
|
|
|
|
"elinks" "-remote"
|
|
|
|
(concat "openURL(\"" url "\",new-tab)"))))
|
|
|
|
(exit-status
|
|
|
|
(error "Unrecognized exit-code %d of process `elinks'"
|
|
|
|
exit-status))))
|
2007-09-07 04:37:01 +00:00
|
|
|
|
2000-03-20 13:12:14 +00:00
|
|
|
(provide 'browse-url)
|
|
|
|
|
|
|
|
;;; browse-url.el ends here
|