org-mode:如何正确捕获电子邮件地址?
我想使用组织模式捕获联系人(姓名、电子邮件地址等)并进行设置 .emacs 中的以下内容:
(setq org-capture-templates
'(("t" "TODO in ~/org/agenda.org -> Tasks" entry (file+headline
"~/org/agenda.org" "Tasks")
"* TODO %?\nSCHEDULED: %^t\n%U %a")
("c" "Contact in ~/org/contacts.org -> Contact" entry (file+headline
"~/org/contacts.org" "Contact")
"* %?%(org-contacts-template-name) %^g
:PROPERTIES:
:EMAIL: %(org-contacts-template-email)
:URL:
:WORK:
:HOME:
:MOBILE:
:LOCATION:
:BIRTHDAY:
:NOTE:
:END:")))
我可以使用抄送抄送轻松捕获联系人,它会提示输入姓名、标签和 电子邮件地址。但是,而不是像我获得的输出
* My contact :my.tag:
:PROPERTIES:
:EMAIL: address@hidden
:URL:
:WORK:
:HOME:
:MOBILE:
:LOCATION:
:BIRTHDAY:
:NOTE:
:END:
:
* My contact :my.tag:
:PROPERTIES:
:EMAIL:
:URL:
:WORK:
:HOME:
:MOBILE:
:LOCATION:
:BIRTHDAY:
:NOTE:
:EMAIL: address@hidden
:END:
所以问题是第一个 :EMAIL: 被忽略,而是第二个 :EMAIL: 插入在 :END: 之前。我怎样才能获得正确的输出(如 如上所述)?
I would like to capture contacts (name, email address,..) with org-mode and thus setup
the following in .emacs:
(setq org-capture-templates
'(("t" "TODO in ~/org/agenda.org -> Tasks" entry (file+headline
"~/org/agenda.org" "Tasks")
"* TODO %?\nSCHEDULED: %^t\n%U %a")
("c" "Contact in ~/org/contacts.org -> Contact" entry (file+headline
"~/org/contacts.org" "Contact")
"* %?%(org-contacts-template-name) %^g
:PROPERTIES:
:EMAIL: %(org-contacts-template-email)
:URL:
:WORK:
:HOME:
:MOBILE:
:LOCATION:
:BIRTHDAY:
:NOTE:
:END:")))
I can easily capture contacts with C-c c c, it prompts for the name, a tag, and
the email address. However, instead of an output like
* My contact :my.tag:
:PROPERTIES:
:EMAIL: address@hidden
:URL:
:WORK:
:HOME:
:MOBILE:
:LOCATION:
:BIRTHDAY:
:NOTE:
:END:
I obtain:
* My contact :my.tag:
:PROPERTIES:
:EMAIL:
:URL:
:WORK:
:HOME:
:MOBILE:
:LOCATION:
:BIRTHDAY:
:NOTE:
:EMAIL: address@hidden
:END:
So the problem is that the first :EMAIL: is ignored and instead a second
:EMAIL: is inserted before :END:. How can I obtain the correct output (as
described above)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
sexp
%(org-contacts-template-email)
在调用时实际上会创建一个 :EMAIL: 属性。如果将捕获模板更改为:您将获得所需的输出。您也不需要
%?
除非您特别希望在退出捕获时将光标放置在联系人姓名之前。The sexp
%(org-contacts-template-email)
will actually create a :EMAIL: property when called. If you change your capture template to:You will get the desired output. You also don't need the
%?
unless you particularly want the cursor to be placed before the contact-name when capture is exited.