Implement mailto: urls in gnus-html and shr.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Thu, 4 Nov 2010 20:29:30 +0000 (21:29 +0100)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Thu, 4 Nov 2010 20:29:30 +0000 (21:29 +0100)
lisp/ChangeLog
lisp/gnus-html.el
lisp/shr.el

index 482668c..c979f98 100644 (file)
@@ -1,5 +1,9 @@
 2010-11-04  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * gnus-html.el (gnus-html-browse-url): Implement mailto: URLs.
+
+       * shr.el (shr-browse-url): Implement mailto: URLs.
+
        * gnus-sum.el (gnus-summary-show-article): Take `t' as the arg to mean
        "raw".
 
index cf139f2..46e5881 100644 (file)
@@ -350,9 +350,13 @@ Use ALT-TEXT for the image string."
   "Browse the image under point."
   (interactive)
   (let ((url (get-text-property (point) 'gnus-string)))
-    (if (not url)
-       (message "No URL at point")
-      (browse-url url))))
+    (cond
+     ((not url)
+      (message "No link under point"))
+     ((string-match "^mailto:" url)
+      (gnus-url-mailto url))
+     (t
+      (browse-url url)))))
 
 (defun gnus-html-schedule-image-fetching (buffer image)
   "Retrieve IMAGE, and place it into BUFFER on arrival."
index 5614e72..c828d19 100644 (file)
@@ -340,9 +340,13 @@ redirects somewhere else."
   "Browse the URL under point."
   (interactive)
   (let ((url (get-text-property (point) 'shr-url)))
-    (if (not url)
-       (message "No link under point")
-      (browse-url url))))
+    (cond
+     ((not url)
+      (message "No link under point"))
+     ((string-match "^mailto:" url)
+      (gnus-url-mailto url))
+     (t
+      (browse-url url)))))
 
 (defun shr-save-contents (directory)
   "Save the contents from URL in a file."