EMACS-DOCUMENT

=============>随便,谢谢

An Agenda for Life With Org Mode

I've been promising the Twitterverse that I would write more about how I use Org 我已经向Twitterverse承诺,我会写更多关于如何使用Org的文章 Mode to get stuff done and how I use it to be a better manager. Upon careful 我如何利用它成为一个更好的管理者。在仔细 reflection, there is too much to cover in just one post, so this is the first of 反思一下,这篇文章涉及的内容太多了,所以这是第一篇 what will likely be several posts on these topics. 可能会有几篇关于这些主题的文章。

Today I would like to focus on the “agenda view” and how I've configured it to 今天我想重点谈谈“日程视图”以及我是如何配置它的 give me a window into what I need to do now, what is on the horizon, and manage 给我一个窗口,让我了解我现在需要做什么,什么是地平线上,并管理 which things I should do first. 我应该先做哪件事?

This is what we'll build: 这就是我们要建造的:

composite-agenda-view.png  composite-agenda-view.png

I classify all of my activities into one of four buckets: 我把我所有的活动分成四类:

  1. Things I need to do, eventually;
  2. 我最终需要做的事情;
  3. Things I need to complete by a specific date;
  4. 我需要在特定日期完成的事情;
  5. Things I cannot (or won't) start until a specific date; and

3.在特定日期之前我不能(或不会)开始做的事情;和

  1. Things I should do with some loose frequency.
  2. 我应该做一些频率不固定的事情。

Each of these use cases aligns with an Org Mode feature, and those features are, 每个用例都与一个组织模式特性相一致,这些特性是, respectively: 分别为:

  1. A plain TODO entry,
  2. 一个简单的待办事项条目,
  3. An entry with a SCHEDULED time stamp,
  4. 带有预定时间戳的条目,
  5. An entry with a DEADLINE time stamp, and

3.带有截止日期时间戳的条目,并且

  1. An entry with a STYLE property of “habit.”
  2. 带有“习惯”样式属性的条目。

Building the Agenda

*制定议程

属性: :CUSTOM_ID: building-the-agenda :CUSTOM_ID building-the-agenda

结束:

I very briefly introduced the agenda in my previous post, 我在之前的文章中简要介绍了议程, Dig into Org Mode. The “agenda” is a time-aware, filtered view of all [[/ 2016/01/30 / dig-into-org-mode。[深入到组织模式]]。“日程”是所有内容的时间感知、过滤视图 of the entries in some set of Org files, which you can specify. To make proper 可以指定的一组Org文件中的项。做出适当的 use of the agenda, you must first tell Org which files to read by configuring 使用议程时,您必须首先通过配置告诉Org要读取哪些文件 the org-agenda-files variable. = org-agenda-files =变量。

As I noted in Dig into Org Mode, I build my agenda from all of the Org 正如我在[[/2016/01/30/ digi -into-org-mode]中提到的。[深入到组织模式]],我建立我的议程从所有的组织 files in my “org” directory in Dropbox. Specifying a single directory is the 文件在我的“org”目录下的Dropbox。方法指定单个目录 easiest thing you can do: 你能做的最简单的事情:

(setq org-agenda-files '("~/Dropbox/org/"))

You can also select individual files or specify a file that contains a list of 您还可以选择单独的文件,或指定包含列表的文件 files to read. See the variable's documentation for specifics. 阅读文件。有关详细信息,请参阅变量的文档。

Once Org knows where to look to build up the agenda view, you can populate it 一旦Org知道在何处查找以构建日程视图,您就可以填充它 with your tasks. I'm assuming that you already use Org for note-taking or task 你的任务。我假设你已经使用Org做笔记或做任务了 management in some way, but if you don't, here is the bare minimum you should 从某种程度上说,这是一种管理,但如果你不这样做,你至少应该这么做 place into a file to see how this works: 放入一个文件,看看这是如何工作:

#+BEGIN_EXAMPLE

TODO Complete this task eventually

TODO Complete this task by September 30th

TODO Start this task on September 30th.

#+END_EXAMPLE

With a file like this saved as something like todo.org in the directory 在目录中保存类似于=todo.org=这样的文件 specified in org-agenda-files, you can now press M-x org-agenda RET to 在=org-agenda-files=中指定,现在可以按=M-x org-agenda RET= to display the “agenda dispatch” menu. The first option, “a,” is the most common as 显示“日程调度”菜单。第一个选项“a”是最常见的as it will display a weekly view with entries sorted into their respective dates. 它将显示一个按日期排序的每周视图。

You may have noticed that the “agenda dispatch” menu contains options for 您可能已经注意到,“日程调度”菜单包含以下选项 displaying views based on dates, views of pure TODO items, and even views 显示基于日期的视图、纯TODO项的视图,甚至视图 filtered by search criteria. These are extremely useful features that I use all 根据搜索条件过滤。这些都是我使用的非常有用的特性 the time, but it's hard to face a busy day with all of your activities sorted 时间,但很难面对一个忙碌的一天,你的所有活动排序 into separate lists with separate commands, so let's combine them. 用不同的命令把它们分成不同的列表,让我们把它们组合起来。

To do this, we will use an “agenda custom command.” 为此,我们将使用“日程自定义命令”。

Agenda Custom Commands

*议程自定义命令

属性: :CUSTOM_ID: agenda-custom-commands :CUSTOM_ID agenda-custom-commands

结束:

An “agenda custom command” allows you to add your own entries to the dispatch “日程自定义命令”允许您将自己的条目添加到调度中 menu and, in effect, define your own agenda view that you can trigger easily. To 菜单,实际上,定义您可以轻松触发的自己的议程视图。自 define custom agenda commands, you customize the variable 定义自定义议程命令,自定义变量 org-agenda-custom-commands. = org-agenda-custom-commands =。

In its simplest form, an agenda command looks like this: 在其最简单的形式,一个议程命令看起来像这样:

(setq org-agenda-custom-commands
'(("c" "Simple agenda view" agenda ""))

Note that org-agenda-custom-commands is itself a list, so its value here is a 注意=org-agenda-custom-commands=本身就是一个列表,所以它的值是a list with one element, which is also a list. That inner list is our custom 带有一个元素的列表,它也是一个列表。内部列表是我们的习惯 command; it has a single letter key that will appear in the menu (“c”), a 命令;它有一个字母键,将出现在菜单(“c”),a description that will also appear, and then a type. 描述也将出现,然后是类型。

There are many types available and some can accept arguments. Types and their 有许多可用的类型,有些可以接受参数。类型和他们的 arguments are given one after another. In this case, the “agenda” type takes no 参数一个接一个地给出。在这种情况下,“日程”类型接受no arguments and the documentation specifies that the empty string must be given. 参数和文档指定必须提供空字符串。

OK, so this is great and all, but all we've actually done is recreate the “a” 好的,这很好,但是我们实际上所做的就是重新创建了" a " option with the letter “c” instead. That isn't very helpful. 用字母“c”代替选项。这没什么用。

The goal is to be able to see our scheduled items and our unscheduled items 目标是能够看到我们的计划项目*和*我们的计划外项目 in the same view. Fortunately, there is a feature for this (of course), and it 同样的观点。幸运的是,它有一个特性(当然) is called a “composite agenda” or “agenda block view.” 称为“组合议程”或“议程块视图”。

Essentially, by supplying a list of types, the agenda view will generate each 本质上,通过提供类型列表,agenda视图将生成每种类型 one in turn and display them in the same buffer together! This is one of the 一个依次显示在同一个缓冲区中!这是其中一个 greatest things I've ever discovered. I lived for months scheduling things to 我所发现的最伟大的事情。我花了几个月的时间来安排事情 start “today” just so they would show up in the agenda, even though dates were 从“今天”开始,这样他们就会出现在议程上,即使日期是 irrelevant. Since discovering this view, I now have a much more nuanced 无关紧要的。自从发现了这个观点,我现在有了一个更微妙的观点 perspective on my priorities. 我优先考虑的事情。

Building the Composite Agenda View

构建复合议程视图

属性: :CUSTOM_ID: building-the-composite-agenda-view :CUSTOM_ID building-the-composite-agenda-view

结束:

As I mentioned above, all you need to do is build a list of types within your 如前所述,您所需要做的就是在您的 custom agenda command. Here is a simple one that will display your scheduled 自定义日程命令。下面是一个简单的示例,它将显示您的日程安排 items followed by all of your TODO items: 所有待办事项之后的项目:

(setq org-agenda-custom-commands
'(("c" "Simple agenda view"
((agenda "")
(alltodo "")))))

A couple of things are going on here that deserve some explanation: 这里发生的一些事情值得解释一下:

  • When you build a composite agenda, the types are a list and each type becomes

-当你建立一个复合议程,类型是一个列表,每个类型成为 its own list, so you will note that (agenda "") and (alltodo "") now have 它有自己的列表,因此您将注意到=(agenda "")=和=(alltodo "")= now have parentheses around them. That is a requirement and will not work otherwise. 括号。这是一个要求,否则是行不通的。

  • alltodo is a type that is only available in a composite agenda; it will not
  • =alltodo=是一种只能在复合议程中使用的类型;它不会

work in a single custom agenda command, instead you should use todo. 在单个自定义议程命令中工作,您应该使用=todo=。

When you run this, you will see your scheduled items at the top, a divider line 当您运行这个时,您将在顶部看到您的计划项目,一个分隔线 made up of equal signs, and all of your other TODO items at the bottom, like this: 由等号组成,所有其他待办事项都在底部,就像这样:

composite-1.png file:///图片/上传/ an-agenda-for-life-with-org-mode /复合- 1. png

We are already much closer now to our goal of visualizing all of our activities 我们现在已经离将所有活动可视化的目标更近了 in one place. This covers scheduled items, deadline items, and “eventually” 在一个地方。这包括计划项目、最后期限项目和“最终” items, but it doesn't help us to see what we should do next. For that, I use 但这并不能帮助我们看到下一步该做什么。我用 prioritization. 优先级。

Priorities, and Focusing Your Day

**优先事项,关注你的每一天

属性: :CUSTOM_ID: priorities-and-focusing-your-day :CUSTOM_ID priorities-and-focusing-your-day

结束:

Org Mode already has a notion of “priority,” and you can mark each item with a Org模式已经有了“优先级”的概念,您可以用a标记每个项目 priority “cookie” by calling org-priority, org-priority-up, or 通过调用=org-priority=, org-priority-up=,或 =org-priority-down. It is possible to sort TODO lists by priority, so it may be = org-priority-down =。可以按优先级对待办事项列表进行排序,可能是这样 enough for you to see the higher priority items at the top of your “eventually” 足够让你看到优先级更高的项目在你的“最终”顶部 list, and to pick away at those, perhaps re-prioritizing other things as you go 列出清单,然后挑出其中的一些,也许在你做事的时候重新排列其他事情的优先级 along. 沿着。

I do continuously re-prioritize, but I also subscribe to a GTD approach that 我不断地重新排列优先级,但我也赞同GTD方法 Netscape co-founder Marc Andreessen wrote about, which is to take some time at 网景的共同创始人马克·安德森写过,这是需要一些时间 the end of the day to pick the three things you will do the following day. I 在一天结束的时候选择你第二天要做的三件事。我 really liked that idea, so I wanted to make it more formal in my agenda view. 我很喜欢这个想法,所以我想让它在我的日程视图中更加正式。

I decided to use priority “A” items as “things I must do today,” and let the 我决定使用优先级“A”项作为“我今天必须做的事情”,让 other priorities act as simple differentiators for the remaining “eventually” 其他优先级充当其余“最终”的简单区分器 items so that I can at least pay closer attention to things I determined to care 这样我至少可以更密切地关注我决定关心的事情 more about (and ignore things that are not as important, which is what I use 更多的关注(忽略那些不重要的事情,这正是我所使用的 priority “C” for). 重点“C”)。

To achieve this, I did two things: 为了实现这个目标,我做了两件事:

  1. I placed a TODO section at the top of my composite agenda view that displays
  2. 我在显示的复合日程视图的顶部放置了一个TODO部分

only priority “A” items, and *只有*优先级“A”的项目,和

  1. I filtered priority “A” items out of the “eventually” list so that I see them
  2. 我从“最终”列表中过滤了优先级为“A”的项,这样我就可以看到它们

only once. 只有一次。

There is occasionally duplication across the scheduled section of the view, but 在视图的预定部分偶尔会有重复,但是 I haven't come up with the best way to handle that yet. My goal is to keep the 我还没想出解决这个问题的最好办法。我的目标是保持 scheduled section as short as possible, and very few of my activities are 计划节越短越好,我的活动也越少越好 actually time-sensitive in a formal sense, but when I tell someone I will get 从正式的意义上说,我对时间很敏感,但当我告诉别人我就会知道 back to them by X date, I use that function to ensure that I will remember to do 在X日期之前回到它们,我使用那个函数来确保我会记得去做 so. 所以。

The first part of the solution is easy, the second part was not so easy. 解决方案的第一部分很容易,第二部分就不那么容易了。

The Top Priority Section

***优先级最高的部分

属性: :CUSTOM_ID: the-top-priority-section :CUSTOM_ID the-top-priority-section

结束:

As it turns out, certain properties of Org entries can be treated as special 事实证明,Org条目的某些属性可以被看作是特殊的 “tags” and filtered using the tags filtering options in the agenda custom “标签”和过滤使用标签过滤选项在议程自定义 commands and composite view types. In this case, we want to see only items with 命令和复合视图类型。在本例中,我们只希望看到具有 a priority of “A”, and so we can use the tag PRIORITY"A"= to achieve that. 优先级为a,因此我们可以使用tag = priority =" a "=来实现这一点。

Here is what that configuration looks like: 下面是配置的样子:

(setq org-agenda-custom-commands
'(("c" "Simple agenda view"
((tags "PRIORITY="A""
((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done))
(org-agenda-overriding-header "High-priority unfinished tasks:")))
(agenda "")
(alltodo "")))))

A few things to note here: 这里有几点需要注意:

  1. You actually have to quote the value of the priority tag, but the tag
  2. 你必须引用优先级标签的值,但是标签

selector is quoted itself so you wind up with some yucky escaping 选择器本身是带引号的,所以你会有一些讨厌的转义 backslashes. Such is life. It won't work if you don't quote the value. 反斜杠。生活就是这样。如果你不引用这个值,它就不会工作。

  1. This example introduces the local settings list, which is a let-style
  2. 这个例子介绍了本地设置列表,它是一个=let=样式的列表

list of Org configuration variables and their values that will be applied 将应用的Org配置变量及其值的列表 only during the generation of that section of the composite view. In this 只有在生成复合视图的那个部分期间。在这个 case, I am setting the value of org-agenda-skip-function and case,我正在设置=org-agenda-skip-function=和的值 org-agenda-overriding-header. = org-agenda-overriding-header =。

The org-agenda-skip-function is one of the coolest ideas; it allows you to =组织议程-跳跃-功能=是最酷的想法之一;它允许你 specify a function that will be called on each entry and the function can either 指定将在每个条目上调用的函数,该函数可以选择其中之一 return nil to display that entry, or return a character location to skip 返回=nil=显示该条目,或返回要跳过的字符位置 to. This allows you to skip a single entry or even an entire subtree if some 出现。这允许您跳过单个条目,甚至整个子树(如果有的话) criteria applies. 标准适用。

