1

I'm trying the 23.2 release Cocoa Emacs build (OS X 10.6). There's a number of things that are more annoying about Cocoa Emacs than the terrific Carbon Emacs (based on an Emacs 22 build, I believe), so I hoped folks might have some solutions/thoughts (unfortunately posting on neither the carbon-emacs list nor emacs-dev has produced a useful reply, so I thought I'd try Stack Overflow for the first time):

  • In Firefox, I can set the Preferences, Applications, mailto content type to "Use Emacs". This used to work in Carbon Emacs. Now when I click on a Firefox mailto link, it changes focus to Emacs but doesn't actually do anything.

    My .emacs has the following, which I guess doesn't work in 23. Suggestions?

    (setq browse-url-browser-function
          '(("^http:" . browse-url-generic)
            ("^https:" . browse-url-generic)
            ("^mailto:" lambda (url &rest stuff) (compose-mail 
                                                  (substring to 7)))
            ;; ("^mailto:"  . browse-url-mail) ;; same behavior
            ("^file:.*\\.html?$" . w3m-browse-url))
    )
jowens
  • 355
  • 3
  • 10
  • The documentation for `browse-url-browser-function` says it last changed in 21.1, so the problem may be deeper. What happens if you put mailto:example@example.com in a buffer and then browse it (e.g. M-x browse-url-at-point)? – Kirk Kelsey Sep 28 '10 at 12:55
  • Works properly. (Opens a draft window with the proper address on the "to" line.) – jowens Sep 30 '10 at 01:02

1 Answers1

0

I suspect that emacs is failing to find the 'file' it's being told to open. Try a couple things on the command line to see what happens:

emacs mailto:example@example.com

should just open emacs and stare at you blankly.

emacs --eval '(browse-url "mailto:user@example.com")'

should handle the url.

If that all checks out, then you need to wrap things when firefox makes it's invocation (with a script unless FF lets you specify the command line using a %s replacement). Alternatively, you might be able to get things working by setting TRAMP up to understand a mailto: url, but that seems a bit convoluted.

(now that I know what to look for: you might find the EmacsWiki:MailtoHandler helpful.)

Kirk Kelsey
  • 4,259
  • 1
  • 23
  • 26
  • $ /Applications/MacPorts/Emacs.app/Contents/MacOS/Emacs mailto://example@example.com spits out the message "File /Users/username/mailto:/mailto:/example@example.com is read-only on disk. Change buffer mode?" – jowens Oct 22 '10 at 04:47
  • $ /Applications/MacPorts/Emacs.app/Contents/MacOS/Emacs --eval '(browse-url "mailto://user@example.com")' works properly (though it opens a draft buffer to "//user@example.com"; if I use "mailto:user@example.com" it works without the //, woo!). – jowens Oct 22 '10 at 04:49
  • Sorry about the stray //'s, I'll yank it out of the answer for anyone else that stumbles on it. – Kirk Kelsey Oct 23 '10 at 21:46
  • http://stackoverflow.com/questions/4170224/os-x-how-to-make-command-line-script-appear-as-helper-application-to-handle-mail is a followup question that might be helpful in making this work on the Mac. – jowens Nov 13 '10 at 20:43