comparison lisp/net/browse-url.el @ 111451:98299fb04891

net/browse-url.el (browse-url-mail): Insert body part of mailto url in mail buffer; make yank-action always a command that yanks original buffer.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Wed, 10 Nov 2010 00:02:44 +0000
parents 1b90af51024f
children 3cd0a7a068d5
comparison
equal deleted inserted replaced
111450:eb9988805a37 111451:98299fb04891
1477 (save-excursion 1477 (save-excursion
1478 (let* ((alist (rfc2368-parse-mailto-url url)) 1478 (let* ((alist (rfc2368-parse-mailto-url url))
1479 (to (assoc "To" alist)) 1479 (to (assoc "To" alist))
1480 (subject (assoc "Subject" alist)) 1480 (subject (assoc "Subject" alist))
1481 (body (assoc "Body" alist)) 1481 (body (assoc "Body" alist))
1482 (rest (delete to (delete subject (delete body alist)))) 1482 (rest (delq to (delq subject (delq body alist))))
1483 (to (cdr to)) 1483 (to (cdr to))
1484 (subject (cdr subject)) 1484 (subject (cdr subject))
1485 (body (cdr body)) 1485 (body (cdr body))
1486 (mail-citation-hook (unless body mail-citation-hook))) 1486 (mail-citation-hook (unless body mail-citation-hook)))
1487 (if (browse-url-maybe-new-window new-window) 1487 (if (browse-url-maybe-new-window new-window)
1488 (compose-mail-other-window to subject rest nil 1488 (compose-mail-other-window to subject rest nil
1489 (if body 1489 (list 'insert-buffer (current-buffer)))
1490 (list 'insert body)
1491 (list 'insert-buffer (current-buffer))))
1492 (compose-mail to subject rest nil nil 1490 (compose-mail to subject rest nil nil
1493 (if body 1491 (list 'insert-buffer (current-buffer))))
1494 (list 'insert body) 1492 (when body
1495 (list 'insert-buffer (current-buffer)))))))) 1493 (goto-char (point-min))
1494 (unless (or (search-forward (concat "\n" mail-header-separator "\n")
1495 nil 'move)
1496 (bolp))
1497 (insert "\n"))
1498 (goto-char (prog1
1499 (point)
1500 (insert (replace-regexp-in-string "\r\n" "\n" body))
1501 (unless (bolp)
1502 (insert "\n"))))))))
1496 1503
1497 ;; --- Random browser --- 1504 ;; --- Random browser ---
1498 1505
1499 ;;;###autoload 1506 ;;;###autoload
1500 (defun browse-url-generic (url &optional new-window) 1507 (defun browse-url-generic (url &optional new-window)