Emacs Study Notes (10): Org-mode, one of the most powerful task management tools

Source: Internet
Author: User
Org-mode is one of the most powerful task management tools.

Programmers must be familiar with the word "TODO. One TODO means one thing needs to be done. Further, TODO is an unfinished task.

Org-mode can perfectly solve various task management problems, including task/subtask division, key time setting, task state change tracking, and task retrieval and query. With the powerful editing function of Org-mode, you can implement many functions, such as time management (GTD), project planning and management, and work logs.

This article describes the powerful task management functions of Org-mode.

Table of Contents
  • 1. define tasks and subtasks
  • 2. Define the task status
  • 3. Set task priority
  • 4. Track subtask completion
  • 5. Use the check box to mark non-title subtasks
  • 6. query a task
  • 7. Schedule a task
    • 7.1 Timestamp
    • 7.2 planned time and deadline
  • 8. List of Global Task files
  • 9 Global TODO list
  • 10 calendar
  • 11 Summary
1. define tasks and subtasks

Org-mode considers that each task usually requires some text instructions. Therefore, Org-mode uses the title as the task carrier. You can add status tags to the title to define a task. Because the outline is hierarchical, defining the title as a task naturally supports subtasks: You can mark subtasks on the subtitle.

Use C-c C-t or S-LEFT/ribbon to add or change the task tag for the title.

2. Define the task status

There are only two built-in task statuses in Org-mode: TODO and DONE. If you need more states, you need to define them by yourself.

You can define the task status in the file: the keywords should be different, so that the Org option can know which state sequence (SET) to use ). The example also provides a method to quickly use a keyword, that is, to give a quick letter in the brackets behind the keyword-when using C-c-t, you will be asked to enter a letter.

To customize the task status, you can use the document metadata "# + SEQTODO:", which can be defined anywhere in the document, but we recommend that you define it in the Document Header:

#+SEQ_TODO: REPORT(r) BUG(b) KNOWNCAUSE(k) | FIXED(f)#+SEQ_TODO: TODO(T!) | DONE(D@)3  CANCELED(C@/!)    

Place the cursor over the content, and enter C-c to take effect directly. When you use C-c-t to set the task, a new buffer is opened:

 

Compared with the previous definition, it is not difficult to find:

  • You can define multiple sets of status sequences. Each "# + SEQTODO" Row defines a group.
  • States are separated by Spaces
  • You can define additional options in (), including:
    • Character: shortcut key for this status
    • ! : The timestamp is automatically added when you switch to this status.
    • @: Enter text description when switching to this status
    • If both @ and! are set !, Use "@/!"
  • Separate the incomplete and completed states with '|. The incomplete status is listed when you query the to-do list.

After switching some States with C-c-t or S-LEFT/ribbon, the job will look like this:

The timestamp is automatically generated and a description is displayed. This leaves a complete record.

The preceding task status settings only apply to the current document. If you want to set the default task status for all. org documents, you must define it in the. emacs configuration file. The preceding task status is set:

