(gnus-button-alist): Allow & in mailto URLs.
authorSimon Josefsson <jas@extundo.com>
Sun, 26 Oct 2003 11:04:23 +0000 (11:04 +0000)
committerSimon Josefsson <jas@extundo.com>
Sun, 26 Oct 2003 11:04:23 +0000 (11:04 +0000)
(gnus-header-button-alist): Likewise.
(gnus-url-mailto): Handle ?to parameters.  Replace \r\n with \n.
Reverse parameter list to use same order as in the URL.  Reported
by f95-msv@f.kth.se (MÃ¥rten Svantesson).

lisp/ChangeLog
lisp/gnus-art.el

index 01144c7..fc386d1 100644 (file)
@@ -1,3 +1,11 @@
+2003-10-26  Simon Josefsson  <jas@extundo.com>
+
+       * gnus-art.el (gnus-button-alist): Allow & in mailto URLs.
+       (gnus-header-button-alist): Likewise.
+       (gnus-url-mailto): Handle ?to parameters.  Replace \r\n with \n.
+       Reverse parameter list to use same order as in the URL.  Reported
+       by f95-msv@f.kth.se (M\e,Ae\e(Brten Svantesson).
+
 2003-10-25  Teodor Zlatanov  <tzz@lifelogs.com>
 
        * spam.el (spam-move-spam-nonspam-groups-only): documentation fix
index e208f11..76b6b92 100644 (file)
@@ -6049,7 +6049,7 @@ positives are possible."
      2 (>= gnus-button-message-level 0) gnus-button-message-id 3)
     ("\\(<URL: *\\)mailto: *\\([^> \n\t]+\\)>"
      0 (>= gnus-button-message-level 0) gnus-url-mailto 2)
-    ("mailto:\\([-a-z.@_+0-9%=?]+\\)"
+    ("mailto:\\([-a-z.@_+0-9%=?&]+\\)"
      0 (>= gnus-button-message-level 0) gnus-url-mailto 1)
     ("\\bmailto:\\([^ \n\t]+\\)"
      0 (>= gnus-button-message-level 0) gnus-url-mailto 1)
@@ -6176,7 +6176,7 @@ variable it the real callback function."
      0 (>= gnus-button-browse-level 0) browse-url 0)
     ("^[^:]+:" gnus-button-url-regexp
      0 (>= gnus-button-browse-level 0) browse-url 0)
-    ("^[^:]+:" "\\bmailto:\\([-a-z.@_+0-9%=?]+\\)"
+    ("^[^:]+:" "\\bmailto:\\([-a-z.@_+0-9%=?&]+\\)"
      0 (>= gnus-button-message-level 0) gnus-url-mailto 1)
     ("^[^:]+:" "\\(<\\(url: \\)?\\(nntp\\|news\\):\\([^>\n ]*\\)>\\)"
      1 (>= gnus-button-message-level 0) gnus-button-message-id 4))
@@ -6613,12 +6613,14 @@ specified by `gnus-button-alist'."
   (when (string-match "mailto:/*\\(.*\\)" url)
     (setq url (substring url (match-beginning 1) nil)))
   (let (to args subject func)
-    (if (string-match (regexp-quote "?") url)
-       (setq to (gnus-url-unhex-string (substring url 0 (match-beginning 0)))
-             args (gnus-url-parse-query-string
-                   (substring url (match-end 0) nil) t))
-      (setq to (gnus-url-unhex-string url)))
-    (setq args (cons (list "to" to) args)
+    (setq args (gnus-url-parse-query-string
+               (if (string-match "^\\?" url)
+                   (substring url 1)
+                 (if (string-match "^\\([^?]+\\)\\?\\(.*\\)" url)
+                     (concat "to=" (match-string 1 url) "&"
+                             (match-string 2 url))
+                   (concat "to=" url)))
+               t)
          subject (cdr-safe (assoc "subject" args)))
     (gnus-msg-mail)
     (while args
@@ -6626,7 +6628,9 @@ specified by `gnus-button-alist'."
       (if (fboundp func)
          (funcall func)
        (message-position-on-field (caar args)))
-      (insert (mapconcat 'identity (cdar args) ", "))
+      (insert (gnus-replace-in-string
+              (mapconcat 'identity (reverse (cdar args)) ", ")
+              "\r\n" "\n" t))
       (setq args (cdr args)))
     (if subject
        (message-goto-body)