I am using it here to skip all entries that are already marked DONE, because 我在这里使用它来跳过所有已经标记为DONE的条目,因为 once something is DONE, I don't need to work on it anymore and I don't want to 一旦某件事完成了,我就不需要再做了,我也不想再做了 see it in my list. org-agenda-skip-entry-if is a function provided for use in 看看我的清单。是一个提供给in使用的函数 these kinds of cases and I recommend reading its documentation for more details. 这些类型的案例,我建议阅读它的文档以获得更多的细节。

The org-agenda-overriding-header does what it sounds like: it changes the 这个=org-agenda-overriding-header=做了它听起来像的事情:它改变了 header line of this agenda section to the string specified. Here's what it all 将此议程节的标题行转换为指定的字符串。事情是这样的 looks like together: 看起来像在一起:

composite-2.png file:///图片/上传/ an-agenda-for-life-with-org-mode /复合- 2. png

Filtering the “Eventually” List

***过滤“最终”列表

属性: :CUSTOM_ID: filtering-the-eventually-list :CUSTOM_ID filtering-the-eventually-list

结束:

Great, so now you have a section at the top for the stuff you want to do 很好,现在你在顶部有一个区域来放置你想要做的事情 immediately, a section showing a time-based view of what you need to accomplish 立即显示需要完成的任务的基于时间的视图的部分 soon, and a list of all the other items on your TODO list (your “eventually” 很快,你的待办事项清单(你的“最终” items). 项目)。

