Mercurial > emacs
annotate lisp/goto-addr.el @ 27687:ee4f82952cde
*** empty log message ***
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Sat, 12 Feb 2000 19:50:59 +0000 |
parents | a74c3ac8e0d8 |
children |
rev | line source |
---|---|
13208 | 1 ;;; goto-addr.el --- click to browse URL or to send to e-mail address |
14169 | 2 |
13208 | 3 ;; Copyright (C) 1995 Free Software Foundation, Inc. |
4 | |
13550
06e46fbae7f0
(goto-address-highlight-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
13208
diff
changeset
|
5 ;; Author: Eric Ding <ericding@mit.edu> |
13208 | 6 ;; Maintainer: Eric Ding <ericding@mit.edu> |
7 ;; Created: 15 Aug 1995 | |
8 ;; Keywords: mh-e, www, mouse, mail | |
9 | |
10 ;; This file is part of GNU Emacs. | |
11 | |
12 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
13 ;; it under the terms of the GNU General Public License as published by | |
14 ;; the Free Software Foundation; either version 2, or (at your option) | |
15 ;; any later version. | |
16 | |
17 ;; GNU Emacs is distributed in the hope that it will be useful, | |
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
20 ;; GNU General Public License for more details. | |
21 | |
22 ;; You should have received a copy of the GNU General Public License | |
14169 | 23 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
25 ;; Boston, MA 02111-1307, USA. | |
13208 | 26 |
27 ;;; Commentary: | |
28 | |
29 ;; This package allows you to click or hit a key sequence while on a | |
30 ;; URL or e-mail address, and either load the URL into a browser of | |
31 ;; your choice using the browse-url package, or if it's an e-mail | |
32 ;; address, to send an e-mail to that address. By default, we bind to | |
13739
f6fa5b68f9c7
Mouse-click method now bound using text
Karl Heuer <kwzh@gnu.org>
parents:
13550
diff
changeset
|
33 ;; the [mouse-2] and the [C-c return] key sequences. |
13208 | 34 |
35 ;; INSTALLATION | |
36 ;; | |
13550
06e46fbae7f0
(goto-address-highlight-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
13208
diff
changeset
|
37 ;; To use goto-address in a particular mode (for example, while |
06e46fbae7f0
(goto-address-highlight-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
13208
diff
changeset
|
38 ;; reading mail in mh-e), add something like this in your .emacs file: |
26458
a74c3ac8e0d8
* goto-addr.el (goto-address-at-mouse,
Sam Steingold <sds@gnu.org>
parents:
23609
diff
changeset
|
39 ;; |
13208 | 40 ;; (add-hook 'mh-show-mode-hook 'goto-address) |
41 ;; | |
13739
f6fa5b68f9c7
Mouse-click method now bound using text
Karl Heuer <kwzh@gnu.org>
parents:
13550
diff
changeset
|
42 ;; The mouse click method is bound to [mouse-2] on highlighted URL's or |
f6fa5b68f9c7
Mouse-click method now bound using text
Karl Heuer <kwzh@gnu.org>
parents:
13550
diff
changeset
|
43 ;; e-mail addresses only; it functions normally everywhere else. To bind |
f6fa5b68f9c7
Mouse-click method now bound using text
Karl Heuer <kwzh@gnu.org>
parents:
13550
diff
changeset
|
44 ;; another mouse click to the function, add the following to your .emacs |
f6fa5b68f9c7
Mouse-click method now bound using text
Karl Heuer <kwzh@gnu.org>
parents:
13550
diff
changeset
|
45 ;; (for example): |
13208 | 46 ;; |
13739
f6fa5b68f9c7
Mouse-click method now bound using text
Karl Heuer <kwzh@gnu.org>
parents:
13550
diff
changeset
|
47 ;; (setq goto-address-highlight-keymap |
f6fa5b68f9c7
Mouse-click method now bound using text
Karl Heuer <kwzh@gnu.org>
parents:
13550
diff
changeset
|
48 ;; (let ((m (make-sparse-keymap))) |
f6fa5b68f9c7
Mouse-click method now bound using text
Karl Heuer <kwzh@gnu.org>
parents:
13550
diff
changeset
|
49 ;; (define-key m [S-mouse-2] 'goto-address-at-mouse) |
f6fa5b68f9c7
Mouse-click method now bound using text
Karl Heuer <kwzh@gnu.org>
parents:
13550
diff
changeset
|
50 ;; m)) |
13208 | 51 ;; |
52 | |
53 ;; BUG REPORTS | |
54 ;; | |
55 ;; Please send bug reports to me at ericding@mit.edu. | |
56 | |
57 ;; Known bugs/features: | |
58 ;; * goto-address-mail-regexp only catches foo@bar.org style addressing, | |
59 ;; not stuff like X.400 addresses, etc. | |
60 ;; * regexp also catches Message-Id line, since it is in the format of | |
61 ;; an Internet e-mail address (like Compuserve addresses) | |
62 ;; * If show buffer is fontified after goto-address-fontify is run | |
63 ;; (say, using font-lock-fontify-buffer), then font-lock face will | |
64 ;; override goto-address faces. | |
65 | |
66 ;;; Code: | |
67 | |
68 (require 'browse-url) | |
69 | |
17634
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
70 (defgroup goto-address nil |
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
71 "Click to browse URL or to send to e-mail address." |
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
72 :group 'mouse |
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
73 :group 'hypermedia) |
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
74 |
13550
06e46fbae7f0
(goto-address-highlight-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
13208
diff
changeset
|
75 |
17634
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
76 ;;; I don't expect users to want fontify'ing without highlighting. |
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
77 (defcustom goto-address-fontify-p t |
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
78 "*If t, URL's and e-mail addresses in buffer are fontified. |
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
79 But only if `goto-address-highlight-p' is also non-nil." |
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
80 :type 'boolean |
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
81 :group 'goto-address) |
13208 | 82 |
17634
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
83 (defcustom goto-address-highlight-p t |
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
84 "*If t, URL's and e-mail addresses in buffer are highlighted." |
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
85 :type 'boolean |
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
86 :group 'goto-address) |
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
87 |
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
88 (defcustom goto-address-fontify-maximum-size 30000 |
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
89 "*Maximum size of file in which to fontify and/or highlight URL's." |
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
90 :type 'integer |
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
91 :group 'goto-address) |
13208 | 92 |
93 (defvar goto-address-mail-regexp | |
94 "[-a-zA-Z0-9._]+@\\([-a-zA-z0-9_]+\\.\\)+[a-zA-Z0-9]+" | |
95 "A regular expression probably matching an e-mail address.") | |
96 | |
97 (defvar goto-address-url-regexp | |
98 (concat "\\b\\(s?https?\\|ftp\\|file\\|gopher\\|news\\|" | |
99 "telnet\\|wais\\):\\(//[-a-zA-Z0-9_.]+:" | |
100 "[0-9]*\\)?[-a-zA-Z0-9_=?#$@~`%&*+|\\/.,]*" | |
101 "[-a-zA-Z0-9_=#$@~`%&*+|\\/]") | |
102 "A regular expression probably matching a URL.") | |
103 | |
13739
f6fa5b68f9c7
Mouse-click method now bound using text
Karl Heuer <kwzh@gnu.org>
parents:
13550
diff
changeset
|
104 (defvar goto-address-highlight-keymap |
f6fa5b68f9c7
Mouse-click method now bound using text
Karl Heuer <kwzh@gnu.org>
parents:
13550
diff
changeset
|
105 (let ((m (make-sparse-keymap))) |
f6fa5b68f9c7
Mouse-click method now bound using text
Karl Heuer <kwzh@gnu.org>
parents:
13550
diff
changeset
|
106 (define-key m [mouse-2] 'goto-address-at-mouse) |
f6fa5b68f9c7
Mouse-click method now bound using text
Karl Heuer <kwzh@gnu.org>
parents:
13550
diff
changeset
|
107 m) |
f6fa5b68f9c7
Mouse-click method now bound using text
Karl Heuer <kwzh@gnu.org>
parents:
13550
diff
changeset
|
108 "keymap to hold goto-addr's mouse key defs under highlighted URLs.") |
f6fa5b68f9c7
Mouse-click method now bound using text
Karl Heuer <kwzh@gnu.org>
parents:
13550
diff
changeset
|
109 |
17634
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
110 (defcustom goto-address-url-face 'bold |
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
111 "*Face to use for URLs." |
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
112 :type 'face |
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
113 :group 'goto-address) |
15502
5053b03d18cb
(goto-address-url-face, goto-address-mail-face)
Richard M. Stallman <rms@gnu.org>
parents:
15028
diff
changeset
|
114 |
17634
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
115 (defcustom goto-address-url-mouse-face 'highlight |
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
116 "*Face to use for URLs when the mouse is on them." |
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
117 :type 'face |
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
118 :group 'goto-address) |
15502
5053b03d18cb
(goto-address-url-face, goto-address-mail-face)
Richard M. Stallman <rms@gnu.org>
parents:
15028
diff
changeset
|
119 |
17634
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
120 (defcustom goto-address-mail-face 'italic |
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
121 "*Face to use for e-mail addresses." |
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
122 :type 'face |
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
123 :group 'goto-address) |
15502
5053b03d18cb
(goto-address-url-face, goto-address-mail-face)
Richard M. Stallman <rms@gnu.org>
parents:
15028
diff
changeset
|
124 |
17634
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
125 (defcustom goto-address-mail-mouse-face 'secondary-selection |
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
126 "*Face to use for e-mail addresses when the mouse is on them." |
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
127 :type 'face |
247c2a11843d
Use defgroup and defcustom.
Richard M. Stallman <rms@gnu.org>
parents:
16661
diff
changeset
|
128 :group 'goto-address) |
15502
5053b03d18cb
(goto-address-url-face, goto-address-mail-face)
Richard M. Stallman <rms@gnu.org>
parents:
15028
diff
changeset
|
129 |
13208 | 130 (defun goto-address-fontify () |
13550
06e46fbae7f0
(goto-address-highlight-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
13208
diff
changeset
|
131 "Fontify the URL's and e-mail addresses in the current buffer. |
06e46fbae7f0
(goto-address-highlight-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
13208
diff
changeset
|
132 This function implements `goto-address-highlight-p' |
06e46fbae7f0
(goto-address-highlight-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
13208
diff
changeset
|
133 and `goto-address-fontify-p'." |
13208 | 134 (save-excursion |
135 (let ((inhibit-read-only t) | |
13550
06e46fbae7f0
(goto-address-highlight-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
13208
diff
changeset
|
136 (inhibit-point-motion-hooks t) |
13208 | 137 (modified (buffer-modified-p))) |
138 (goto-char (point-min)) | |
139 (if (< (- (point-max) (point)) goto-address-fontify-maximum-size) | |
140 (progn | |
141 (while (re-search-forward goto-address-url-regexp nil t) | |
16661
22c70a622b67
(goto-address-fontify): Use overlay, not text props.
Richard M. Stallman <rms@gnu.org>
parents:
15502
diff
changeset
|
142 (let* ((s (match-beginning 0)) |
22c70a622b67
(goto-address-fontify): Use overlay, not text props.
Richard M. Stallman <rms@gnu.org>
parents:
15502
diff
changeset
|
143 (e (match-end 0)) |
22c70a622b67
(goto-address-fontify): Use overlay, not text props.
Richard M. Stallman <rms@gnu.org>
parents:
15502
diff
changeset
|
144 (this-overlay (make-overlay s e))) |
13550
06e46fbae7f0
(goto-address-highlight-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
13208
diff
changeset
|
145 (and goto-address-fontify-p |
16661
22c70a622b67
(goto-address-fontify): Use overlay, not text props.
Richard M. Stallman <rms@gnu.org>
parents:
15502
diff
changeset
|
146 (overlay-put this-overlay 'face goto-address-url-face)) |
22c70a622b67
(goto-address-fontify): Use overlay, not text props.
Richard M. Stallman <rms@gnu.org>
parents:
15502
diff
changeset
|
147 (overlay-put this-overlay |
22c70a622b67
(goto-address-fontify): Use overlay, not text props.
Richard M. Stallman <rms@gnu.org>
parents:
15502
diff
changeset
|
148 'mouse-face goto-address-url-mouse-face) |
22c70a622b67
(goto-address-fontify): Use overlay, not text props.
Richard M. Stallman <rms@gnu.org>
parents:
15502
diff
changeset
|
149 (overlay-put this-overlay |
22c70a622b67
(goto-address-fontify): Use overlay, not text props.
Richard M. Stallman <rms@gnu.org>
parents:
15502
diff
changeset
|
150 'local-map goto-address-highlight-keymap))) |
13208 | 151 (goto-char (point-min)) |
152 (while (re-search-forward goto-address-mail-regexp nil t) | |
16661
22c70a622b67
(goto-address-fontify): Use overlay, not text props.
Richard M. Stallman <rms@gnu.org>
parents:
15502
diff
changeset
|
153 (let* ((s (match-beginning 0)) |
22c70a622b67
(goto-address-fontify): Use overlay, not text props.
Richard M. Stallman <rms@gnu.org>
parents:
15502
diff
changeset
|
154 (e (match-end 0)) |
22c70a622b67
(goto-address-fontify): Use overlay, not text props.
Richard M. Stallman <rms@gnu.org>
parents:
15502
diff
changeset
|
155 (this-overlay (make-overlay s e))) |
13550
06e46fbae7f0
(goto-address-highlight-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
13208
diff
changeset
|
156 (and goto-address-fontify-p |
16661
22c70a622b67
(goto-address-fontify): Use overlay, not text props.
Richard M. Stallman <rms@gnu.org>
parents:
15502
diff
changeset
|
157 (overlay-put this-overlay 'face goto-address-mail-face)) |
22c70a622b67
(goto-address-fontify): Use overlay, not text props.
Richard M. Stallman <rms@gnu.org>
parents:
15502
diff
changeset
|
158 (overlay-put this-overlay 'mouse-face |
22c70a622b67
(goto-address-fontify): Use overlay, not text props.
Richard M. Stallman <rms@gnu.org>
parents:
15502
diff
changeset
|
159 goto-address-mail-mouse-face) |
22c70a622b67
(goto-address-fontify): Use overlay, not text props.
Richard M. Stallman <rms@gnu.org>
parents:
15502
diff
changeset
|
160 (overlay-put this-overlay |
22c70a622b67
(goto-address-fontify): Use overlay, not text props.
Richard M. Stallman <rms@gnu.org>
parents:
15502
diff
changeset
|
161 'local-map goto-address-highlight-keymap))))) |
13208 | 162 (and (buffer-modified-p) |
163 (not modified) | |
164 (set-buffer-modified-p nil))))) | |
165 | |
166 ;;; code to find and goto addresses; much of this has been blatantly | |
167 ;;; snarfed from browse-url.el | |
168 | |
14208
1f2f55478197
(goto-address-at-point, goto-address-at-mouse): Add autoload cookies.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
169 ;;;###autoload |
13208 | 170 (defun goto-address-at-mouse (event) |
171 "Send to the e-mail address or load the URL clicked with the mouse. | |
172 Send mail to address at position of mouse click. See documentation for | |
173 `goto-address-find-address-at-point'. If no address is found | |
174 there, then load the URL at or before the position of the mouse click." | |
175 (interactive "e") | |
176 (save-excursion | |
177 (let ((posn (event-start event))) | |
178 (set-buffer (window-buffer (posn-window posn))) | |
179 (goto-char (posn-point posn)) | |
180 (let ((address | |
181 (save-excursion (goto-address-find-address-at-point)))) | |
182 (if (string-equal address "") | |
183 (let ((url (browse-url-url-at-point))) | |
184 (if (string-equal url "") | |
185 (error "No e-mail address or URL found") | |
23609
133e5c5c2e64
(goto-address-at-point, goto-address-at-mouse):
Dave Love <fx@gnu.org>
parents:
17634
diff
changeset
|
186 (browse-url url))) |
26458
a74c3ac8e0d8
* goto-addr.el (goto-address-at-mouse,
Sam Steingold <sds@gnu.org>
parents:
23609
diff
changeset
|
187 (compose-mail address)))))) |
13208 | 188 |
14208
1f2f55478197
(goto-address-at-point, goto-address-at-mouse): Add autoload cookies.
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
189 ;;;###autoload |
13208 | 190 (defun goto-address-at-point () |
191 "Send to the e-mail address or load the URL at point. | |
192 Send mail to address at point. See documentation for | |
193 `goto-address-find-address-at-point'. If no address is found | |
194 there, then load the URL at or before point." | |
195 (interactive) | |
196 (save-excursion | |
197 (let ((address (save-excursion (goto-address-find-address-at-point)))) | |
198 (if (string-equal address "") | |
199 (let ((url (browse-url-url-at-point))) | |
200 (if (string-equal url "") | |
201 (error "No e-mail address or URL found") | |
23609
133e5c5c2e64
(goto-address-at-point, goto-address-at-mouse):
Dave Love <fx@gnu.org>
parents:
17634
diff
changeset
|
202 (browse-url url))) |
26458
a74c3ac8e0d8
* goto-addr.el (goto-address-at-mouse,
Sam Steingold <sds@gnu.org>
parents:
23609
diff
changeset
|
203 (compose-mail address))))) |
13208 | 204 |
205 (defun goto-address-find-address-at-point () | |
206 "Find e-mail address around or before point. | |
207 Then search backwards to beginning of line for the start of an e-mail | |
208 address. If no e-mail address found, return the empty string." | |
209 (let ((bol (save-excursion (beginning-of-line) (point)))) | |
210 (re-search-backward "[^-_A-z0-9.@]" bol 'lim) | |
211 (if (or (looking-at goto-address-mail-regexp) ; already at start | |
212 (let ((eol (save-excursion (end-of-line) (point)))) | |
213 (and (re-search-forward goto-address-mail-regexp eol 'lim) | |
214 (goto-char (match-beginning 0))))) | |
215 (buffer-substring (match-beginning 0) (match-end 0)) | |
26458
a74c3ac8e0d8
* goto-addr.el (goto-address-at-mouse,
Sam Steingold <sds@gnu.org>
parents:
23609
diff
changeset
|
216 "")))m |
13208 | 217 |
13550
06e46fbae7f0
(goto-address-highlight-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
13208
diff
changeset
|
218 ;;;###autoload |
13208 | 219 (defun goto-address () |
13550
06e46fbae7f0
(goto-address-highlight-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
13208
diff
changeset
|
220 "Sets up goto-address functionality in the current buffer. |
06e46fbae7f0
(goto-address-highlight-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
13208
diff
changeset
|
221 Allows user to use mouse/keyboard command to click to go to a URL |
06e46fbae7f0
(goto-address-highlight-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
13208
diff
changeset
|
222 or to send e-mail. |
13739
f6fa5b68f9c7
Mouse-click method now bound using text
Karl Heuer <kwzh@gnu.org>
parents:
13550
diff
changeset
|
223 By default, goto-address binds to mouse-2 and C-c RET. |
13550
06e46fbae7f0
(goto-address-highlight-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
13208
diff
changeset
|
224 |
06e46fbae7f0
(goto-address-highlight-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
13208
diff
changeset
|
225 Also fontifies the buffer appropriately (see `goto-address-fontify-p' and |
06e46fbae7f0
(goto-address-highlight-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
13208
diff
changeset
|
226 `goto-address-highlight-p' for more information)." |
13208 | 227 (interactive) |
228 (local-set-key "\C-c\r" 'goto-address-at-point) | |
13550
06e46fbae7f0
(goto-address-highlight-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
13208
diff
changeset
|
229 (if goto-address-highlight-p |
13208 | 230 (goto-address-fontify))) |
231 | |
232 (provide 'goto-addr) | |
233 | |
234 ;;; goto-addr.el ends here. |