aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1996-06-24 16:53:55 +0000
committerRichard M. Stallman1996-06-24 16:53:55 +0000
commit8d36235ff612aada0a47406c62ed7fc8ada33920 (patch)
tree5251030cf6321aa3b4b854ed6205952d4a237b9b
parent9a03a6f46c4a72e3c6d7f04963ffe419f486d169 (diff)
downloademacs-8d36235ff612aada0a47406c62ed7fc8ada33920.tar.gz
emacs-8d36235ff612aada0a47406c62ed7fc8ada33920.zip
(goto-address-url-face, goto-address-mail-face)
(goto-address-url-mouse-face): New variables. (goto-address-fontify): Use them.
-rw-r--r--lisp/goto-addr.el24
1 files changed, 16 insertions, 8 deletions
diff --git a/lisp/goto-addr.el b/lisp/goto-addr.el
index 30f7eca8137..4c40232df42 100644
--- a/lisp/goto-addr.el
+++ b/lisp/goto-addr.el
@@ -106,6 +106,18 @@ and `goto-address-send-using-mh-e' (MH-E).")
106 m) 106 m)
107 "keymap to hold goto-addr's mouse key defs under highlighted URLs.") 107 "keymap to hold goto-addr's mouse key defs under highlighted URLs.")
108 108
109(defvar goto-address-url-face 'bold
110 "*Face to use for URLs.")
111
112(defvar goto-address-url-mouse-face 'highlight
113 "*Face to use for URLs when the mouse is on them.")
114
115(defvar goto-address-mail-face 'italic
116 "*Face to use for e-mail addresses.")
117
118(defvar goto-address-mail-mouse-face 'secondary-selection
119 "*Face to use for e-mail addresses when the mouse is on them.")
120
109(defun goto-address-fontify () 121(defun goto-address-fontify ()
110 "Fontify the URL's and e-mail addresses in the current buffer. 122 "Fontify the URL's and e-mail addresses in the current buffer.
111This function implements `goto-address-highlight-p' 123This function implements `goto-address-highlight-p'
@@ -120,22 +132,18 @@ and `goto-address-fontify-p'."
120 (while (re-search-forward goto-address-url-regexp nil t) 132 (while (re-search-forward goto-address-url-regexp nil t)
121 (let ((s (match-beginning 0)) 133 (let ((s (match-beginning 0))
122 (e (match-end 0))) 134 (e (match-end 0)))
123 (goto-char e)
124 (and goto-address-fontify-p 135 (and goto-address-fontify-p
125 (put-text-property s e 'face 'bold)) 136 (put-text-property s e 'face goto-address-url-face))
126 (put-text-property s e 'mouse-face 'highlight) 137 (put-text-property s e 'mouse-face goto-address-url-mouse-face)
127 (put-text-property 138 (put-text-property
128 s e 'local-map goto-address-highlight-keymap))) 139 s e 'local-map goto-address-highlight-keymap)))
129 (goto-char (point-min)) 140 (goto-char (point-min))
130 (while (re-search-forward goto-address-mail-regexp nil t) 141 (while (re-search-forward goto-address-mail-regexp nil t)
131 (let ((s (match-beginning 0)) 142 (let ((s (match-beginning 0))
132 (e (match-end 0))) 143 (e (match-end 0)))
133 (goto-char (match-end 0))
134 (and goto-address-fontify-p 144 (and goto-address-fontify-p
135 (put-text-property (match-beginning 0) (match-end 0) 145 (put-text-property s e 'face goto-address-mail-face))
136 'face 'italic)) 146 (put-text-property s e 'mouse-face goto-address-mail-mouse-face)
137 (put-text-property (match-beginning 0) (match-end 0)
138 'mouse-face 'secondary-selection)
139 (put-text-property 147 (put-text-property
140 s e 'local-map goto-address-highlight-keymap))))) 148 s e 'local-map goto-address-highlight-keymap)))))
141 (and (buffer-modified-p) 149 (and (buffer-modified-p)