File: goto-addr.el.html
This package allows you to click or hit a key sequence while on a URL or e-mail address, and either load the URL into a browser of your choice using the browse-url package, or if it's an e-mail address, to send an e-mail to that address. By default, we bind to the [mouse-2] and the [C-c return] key sequences.
INSTALLATION
To use goto-address in a particular mode (this example uses the fictional rich-text-mode), add this to your init file:
(add-hook 'rich-text-mode-hook 'goto-address)
The mouse click method is bound to [mouse-2] on highlighted URLs or
e-mail addresses only; it functions normally everywhere else. To bind
another mouse click to the function, add the following to your .emacs
(for example):
(setq goto-address-highlight-keymap
(define-keymap
"S-<mouse-2>" 'goto-address-at-point))
Known bugs/features:
* goto-address-mail-regexp only catches foo@bar.org style addressing,
not stuff like X.400 addresses, etc.
* regexp also catches Message-Id line, since it is in the format of
an Internet e-mail address (like Compuserve addresses)
* If the buffer is fontified after goto-address-fontify is run
(say, using font-lock-fontify-buffer), then font-lock faces will
override goto-address faces.
Defined variables (18)
global-goto-address-mode | Non-nil if Global Goto-Address mode is enabled. |
global-goto-address-mode-hook | Hook run after entering or leaving ‘global-goto-address-mode’. |
goto-address-fontify-maximum-size | Maximum size of file in which to fontify and/or highlight URLs (in bytes). |
goto-address-fontify-p | Non-nil means URLs and e-mail addresses in buffer are fontified. |
goto-address-highlight-keymap | Keymap to hold goto-addr’s mouse key defs under highlighted URLs. |
goto-address-highlight-p | Non-nil means URLs and e-mail addresses in buffer are highlighted. |
goto-address-mail-face | Face to use for e-mail addresses. |
goto-address-mail-mouse-face | Face to use for e-mail addresses when the mouse is on them. |
goto-address-mail-regexp | A regular expression probably matching an e-mail address. |
goto-address-mode | Non-nil if Goto-Address mode is enabled. |
goto-address-mode-hook | Hook run after entering or leaving ‘goto-address-mode’. |
goto-address-prog-mode | Non-nil if Goto-Address-Prog mode is enabled. |
goto-address-prog-mode-hook | Hook run after entering or leaving ‘goto-address-prog-mode’. |
goto-address-uri-schemes | List of URI schemes matched by ‘goto-address-url-regexp’. |
goto-address-uri-schemes-ignored | List of URI schemes to exclude from ‘goto-address-uri-schemes’. |
goto-address-url-face | Face to use for URLs. |
goto-address-url-mouse-face | Face to use for URLs when the mouse is on them. |
goto-address-url-regexp | A regular expression probably matching a URL. |
Defined functions (11)
global-goto-address-mode | (&optional ARG) |
goto-address | () |
goto-address-at-mouse | (CLICK) |
goto-address-at-point | (&optional EVENT) |
goto-address-context-menu | (MENU CLICK) |
goto-address-find-address-at-point | () |
goto-address-fontify | (&optional START END) |
goto-address-fontify-region | (START END) |
goto-address-mode | (&optional ARG) |
goto-address-prog-mode | (&optional ARG) |
goto-address-unfontify | (START END) |