diff options
| author | Eli Zaretskii | 2015-12-26 20:47:42 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2015-12-26 20:47:42 +0200 |
| commit | 0191077d6a96d9ef8e43989fd5dc8a95e61806d5 (patch) | |
| tree | 482d53ac57dac9fc115d7bad3efd81e05f68aaf6 | |
| parent | b45828ee139dae3b9570883816453f5a451d35d3 (diff) | |
| download | emacs-0191077d6a96d9ef8e43989fd5dc8a95e61806d5.tar.gz emacs-0191077d6a96d9ef8e43989fd5dc8a95e61806d5.zip | |
Fix documentation of browse-url browser-related functions
* lisp/net/browse-url.el (browse-url)
(browse-url-default-browser, browse-url-default-windows-browser)
(browse-url-default-macosx-browser, browse-url-chromium)
(browse-url-kde, browse-url-text-xterm): Clarify the usage of ARGS
and NEW-WINDOW arguments in these functions. (Bug#19421)
| -rw-r--r-- | lisp/net/browse-url.el | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index feb0788db92..d232c8add13 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el | |||
| @@ -762,12 +762,17 @@ narrowed." | |||
| 762 | (defun browse-url (url &rest args) | 762 | (defun browse-url (url &rest args) |
| 763 | "Ask a WWW browser to load URL. | 763 | "Ask a WWW browser to load URL. |
| 764 | Prompt for a URL, defaulting to the URL at or before point. | 764 | Prompt for a URL, defaulting to the URL at or before point. |
| 765 | The variable `browse-url-browser-function' says which browser to use. | 765 | Invokes a suitable browser function which does the actual job. |
| 766 | If the URL is a mailto: URL, consult `browse-url-mailto-function' | 766 | The variable `browse-url-browser-function' says which browser function to |
| 767 | use. If the URL is a mailto: URL, consult `browse-url-mailto-function' | ||
| 767 | first, if that exists. | 768 | first, if that exists. |
| 768 | 769 | ||
| 769 | Passes any ARGS to the browser function. | 770 | The additional ARGS are passed to the browser function. See the doc |
| 770 | The default is to pass `browse-url-new-window-flag'." | 771 | strings of the actual functions, starting with `browse-url-browser-function', |
| 772 | for information about the significance of ARGS (most of the functions | ||
| 773 | ignore it). | ||
| 774 | If ARGS are omitted, the default is to pass `browse-url-new-window-flag' | ||
| 775 | as ARGS." | ||
| 771 | (interactive (browse-url-interactive-arg "URL: ")) | 776 | (interactive (browse-url-interactive-arg "URL: ")) |
| 772 | (unless (called-interactively-p 'interactive) | 777 | (unless (called-interactively-p 'interactive) |
| 773 | (setq args (or args (list browse-url-new-window-flag)))) | 778 | (setq args (or args (list browse-url-new-window-flag)))) |
| @@ -836,6 +841,8 @@ says which browser to use." | |||
| 836 | (declare-function w32-shell-execute "w32fns.c") ;; Defined in C. | 841 | (declare-function w32-shell-execute "w32fns.c") ;; Defined in C. |
| 837 | 842 | ||
| 838 | (defun browse-url-default-windows-browser (url &optional _new-window) | 843 | (defun browse-url-default-windows-browser (url &optional _new-window) |
| 844 | "Invoke the MS-Windows system's default Web browser. | ||
| 845 | The optional NEW-WINDOW argument is not used." | ||
| 839 | (interactive (browse-url-interactive-arg "URL: ")) | 846 | (interactive (browse-url-interactive-arg "URL: ")) |
| 840 | (cond ((eq system-type 'ms-dos) | 847 | (cond ((eq system-type 'ms-dos) |
| 841 | (if dos-windows-version | 848 | (if dos-windows-version |
| @@ -846,6 +853,8 @@ says which browser to use." | |||
| 846 | (t (w32-shell-execute "open" url)))) | 853 | (t (w32-shell-execute "open" url)))) |
| 847 | 854 | ||
| 848 | (defun browse-url-default-macosx-browser (url &optional _new-window) | 855 | (defun browse-url-default-macosx-browser (url &optional _new-window) |
| 856 | "Invoke the MacOS X system's default Web browser. | ||
| 857 | The optional NEW-WINDOW argument is not used" | ||
| 849 | (interactive (browse-url-interactive-arg "URL: ")) | 858 | (interactive (browse-url-interactive-arg "URL: ")) |
| 850 | (start-process (concat "open " url) nil "open" url)) | 859 | (start-process (concat "open " url) nil "open" url)) |
| 851 | 860 | ||
| @@ -880,8 +889,8 @@ non-nil, load the document in a new window, if possible, otherwise use | |||
| 880 | a random existing one. A non-nil interactive prefix argument reverses | 889 | a random existing one. A non-nil interactive prefix argument reverses |
| 881 | the effect of `browse-url-new-window-flag'. | 890 | the effect of `browse-url-new-window-flag'. |
| 882 | 891 | ||
| 883 | When called non-interactively, optional second argument NEW-WINDOW is | 892 | When called non-interactively, optional second argument ARGS is used |
| 884 | used instead of `browse-url-new-window-flag'." | 893 | instead of `browse-url-new-window-flag'." |
| 885 | (apply | 894 | (apply |
| 886 | (cond | 895 | (cond |
| 887 | ((memq system-type '(windows-nt ms-dos cygwin)) | 896 | ((memq system-type '(windows-nt ms-dos cygwin)) |
| @@ -1103,7 +1112,8 @@ instead of `browse-url-new-window-flag'." | |||
| 1103 | "Ask the Chromium WWW browser to load URL. | 1112 | "Ask the Chromium WWW browser to load URL. |
| 1104 | Default to the URL around or before point. The strings in | 1113 | Default to the URL around or before point. The strings in |
| 1105 | variable `browse-url-chromium-arguments' are also passed to | 1114 | variable `browse-url-chromium-arguments' are also passed to |
| 1106 | Chromium." | 1115 | Chromium. |
| 1116 | The optional argument NEW-WINDOW is not used." | ||
| 1107 | (interactive (browse-url-interactive-arg "URL: ")) | 1117 | (interactive (browse-url-interactive-arg "URL: ")) |
| 1108 | (setq url (browse-url-encode-url url)) | 1118 | (setq url (browse-url-encode-url url)) |
| 1109 | (let* ((process-environment (browse-url-process-environment))) | 1119 | (let* ((process-environment (browse-url-process-environment))) |
| @@ -1412,7 +1422,8 @@ The `browse-url-gnudoit-program' program is used with options given by | |||
| 1412 | URL defaults to the URL around or before point. | 1422 | URL defaults to the URL around or before point. |
| 1413 | This runs the text browser specified by `browse-url-text-browser'. | 1423 | This runs the text browser specified by `browse-url-text-browser'. |
| 1414 | in an Xterm window using the Xterm program named by `browse-url-xterm-program' | 1424 | in an Xterm window using the Xterm program named by `browse-url-xterm-program' |
| 1415 | with possible additional arguments `browse-url-xterm-args'." | 1425 | with possible additional arguments `browse-url-xterm-args'. |
| 1426 | The optional argument NEW-WINDOW is not used." | ||
| 1416 | (interactive (browse-url-interactive-arg "Text browser URL: ")) | 1427 | (interactive (browse-url-interactive-arg "Text browser URL: ")) |
| 1417 | (apply #'start-process `(,(concat browse-url-text-browser url) | 1428 | (apply #'start-process `(,(concat browse-url-text-browser url) |
| 1418 | nil ,browse-url-xterm-program | 1429 | nil ,browse-url-xterm-program |
| @@ -1560,7 +1571,8 @@ don't offer a form of remote control." | |||
| 1560 | ;;;###autoload | 1571 | ;;;###autoload |
| 1561 | (defun browse-url-kde (url &optional _new-window) | 1572 | (defun browse-url-kde (url &optional _new-window) |
| 1562 | "Ask the KDE WWW browser to load URL. | 1573 | "Ask the KDE WWW browser to load URL. |
| 1563 | Default to the URL around or before point." | 1574 | Default to the URL around or before point. |
| 1575 | The optional argument NEW-WINDOW is not used." | ||
| 1564 | (interactive (browse-url-interactive-arg "KDE URL: ")) | 1576 | (interactive (browse-url-interactive-arg "KDE URL: ")) |
| 1565 | (message "Sending URL to KDE...") | 1577 | (message "Sending URL to KDE...") |
| 1566 | (apply #'start-process (concat "KDE " url) nil browse-url-kde-program | 1578 | (apply #'start-process (concat "KDE " url) nil browse-url-kde-program |