简体   繁体   English

OS X上的emacs 23:mailto链接和调用撰写邮件?

[英]emacs 23 on OS X: mailto links & calling compose-mail?

I'm trying the 23.2 release Cocoa Emacs build (OS X 10.6). 我正在尝试使用23.2版本的Cocoa Emacs版本(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): 比起出色的Carbon Emacs(我相信基于Emacs 22构建),有很多事情比可可Emacs更令人讨厌,所以我希望人们可能有一些解决方案/想法(不幸的是,既没有张贴在Carbon-Emacs列表中,也没有张贴在emacs-dev产生了一个有用的答复,所以我想我会第一次尝试Stack Overflow):

  • In Firefox, I can set the Preferences, Applications, mailto content type to "Use Emacs". 在Firefox中,我可以将“首选项”,“应用程序”,mailto内容类型设置为“使用Emacs”。 This used to work in Carbon Emacs. 这曾经在Carbon Emacs中工作。 Now when I click on a Firefox mailto link, it changes focus to Emacs but doesn't actually do anything. 现在,当我单击Firefox的mailto链接时,它会将焦点更改为Emacs,但实际上没有执行任何操作。

    My .emacs has the following, which I guess doesn't work in 23. Suggestions? 我的.emacs文件包含以下内容,我认为在23中不起作用。

(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))
    )

I suspect that emacs is failing to find the 'file' it's being told to open. 我怀疑emacs无法找到被告知要打开的“文件”。 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并茫然地看着你。

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). 如果全部检查完毕,则需要在firefox调用时进行包装(使用脚本,除非FF允许您使用%s替换来指定命令行)。 Alternatively, you might be able to get things working by setting TRAMP up to understand a mailto: url, but that seems a bit convoluted. 另外,您可以通过设置TRAMP来理解mailto:url来使事情正常进行,但这似乎有些令人费解。

(now that I know what to look for: you might find the EmacsWiki:MailtoHandler helpful.) (现在我知道要查找的内容:您可能会发现EmacsWiki:MailtoHandler很有帮助。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM