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

getting iceweasel to use gnus for MailTo:



In /etc/iceweasel/prof/iceweasel.js I put the line: 

   pref("network.protocol-handler.external.mailto", 
	/home/brownh/scripts/mailto.sh);

The executable script ~/scripts/mailto.sh has in it:

  #!/bin/bash
  # $Id: mailto.sh,v 1.5 2007/02/04 07:03:32 brownh Exp $

  /usr/bin/emacsclient -e "(brownh/mailto \"$1\")"

And put this into ~/.emacs:

  (defun brownh/mailto (url)
    "Follow a mailto URL as passed from Iceweasel, prompting for a 
	posting style."
    (let ((gnus-newsgroup-name
         (completing-read "Use posting style of group: "
                          gnus-active-hashtb nil
                          (gnus-read-active-file-p))))
      (setq url (url-unhex-string url))
      (browse-url-mail url))
    ;; message-mail does not do anything with the body argument, so we have to.
    (if (string-match (regexp-quote "?") url)
      (let* ((start (match-end 0))
             (args (url-parse-query-string
                    (substring url start nil)))
             (body (cadr (assoc-string "body" args t))))
        (when body
          (switch-to-buffer (car (message-buffers)))
          (save-excursion
            (message-goto-body)
            (insert body))))))

While an emacs session is running, I click on a mailto: link on a web
page, and nothing happens.

-- 
 
       Haines Brown, KB1GRM
        
	 
        



Reply to: