help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Open mailto links


From: Tassilo Horn
Subject: Re: Open mailto links
Date: Thu, 04 Sep 2008 17:41:27 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

henry atting <address@hidden> writes:

Hi Henry,

> #!/bin/sh
> /usr/bin/emacsclient -e "(message-mail \"$1\")"

I use a similar script but with `th-message-mail'.  Its definition is:

--8<---------------cut here---------------start------------->8---
(defun th-message-mail (mailto-url)
  "Parse MAILTO-URL and invoke `message-mail'."
  (let (to subject cc bcc)
  (dolist (header (split-string mailto-url "[?&]"))
    (cond
     ((string-match "mailto:"; header)
      (setq to (substring header (match-end 0))))

     ((string-match "Cc=" header)
      (setq cc (substring header (match-end 0))))

     ((string-match "Bcc=" header)
      (setq bcc (substring header (match-end 0))))
     
     ((string-match "Subject=" header)
      (setq subject (substring header (match-end 0))))))
  (message-mail to subject (list (cons "Cc" cc) (cons "Bcc" bcc)))))
--8<---------------cut here---------------end--------------->8---

Hope that helps,
Tassilo





reply via email to

[Prev in Thread] Current Thread [Next in Thread]