OS X 上的 emacs 23:mailto 链接 &调用撰写邮件?
我正在尝试 23.2 版本的 Cocoa Emacs 版本(OS X 10.6)。有一个 Cocoa Emacs 有很多比 很棒的 Carbon Emacs(我相信是基于 Emacs 22 版本),所以我 希望人们可能有一些解决方案/想法(不幸的是发布 在 Carbon-emacs 列表和 emacs-dev 上都没有产生有用的 回复,所以我想我应该第一次尝试 Stack Overflow):
在 Firefox 中,我可以设置首选项、应用程序、mailto 内容 输入“使用 Emacs”。这曾经在 Carbon Emacs 中工作。现在当我 单击 Firefox mailto 链接,它将焦点更改为 Emacs,但是 实际上并没有做任何事情。
我的 .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'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)) )
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我怀疑 emacs 找不到它被告知打开的“文件”。在命令行上尝试一些操作,看看会发生什么:
emacs mailto:[email ;protected]
应该只是打开 emacs 并茫然地盯着你。
emacs --eval '(browse-url "mailto:[电子邮件受保护]< /a>")'
应该处理 url。
如果一切都检查通过,那么当 Firefox 调用它时,您需要包装一些东西(使用脚本,除非 FF 允许您使用 %s 替换来指定命令行)。或者,您可以通过设置 TRAMP 来理解 mailto: url 来使事情正常工作,但这似乎有点复杂。
(现在我知道要寻找什么了:您可能会发现 EmacsWiki:MailtoHandler 很有帮助。)
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:[email protected]
should just open emacs and stare at you blankly.
emacs --eval '(browse-url "mailto:[email protected]")'
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.)