Unfortunately, your “eventually” list now also contains the high-priority items 不幸的是,您的“最终”列表现在也包含高优先级的项 shown at the top, which is redundant and distracting. Let's filter priority “A” 显示在顶部,这是多余的和令人分心的。我们来过滤优先级A items out of this list. 列表中的项目。

I was optimistic that Org shipped with some skip function to skip over 我很乐观地认为Org提供了一些跳过的功能 priorities, but it doesn't. Oh well, time to write some elisp. Here's what I 优先级,但它不是。是时候写点elisp了。这就是我 came up with: 提出了:

(defun air-org-skip-subtree-if-priority (priority)
"Skip an agenda subtree if it has a priority of PRIORITY.

PRIORITY may be one of the characters ?A, ?B, or ?C."
(let ((subtree-end (save-excursion (org-end-of-subtree t)))
(pri-value (* 1000 (- org-lowest-priority priority)))
(pri-current (org-get-priority (thing-at-point 'line t))))
(if (= pri-value pri-current)
subtree-end
nil)))

As always, note that air is simply a “namespace prefix” to ensure uniqueness 与往常一样,请注意=air=只是一个“名称空间前缀”,以确保唯一性 of the function name. 函数名的。

The way priorities work internally is clever; the “lowest priority” is the upper 优先级在内部工作的方式很聪明;“最低优先级”是最高优先级 bounding ASCII value of the letters used, such that the difference of that value 用包围ASCII值表示的字母,使该值的差值 and the entry's priority letter value multiplied by 1,000 is the numeric 条目的优先级字母值乘以1000是数字 priority. 优先级。

The default “lowest priority” value is 67, and the ASCII value of “A” is 65, so 默认的“最低优先级”值是67,“A”的ASCII值是65,所以 the numeric value of priority “A” is 2,000, “B” (ASCII value 66) is 1,000, and 优先级“A”的数值为2000,“B”(ASCII值66)为1000,和 “C” (ASCII value 67) is 0. “C”(ASCII值67)为0。

For whatever reason, there are no internal Org functions to easily extract just 无论出于何种原因,都不存在可以轻松提取的内部组织函数 the priority letter, but I wanted my function to accept the letter rather than 优先级的字母,但是我希望函数接受字母而不是 the numeric value so I just convert that to its corresponding number and use 数值我只是把它转换成相应的数字然后使用 org-get-priority to compare the entry's value to the given one. =org-get-priority=将条目的值与给定的值进行比较。

For this one, I always skip the whole subtree. It hasn't bitten me yet, but it 对于这个,我总是跳过整个子树。它还没咬我,但它咬了 is pretty easy to pivot it to skip only the current entry, or even provide an 是相当容易的枢轴,以跳过目前的项目,甚至提供一个 option, so I might do that if I find out I'm missing something. 选项,所以如果我发现我错过了什么,我可能会这么做。

Let's apply this to our configuration: 让我们把这个应用到我们的配置:

(setq org-agenda-custom-commands
'(("c" "Simple agenda view"
((tags "PRIORITY="A""
((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done))
(org-agenda-overriding-header "High-priority unfinished tasks:")))
(agenda "")
(alltodo ""
((org-agenda-skip-function
'(or (air-org-skip-subtree-if-priority ?A)
(org-agenda-skip-if nil '(scheduled deadline))))))))))

There are two changes here. First, I'm calling my new function to skip priority 这里有两个变化。首先,我调用新函数来跳过优先级 “A” items. I also noticed that the “eventually” list contained items with “A”项目。我还注意到,“最终”列表中包含的项 scheduled or deadline dates, which should appear in the middle section when 预定或截止日期,这应该出现在中间部分的时候 appropriate, so I filtered those out as well. Here's what it looks like: 合适,所以我也过滤掉了。它是这样的:

composite-3.png file:///图片/上传/ an-agenda-for-life-with-org-mode /复合- 3. png

Note here that the skip function is a whole quoted lisp form that is evaluated 这里要注意的是,skip函数是一个完整的引号括起来的lisp形式 for each entry; it is not limited to a single function name. For this reason, it 为每一个条目;它不局限于单个函数名。因为这个原因,它 is straightforward to create more complex logical rules without having to write 是否可以直接创建更复杂的逻辑规则而无需编写 a function to encapsulate them. Here, I am using an or to check both criteria. 一个封装它们的函数。这里,我使用=或=来检查两个条件。

Finally, Habits

*最后,习惯

属性: :CUSTOM_ID: finally-habits :CUSTOM_ID finally-habits

结束:

You may already know that Org Mode supports TODO items that repeat. There are a 您可能已经知道Org模式支持重复的TODO项。有 few ways that repeating schedules can be specified, so I recommend 可以指定重复调度的方法很少,因此我建议您这样做 reading the full documentation. 阅读完整文档

One of the most powerful ways of tracking repeated tasks is by using 跟踪重复任务的最强大的方法之一是使用 habits. A habit is something that you want to do on a regular basis, but

*习惯。习惯是你想要经常做的事情,但是

where you have flexibility in how regular the schedule is. 你可以灵活安排时间。

Here, again, you may want to review the 在这里,你可能想复习一下 full habits documentation. The example used in the documentation 完整的习惯文档。文档中使用的示例 is remembering to shave. It is not critical that you shave on any single, exact 就是记得刮胡子。你刮任何一种胡子都是可以的 day, but it may be important to you to shave within a loose cadence with a 但它可能是重要的,你刮在一个松散的节奏与一个 couple of days of leeway. 有几天的时间。

I use habits to track scheduling appointments like one-on-ones with my direct 我以一对一的方式来跟踪日程安排 reports. While it is very important that one-on-ones happen regularly, it is not 报告。一对一的会面很重要,但事实并非如此 critical that they take place at exactly X days apart, and this gives me 关键是它们恰好在X天内发生,这给了我 flexibility to schedule more frequently with people who need more attention and 灵活安排时间,与需要更多关注的人在一起 to work around my other appointments. 避开我的其他约会

To create a habit, you need two things: 要养成习惯,你需要两样东西:

  1. A SCHEDULED tag with a repeat specification (like .+ or ++), and
  2. 带有重复规范(like )的调度=标记。+=或=++),和
  3. A STYLE property set to the value habit.
  4. 将A STYLE property设置为value =habit=。

Here is the example from the documentation: 下面是文档中的例子:

#+BEGIN_EXAMPLE

TODO Shave

#+END_EXAMPLE

The repeat specification, .+2d/4d means: repeat规范,=。4 + 2 d / d =的意思是:

  • Repeat as frequently as every two days, but

-每两天重复一次,但是

  • Never less frequently than every four days, and

-频率从不少于每四天一次,而且

  • When completed, start counting again from today.

-完成后,从*今天*开始重新计数。

If you use ++ instead of .+ it means “from the last date completed, count as 如果你用=++=代替=。+=它的意思是“从最后完成的日期算起” many 2-day intervals as necessary to find a date in the future.” This is useful 为了找到未来的约会,需要2天的间隔。这很有用 if you want something to always fall on the same days of the week, for example. 例如,如果你希望某件事总是发生在同一周的同一天。

You can use a plain + repeat, which is unusual for a habit, because if you 你可以使用简单的=+=重复,这对于一个习惯来说是不寻常的,因为如果你 fall quite behind you will need to complete the task as many times as it takes 你需要尽可能多地完成这项任务 for the next occurrence to get into the future. This would be useful for 为下一次事件进入未来。这对 something like paying your rent where you cannot skip any instances, but that 比如付房租,你不能跳过任何情况,但是 isn't really a habit, now is it? 这真的不是一种习惯,不是吗?

I love habits, but now we have another problem... Habits appear with the 我喜欢习惯,但现在我们有另一个问题……习惯伴随着 blue/green/red bar as shown in the screenshot at the top of this post when they 蓝色/绿色/红色条显示在这篇文章的顶部截图当他们 are listed in a daily or weekly agenda view, but because they are also regular 都列在每日或每周的日程视图中,但因为它们也是定期的吗 scheduled items, they appear in our “eventually” list with a lot less useful 排定的项目,它们出现在我们的“最终”列表中,没有那么有用 detail. 细节。

You know what time it is. Filtering time. 你知道现在几点了。过滤时间。

Filtering Habits

* *过滤的习惯

属性: :CUSTOM_ID: filtering-habits :CUSTOM_ID filtering-habits

结束:

Again I was really optimistic that Org provided some built-in function for 我还是很乐观Org提供了一些内置功能 filtering by style or property... But it doesn't. So here's my implementation of 根据样式或属性过滤…但它不是。这是我的实现 a habit-skipping function: habit-skipping函数:

(defun air-org-skip-subtree-if-habit ()
"Skip an agenda entry if it has a STYLE property equal to "habit"."
(let ((subtree-end (save-excursion (org-end-of-subtree t))))
(if (string= (org-entry-get nil "STYLE") "habit")
subtree-end
nil)))

Org does provide helper functions for extracting property values and finding Org确实为提取属性值和查找提供了帮助函数 locations relative to entries, so it was straightforward to write this. It would 相对于项的位置,所以很简单。它将 be easy enough to parameterize the property value if you wanted to skip 如果想要跳过,参数化属性值非常简单 different types of properties, but I don't have that use case (yet). 不同类型的属性,但我还没有那个用例。

The Final Agenda

*最后议程

属性: :CUSTOM_ID: the-final-agenda :CUSTOM_ID the-final-agenda

结束:

I've covered almost everything, so finally here is the complete agenda composite 我几乎涵盖了所有内容,所以最后这里是完整的议程组合 view command: 查看命令:

(setq org-agenda-custom-commands
'(("d" "Daily agenda and all TODOs"
((tags "PRIORITY="A""
((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done))
(org-agenda-overriding-header "High-priority unfinished tasks:")))
(agenda "" ((org-agenda-ndays 1)))
(alltodo ""
((org-agenda-skip-function '(or (air-org-skip-subtree-if-habit)
(air-org-skip-subtree-if-priority ?A)
(org-agenda-skip-if nil '(scheduled deadline))))
(org-agenda-overriding-header "ALL normal priority tasks:"))))
((org-agenda-compact-blocks t)))))

There are just a couple of things in here that I haven't mentioned specifically, 这里有几件事我没有特别提到, so let me do that. 我来做一下。

  1. Both TODO sections use org-agenda-overriding-header, which I previously
  2. 两个TODO部分都使用=org-agenda-overriding-header=,这是我前面介绍过的

described. 描述。

  1. The “agenda” section in the middle also specifies org-agenda-ndays with a
  2. 中间的“agenda”部分还指定=org-agenda-ndays= with a

value of 1, because I only want to see one day at a time. If you have been 值为1,因为我想一次只看一天。如果你曾经 coding along with this you might have wondered how to get rid of all the 与此同时,您可能想知道如何去掉所有的 other days of the week... This is how. 一周中的其他几天……这是如何。

  1. There is a final settings list at the end containing

3.最后有一个最终的设置列表 org-agenda-compact-blocks. Settings in this list apply to the entire = org-agenda-compact-blocks =。此列表中的设置适用于整个列表 composite view, and this setting removes the equal sign dividers between the 属性之间的等号分隔符 sections, because I think they're a waste of space. 部分,因为我认为它们是对空间的浪费。

Congratulations, you now probably know more about building Org Mode agenda 祝贺您,您现在可能对构建Org模式日程有了更多的了解 commands and composite views than most people. I hope that these tools give you 命令和复合视图。我希望这些工具能给你 the ability to confidently tackle the tasks in your life and give you a sense of 自信地处理你生活中的任务的能力,给你一种感觉 peace. 和平。

Navigating Your Agenda

*浏览议程

属性: :CUSTOM_ID: navigating-your-agenda :CUSTOM_ID navigating-your-agenda

结束:

The agenda view is pretty amazing, and it's very useful as a read-only overview 日程视图非常棒,作为只读概览非常有用 of what you need to get done, but the journey doesn't stop there because the 你需要做的事情,但是你的旅程不会就此结束 agenda is also completely interactive. 议程也是完全交互式的。

I've tweaked my configuration to make the agenda view easy to navigate and 我已经调整了我的配置,使议程视图易于导航和 interact with, optimized for my common use cases, and I'm going to get into that 交互,针对我的常用用例进行了优化,我将会讲到这个 in depth in my next post, so stay tuned! 在我的下一篇文章中有详细的介绍,请继续关注!