diff options
| author | Tassilo Horn | 2020-05-04 11:24:08 +0200 |
|---|---|---|
| committer | Tassilo Horn | 2020-05-06 10:14:58 +0200 |
| commit | c4adfbae24d920f0ce62cb88b988219348d1ec73 (patch) | |
| tree | b60ac0e763bc09d50c56795e833fe1a44070f28a /etc | |
| parent | 58c234aa8cb6e76d377f07cbf0b59f2552eb296b (diff) | |
| download | emacs-c4adfbae24d920f0ce62cb88b988219348d1ec73.tar.gz emacs-c4adfbae24d920f0ce62cb88b988219348d1ec73.zip | |
Allow for custom URL handlers in browse-url.
* lisp/net/browse-url.el (browse-url-handlers): New defcustom.
(browse-url-default-handlers): New defvar.
(browse-url): Use them. Adapt docstring. Issue a warning pointing to
browse-url-handlers when browse-url-browser-function is an alist.
(browse-url--mailto, browse-url--man): New functions.
(browse-url--browser-defcustom-type): Add :doc that the alist usage is
deprecated.
(browse-url-browser-function): Remove documentation referring to the
alist usage and mention browse-url-handlers.
* doc/emacs/misc.texi: Document browse-url-handlers in Browse-URL
node.
* etc/NEWS: Mention browse-url-default-handlers and
browse-url-handlers.
Diffstat (limited to 'etc')
| -rw-r--r-- | etc/NEWS | 16 |
1 files changed, 16 insertions, 0 deletions
| @@ -304,6 +304,22 @@ use ‘doxygen’ by default one might evaluate: | |||
| 304 | (c++-mode . doxygen))) | 304 | (c++-mode . doxygen))) |
| 305 | 305 | ||
| 306 | or use it in a custom ‘c-style’. | 306 | or use it in a custom ‘c-style’. |
| 307 | |||
| 308 | ** browse-url | ||
| 309 | |||
| 310 | *** Added support for custom URL handlers | ||
| 311 | |||
| 312 | There is a new defvar 'browse-url-default-handlers' and a defcustom | ||
| 313 | 'browse-url-handlers' being alists with (REGEXP . FUNCTION) entries | ||
| 314 | allowing to define different browsing FUNCTIONs depending on the URL | ||
| 315 | to be browsed. The defvar is for default handlers provided by Emacs | ||
| 316 | itself or external packages, the defcustom is for the user (and allows | ||
| 317 | for overriding the default handlers). | ||
| 318 | |||
| 319 | Formerly, one could do the same by setting | ||
| 320 | 'browse-url-browser-function' to such an alist. This usage is still | ||
| 321 | supported but deprecated. | ||
| 322 | |||
| 307 | 323 | ||
| 308 | * New Modes and Packages in Emacs 28.1 | 324 | * New Modes and Packages in Emacs 28.1 |
| 309 | 325 | ||