Emacs Org-mode:如何在日记周年纪念日中包含属性?

发布于 2024-08-28 03:43:40 字数 392 浏览 11 评论 0原文

我正在尝试将组织模式条目的“生日”和“名称”属性自动添加到议程中:

* John
  :PROPERTIES:
  :Name: John
  :Birthday: (5 4 1900)
  :END:

我找到了一种方法,通过在议程中的正确周年日期添加条目,方法是在属性:

%%(apply 'diary-anniversary (read (org-entry-get nil "Birthday"))) John

但是,使用此代码,我仍然需要手动输入名称。有没有办法将“名称”属性的值自动添加到所有条目的日记文本中?

编辑1:该示例以前不起作用,现在在生日属性的值周围添加了括号

I am trying to have the "Birthday" and "Name" properties of an Org-mode entry added to the agenda automatically:

* John
  :PROPERTIES:
  :Name: John
  :Birthday: (5 4 1900)
  :END:

I found a way to add an entry at the correct anniversary date in the agenda by inserting the following line right after the properties:

%%(apply 'diary-anniversary (read (org-entry-get nil "Birthday"))) John

However, using this code, I still have to enter the name manually. Is there a way to have the value of the "Name" property added to the diary text automatically for all entries?

EDIT 1: the example did not work before, now added parantheses around the value of the birthday property

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

清醇 2024-09-04 03:43:40

也许 https://julien.danjou.info/projects/emacs-packages#org-联系人 是您问题的解决方案。 org-contacts 是 org-mode 的地址簿。

Maybe https://julien.danjou.info/projects/emacs-packages#org-contacts is the solution to your problem. org-contacts is a address book for org-mode.

眸中客 2024-09-04 03:43:40

最好在 Org 邮件列表 询问这个问题,他们非常活跃,而 Carsten Dominik(org-mode 的创建者)通常几乎立即回复此列表中的帖子(顺便说一句,这个 是主要列表电子邮件。

It is probably better to ask this at the Org mailing list, they are very active, and Carsten Dominik (the creator of org-mode) usually answers posts on this list almost immediately (BTW, this is the main list email.

泡沫很甜 2024-09-04 03:43:40

也许你正在走一条需要你写一些 lisp 才能得到你想要的东西的道路。组织模式手册给出了类似的示例,但我猜您想要一种更简单的格式,当它描述日历/议程集成时 http://www.gnu.org/software/emacs/manual/html_node/org/Weekly_002fdaily-agenda.html

* Birthdays and similar stuff
 #+CATEGORY: Holiday
 %%(org-calendar-holiday)   ; special function for holiday names
 #+CATEGORY: Ann
 %%(diary-anniversary 14  5 1956) Arthur Dent is %d years old
 %%(diary-anniversary  2 10 1869) Mahatma Gandhi would be %d years old

我认为如果您想要自定义设置,您还有其他选择:可以使用新型导出或动态块。这可能会突出议程与日记的不同用例。议程似乎更适合日常任务。

Perhaps you a taking a path which requires you to write some lisp to get what you want. The org-mode manual gives an example of something similar, but I'm guessing you wanted a simpler format, when it describes the calendar/agenda integration http://www.gnu.org/software/emacs/manual/html_node/org/Weekly_002fdaily-agenda.html

* Birthdays and similar stuff
 #+CATEGORY: Holiday
 %%(org-calendar-holiday)   ; special function for holiday names
 #+CATEGORY: Ann
 %%(diary-anniversary 14  5 1956) Arthur Dent is %d years old
 %%(diary-anniversary  2 10 1869) Mahatma Gandhi would be %d years old

I would think you have other options if you want a custom setup: either a new type of export or dynamic blocks might be used. This may highlight the different use-case of agenda over the diary. The agenda seems more geared towards day to day tasks.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文