diff options
| -rw-r--r-- | doc/misc/eww.texi | 4 | ||||
| -rw-r--r-- | doc/misc/gnus.texi | 2 | ||||
| -rw-r--r-- | etc/NEWS | 10 | ||||
| -rw-r--r-- | lisp/emacs-lisp/derived.el | 41 | ||||
| -rw-r--r-- | lisp/emacs-lisp/package.el | 78 | ||||
| -rw-r--r-- | lisp/gnus/gnus-art.el | 22 | ||||
| -rw-r--r-- | lisp/gnus/gnus-sum.el | 4 | ||||
| -rw-r--r-- | lisp/net/browse-url.el | 310 | ||||
| -rw-r--r-- | lisp/net/eww.el | 10 | ||||
| -rw-r--r-- | lisp/net/shr.el | 40 | ||||
| -rw-r--r-- | lisp/progmodes/cc-cmds.el | 26 |
11 files changed, 278 insertions, 269 deletions
diff --git a/doc/misc/eww.texi b/doc/misc/eww.texi index 8dc58e84257..cd74aa32c77 100644 --- a/doc/misc/eww.texi +++ b/doc/misc/eww.texi | |||
| @@ -187,7 +187,7 @@ switch EWW buffers through a minibuffer prompt, press @kbd{s} | |||
| 187 | (@code{eww-switch-to-buffer}). | 187 | (@code{eww-switch-to-buffer}). |
| 188 | 188 | ||
| 189 | @findex eww-browse-with-external-browser | 189 | @findex eww-browse-with-external-browser |
| 190 | @vindex shr-external-browser | 190 | @vindex browse-url-external-browser |
| 191 | @vindex eww-use-external-browser-for-content-type | 191 | @vindex eww-use-external-browser-for-content-type |
| 192 | @kindex & | 192 | @kindex & |
| 193 | @cindex External Browser | 193 | @cindex External Browser |
| @@ -197,7 +197,7 @@ or are not implemented (E.g., JavaScript). If you have trouble | |||
| 197 | viewing a website with EWW then hit @kbd{&} | 197 | viewing a website with EWW then hit @kbd{&} |
| 198 | (@code{eww-browse-with-external-browser}) inside the EWW buffer to | 198 | (@code{eww-browse-with-external-browser}) inside the EWW buffer to |
| 199 | open the website in the external browser specified by | 199 | open the website in the external browser specified by |
| 200 | @code{shr-external-browser}. Some content types, such as video or | 200 | @code{browse-url-external-browser}. Some content types, such as video or |
| 201 | audio content, do not make sense to display in GNU Emacs at all. You | 201 | audio content, do not make sense to display in GNU Emacs at all. You |
| 202 | can tell EWW to open specific content automatically in an external | 202 | can tell EWW to open specific content automatically in an external |
| 203 | browser by customizing | 203 | browser by customizing |
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 3968fa58377..7a3322d9fc0 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi | |||
| @@ -10164,7 +10164,7 @@ do so. | |||
| 10164 | @findex gnus-summary-browse-url | 10164 | @findex gnus-summary-browse-url |
| 10165 | Scan the article buffer for links, and offer them to the user for | 10165 | Scan the article buffer for links, and offer them to the user for |
| 10166 | browsing with @code{browse-url}. With a prefix argument, browse with | 10166 | browsing with @code{browse-url}. With a prefix argument, browse with |
| 10167 | @code{shr-external-browser} instead. | 10167 | @code{browse-url-external-browser} instead. |
| 10168 | 10168 | ||
| 10169 | @end table | 10169 | @end table |
| 10170 | 10170 | ||
| @@ -765,6 +765,12 @@ start of a sentence or at '(point-min)', else '@ref'. | |||
| 765 | It now treats the optional 2nd argument to mean that the URL should be | 765 | It now treats the optional 2nd argument to mean that the URL should be |
| 766 | shown in the currently selected window. | 766 | shown in the currently selected window. |
| 767 | 767 | ||
| 768 | *** A new function, 'browse-url-add-buttons' can be used to add clickable | ||
| 769 | links to most ordinary special-mode buffers that display text that | ||
| 770 | have URLs embedded. 'browse-url-button-regexp' controls what's | ||
| 771 | considered a button. | ||
| 772 | |||
| 773 | *** A new variable, 'browse-url-external-browser', has been added. | ||
| 768 | ** Comint | 774 | ** Comint |
| 769 | 775 | ||
| 770 | +++ | 776 | +++ |
| @@ -1037,6 +1043,10 @@ has been executed. | |||
| 1037 | If set, shr will not render tags with attribute 'aria-hidden="true"'. | 1043 | If set, shr will not render tags with attribute 'aria-hidden="true"'. |
| 1038 | This attribute is meant to tell screen readers to ignore a tag. | 1044 | This attribute is meant to tell screen readers to ignore a tag. |
| 1039 | 1045 | ||
| 1046 | +++ | ||
| 1047 | *** 'shr-external-browser' has been made into an obsolete alias | ||
| 1048 | of 'browse-url-external-browser'. | ||
| 1049 | |||
| 1040 | --- | 1050 | --- |
| 1041 | *** 'shr-tag-ol' now respects the ordered list 'start' attribute. | 1051 | *** 'shr-tag-ol' now respects the ordered list 'start' attribute. |
| 1042 | 1052 | ||
diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el index dc867d61da3..a6578e33086 100644 --- a/lisp/emacs-lisp/derived.el +++ b/lisp/emacs-lisp/derived.el | |||
| @@ -113,9 +113,9 @@ | |||
| 113 | 113 | ||
| 114 | ;;;###autoload | 114 | ;;;###autoload |
| 115 | (defmacro define-derived-mode (child parent name &optional docstring &rest body) | 115 | (defmacro define-derived-mode (child parent name &optional docstring &rest body) |
| 116 | "Create a new mode as a variant of an existing mode. | 116 | "Create a new mode CHILD which is a variant of an existing mode PARENT. |
| 117 | 117 | ||
| 118 | The arguments to this command are as follow: | 118 | The arguments are as follows: |
| 119 | 119 | ||
| 120 | CHILD: the name of the command for the derived mode. | 120 | CHILD: the name of the command for the derived mode. |
| 121 | PARENT: the name of the command for the parent mode (e.g. `text-mode') | 121 | PARENT: the name of the command for the parent mode (e.g. `text-mode') |
| @@ -123,25 +123,28 @@ PARENT: the name of the command for the parent mode (e.g. `text-mode') | |||
| 123 | NAME: a string which will appear in the status line (e.g. \"Hypertext\") | 123 | NAME: a string which will appear in the status line (e.g. \"Hypertext\") |
| 124 | DOCSTRING: an optional documentation string--if you do not supply one, | 124 | DOCSTRING: an optional documentation string--if you do not supply one, |
| 125 | the function will attempt to invent something useful. | 125 | the function will attempt to invent something useful. |
| 126 | KEYWORDS: optional keywords. | 126 | KEYWORD-ARGS: |
| 127 | optional arguments in the form of pairs of keyword and value. | ||
| 128 | The following keyword arguments are currently supported: | ||
| 129 | |||
| 130 | :group GROUP | ||
| 131 | Declare the customization group that corresponds | ||
| 132 | to this mode. The command `customize-mode' uses this. | ||
| 133 | :syntax-table TABLE | ||
| 134 | Use TABLE instead of the default (CHILD-syntax-table). | ||
| 135 | A nil value means to simply use the same syntax-table | ||
| 136 | as the parent. | ||
| 137 | :abbrev-table TABLE | ||
| 138 | Use TABLE instead of the default (CHILD-abbrev-table). | ||
| 139 | A nil value means to simply use the same abbrev-table | ||
| 140 | as the parent. | ||
| 141 | :after-hook FORM | ||
| 142 | A single lisp form which is evaluated after the mode | ||
| 143 | hooks have been run. It should not be quoted. | ||
| 144 | |||
| 127 | BODY: forms to execute just before running the | 145 | BODY: forms to execute just before running the |
| 128 | hooks for the new mode. Do not use `interactive' here. | 146 | hooks for the new mode. Do not use `interactive' here. |
| 129 | 147 | ||
| 130 | The following keywords are currently supported: | ||
| 131 | |||
| 132 | :group GROUP | ||
| 133 | Declare the customization group that corresponds to this mode. | ||
| 134 | The command `customize-mode' uses this. | ||
| 135 | :syntax-table TABLE | ||
| 136 | Use TABLE instead of the default (CHILD-syntax-table). | ||
| 137 | A nil value means to simply use the same syntax-table as the parent. | ||
| 138 | :abbrev-table TABLE | ||
| 139 | Use TABLE instead of the default (CHILD-abbrev-table). | ||
| 140 | A nil value means to simply use the same abbrev-table as the parent. | ||
| 141 | :after-hook FORM | ||
| 142 | A single lisp form which is evaluated after the mode hooks have been | ||
| 143 | run. It should not be quoted. | ||
| 144 | |||
| 145 | Here is how you could define LaTeX-Thesis mode as a variant of LaTeX mode: | 148 | Here is how you could define LaTeX-Thesis mode as a variant of LaTeX mode: |
| 146 | 149 | ||
| 147 | (define-derived-mode LaTeX-thesis-mode LaTeX-mode \"LaTeX-Thesis\") | 150 | (define-derived-mode LaTeX-thesis-mode LaTeX-mode \"LaTeX-Thesis\") |
| @@ -165,7 +168,7 @@ The new mode runs the hook constructed by the function | |||
| 165 | 168 | ||
| 166 | See Info node `(elisp)Derived Modes' for more details. | 169 | See Info node `(elisp)Derived Modes' for more details. |
| 167 | 170 | ||
| 168 | \(fn CHILD PARENT NAME [DOCSTRING] [KEYWORDS...] &rest BODY)" | 171 | \(fn CHILD PARENT NAME [DOCSTRING] [KEYWORD-ARGS...] &rest BODY)" |
| 169 | (declare (debug (&define name symbolp sexp [&optional stringp] | 172 | (declare (debug (&define name symbolp sexp [&optional stringp] |
| 170 | [&rest keywordp sexp] def-body)) | 173 | [&rest keywordp sexp] def-body)) |
| 171 | (doc-string 4) | 174 | (doc-string 4) |
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 15f0f93cf5b..e7e0bd11247 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el | |||
| @@ -151,6 +151,7 @@ | |||
| 151 | (require 'tabulated-list) | 151 | (require 'tabulated-list) |
| 152 | (require 'macroexp) | 152 | (require 'macroexp) |
| 153 | (require 'url-handlers) | 153 | (require 'url-handlers) |
| 154 | (require 'browse-url) | ||
| 154 | 155 | ||
| 155 | (defgroup package nil | 156 | (defgroup package nil |
| 156 | "Manager for Emacs Lisp packages." | 157 | "Manager for Emacs Lisp packages." |
| @@ -2504,44 +2505,47 @@ The description is read from the installed package files." | |||
| 2504 | 2505 | ||
| 2505 | (insert "\n") | 2506 | (insert "\n") |
| 2506 | 2507 | ||
| 2507 | (if built-in | 2508 | (let ((start-of-description (point))) |
| 2508 | ;; For built-in packages, get the description from the | 2509 | (if built-in |
| 2509 | ;; Commentary header. | 2510 | ;; For built-in packages, get the description from the |
| 2510 | (let ((fn (locate-file (format "%s.el" name) load-path | 2511 | ;; Commentary header. |
| 2511 | load-file-rep-suffixes)) | 2512 | (let ((fn (locate-file (format "%s.el" name) load-path |
| 2512 | (opoint (point))) | 2513 | load-file-rep-suffixes)) |
| 2513 | (insert (or (lm-commentary fn) "")) | 2514 | (opoint (point))) |
| 2514 | (save-excursion | 2515 | (insert (or (lm-commentary fn) "")) |
| 2515 | (goto-char opoint) | ||
| 2516 | (when (re-search-forward "^;;; Commentary:\n" nil t) | ||
| 2517 | (replace-match "")) | ||
| 2518 | (while (re-search-forward "^\\(;+ ?\\)" nil t) | ||
| 2519 | (replace-match "")))) | ||
| 2520 | |||
| 2521 | (if (package-installed-p desc) | ||
| 2522 | ;; For installed packages, get the description from the | ||
| 2523 | ;; installed files. | ||
| 2524 | (insert (package--get-description desc)) | ||
| 2525 | |||
| 2526 | ;; For non-built-in, non-installed packages, get description from | ||
| 2527 | ;; the archive. | ||
| 2528 | (let* ((basename (format "%s-readme.txt" name)) | ||
| 2529 | readme-string) | ||
| 2530 | |||
| 2531 | (package--with-response-buffer (package-archive-base desc) | ||
| 2532 | :file basename :noerror t | ||
| 2533 | (save-excursion | 2516 | (save-excursion |
| 2534 | (goto-char (point-max)) | 2517 | (goto-char opoint) |
| 2535 | (unless (bolp) | 2518 | (when (re-search-forward "^;;; Commentary:\n" nil t) |
| 2536 | (insert ?\n))) | 2519 | (replace-match "")) |
| 2537 | (cl-assert (not enable-multibyte-characters)) | 2520 | (while (re-search-forward "^\\(;+ ?\\)" nil t) |
| 2538 | (setq readme-string | 2521 | (replace-match "")))) |
| 2539 | ;; The readme.txt files are defined to contain utf-8 text. | 2522 | |
| 2540 | (decode-coding-region (point-min) (point-max) 'utf-8 t)) | 2523 | (if (package-installed-p desc) |
| 2541 | t) | 2524 | ;; For installed packages, get the description from the |
| 2542 | (insert (or readme-string | 2525 | ;; installed files. |
| 2543 | "This package does not provide a description."))) | 2526 | (insert (package--get-description desc)) |
| 2544 | )))) | 2527 | |
| 2528 | ;; For non-built-in, non-installed packages, get description from | ||
| 2529 | ;; the archive. | ||
| 2530 | (let* ((basename (format "%s-readme.txt" name)) | ||
| 2531 | readme-string) | ||
| 2532 | |||
| 2533 | (package--with-response-buffer (package-archive-base desc) | ||
| 2534 | :file basename :noerror t | ||
| 2535 | (save-excursion | ||
| 2536 | (goto-char (point-max)) | ||
| 2537 | (unless (bolp) | ||
| 2538 | (insert ?\n))) | ||
| 2539 | (cl-assert (not enable-multibyte-characters)) | ||
| 2540 | (setq readme-string | ||
| 2541 | ;; The readme.txt files are defined to contain utf-8 text. | ||
| 2542 | (decode-coding-region (point-min) (point-max) 'utf-8 t)) | ||
| 2543 | t) | ||
| 2544 | (insert (or readme-string | ||
| 2545 | "This package does not provide a description."))))) | ||
| 2546 | ;; Make URLs in the description into links. | ||
| 2547 | (goto-char start-of-description) | ||
| 2548 | (browse-url-add-buttons)))) | ||
| 2545 | 2549 | ||
| 2546 | (defun package-install-button-action (button) | 2550 | (defun package-install-button-action (button) |
| 2547 | (let ((pkg-desc (button-get button 'package-desc))) | 2551 | (let ((pkg-desc (button-get button 'package-desc))) |
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 65e1c8106d5..89f57712c56 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el | |||
| @@ -7343,27 +7343,9 @@ groups." | |||
| 7343 | 7343 | ||
| 7344 | ;; Written by Per Abrahamsen <abraham@iesd.auc.dk>. | 7344 | ;; Written by Per Abrahamsen <abraham@iesd.auc.dk>. |
| 7345 | 7345 | ||
| 7346 | ;;; Internal Variables: | 7346 | (defcustom gnus-button-url-regexp browse-url-button-regexp |
| 7347 | |||
| 7348 | (defcustom gnus-button-url-regexp | ||
| 7349 | (concat | ||
| 7350 | "\\b\\(\\(www\\.\\|\\(s?https?\\|ftp\\|file\\|gopher\\|" | ||
| 7351 | "nntp\\|news\\|telnet\\|wais\\|mailto\\|info\\):\\)" | ||
| 7352 | "\\(//[-a-z0-9_.]+:[0-9]*\\)?" | ||
| 7353 | (let ((chars "-a-z0-9_=#$@~%&*+\\/[:word:]") | ||
| 7354 | (punct "!?:;.,")) | ||
| 7355 | (concat | ||
| 7356 | "\\(?:" | ||
| 7357 | ;; Match paired parentheses, e.g. in Wikipedia URLs: | ||
| 7358 | ;; http://thread.gmane.org/47B4E3B2.3050402@gmail.com | ||
| 7359 | "[" chars punct "]+" "(" "[" chars punct "]+" "[" chars "]*)" | ||
| 7360 | "\\(?:" "[" chars punct "]+" "[" chars "]" "\\)?" | ||
| 7361 | "\\|" | ||
| 7362 | "[" chars punct "]+" "[" chars "]" | ||
| 7363 | "\\)")) | ||
| 7364 | "\\)") | ||
| 7365 | "Regular expression that matches URLs." | 7347 | "Regular expression that matches URLs." |
| 7366 | :version "24.4" | 7348 | :version "27.1" |
| 7367 | :group 'gnus-article-buttons | 7349 | :group 'gnus-article-buttons |
| 7368 | :type 'regexp) | 7350 | :type 'regexp) |
| 7369 | 7351 | ||
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index b239890c884..d3103bd4b20 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el | |||
| @@ -9478,7 +9478,7 @@ The 1st element is the widget named by `gnus-collect-urls-primary-text'." | |||
| 9478 | "Scan the current article body for links, and offer to browse them. | 9478 | "Scan the current article body for links, and offer to browse them. |
| 9479 | 9479 | ||
| 9480 | Links are opened using `browse-url' unless a prefix argument is | 9480 | Links are opened using `browse-url' unless a prefix argument is |
| 9481 | given: Then `shr-external-browser' is used instead. | 9481 | given: Then `browse-url-external-browser' is used instead. |
| 9482 | 9482 | ||
| 9483 | If only one link is found, browse that directly, otherwise use | 9483 | If only one link is found, browse that directly, otherwise use |
| 9484 | completion to select a link. The first link marked in the | 9484 | completion to select a link. The first link marked in the |
| @@ -9502,7 +9502,7 @@ default." | |||
| 9502 | (car urls))))) | 9502 | (car urls))))) |
| 9503 | (if target | 9503 | (if target |
| 9504 | (if external | 9504 | (if external |
| 9505 | (funcall shr-external-browser target) | 9505 | (funcall browse-url-external-browser target) |
| 9506 | (browse-url target)) | 9506 | (browse-url target)) |
| 9507 | (message "No URLs found."))))) | 9507 | (message "No URLs found."))))) |
| 9508 | 9508 | ||
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index aa31e25fa91..17b6d36ca87 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el | |||
| @@ -131,9 +131,36 @@ | |||
| 131 | :group 'external | 131 | :group 'external |
| 132 | :group 'comm) | 132 | :group 'comm) |
| 133 | 133 | ||
| 134 | (defvar browse-url--browser-defcustom-type | ||
| 135 | '(choice | ||
| 136 | (function-item :tag "Emacs W3" :value browse-url-w3) | ||
| 137 | (function-item :tag "eww" :value eww-browse-url) | ||
| 138 | (function-item :tag "Mozilla" :value browse-url-mozilla) | ||
| 139 | (function-item :tag "Firefox" :value browse-url-firefox) | ||
| 140 | (function-item :tag "Google Chrome" :value browse-url-chrome) | ||
| 141 | (function-item :tag "Chromium" :value browse-url-chromium) | ||
| 142 | (function-item :tag "Epiphany" :value browse-url-epiphany) | ||
| 143 | (function-item :tag "Conkeror" :value browse-url-conkeror) | ||
| 144 | (function-item :tag "Text browser in an xterm window" | ||
| 145 | :value browse-url-text-xterm) | ||
| 146 | (function-item :tag "Text browser in an Emacs window" | ||
| 147 | :value browse-url-text-emacs) | ||
| 148 | (function-item :tag "KDE" :value browse-url-kde) | ||
| 149 | (function-item :tag "Elinks" :value browse-url-elinks) | ||
| 150 | (function-item :tag "Specified by `Browse Url Generic Program'" | ||
| 151 | :value browse-url-generic) | ||
| 152 | (function-item :tag "Default Windows browser" | ||
| 153 | :value browse-url-default-windows-browser) | ||
| 154 | (function-item :tag "Default macOS browser" | ||
| 155 | :value browse-url-default-macosx-browser) | ||
| 156 | (function-item :tag "Default browser" | ||
| 157 | :value browse-url-default-browser) | ||
| 158 | (function :tag "Your own function") | ||
| 159 | (alist :tag "Regexp/function association list" | ||
| 160 | :key-type regexp :value-type function))) | ||
| 161 | |||
| 134 | ;;;###autoload | 162 | ;;;###autoload |
| 135 | (defcustom browse-url-browser-function | 163 | (defcustom browse-url-browser-function 'browse-url-default-browser |
| 136 | 'browse-url-default-browser | ||
| 137 | "Function to display the current buffer in a WWW browser. | 164 | "Function to display the current buffer in a WWW browser. |
| 138 | This is used by the `browse-url-at-point', `browse-url-at-mouse', and | 165 | This is used by the `browse-url-at-point', `browse-url-at-mouse', and |
| 139 | `browse-url-of-file' commands. | 166 | `browse-url-of-file' commands. |
| @@ -143,34 +170,17 @@ If the value is not a function it should be a list of pairs | |||
| 143 | associated with the first REGEXP which matches the current URL. The | 170 | associated with the first REGEXP which matches the current URL. The |
| 144 | function is passed the URL and any other args of `browse-url'. The last | 171 | function is passed the URL and any other args of `browse-url'. The last |
| 145 | regexp should probably be \".\" to specify a default browser." | 172 | regexp should probably be \".\" to specify a default browser." |
| 146 | :type '(choice | 173 | :type browse-url--browser-defcustom-type |
| 147 | (function-item :tag "Emacs W3" :value browse-url-w3) | 174 | :version "24.1") |
| 148 | (function-item :tag "eww" :value eww-browse-url) | 175 | |
| 149 | (function-item :tag "Mozilla" :value browse-url-mozilla) | 176 | (defcustom browse-url-external-browser 'browse-url-default-browser |
| 150 | (function-item :tag "Firefox" :value browse-url-firefox) | 177 | "Function used to launch an external browser. |
| 151 | (function-item :tag "Google Chrome" :value browse-url-chrome) | 178 | This can actually be any browser, internal or external, used as |
| 152 | (function-item :tag "Chromium" :value browse-url-chromium) | 179 | the secondary browser choice, and is typically used when giving a |
| 153 | (function-item :tag "Epiphany" :value browse-url-epiphany) | 180 | prefix argument to the URL-opening command (in those modes that |
| 154 | (function-item :tag "Conkeror" :value browse-url-conkeror) | 181 | support this (for instance, eww/shr)." |
| 155 | (function-item :tag "Text browser in an xterm window" | 182 | :version "27.1" |
| 156 | :value browse-url-text-xterm) | 183 | :type browse-url--browser-defcustom-type) |
| 157 | (function-item :tag "Text browser in an Emacs window" | ||
| 158 | :value browse-url-text-emacs) | ||
| 159 | (function-item :tag "KDE" :value browse-url-kde) | ||
| 160 | (function-item :tag "Elinks" :value browse-url-elinks) | ||
| 161 | (function-item :tag "Specified by `Browse Url Generic Program'" | ||
| 162 | :value browse-url-generic) | ||
| 163 | (function-item :tag "Default Windows browser" | ||
| 164 | :value browse-url-default-windows-browser) | ||
| 165 | (function-item :tag "Default macOS browser" | ||
| 166 | :value browse-url-default-macosx-browser) | ||
| 167 | (function-item :tag "Default browser" | ||
| 168 | :value browse-url-default-browser) | ||
| 169 | (function :tag "Your own function") | ||
| 170 | (alist :tag "Regexp/function association list" | ||
| 171 | :key-type regexp :value-type function)) | ||
| 172 | :version "24.1" | ||
| 173 | :group 'browse-url) | ||
| 174 | 184 | ||
| 175 | (defcustom browse-url-mailto-function 'browse-url-mail | 185 | (defcustom browse-url-mailto-function 'browse-url-mail |
| 176 | "Function to display mailto: links. | 186 | "Function to display mailto: links. |
| @@ -181,8 +191,7 @@ be used instead." | |||
| 181 | :type '(choice | 191 | :type '(choice |
| 182 | (function-item :tag "Emacs Mail" :value browse-url-mail) | 192 | (function-item :tag "Emacs Mail" :value browse-url-mail) |
| 183 | (function-item :tag "None" nil)) | 193 | (function-item :tag "None" nil)) |
| 184 | :version "24.1" | 194 | :version "24.1") |
| 185 | :group 'browse-url) | ||
| 186 | 195 | ||
| 187 | (defcustom browse-url-man-function 'browse-url-man | 196 | (defcustom browse-url-man-function 'browse-url-man |
| 188 | "Function to display man: links." | 197 | "Function to display man: links." |
| @@ -190,8 +199,28 @@ be used instead." | |||
| 190 | (function-item :tag "Emacs Man" :value browse-url-man) | 199 | (function-item :tag "Emacs Man" :value browse-url-man) |
| 191 | (const :tag "None" nil) | 200 | (const :tag "None" nil) |
| 192 | (function :tag "Other function")) | 201 | (function :tag "Other function")) |
| 193 | :version "26.1" | 202 | :version "26.1") |
| 194 | :group 'browse-url) | 203 | |
| 204 | (defcustom browse-url-button-regexp | ||
| 205 | (concat | ||
| 206 | "\\b\\(\\(www\\.\\|\\(s?https?\\|ftp\\|file\\|gopher\\|" | ||
| 207 | "nntp\\|news\\|telnet\\|wais\\|mailto\\|info\\):\\)" | ||
| 208 | "\\(//[-a-z0-9_.]+:[0-9]*\\)?" | ||
| 209 | (let ((chars "-a-z0-9_=#$@~%&*+\\/[:word:]") | ||
| 210 | (punct "!?:;.,")) | ||
| 211 | (concat | ||
| 212 | "\\(?:" | ||
| 213 | ;; Match paired parentheses, e.g. in Wikipedia URLs: | ||
| 214 | ;; http://thread.gmane.org/47B4E3B2.3050402@gmail.com | ||
| 215 | "[" chars punct "]+" "(" "[" chars punct "]+" "[" chars "]*)" | ||
| 216 | "\\(?:" "[" chars punct "]+" "[" chars "]" "\\)?" | ||
| 217 | "\\|" | ||
| 218 | "[" chars punct "]+" "[" chars "]" | ||
| 219 | "\\)")) | ||
| 220 | "\\)") | ||
| 221 | "Regular expression that matches URLs." | ||
| 222 | :version "27.1" | ||
| 223 | :type 'regexp) | ||
| 195 | 224 | ||
| 196 | (defcustom browse-url-netscape-program "netscape" | 225 | (defcustom browse-url-netscape-program "netscape" |
| 197 | ;; Info about netscape-remote from Karl Berry. | 226 | ;; Info about netscape-remote from Karl Berry. |
| @@ -202,15 +231,13 @@ The free program `netscape-remote' from | |||
| 202 | up very much quicker than `netscape'. Reported to compile on a GNU | 231 | up very much quicker than `netscape'. Reported to compile on a GNU |
| 203 | system, given vroot.h from the same directory, with cc flags | 232 | system, given vroot.h from the same directory, with cc flags |
| 204 | -DSTANDALONE -L/usr/X11R6/lib -lXmu -lX11." | 233 | -DSTANDALONE -L/usr/X11R6/lib -lXmu -lX11." |
| 205 | :type 'string | 234 | :type 'string) |
| 206 | :group 'browse-url) | ||
| 207 | 235 | ||
| 208 | (make-obsolete-variable 'browse-url-netscape-program nil "25.1") | 236 | (make-obsolete-variable 'browse-url-netscape-program nil "25.1") |
| 209 | 237 | ||
| 210 | (defcustom browse-url-netscape-arguments nil | 238 | (defcustom browse-url-netscape-arguments nil |
| 211 | "A list of strings to pass to Netscape as arguments." | 239 | "A list of strings to pass to Netscape as arguments." |
| 212 | :type '(repeat (string :tag "Argument")) | 240 | :type '(repeat (string :tag "Argument"))) |
| 213 | :group 'browse-url) | ||
| 214 | 241 | ||
| 215 | (make-obsolete-variable 'browse-url-netscape-arguments nil "25.1") | 242 | (make-obsolete-variable 'browse-url-netscape-arguments nil "25.1") |
| 216 | 243 | ||
| @@ -218,33 +245,27 @@ system, given vroot.h from the same directory, with cc flags | |||
| 218 | "A list of strings to pass to Netscape when it starts up. | 245 | "A list of strings to pass to Netscape when it starts up. |
| 219 | Defaults to the value of `browse-url-netscape-arguments' at the time | 246 | Defaults to the value of `browse-url-netscape-arguments' at the time |
| 220 | `browse-url' is loaded." | 247 | `browse-url' is loaded." |
| 221 | :type '(repeat (string :tag "Argument")) | 248 | :type '(repeat (string :tag "Argument"))) |
| 222 | |||
| 223 | :group 'browse-url) | ||
| 224 | 249 | ||
| 225 | (make-obsolete-variable 'browse-url-netscape-startup-arguments nil "25.1") | 250 | (make-obsolete-variable 'browse-url-netscape-startup-arguments nil "25.1") |
| 226 | 251 | ||
| 227 | (defcustom browse-url-browser-display nil | 252 | (defcustom browse-url-browser-display nil |
| 228 | "The X display for running the browser, if not same as Emacs's." | 253 | "The X display for running the browser, if not same as Emacs's." |
| 229 | :type '(choice string (const :tag "Default" nil)) | 254 | :type '(choice string (const :tag "Default" nil))) |
| 230 | :group 'browse-url) | ||
| 231 | 255 | ||
| 232 | (defcustom browse-url-mozilla-program "mozilla" | 256 | (defcustom browse-url-mozilla-program "mozilla" |
| 233 | "The name by which to invoke Mozilla." | 257 | "The name by which to invoke Mozilla." |
| 234 | :type 'string | 258 | :type 'string) |
| 235 | :group 'browse-url) | ||
| 236 | 259 | ||
| 237 | (defcustom browse-url-mozilla-arguments nil | 260 | (defcustom browse-url-mozilla-arguments nil |
| 238 | "A list of strings to pass to Mozilla as arguments." | 261 | "A list of strings to pass to Mozilla as arguments." |
| 239 | :type '(repeat (string :tag "Argument")) | 262 | :type '(repeat (string :tag "Argument"))) |
| 240 | :group 'browse-url) | ||
| 241 | 263 | ||
| 242 | (defcustom browse-url-mozilla-startup-arguments browse-url-mozilla-arguments | 264 | (defcustom browse-url-mozilla-startup-arguments browse-url-mozilla-arguments |
| 243 | "A list of strings to pass to Mozilla when it starts up. | 265 | "A list of strings to pass to Mozilla when it starts up. |
| 244 | Defaults to the value of `browse-url-mozilla-arguments' at the time | 266 | Defaults to the value of `browse-url-mozilla-arguments' at the time |
| 245 | `browse-url' is loaded." | 267 | `browse-url' is loaded." |
| 246 | :type '(repeat (string :tag "Argument")) | 268 | :type '(repeat (string :tag "Argument"))) |
| 247 | :group 'browse-url) | ||
| 248 | 269 | ||
| 249 | (defcustom browse-url-firefox-program | 270 | (defcustom browse-url-firefox-program |
| 250 | (let ((candidates '("icecat" "iceweasel" "firefox"))) | 271 | (let ((candidates '("icecat" "iceweasel" "firefox"))) |
| @@ -252,20 +273,17 @@ Defaults to the value of `browse-url-mozilla-arguments' at the time | |||
| 252 | (setq candidates (cdr candidates))) | 273 | (setq candidates (cdr candidates))) |
| 253 | (or (car candidates) "firefox")) | 274 | (or (car candidates) "firefox")) |
| 254 | "The name by which to invoke Firefox or a variant of it." | 275 | "The name by which to invoke Firefox or a variant of it." |
| 255 | :type 'string | 276 | :type 'string) |
| 256 | :group 'browse-url) | ||
| 257 | 277 | ||
| 258 | (defcustom browse-url-firefox-arguments nil | 278 | (defcustom browse-url-firefox-arguments nil |
| 259 | "A list of strings to pass to Firefox (or variant) as arguments." | 279 | "A list of strings to pass to Firefox (or variant) as arguments." |
| 260 | :type '(repeat (string :tag "Argument")) | 280 | :type '(repeat (string :tag "Argument"))) |
| 261 | :group 'browse-url) | ||
| 262 | 281 | ||
| 263 | (defcustom browse-url-firefox-startup-arguments browse-url-firefox-arguments | 282 | (defcustom browse-url-firefox-startup-arguments browse-url-firefox-arguments |
| 264 | "A list of strings to pass to Firefox (or variant) when it starts up. | 283 | "A list of strings to pass to Firefox (or variant) when it starts up. |
| 265 | Defaults to the value of `browse-url-firefox-arguments' at the time | 284 | Defaults to the value of `browse-url-firefox-arguments' at the time |
| 266 | `browse-url' is loaded." | 285 | `browse-url' is loaded." |
| 267 | :type '(repeat (string :tag "Argument")) | 286 | :type '(repeat (string :tag "Argument"))) |
| 268 | :group 'browse-url) | ||
| 269 | 287 | ||
| 270 | (make-obsolete-variable 'browse-url-firefox-startup-arguments | 288 | (make-obsolete-variable 'browse-url-firefox-startup-arguments |
| 271 | "it no longer has any effect." "24.5") | 289 | "it no longer has any effect." "24.5") |
| @@ -277,14 +295,12 @@ Defaults to the value of `browse-url-firefox-arguments' at the time | |||
| 277 | (or (car candidates) "chromium")) | 295 | (or (car candidates) "chromium")) |
| 278 | "The name by which to invoke the Chrome browser." | 296 | "The name by which to invoke the Chrome browser." |
| 279 | :type 'string | 297 | :type 'string |
| 280 | :version "25.1" | 298 | :version "25.1") |
| 281 | :group 'browse-url) | ||
| 282 | 299 | ||
| 283 | (defcustom browse-url-chrome-arguments nil | 300 | (defcustom browse-url-chrome-arguments nil |
| 284 | "A list of strings to pass to Google Chrome as arguments." | 301 | "A list of strings to pass to Google Chrome as arguments." |
| 285 | :type '(repeat (string :tag "Argument")) | 302 | :type '(repeat (string :tag "Argument")) |
| 286 | :version "25.1" | 303 | :version "25.1") |
| 287 | :group 'browse-url) | ||
| 288 | 304 | ||
| 289 | (defcustom browse-url-chromium-program | 305 | (defcustom browse-url-chromium-program |
| 290 | (let ((candidates '("chromium" "chromium-browser"))) | 306 | (let ((candidates '("chromium" "chromium-browser"))) |
| @@ -293,26 +309,22 @@ Defaults to the value of `browse-url-firefox-arguments' at the time | |||
| 293 | (or (car candidates) "chromium")) | 309 | (or (car candidates) "chromium")) |
| 294 | "The name by which to invoke Chromium." | 310 | "The name by which to invoke Chromium." |
| 295 | :type 'string | 311 | :type 'string |
| 296 | :version "24.1" | 312 | :version "24.1") |
| 297 | :group 'browse-url) | ||
| 298 | 313 | ||
| 299 | (defcustom browse-url-chromium-arguments nil | 314 | (defcustom browse-url-chromium-arguments nil |
| 300 | "A list of strings to pass to Chromium as arguments." | 315 | "A list of strings to pass to Chromium as arguments." |
| 301 | :type '(repeat (string :tag "Argument")) | 316 | :type '(repeat (string :tag "Argument")) |
| 302 | :version "24.1" | 317 | :version "24.1") |
| 303 | :group 'browse-url) | ||
| 304 | 318 | ||
| 305 | (defcustom browse-url-galeon-program "galeon" | 319 | (defcustom browse-url-galeon-program "galeon" |
| 306 | "The name by which to invoke Galeon." | 320 | "The name by which to invoke Galeon." |
| 307 | :type 'string | 321 | :type 'string) |
| 308 | :group 'browse-url) | ||
| 309 | 322 | ||
| 310 | (make-obsolete-variable 'browse-url-galeon-program nil "25.1") | 323 | (make-obsolete-variable 'browse-url-galeon-program nil "25.1") |
| 311 | 324 | ||
| 312 | (defcustom browse-url-galeon-arguments nil | 325 | (defcustom browse-url-galeon-arguments nil |
| 313 | "A list of strings to pass to Galeon as arguments." | 326 | "A list of strings to pass to Galeon as arguments." |
| 314 | :type '(repeat (string :tag "Argument")) | 327 | :type '(repeat (string :tag "Argument"))) |
| 315 | :group 'browse-url) | ||
| 316 | 328 | ||
| 317 | (make-obsolete-variable 'browse-url-galeon-arguments nil "25.1") | 329 | (make-obsolete-variable 'browse-url-galeon-arguments nil "25.1") |
| 318 | 330 | ||
| @@ -320,27 +332,23 @@ Defaults to the value of `browse-url-firefox-arguments' at the time | |||
| 320 | "A list of strings to pass to Galeon when it starts up. | 332 | "A list of strings to pass to Galeon when it starts up. |
| 321 | Defaults to the value of `browse-url-galeon-arguments' at the time | 333 | Defaults to the value of `browse-url-galeon-arguments' at the time |
| 322 | `browse-url' is loaded." | 334 | `browse-url' is loaded." |
| 323 | :type '(repeat (string :tag "Argument")) | 335 | :type '(repeat (string :tag "Argument"))) |
| 324 | :group 'browse-url) | ||
| 325 | 336 | ||
| 326 | (make-obsolete-variable 'browse-url-galeon-startup-arguments nil "25.1") | 337 | (make-obsolete-variable 'browse-url-galeon-startup-arguments nil "25.1") |
| 327 | 338 | ||
| 328 | (defcustom browse-url-epiphany-program "epiphany" | 339 | (defcustom browse-url-epiphany-program "epiphany" |
| 329 | "The name by which to invoke Epiphany." | 340 | "The name by which to invoke Epiphany." |
| 330 | :type 'string | 341 | :type 'string) |
| 331 | :group 'browse-url) | ||
| 332 | 342 | ||
| 333 | (defcustom browse-url-epiphany-arguments nil | 343 | (defcustom browse-url-epiphany-arguments nil |
| 334 | "A list of strings to pass to Epiphany as arguments." | 344 | "A list of strings to pass to Epiphany as arguments." |
| 335 | :type '(repeat (string :tag "Argument")) | 345 | :type '(repeat (string :tag "Argument"))) |
| 336 | :group 'browse-url) | ||
| 337 | 346 | ||
| 338 | (defcustom browse-url-epiphany-startup-arguments browse-url-epiphany-arguments | 347 | (defcustom browse-url-epiphany-startup-arguments browse-url-epiphany-arguments |
| 339 | "A list of strings to pass to Epiphany when it starts up. | 348 | "A list of strings to pass to Epiphany when it starts up. |
| 340 | Defaults to the value of `browse-url-epiphany-arguments' at the time | 349 | Defaults to the value of `browse-url-epiphany-arguments' at the time |
| 341 | `browse-url' is loaded." | 350 | `browse-url' is loaded." |
| 342 | :type '(repeat (string :tag "Argument")) | 351 | :type '(repeat (string :tag "Argument"))) |
| 343 | :group 'browse-url) | ||
| 344 | 352 | ||
| 345 | ;; GNOME means of invoking either Mozilla or Netscape. | 353 | ;; GNOME means of invoking either Mozilla or Netscape. |
| 346 | (defvar browse-url-gnome-moz-program "gnome-moz-remote") | 354 | (defvar browse-url-gnome-moz-program "gnome-moz-remote") |
| @@ -350,8 +358,7 @@ Defaults to the value of `browse-url-epiphany-arguments' at the time | |||
| 350 | (defcustom browse-url-gnome-moz-arguments '() | 358 | (defcustom browse-url-gnome-moz-arguments '() |
| 351 | "A list of strings passed to the GNOME mozilla viewer as arguments." | 359 | "A list of strings passed to the GNOME mozilla viewer as arguments." |
| 352 | :version "21.1" | 360 | :version "21.1" |
| 353 | :type '(repeat (string :tag "Argument")) | 361 | :type '(repeat (string :tag "Argument"))) |
| 354 | :group 'browse-url) | ||
| 355 | 362 | ||
| 356 | (make-obsolete-variable 'browse-url-gnome-moz-arguments nil "25.1") | 363 | (make-obsolete-variable 'browse-url-gnome-moz-arguments nil "25.1") |
| 357 | 364 | ||
| @@ -359,30 +366,26 @@ Defaults to the value of `browse-url-epiphany-arguments' at the time | |||
| 359 | "Whether to open up new windows in a tab or a new window. | 366 | "Whether to open up new windows in a tab or a new window. |
| 360 | If non-nil, then open the URL in a new tab rather than a new window if | 367 | If non-nil, then open the URL in a new tab rather than a new window if |
| 361 | `browse-url-mozilla' is asked to open it in a new window." | 368 | `browse-url-mozilla' is asked to open it in a new window." |
| 362 | :type 'boolean | 369 | :type 'boolean) |
| 363 | :group 'browse-url) | ||
| 364 | 370 | ||
| 365 | (defcustom browse-url-firefox-new-window-is-tab nil | 371 | (defcustom browse-url-firefox-new-window-is-tab nil |
| 366 | "Whether to open up new windows in a tab or a new window. | 372 | "Whether to open up new windows in a tab or a new window. |
| 367 | If non-nil, then open the URL in a new tab rather than a new window if | 373 | If non-nil, then open the URL in a new tab rather than a new window if |
| 368 | `browse-url-firefox' is asked to open it in a new window." | 374 | `browse-url-firefox' is asked to open it in a new window." |
| 369 | :type 'boolean | 375 | :type 'boolean) |
| 370 | :group 'browse-url) | ||
| 371 | 376 | ||
| 372 | (defcustom browse-url-conkeror-new-window-is-buffer nil | 377 | (defcustom browse-url-conkeror-new-window-is-buffer nil |
| 373 | "Whether to open up new windows in a buffer or a new window. | 378 | "Whether to open up new windows in a buffer or a new window. |
| 374 | If non-nil, then open the URL in a new buffer rather than a new window if | 379 | If non-nil, then open the URL in a new buffer rather than a new window if |
| 375 | `browse-url-conkeror' is asked to open it in a new window." | 380 | `browse-url-conkeror' is asked to open it in a new window." |
| 376 | :version "25.1" | 381 | :version "25.1" |
| 377 | :type 'boolean | 382 | :type 'boolean) |
| 378 | :group 'browse-url) | ||
| 379 | 383 | ||
| 380 | (defcustom browse-url-galeon-new-window-is-tab nil | 384 | (defcustom browse-url-galeon-new-window-is-tab nil |
| 381 | "Whether to open up new windows in a tab or a new window. | 385 | "Whether to open up new windows in a tab or a new window. |
| 382 | If non-nil, then open the URL in a new tab rather than a new window if | 386 | If non-nil, then open the URL in a new tab rather than a new window if |
| 383 | `browse-url-galeon' is asked to open it in a new window." | 387 | `browse-url-galeon' is asked to open it in a new window." |
| 384 | :type 'boolean | 388 | :type 'boolean) |
| 385 | :group 'browse-url) | ||
| 386 | 389 | ||
| 387 | (make-obsolete-variable 'browse-url-galeon-new-window-is-tab nil "25.1") | 390 | (make-obsolete-variable 'browse-url-galeon-new-window-is-tab nil "25.1") |
| 388 | 391 | ||
| @@ -390,16 +393,14 @@ If non-nil, then open the URL in a new tab rather than a new window if | |||
| 390 | "Whether to open up new windows in a tab or a new window. | 393 | "Whether to open up new windows in a tab or a new window. |
| 391 | If non-nil, then open the URL in a new tab rather than a new window if | 394 | If non-nil, then open the URL in a new tab rather than a new window if |
| 392 | `browse-url-epiphany' is asked to open it in a new window." | 395 | `browse-url-epiphany' is asked to open it in a new window." |
| 393 | :type 'boolean | 396 | :type 'boolean) |
| 394 | :group 'browse-url) | ||
| 395 | 397 | ||
| 396 | (defcustom browse-url-netscape-new-window-is-tab nil | 398 | (defcustom browse-url-netscape-new-window-is-tab nil |
| 397 | "Whether to open up new windows in a tab or a new window. | 399 | "Whether to open up new windows in a tab or a new window. |
| 398 | If non-nil, then open the URL in a new tab rather than a new | 400 | If non-nil, then open the URL in a new tab rather than a new |
| 399 | window if `browse-url-netscape' is asked to open it in a new | 401 | window if `browse-url-netscape' is asked to open it in a new |
| 400 | window." | 402 | window." |
| 401 | :type 'boolean | 403 | :type 'boolean) |
| 402 | :group 'browse-url) | ||
| 403 | 404 | ||
| 404 | (make-obsolete-variable 'browse-url-netscape-new-window-is-tab nil "25.1") | 405 | (make-obsolete-variable 'browse-url-netscape-new-window-is-tab nil "25.1") |
| 405 | 406 | ||
| @@ -407,42 +408,36 @@ window." | |||
| 407 | "Non-nil means always open a new browser window with appropriate browsers. | 408 | "Non-nil means always open a new browser window with appropriate browsers. |
| 408 | Passing an interactive argument to \\[browse-url], or specific browser | 409 | Passing an interactive argument to \\[browse-url], or specific browser |
| 409 | commands reverses the effect of this variable." | 410 | commands reverses the effect of this variable." |
| 410 | :type 'boolean | 411 | :type 'boolean) |
| 411 | :group 'browse-url) | ||
| 412 | 412 | ||
| 413 | (defcustom browse-url-mosaic-program "xmosaic" | 413 | (defcustom browse-url-mosaic-program "xmosaic" |
| 414 | "The name by which to invoke Mosaic (or mMosaic)." | 414 | "The name by which to invoke Mosaic (or mMosaic)." |
| 415 | :type 'string | 415 | :type 'string |
| 416 | :version "20.3" | 416 | :version "20.3") |
| 417 | :group 'browse-url) | ||
| 418 | 417 | ||
| 419 | (make-obsolete-variable 'browse-url-mosaic-program nil "25.1") | 418 | (make-obsolete-variable 'browse-url-mosaic-program nil "25.1") |
| 420 | 419 | ||
| 421 | (defcustom browse-url-mosaic-arguments nil | 420 | (defcustom browse-url-mosaic-arguments nil |
| 422 | "A list of strings to pass to Mosaic as arguments." | 421 | "A list of strings to pass to Mosaic as arguments." |
| 423 | :type '(repeat (string :tag "Argument")) | 422 | :type '(repeat (string :tag "Argument"))) |
| 424 | :group 'browse-url) | ||
| 425 | 423 | ||
| 426 | (make-obsolete-variable 'browse-url-mosaic-arguments nil "25.1") | 424 | (make-obsolete-variable 'browse-url-mosaic-arguments nil "25.1") |
| 427 | 425 | ||
| 428 | (defcustom browse-url-mosaic-pidfile "~/.mosaicpid" | 426 | (defcustom browse-url-mosaic-pidfile "~/.mosaicpid" |
| 429 | "The name of the pidfile created by Mosaic." | 427 | "The name of the pidfile created by Mosaic." |
| 430 | :type 'string | 428 | :type 'string) |
| 431 | :group 'browse-url) | ||
| 432 | 429 | ||
| 433 | (make-obsolete-variable 'browse-url-mosaic-pidfile nil "25.1") | 430 | (make-obsolete-variable 'browse-url-mosaic-pidfile nil "25.1") |
| 434 | 431 | ||
| 435 | (defcustom browse-url-conkeror-program "conkeror" | 432 | (defcustom browse-url-conkeror-program "conkeror" |
| 436 | "The name by which to invoke Conkeror." | 433 | "The name by which to invoke Conkeror." |
| 437 | :type 'string | 434 | :type 'string |
| 438 | :version "25.1" | 435 | :version "25.1") |
| 439 | :group 'browse-url) | ||
| 440 | 436 | ||
| 441 | (defcustom browse-url-conkeror-arguments nil | 437 | (defcustom browse-url-conkeror-arguments nil |
| 442 | "A list of strings to pass to Conkeror as arguments." | 438 | "A list of strings to pass to Conkeror as arguments." |
| 443 | :version "25.1" | 439 | :version "25.1" |
| 444 | :type '(repeat (string :tag "Argument")) | 440 | :type '(repeat (string :tag "Argument"))) |
| 445 | :group 'browse-url) | ||
| 446 | 441 | ||
| 447 | (defcustom browse-url-filename-alist | 442 | (defcustom browse-url-filename-alist |
| 448 | `(("^/\\(ftp@\\|anonymous@\\)?\\([^:/]+\\):/*" . "ftp://\\2/") | 443 | `(("^/\\(ftp@\\|anonymous@\\)?\\([^:/]+\\):/*" . "ftp://\\2/") |
| @@ -473,26 +468,22 @@ address to an HTTP URL: | |||
| 473 | :type '(repeat (cons :format "%v" | 468 | :type '(repeat (cons :format "%v" |
| 474 | (regexp :tag "Regexp") | 469 | (regexp :tag "Regexp") |
| 475 | (string :tag "Replacement"))) | 470 | (string :tag "Replacement"))) |
| 476 | :version "25.1" | 471 | :version "25.1") |
| 477 | :group 'browse-url) | ||
| 478 | 472 | ||
| 479 | (defcustom browse-url-save-file nil | 473 | (defcustom browse-url-save-file nil |
| 480 | "If non-nil, save the buffer before displaying its file. | 474 | "If non-nil, save the buffer before displaying its file. |
| 481 | Used by the `browse-url-of-file' command." | 475 | Used by the `browse-url-of-file' command." |
| 482 | :type 'boolean | 476 | :type 'boolean) |
| 483 | :group 'browse-url) | ||
| 484 | 477 | ||
| 485 | (defcustom browse-url-of-file-hook nil | 478 | (defcustom browse-url-of-file-hook nil |
| 486 | "Hook run after `browse-url-of-file' has asked a browser to load a file." | 479 | "Hook run after `browse-url-of-file' has asked a browser to load a file." |
| 487 | :type 'hook | 480 | :type 'hook) |
| 488 | :group 'browse-url) | ||
| 489 | 481 | ||
| 490 | (defcustom browse-url-CCI-port 3003 | 482 | (defcustom browse-url-CCI-port 3003 |
| 491 | "Port to access XMosaic via CCI. | 483 | "Port to access XMosaic via CCI. |
| 492 | This can be any number between 1024 and 65535 but must correspond to | 484 | This can be any number between 1024 and 65535 but must correspond to |
| 493 | the value set in the browser." | 485 | the value set in the browser." |
| 494 | :type 'integer | 486 | :type 'integer) |
| 495 | :group 'browse-url) | ||
| 496 | 487 | ||
| 497 | (make-obsolete-variable 'browse-url-CCI-port nil "25.1") | 488 | (make-obsolete-variable 'browse-url-CCI-port nil "25.1") |
| 498 | 489 | ||
| @@ -500,8 +491,7 @@ the value set in the browser." | |||
| 500 | "Host to access XMosaic via CCI. | 491 | "Host to access XMosaic via CCI. |
| 501 | This should be the host name of the machine running XMosaic with CCI | 492 | This should be the host name of the machine running XMosaic with CCI |
| 502 | enabled. The port number should be set in `browse-url-CCI-port'." | 493 | enabled. The port number should be set in `browse-url-CCI-port'." |
| 503 | :type 'string | 494 | :type 'string) |
| 504 | :group 'browse-url) | ||
| 505 | 495 | ||
| 506 | (make-obsolete-variable 'browse-url-CCI-host nil "25.1") | 496 | (make-obsolete-variable 'browse-url-CCI-host nil "25.1") |
| 507 | 497 | ||
| @@ -511,57 +501,48 @@ enabled. The port number should be set in `browse-url-CCI-port'." | |||
| 511 | (defcustom browse-url-xterm-program "xterm" | 501 | (defcustom browse-url-xterm-program "xterm" |
| 512 | "The name of the terminal emulator used by `browse-url-text-xterm'. | 502 | "The name of the terminal emulator used by `browse-url-text-xterm'. |
| 513 | This might, for instance, be a separate color version of xterm." | 503 | This might, for instance, be a separate color version of xterm." |
| 514 | :type 'string | 504 | :type 'string) |
| 515 | :group 'browse-url) | ||
| 516 | 505 | ||
| 517 | (defcustom browse-url-xterm-args nil | 506 | (defcustom browse-url-xterm-args nil |
| 518 | "A list of strings defining options for `browse-url-xterm-program'. | 507 | "A list of strings defining options for `browse-url-xterm-program'. |
| 519 | These might set its size, for instance." | 508 | These might set its size, for instance." |
| 520 | :type '(repeat (string :tag "Argument")) | 509 | :type '(repeat (string :tag "Argument"))) |
| 521 | :group 'browse-url) | ||
| 522 | 510 | ||
| 523 | (defcustom browse-url-gnudoit-program "gnudoit" | 511 | (defcustom browse-url-gnudoit-program "gnudoit" |
| 524 | "The name of the `gnudoit' program used by `browse-url-w3-gnudoit'." | 512 | "The name of the `gnudoit' program used by `browse-url-w3-gnudoit'." |
| 525 | :type 'string | 513 | :type 'string) |
| 526 | :group 'browse-url) | ||
| 527 | 514 | ||
| 528 | (defcustom browse-url-gnudoit-args '("-q") | 515 | (defcustom browse-url-gnudoit-args '("-q") |
| 529 | "A list of strings defining options for `browse-url-gnudoit-program'. | 516 | "A list of strings defining options for `browse-url-gnudoit-program'. |
| 530 | These might set the port, for instance." | 517 | These might set the port, for instance." |
| 531 | :type '(repeat (string :tag "Argument")) | 518 | :type '(repeat (string :tag "Argument"))) |
| 532 | :group 'browse-url) | ||
| 533 | 519 | ||
| 534 | (defcustom browse-url-generic-program nil | 520 | (defcustom browse-url-generic-program nil |
| 535 | "The name of the browser program used by `browse-url-generic'." | 521 | "The name of the browser program used by `browse-url-generic'." |
| 536 | :type '(choice string (const :tag "None" nil)) | 522 | :type '(choice string (const :tag "None" nil))) |
| 537 | :group 'browse-url) | ||
| 538 | 523 | ||
| 539 | (defcustom browse-url-generic-args nil | 524 | (defcustom browse-url-generic-args nil |
| 540 | "A list of strings defining options for `browse-url-generic-program'." | 525 | "A list of strings defining options for `browse-url-generic-program'." |
| 541 | :type '(repeat (string :tag "Argument")) | 526 | :type '(repeat (string :tag "Argument"))) |
| 542 | :group 'browse-url) | ||
| 543 | 527 | ||
| 544 | (defcustom browse-url-temp-dir temporary-file-directory | 528 | (defcustom browse-url-temp-dir temporary-file-directory |
| 545 | "The name of a directory for browse-url's temporary files. | 529 | "The name of a directory for browse-url's temporary files. |
| 546 | Such files are generated by functions like `browse-url-of-region'. | 530 | Such files are generated by functions like `browse-url-of-region'. |
| 547 | You might want to set this to somewhere with restricted read permissions | 531 | You might want to set this to somewhere with restricted read permissions |
| 548 | for privacy's sake." | 532 | for privacy's sake." |
| 549 | :type 'string | 533 | :type 'string) |
| 550 | :group 'browse-url) | ||
| 551 | 534 | ||
| 552 | (defcustom browse-url-netscape-version 3 | 535 | (defcustom browse-url-netscape-version 3 |
| 553 | "The version of Netscape you are using. | 536 | "The version of Netscape you are using. |
| 554 | This affects how URL reloading is done; the mechanism changed | 537 | This affects how URL reloading is done; the mechanism changed |
| 555 | incompatibly at version 4." | 538 | incompatibly at version 4." |
| 556 | :type 'number | 539 | :type 'number) |
| 557 | :group 'browse-url) | ||
| 558 | 540 | ||
| 559 | (make-obsolete-variable 'browse-url-netscape-version nil "25.1") | 541 | (make-obsolete-variable 'browse-url-netscape-version nil "25.1") |
| 560 | 542 | ||
| 561 | (defcustom browse-url-text-browser "lynx" | 543 | (defcustom browse-url-text-browser "lynx" |
| 562 | "The name of the text browser to invoke." | 544 | "The name of the text browser to invoke." |
| 563 | :type 'string | 545 | :type 'string |
| 564 | :group 'browse-url | ||
| 565 | :version "23.1") | 546 | :version "23.1") |
| 566 | 547 | ||
| 567 | (defcustom browse-url-text-emacs-args (and (not window-system) | 548 | (defcustom browse-url-text-emacs-args (and (not window-system) |
| @@ -572,8 +553,7 @@ The default is none in a window system, otherwise `-show_cursor' to | |||
| 572 | indicate the position of the current link in the absence of | 553 | indicate the position of the current link in the absence of |
| 573 | highlighting, assuming the normal default for showing the cursor." | 554 | highlighting, assuming the normal default for showing the cursor." |
| 574 | :type '(repeat (string :tag "Argument")) | 555 | :type '(repeat (string :tag "Argument")) |
| 575 | :version "23.1" | 556 | :version "23.1") |
| 576 | :group 'browse-url) | ||
| 577 | 557 | ||
| 578 | (defcustom browse-url-text-input-field 'avoid | 558 | (defcustom browse-url-text-input-field 'avoid |
| 579 | "Action on selecting an existing text browser buffer at an input field. | 559 | "Action on selecting an existing text browser buffer at an input field. |
| @@ -586,36 +566,30 @@ down (this *won't* always work)." | |||
| 586 | :type '(choice (const :tag "Move to try to avoid field" :value avoid) | 566 | :type '(choice (const :tag "Move to try to avoid field" :value avoid) |
| 587 | (const :tag "Disregard" :value nil) | 567 | (const :tag "Disregard" :value nil) |
| 588 | (const :tag "Warn, don't emit URL" :value warn)) | 568 | (const :tag "Warn, don't emit URL" :value warn)) |
| 589 | :version "23.1" | 569 | :version "23.1") |
| 590 | :group 'browse-url) | ||
| 591 | 570 | ||
| 592 | (defcustom browse-url-text-input-attempts 10 | 571 | (defcustom browse-url-text-input-attempts 10 |
| 593 | "How many times to try to move down from a series of text browser input fields." | 572 | "How many times to try to move down from a series of text browser input fields." |
| 594 | :type 'integer | 573 | :type 'integer |
| 595 | :version "23.1" | 574 | :version "23.1") |
| 596 | :group 'browse-url) | ||
| 597 | 575 | ||
| 598 | (defcustom browse-url-text-input-delay 0.2 | 576 | (defcustom browse-url-text-input-delay 0.2 |
| 599 | "Seconds to wait for a text browser between moves down from an input field." | 577 | "Seconds to wait for a text browser between moves down from an input field." |
| 600 | :type 'number | 578 | :type 'number |
| 601 | :version "23.1" | 579 | :version "23.1") |
| 602 | :group 'browse-url) | ||
| 603 | 580 | ||
| 604 | (defcustom browse-url-kde-program "kfmclient" | 581 | (defcustom browse-url-kde-program "kfmclient" |
| 605 | "The name by which to invoke the KDE web browser." | 582 | "The name by which to invoke the KDE web browser." |
| 606 | :type 'string | 583 | :type 'string |
| 607 | :version "21.1" | 584 | :version "21.1") |
| 608 | :group 'browse-url) | ||
| 609 | 585 | ||
| 610 | (defcustom browse-url-kde-args '("openURL") | 586 | (defcustom browse-url-kde-args '("openURL") |
| 611 | "A list of strings defining options for `browse-url-kde-program'." | 587 | "A list of strings defining options for `browse-url-kde-program'." |
| 612 | :type '(repeat (string :tag "Argument")) | 588 | :type '(repeat (string :tag "Argument"))) |
| 613 | :group 'browse-url) | ||
| 614 | 589 | ||
| 615 | (defcustom browse-url-elinks-wrapper '("xterm" "-e") | 590 | (defcustom browse-url-elinks-wrapper '("xterm" "-e") |
| 616 | "Wrapper command prepended to the Elinks command-line." | 591 | "Wrapper command prepended to the Elinks command-line." |
| 617 | :type '(repeat (string :tag "Wrapper")) | 592 | :type '(repeat (string :tag "Wrapper"))) |
| 618 | :group 'browse-url) | ||
| 619 | 593 | ||
| 620 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 594 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 621 | ;; URL encoding | 595 | ;; URL encoding |
| @@ -1673,6 +1647,58 @@ from `browse-url-elinks-wrapper'." | |||
| 1673 | (error "Unrecognized exit-code %d of process `elinks'" | 1647 | (error "Unrecognized exit-code %d of process `elinks'" |
| 1674 | exit-status)))) | 1648 | exit-status)))) |
| 1675 | 1649 | ||
| 1650 | ;;; Adding buttons to a buffer to call `browse-url' when you hit them. | ||
| 1651 | |||
| 1652 | (defvar browse-url-button-map | ||
| 1653 | (let ((map (make-sparse-keymap))) | ||
| 1654 | (define-key map "\r" 'browse-url-button-open) | ||
| 1655 | (define-key map [mouse-2] 'browse-url-button-open) | ||
| 1656 | (define-key map "w" 'browse-url-button-copy) | ||
| 1657 | map) | ||
| 1658 | "The keymap used for browse-url buttons.") | ||
| 1659 | |||
| 1660 | (defface browse-url-button | ||
| 1661 | '((t :inherit link)) | ||
| 1662 | "Face for browse-url buttons (i.e., links)." | ||
| 1663 | :version "27.1") | ||
| 1664 | |||
| 1665 | (defun browse-url-add-buttons () | ||
| 1666 | "Add clickable buttons to the text following point in the current buffer. | ||
| 1667 | Everything that matches `browse-url-button-regexp' will be made | ||
| 1668 | clickable and will use `browse-url' to open the URLs in question." | ||
| 1669 | (let ((inhibit-read-only t)) | ||
| 1670 | (save-excursion | ||
| 1671 | (while (re-search-forward browse-url-button-regexp nil t) | ||
| 1672 | (add-text-properties (match-beginning 0) | ||
| 1673 | (match-end 0) | ||
| 1674 | `(help-echo "Open the URL under point" | ||
| 1675 | keymap ,browse-url-button-map | ||
| 1676 | face browse-url-button | ||
| 1677 | button t | ||
| 1678 | browse-url-data ,(match-string 0))))))) | ||
| 1679 | |||
| 1680 | (defun browse-url-button-open (&optional external mouse-event) | ||
| 1681 | "Follow the link under point using `browse-url'. | ||
| 1682 | If EXTERNAL (the prefix if used interactively), open with the | ||
| 1683 | external browser instead of the default one." | ||
| 1684 | (interactive (list current-prefix-arg last-nonmenu-event)) | ||
| 1685 | (mouse-set-point mouse-event) | ||
| 1686 | (let ((url (get-text-property (point) 'browse-url-data))) | ||
| 1687 | (unless url | ||
| 1688 | (error "No URL under point")) | ||
| 1689 | (if external | ||
| 1690 | (funcall browse-url-external-browser url) | ||
| 1691 | (browse-url url)))) | ||
| 1692 | |||
| 1693 | (defun browse-url-button-copy () | ||
| 1694 | "Copy the URL under point" | ||
| 1695 | (interactive) | ||
| 1696 | (let ((url (get-text-property (point) 'browse-url-data))) | ||
| 1697 | (unless url | ||
| 1698 | (error "No URL under point")) | ||
| 1699 | (kill-new url) | ||
| 1700 | (message "Copied %s" url))) | ||
| 1701 | |||
| 1676 | (provide 'browse-url) | 1702 | (provide 'browse-url) |
| 1677 | 1703 | ||
| 1678 | ;;; browse-url.el ends here | 1704 | ;;; browse-url.el ends here |
diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 206f9cfdf30..d839cc24c46 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el | |||
| @@ -1501,13 +1501,15 @@ See URL `https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input'.") | |||
| 1501 | 1501 | ||
| 1502 | (defun eww-browse-with-external-browser (&optional url) | 1502 | (defun eww-browse-with-external-browser (&optional url) |
| 1503 | "Browse the current URL with an external browser. | 1503 | "Browse the current URL with an external browser. |
| 1504 | The browser to used is specified by the `shr-external-browser' variable." | 1504 | The browser to used is specified by the `browse-url-external-browser' variable." |
| 1505 | (interactive) | 1505 | (interactive) |
| 1506 | (funcall shr-external-browser (or url (plist-get eww-data :url)))) | 1506 | (funcall browse-url-external-browser (or url (plist-get eww-data :url)))) |
| 1507 | 1507 | ||
| 1508 | (defun eww-follow-link (&optional external mouse-event) | 1508 | (defun eww-follow-link (&optional external mouse-event) |
| 1509 | "Browse the URL under point. | 1509 | "Browse the URL under point. |
| 1510 | If EXTERNAL is single prefix, browse the URL using `shr-external-browser'. | 1510 | If EXTERNAL is single prefix, browse the URL using |
| 1511 | `browse-url-external-browser'. | ||
| 1512 | |||
| 1511 | If EXTERNAL is double prefix, browse in new buffer." | 1513 | If EXTERNAL is double prefix, browse in new buffer." |
| 1512 | (interactive (list current-prefix-arg last-nonmenu-event)) | 1514 | (interactive (list current-prefix-arg last-nonmenu-event)) |
| 1513 | (mouse-set-point mouse-event) | 1515 | (mouse-set-point mouse-event) |
| @@ -1518,7 +1520,7 @@ If EXTERNAL is double prefix, browse in new buffer." | |||
| 1518 | ((string-match "^mailto:" url) | 1520 | ((string-match "^mailto:" url) |
| 1519 | (browse-url-mail url)) | 1521 | (browse-url-mail url)) |
| 1520 | ((and (consp external) (<= (car external) 4)) | 1522 | ((and (consp external) (<= (car external) 4)) |
| 1521 | (funcall shr-external-browser url) | 1523 | (funcall browse-url-external-browser url) |
| 1522 | (shr--blink-link)) | 1524 | (shr--blink-link)) |
| 1523 | ;; This is a #target url in the same page as the current one. | 1525 | ;; This is a #target url in the same page as the current one. |
| 1524 | ((and (url-target (url-generic-parse-url url)) | 1526 | ((and (url-target (url-generic-parse-url url)) |
diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 98b09ab2970..2bc25930fcb 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el | |||
| @@ -53,53 +53,44 @@ width and height of the window. If they are larger than this, | |||
| 53 | and Emacs supports it, then the images will be rescaled down to | 53 | and Emacs supports it, then the images will be rescaled down to |
| 54 | fit these criteria." | 54 | fit these criteria." |
| 55 | :version "24.1" | 55 | :version "24.1" |
| 56 | :group 'shr | ||
| 57 | :type 'float) | 56 | :type 'float) |
| 58 | 57 | ||
| 59 | (defcustom shr-blocked-images nil | 58 | (defcustom shr-blocked-images nil |
| 60 | "Images that have URLs matching this regexp will be blocked." | 59 | "Images that have URLs matching this regexp will be blocked." |
| 61 | :version "24.1" | 60 | :version "24.1" |
| 62 | :group 'shr | ||
| 63 | :type '(choice (const nil) regexp)) | 61 | :type '(choice (const nil) regexp)) |
| 64 | 62 | ||
| 65 | (defcustom shr-use-fonts t | 63 | (defcustom shr-use-fonts t |
| 66 | "If non-nil, use proportional fonts for text." | 64 | "If non-nil, use proportional fonts for text." |
| 67 | :version "25.1" | 65 | :version "25.1" |
| 68 | :group 'shr | ||
| 69 | :type 'boolean) | 66 | :type 'boolean) |
| 70 | 67 | ||
| 71 | (defcustom shr-discard-aria-hidden nil | 68 | (defcustom shr-discard-aria-hidden nil |
| 72 | "If non-nil, don't render tags with `aria-hidden=\"true\"'. | 69 | "If non-nil, don't render tags with `aria-hidden=\"true\"'. |
| 73 | This attribute is meant to tell screen readers to ignore a tag." | 70 | This attribute is meant to tell screen readers to ignore a tag." |
| 74 | :version "27.1" | 71 | :version "27.1" |
| 75 | :group 'shr | ||
| 76 | :type 'boolean) | 72 | :type 'boolean) |
| 77 | 73 | ||
| 78 | (defcustom shr-use-colors t | 74 | (defcustom shr-use-colors t |
| 79 | "If non-nil, respect color specifications in the HTML." | 75 | "If non-nil, respect color specifications in the HTML." |
| 80 | :version "26.1" | 76 | :version "26.1" |
| 81 | :group 'shr | ||
| 82 | :type 'boolean) | 77 | :type 'boolean) |
| 83 | 78 | ||
| 84 | (defcustom shr-table-horizontal-line nil | 79 | (defcustom shr-table-horizontal-line nil |
| 85 | "Character used to draw horizontal table lines. | 80 | "Character used to draw horizontal table lines. |
| 86 | If nil, don't draw horizontal table lines." | 81 | If nil, don't draw horizontal table lines." |
| 87 | :group 'shr | ||
| 88 | :type '(choice (const nil) character)) | 82 | :type '(choice (const nil) character)) |
| 89 | 83 | ||
| 90 | (defcustom shr-table-vertical-line ?\s | 84 | (defcustom shr-table-vertical-line ?\s |
| 91 | "Character used to draw vertical table lines." | 85 | "Character used to draw vertical table lines." |
| 92 | :group 'shr | ||
| 93 | :type 'character) | 86 | :type 'character) |
| 94 | 87 | ||
| 95 | (defcustom shr-table-corner ?\s | 88 | (defcustom shr-table-corner ?\s |
| 96 | "Character used to draw table corners." | 89 | "Character used to draw table corners." |
| 97 | :group 'shr | ||
| 98 | :type 'character) | 90 | :type 'character) |
| 99 | 91 | ||
| 100 | (defcustom shr-hr-line ?- | 92 | (defcustom shr-hr-line ?- |
| 101 | "Character used to draw hr lines." | 93 | "Character used to draw hr lines." |
| 102 | :group 'shr | ||
| 103 | :type 'character) | 94 | :type 'character) |
| 104 | 95 | ||
| 105 | (defcustom shr-width nil | 96 | (defcustom shr-width nil |
| @@ -110,8 +101,7 @@ If `shr-use-fonts' is set, the mean character width is used to | |||
| 110 | compute the pixel width, which is used instead." | 101 | compute the pixel width, which is used instead." |
| 111 | :version "25.1" | 102 | :version "25.1" |
| 112 | :type '(choice (integer :tag "Fixed width in characters") | 103 | :type '(choice (integer :tag "Fixed width in characters") |
| 113 | (const :tag "Use the width of the window" nil)) | 104 | (const :tag "Use the width of the window" nil))) |
| 114 | :group 'shr) | ||
| 115 | 105 | ||
| 116 | (defcustom shr-bullet "* " | 106 | (defcustom shr-bullet "* " |
| 117 | "Bullet used for unordered lists. | 107 | "Bullet used for unordered lists. |
| @@ -119,19 +109,14 @@ Alternative suggestions are: | |||
| 119 | - \" \" | 109 | - \" \" |
| 120 | - \" \"" | 110 | - \" \"" |
| 121 | :version "24.4" | 111 | :version "24.4" |
| 122 | :type 'string | 112 | :type 'string) |
| 123 | :group 'shr) | ||
| 124 | 113 | ||
| 125 | (defcustom shr-external-browser 'browse-url-default-browser | 114 | (define-obsolete-variable-alias 'shr-external-browser |
| 126 | "Function used to launch an external browser." | 115 | 'browse-url-external-browser "27.1") |
| 127 | :version "24.4" | ||
| 128 | :group 'shr | ||
| 129 | :type 'function) | ||
| 130 | 116 | ||
| 131 | (defcustom shr-image-animate t | 117 | (defcustom shr-image-animate t |
| 132 | "Non nil means that images that can be animated will be." | 118 | "Non nil means that images that can be animated will be." |
| 133 | :version "24.4" | 119 | :version "24.4" |
| 134 | :group 'shr | ||
| 135 | :type 'boolean) | 120 | :type 'boolean) |
| 136 | 121 | ||
| 137 | (defvar shr-content-function nil | 122 | (defvar shr-content-function nil |
| @@ -144,28 +129,24 @@ cid: URL as the argument.") | |||
| 144 | 129 | ||
| 145 | (defface shr-strike-through '((t :strike-through t)) | 130 | (defface shr-strike-through '((t :strike-through t)) |
| 146 | "Face for <s> elements." | 131 | "Face for <s> elements." |
| 147 | :version "24.1" | 132 | :version "24.1") |
| 148 | :group 'shr) | ||
| 149 | 133 | ||
| 150 | (defface shr-link | 134 | (defface shr-link |
| 151 | '((t :inherit link)) | 135 | '((t :inherit link)) |
| 152 | "Face for link elements." | 136 | "Face for link elements." |
| 153 | :version "24.1" | 137 | :version "24.1") |
| 154 | :group 'shr) | ||
| 155 | 138 | ||
| 156 | (defface shr-selected-link | 139 | (defface shr-selected-link |
| 157 | '((t :inherit shr-link :background "red")) | 140 | '((t :inherit shr-link :background "red")) |
| 158 | "Temporary face for externally visited link elements. | 141 | "Temporary face for externally visited link elements. |
| 159 | When a link is visited with an external browser, the link | 142 | When a link is visited with an external browser, the link |
| 160 | temporarily blinks with this face." | 143 | temporarily blinks with this face." |
| 161 | :version "27.1" | 144 | :version "27.1") |
| 162 | :group 'shr) | ||
| 163 | 145 | ||
| 164 | (defface shr-abbreviation | 146 | (defface shr-abbreviation |
| 165 | '((t :inherit underline :underline (:style wave))) | 147 | '((t :inherit underline :underline (:style wave))) |
| 166 | "Face for <abbr> elements." | 148 | "Face for <abbr> elements." |
| 167 | :version "27.1" | 149 | :version "27.1") |
| 168 | :group 'shr) | ||
| 169 | 150 | ||
| 170 | (defvar shr-inhibit-images nil | 151 | (defvar shr-inhibit-images nil |
| 171 | "If non-nil, inhibit loading images.") | 152 | "If non-nil, inhibit loading images.") |
| @@ -973,7 +954,7 @@ size, and full-buffer size." | |||
| 973 | (defun shr-browse-url (&optional external mouse-event) | 954 | (defun shr-browse-url (&optional external mouse-event) |
| 974 | "Browse the URL at point using `browse-url'. | 955 | "Browse the URL at point using `browse-url'. |
| 975 | If EXTERNAL is non-nil (interactively, the prefix argument), browse | 956 | If EXTERNAL is non-nil (interactively, the prefix argument), browse |
| 976 | the URL using `shr-external-browser'. | 957 | the URL using `browse-url-external-browser'. |
| 977 | If this function is invoked by a mouse click, it will browse the URL | 958 | If this function is invoked by a mouse click, it will browse the URL |
| 978 | at the position of the click. Optional argument MOUSE-EVENT describes | 959 | at the position of the click. Optional argument MOUSE-EVENT describes |
| 979 | the mouse click event." | 960 | the mouse click event." |
| @@ -988,7 +969,7 @@ the mouse click event." | |||
| 988 | (t | 969 | (t |
| 989 | (if external | 970 | (if external |
| 990 | (progn | 971 | (progn |
| 991 | (funcall shr-external-browser url) | 972 | (funcall browse-url-external-browser url) |
| 992 | (shr--blink-link)) | 973 | (shr--blink-link)) |
| 993 | (browse-url url)))))) | 974 | (browse-url url)))))) |
| 994 | 975 | ||
| @@ -1534,7 +1515,6 @@ The key element should be a regexp matched against the type of the source or | |||
| 1534 | url if no type is specified. The value should be a float in the range 0.0 to | 1515 | url if no type is specified. The value should be a float in the range 0.0 to |
| 1535 | 1.0. Media elements with higher value are preferred." | 1516 | 1.0. Media elements with higher value are preferred." |
| 1536 | :version "24.4" | 1517 | :version "24.4" |
| 1537 | :group 'shr | ||
| 1538 | :type '(alist :key-type regexp :value-type float)) | 1518 | :type '(alist :key-type regexp :value-type float)) |
| 1539 | 1519 | ||
| 1540 | (defun shr--get-media-pref (elem) | 1520 | (defun shr--get-media-pref (elem) |
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index efc6747de48..2ccdc1d0bc8 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el | |||
| @@ -1775,7 +1775,7 @@ defun." | |||
| 1775 | (setq arg (1+ arg))) | 1775 | (setq arg (1+ arg))) |
| 1776 | (if (< arg 0) | 1776 | (if (< arg 0) |
| 1777 | (c-while-widening-to-decl-block | 1777 | (c-while-widening-to-decl-block |
| 1778 | (< (setq arg (- (c-forward-to-nth-EOF-} (- arg) where))) 0))) | 1778 | (< (setq arg (- (c-forward-to-nth-EOF-\;-or-} (- arg) where))) 0))) |
| 1779 | ;; Move forward to the next opening brace.... | 1779 | ;; Move forward to the next opening brace.... |
| 1780 | (when (and (= arg 0) | 1780 | (when (and (= arg 0) |
| 1781 | (progn | 1781 | (progn |
| @@ -1811,10 +1811,11 @@ defun." | |||
| 1811 | (c-keep-region-active) | 1811 | (c-keep-region-active) |
| 1812 | (= arg 0))))) | 1812 | (= arg 0))))) |
| 1813 | 1813 | ||
| 1814 | (defun c-forward-to-nth-EOF-} (n where) | 1814 | (defun c-forward-to-nth-EOF-\;-or-} (n where) |
| 1815 | ;; Skip to the closing brace of the Nth function after point. If | 1815 | ;; Skip to the closing brace or semicolon of the Nth function after point. |
| 1816 | ;; point is inside a function, this counts as the first. Point must be | 1816 | ;; We move to a semicolon only for things like structs which don't end at a |
| 1817 | ;; outside any comment/string or macro. | 1817 | ;; closing brace. If point is inside a function, this counts as the first. |
| 1818 | ;; Point must be outside any comment/string or macro. | ||
| 1818 | ;; | 1819 | ;; |
| 1819 | ;; N must be strictly positive. | 1820 | ;; N must be strictly positive. |
| 1820 | ;; WHERE describes the position of point, one of the symbols `at-header', | 1821 | ;; WHERE describes the position of point, one of the symbols `at-header', |
| @@ -1836,23 +1837,24 @@ defun." | |||
| 1836 | (forward-sexp) | 1837 | (forward-sexp) |
| 1837 | (setq n (1- n))) | 1838 | (setq n (1- n))) |
| 1838 | ((eq where 'in-trailer) | 1839 | ((eq where 'in-trailer) |
| 1839 | (c-syntactic-skip-backward "^}") | 1840 | ;; The actual movement is done below. |
| 1840 | (setq n (1- n))) | 1841 | (setq n (1- n))) |
| 1841 | ((memq where '(at-function-end outwith-function at-header in-header)) | 1842 | ((memq where '(at-function-end outwith-function at-header in-header)) |
| 1842 | (when (c-syntactic-re-search-forward "{" nil 'eob) | 1843 | (when (c-syntactic-re-search-forward "{" nil 'eob) |
| 1843 | (backward-char) | 1844 | (backward-char) |
| 1844 | (forward-sexp) | 1845 | (forward-sexp) |
| 1845 | (setq n (1- n)))) | 1846 | (setq n (1- n)))) |
| 1846 | (t (error "c-forward-to-nth-EOF-}: `where' is %s" where))) | 1847 | (t (error "c-forward-to-nth-EOF-\\;-or-}: `where' is %s" where))) |
| 1848 | |||
| 1849 | (when (c-in-function-trailer-p) | ||
| 1850 | (c-syntactic-re-search-forward ";" nil 'eob t)) | ||
| 1847 | 1851 | ||
| 1848 | ;; Each time round the loop, go forward to a "}" at the outermost level. | 1852 | ;; Each time round the loop, go forward to a "}" at the outermost level. |
| 1849 | (while (and (> n 0) (not (eobp))) | 1853 | (while (and (> n 0) (not (eobp))) |
| 1850 | ;(c-parse-state) ; This call speeds up the following one by a factor | ||
| 1851 | ; of ~6. Hmmm. 2006/4/5. | ||
| 1852 | (when (c-syntactic-re-search-forward "{" nil 'eob) | 1854 | (when (c-syntactic-re-search-forward "{" nil 'eob) |
| 1853 | (backward-char) | 1855 | (backward-char) |
| 1854 | (forward-sexp)) | 1856 | (forward-sexp) |
| 1855 | (setq n (1- n))) | 1857 | (setq n (1- n)))) |
| 1856 | n) | 1858 | n) |
| 1857 | 1859 | ||
| 1858 | (defun c-end-of-defun (&optional arg) | 1860 | (defun c-end-of-defun (&optional arg) |
| @@ -1907,7 +1909,7 @@ the open-parenthesis that starts a defun; see `beginning-of-defun'." | |||
| 1907 | ;; Move forward to the } of a function | 1909 | ;; Move forward to the } of a function |
| 1908 | (if (> arg 0) | 1910 | (if (> arg 0) |
| 1909 | (c-while-widening-to-decl-block | 1911 | (c-while-widening-to-decl-block |
| 1910 | (> (setq arg (c-forward-to-nth-EOF-} arg where)) 0)))) | 1912 | (> (setq arg (c-forward-to-nth-EOF-\;-or-} arg where)) 0)))) |
| 1911 | 1913 | ||
| 1912 | ;; Do we need to move forward from the brace to the semicolon? | 1914 | ;; Do we need to move forward from the brace to the semicolon? |
| 1913 | (when (eq arg 0) | 1915 | (when (eq arg 0) |