(setq org-todo-keywords    '((sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)" "|" "FIXED(f)")      (sequence "TODO(T!)" "|" "DONE(D@)3" "CANCELED(C@/!)")     ))    

In addition to the status sequence, you can also define the type to mark the task category. You can refer to here.

3. Set task priority

In Org-mode, Priority A, B, and C are also set for the task, which can be sorted by priority during schedule. Setting a priority for a task is done by pressing the S-UP/DOWN

4. Track subtask completion

A common requirement for higher-level tasks with multiple subtasks is to track the completion of subtasks at any time. Org-mode supports adding tags to a parent task. When the status of a subtask changes, the completion status of the parent task is automatically updated. Both percentages and scores are supported, for example, [66%] or [2/3].

You can insert [%] or [/] to any position in the parent task title. When the status of the subtask changes, the value of this position is automatically updated. For example:

* Organize Party [%]** Call people [/]*** Peter*** Sarah** Buy food** Talk to neighbor

Note:

  1. When the status of a subtask is changed, only the completion status of the previous-level task is updated and cannot be cascaded.
  2. Even if all the sub-tasks are completed, the completion status of the above-level tasks is only marked as 100%, and the completion status of the higher-level tasks cannot be automatically updated. If you need to set it to complete automatically, you can add the following configuration in. emacs:
    (defun org-summary-todo (n-done n-not-done)      "Switch entry to DONE when all subentries are done, to TODO otherwise."      (let (org-log-done org-log-states)   ; turn off logging        (org-todo (if (= n-not-done 0) "DONE" "TODO"))))        (add-hook 'org-after-todo-statistics-hook 'org-summary-todo)
5. Use the check box to mark non-title subtasks

The preceding tasks and subtasks are in the title format. Org-mode also supports non-title subtasks. A list starting with "[]" is considered as a check box. In this way, a local subtask is formed, which is suitable for dividing a task into several simple steps. The following is an example:

* ** A task [0/2] contains several steps: -[-] Step 1 [1/2]-[X] Step 1.1-[] Step 1.2-[-] Step 2 [1/2]-[X] Step 2.1-[] Step 2.2

Similar to a subtask, a change in the status of a step changes the completion of a higher-level step/task. The commands related to the check box are as follows:

KEYS COMMENT
C-c Change check box status
M-S-RET Add a subitem
6. query a task

The outline retrieval function is introduced in the Org-mode editing function:

The preceding section C-c/only lists the outlines containing search results and highlights them. Multiple search methods are supported.

This function can be searched in multiple ways, including todo and TODO key words. Highlight all TODO and TODO with specific keywords respectively

7. Schedule a task

You can also set the SCHEDULED time and DEADLINE for tasks in Org-mode to facilitate task management and scheduling.

7.1 Timestamp

In Org-mode, strings in a specific format with date and time information are called timestamps. The timestamp is marked with "<>", for example:

<2005-10-01 Tue><2003-09-16 Tue 09:39><2003-09-16 Tue 12:00-12:30>

The timestamp can be divided into two types. In the preceding example, the timestamp marks a "time point", and the timestamp marks multiple recurring time points. It is expressed by time + interval (Day (d), Week (w), month (m), or year (y. For example:

 <2007-05-16 Wed 12:30 +1w>

Indicates that the task has been repeated once a week since.

The timestamp can be placed in any part of the title or body.

When you enter a timestamp, You can manually enter a tag that complies with the format, or you can use the shortcut key C-c. To create a tag.

If you do not need to select a date to enter it quickly, you can use C-c <.

C-c> you can view the calendar.

If you only want to enter a date/time that has nothing to do with the task, you can use C-c !.

S-left | S-right adjusts the timestamp S-up in days | S-down adjusts the time unit of the cursor. If the cursor is outside the timestamp, adjust the timestamp type (whether displayed in the calendar) S-LEFT/change the timestamp processed by the cursor to a day. RIGHT ── ─ S-UP /change the entry under the cursor in the timestamp. The cursor can be placed on year, month, day, hour, or points. When the timestamp contains a time period, for example, "-", the first time is modified, and the second time is automatically modified at the same time to keep the length of the time period unchanged. To modify the length of a time period, you can modify the second time. There are already too many problems between them.

Time/Date segment

The two timestamps are connected with '-' to define a time period:

  <2004-08-23 Mon>--<2004-08-26 Thu>

Continuous use of C-c. Can Create Time Periods

Interval between the period of C-c-y Calculation

7.2 planned time and deadline

Org-mode allows you to set a SCHEDULED time (SCHEDULED) for a task. You can enter C-c-s to set the SCHEDULED time of the task where the cursor is located. C-c C-d is the input DEADLINE (DEADLINE ).

8. List of Global Task files

The previous content is about task management of a single. org file. Org-mode also supports combining multiple. org files for management. This brings many benefits:

You can place tasks in different files for different purposes, such as projects, personal transactions, and families.

To let Org-mode know which files need to be considered as part of a global task, you need to set a list, which can be set in. emacs as follows:

(setq org-agenda-files (list "~/.todos/work.org"                             "~/.todos/projects.org"                             "~/.todos/home.org"                             "~/Documents/todo/"                           ))

You can add files or directories to the list. If it is a directory, all. org files under the directory will be added to the list.

In addition to the predefined inventory file, you can also use C-c [/] To Add/Remove files to/from the list at any time when editing the task file (. org.

You can use C-c '/to open all configuration files cyclically at any time.

9 Global TODO list

The global TODO list lists the incomplete tasks in all global task files. Use the shortcut key C-c a t to enter the global TODO list.

In the global TODO list, use the t key to change the task status, and press RET to jump to the source file where the entry is located.

If the prompt "C-c a" shortcut key is not defined, because the Org-mode shortcut key is not enabled, you need to add the configuration in. emacs:

(global-set-key "\C-cl" 'org-store-link)(global-set-key "\C-cc" 'org-capture)(global-set-key "\C-ca" 'org-agenda)(global-set-key "\C-cb" 'org-iswitchb)
10 calendar

Sometimes you may need to display the schedule based on the unfinished tasks. You can use C-c a to enter the calendar view. The Calendar lists daily tasks based on the scheduled time of the task.

In the calendar view, press "l" (lowercase letter L) to display logs. This will display all your completed tasks and their completion time.

11 Summary

This involves some basic usage of Org-mode task management. It is these powerful foundations that enable Org-mode to be used in time management (GTD) project planning and management, and work logs.

Date: 22:06:40 CST

Author: Holbrook

Org version 7.8.08 with Emacs version 23

Validate XHTML 1.0

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.