aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Dominik2007-06-19 08:53:36 +0000
committerCarsten Dominik2007-06-19 08:53:36 +0000
commit219513ac8838d885c1c31fb1ef2b5ead8a7302e7 (patch)
treea888f341531b4bea8a6786cca9e626c6ffa2d313
parentb38c6895869ce5ef99ff7dc6584b1fe007a834a5 (diff)
downloademacs-219513ac8838d885c1c31fb1ef2b5ead8a7302e7.tar.gz
emacs-219513ac8838d885c1c31fb1ef2b5ead8a7302e7.zip
(Tag): Section swapped with node Timestamps.
(Formula syntax for Lisp): Document new `L' flag.
-rw-r--r--man/org.texi591
1 files changed, 302 insertions, 289 deletions
diff --git a/man/org.texi b/man/org.texi
index 22d217c1c89..6fb9d63c540 100644
--- a/man/org.texi
+++ b/man/org.texi
@@ -3,7 +3,7 @@
3@setfilename ../info/org 3@setfilename ../info/org
4@settitle Org Mode Manual 4@settitle Org Mode Manual
5 5
6@set VERSION 4.77 6@set VERSION 4.78
7@set DATE June 2007 7@set DATE June 2007
8 8
9@dircategory Emacs 9@dircategory Emacs
@@ -80,8 +80,8 @@ Software Foundation raise funds for GNU development.''
80* Tables:: Pure magic for quick formatting 80* Tables:: Pure magic for quick formatting
81* Hyperlinks:: Notes in context 81* Hyperlinks:: Notes in context
82* TODO items:: Every tree branch can be a TODO item 82* TODO items:: Every tree branch can be a TODO item
83* Timestamps:: Assign date and time to items
84* Tags:: Tagging headlines and matching sets of tags 83* Tags:: Tagging headlines and matching sets of tags
84* Timestamps:: Assign date and time to items
85* Agenda views:: Collecting information into views 85* Agenda views:: Collecting information into views
86* Embedded LaTeX:: LaTeX fragments and formulas 86* Embedded LaTeX:: LaTeX fragments and formulas
87* Exporting:: Sharing and publishing of notes 87* Exporting:: Sharing and publishing of notes
@@ -173,6 +173,12 @@ Extended use of TODO keywords
173* Multiple sets in one file:: Mixing it all, and still finding your way 173* Multiple sets in one file:: Mixing it all, and still finding your way
174* Per file keywords:: Different files, different requirements 174* Per file keywords:: Different files, different requirements
175 175
176Tags
177
178* Tag inheritance:: Tags use the tree structure of the outline
179* Setting tags:: How to assign tags to a headline
180* Tag searches:: Searching for combinations of tags
181
176Timestamps 182Timestamps
177 183
178* Time stamps:: Assigning a time to a tree entry 184* Time stamps:: Assigning a time to a tree entry
@@ -196,12 +202,6 @@ Progress Logging
196* Tracking TODO state changes:: When did the status change? 202* Tracking TODO state changes:: When did the status change?
197* Clocking work time:: When exactly did you work on this item? 203* Clocking work time:: When exactly did you work on this item?
198 204
199Tags
200
201* Tag inheritance:: Tags use the tree structure of the outline
202* Setting tags:: How to assign tags to a headline
203* Tag searches:: Searching for combinations of tags
204
205Agenda Views 205Agenda Views
206 206
207* Agenda files:: Files being searched for agenda information 207* Agenda files:: Files being searched for agenda information
@@ -1040,10 +1040,7 @@ Org-mode supports these lists by tuning filling and wrapping commands to
1040deal with them correctly@footnote{Org-mode only changes the filling 1040deal with them correctly@footnote{Org-mode only changes the filling
1041settings for Emacs. For XEmacs, you should use Kyle E. Jones' 1041settings for Emacs. For XEmacs, you should use Kyle E. Jones'
1042@file{filladapt.el}. To turn this on, put into @file{.emacs}: 1042@file{filladapt.el}. To turn this on, put into @file{.emacs}:
1043@example 1043@code{(require 'filladapt)}}.
1044(require 'filladapt)
1045@end example
1046}.
1047 1044
1048The following commands act on items when the cursor is in the first line 1045The following commands act on items when the cursor is in the first line
1049of an item (the line with the bullet or number). 1046of an item (the line with the bullet or number).
@@ -1056,6 +1053,9 @@ Items can be folded just like headline levels if you set the variable
1056given by the indentation of the bullet/number. Items are always 1053given by the indentation of the bullet/number. Items are always
1057subordinate to real headlines, however; the hierarchies remain 1054subordinate to real headlines, however; the hierarchies remain
1058completely separated. 1055completely separated.
1056
1057If @code{org-cycle-include-plain-lists} has not been set, @key{TAB}
1058fixes the indentation of the curent line in a heuristic way.
1059@kindex M-@key{RET} 1059@kindex M-@key{RET}
1060@item M-@key{RET} 1060@item M-@key{RET}
1061Insert new item at current level. With prefix arg, force a new heading 1061Insert new item at current level. With prefix arg, force a new heading
@@ -1094,8 +1094,9 @@ the command chain with a cursor motion or so.
1094@kindex C-c C-c 1094@kindex C-c C-c
1095@item C-c C-c 1095@item C-c C-c
1096If there is a checkbox (@pxref{Checkboxes}) in the item line, toggle the 1096If there is a checkbox (@pxref{Checkboxes}) in the item line, toggle the
1097state of the checkbox. Otherwise, if this is an ordered list, renumber 1097state of the checkbox. If not, make this command makes sure that all
1098the ordered list at the cursor. 1098the items on this list level use the same bullet. Furthermore, if this
1099is an ordered list, make sure the numbering is ok.
1099@end table 1100@end table
1100 1101
1101@node Tables, Hyperlinks, Document structure, Top 1102@node Tables, Hyperlinks, Document structure, Top
@@ -1641,12 +1642,18 @@ functionality is not enough. If a formula starts with a single quote
1641followed by an opening parenthesis, then it is evaluated as a lisp form. 1642followed by an opening parenthesis, then it is evaluated as a lisp form.
1642The evaluation should return either a string or a number. Just as with 1643The evaluation should return either a string or a number. Just as with
1643@file{calc} formulas, you can specify modes and a printf format after a 1644@file{calc} formulas, you can specify modes and a printf format after a
1644semicolon. A reference will be replaced with a string (in double 1645semicolon. With Emacs Lisp forms, you need to be concious about the way
1645quotes) containing the field. If you provide the @samp{N} mode switch, 1646field references are interpolated into the form. By default, a
1646all referenced elements will be numbers. Ranges are inserted as 1647reference will be interpolated as a Lisp string (in double quotes)
1647space-separated fields, so you can embed them in list or vector syntax. 1648containing the field. If you provide the @samp{N} mode switch, all
1648A few examples, note how the @samp{N} mode is used when we do 1649referenced elements will be numbers (non-number fields will be zero) and
1649computations in lisp. 1650interpolated as Lisp numbers, without quotes. If you provide the
1651@samp{L} flag, all fields will be interpolated literally, without quotes.
1652I.e., if you want a reference to be interpreted as a string by the Lisp
1653form, enclode the reference operator itself in double quotes, like
1654@code{"$3"}. Ranges are inserted as space-separated fields, so you can
1655embed them in list or vector syntax. A few examples, note how the
1656@samp{N} mode is used when we do computations in lisp.
1650 1657
1651@example 1658@example
1652@r{Swap the first two characters of the content of column 1} 1659@r{Swap the first two characters of the content of column 1}
@@ -2042,8 +2049,8 @@ convenient to put them into a comment line. For example
2042 2049
2043@noindent In HTML export (@pxref{HTML export}), such targets will become 2050@noindent In HTML export (@pxref{HTML export}), such targets will become
2044named anchors for direct access through @samp{http} links@footnote{Note 2051named anchors for direct access through @samp{http} links@footnote{Note
2045that text before the first headline will never be exported, so the first 2052that text before the first headline is usually not exported, so the
2046such target must be after the first headline.}. 2053first such target should be after the first headline.}.
2047 2054
2048If no dedicated target exists, Org-mode will search for the words in the 2055If no dedicated target exists, Org-mode will search for the words in the
2049link. In the above example the search would be for @samp{my target}. 2056link. In the above example the search would be for @samp{my target}.
@@ -2581,7 +2588,7 @@ non-nil, the entire text is also indented so that it starts in the
2581same column as the headline (after the asterisks). 2588same column as the headline (after the asterisks).
2582 2589
2583 2590
2584@node TODO items, Timestamps, Hyperlinks, Top 2591@node TODO items, Tags, Hyperlinks, Top
2585@chapter TODO items 2592@chapter TODO items
2586@cindex TODO items 2593@cindex TODO items
2587 2594
@@ -2960,7 +2967,264 @@ delete boxes or add/change them by hand, use this command to get things
2960back into synch. Or simply toggle any checkbox twice with @kbd{C-c C-c}. 2967back into synch. Or simply toggle any checkbox twice with @kbd{C-c C-c}.
2961@end table 2968@end table
2962 2969
2963@node Timestamps, Tags, TODO items, Top 2970
2971@node Tags, Timestamps, TODO items, Top
2972@chapter Tags
2973@cindex tags
2974@cindex headline tagging
2975@cindex matching, tags
2976@cindex sparse tree, tag based
2977
2978If you wish to implement a system of labels and contexts for
2979cross-correlating information, an excellent way is to assign @i{tags} to
2980headlines. Org-mode has extensive support for using tags.
2981
2982Every headline can contain a list of tags, at the end of the headline.
2983Tags are normal words containing letters, numbers, @samp{_}, and
2984@samp{@@}. Tags must be preceded and followed by a single colon; like
2985@samp{:WORK:}. Several tags can be specified like @samp{:WORK:URGENT:}.
2986
2987@menu
2988* Tag inheritance:: Tags use the tree structure of the outline
2989* Setting tags:: How to assign tags to a headline
2990* Tag searches:: Searching for combinations of tags
2991@end menu
2992
2993@node Tag inheritance, Setting tags, Tags, Tags
2994@section Tag inheritance
2995@cindex inheritance, of tags
2996@cindex sublevels, inclusion into tags match
2997
2998@i{Tags} make use of the hierarchical structure of outline trees. If a
2999heading has a certain tag, all subheadings will inherit the tag as
3000well. For example, in the list
3001
3002@example
3003* Meeting with the French group :WORK:
3004** Summary by Frank :BOSS:NOTES:
3005*** TODO Prepare slides for him :ACTION:
3006@end example
3007
3008@noindent
3009the final heading will have the tags @samp{:WORK:}, @samp{:BOSS:},
3010@samp{:NOTES:}, and @samp{:ACTION:}. When executing tag searches and
3011Org-mode finds that a certain headline matches the search criterion, it
3012will not check any sublevel headline, assuming that these likely also
3013match, and that the list of matches can become very long. This may
3014not be what you want, however, and you can influence inheritance and
3015searching using the variables @code{org-use-tag-inheritance} and
3016@code{org-tags-match-list-sublevels}.
3017
3018@node Setting tags, Tag searches, Tag inheritance, Tags
3019@section Setting tags
3020@cindex setting tags
3021@cindex tags, setting
3022
3023@kindex M-@key{TAB}
3024Tags can simply be typed into the buffer at the end of a headline.
3025After a colon, @kbd{M-@key{TAB}} offers completion on tags. There is
3026also a special command for inserting tags:
3027
3028@table @kbd
3029@kindex C-c C-c
3030@item C-c C-c
3031@cindex completion, of tags
3032Enter new tags for the current headline. Org-mode will either offer
3033completion or a special single-key interface for setting tags, see
3034below. After pressing @key{RET}, the tags will be inserted and aligned
3035to @code{org-tags-column}. When called with a @kbd{C-u} prefix, all
3036tags in the current buffer will be aligned to that column, just to make
3037things look nice. TAGS are automatically realigned after promotion,
3038demotion, and TODO state changes (@pxref{TODO basics}).
3039@end table
3040
3041Org will support tag insertion based on a @emph{list of tags}. By
3042default this list is constructed dynamically, containing all tags
3043currently used in the buffer. You may also globally specify a hard list
3044of tags with the variable @code{org-tag-alist}. Finally you can set
3045the default tags for a given file with lines like
3046
3047@example
3048#+TAGS: @@WORK @@HOME @@TENNISCLUB
3049#+TAGS: Laptop Car PC Sailboat
3050@end example
3051
3052If you have globally defined your preferred set of tags using the
3053variable @code{org-tag-alist}, but would like to use a dynamic tag list
3054in a specific file: Just add an empty TAGS option line to that file:
3055
3056@example
3057#+TAGS:
3058@end example
3059
3060The default support method for entering tags is minibuffer completion.
3061However, Org-mode also implements a much better method: @emph{fast tag
3062selection}. This method allows to select and deselect tags with a
3063single key per tag. To function efficiently, you should assign unique
3064keys to most tags. This can be done globally with
3065
3066@lisp
3067(setq org-tag-alist '(("@@WORK" . ?w) ("@@HOME" . ?h) ("Laptop" . ?l)))
3068@end lisp
3069
3070@noindent or on a per-file basis with
3071
3072@example
3073#+TAGS: @@WORK(w) @@HOME(h) @@TENNISCLUB(t) Laptop(l) PC(p)
3074@end example
3075
3076@noindent
3077You can also group together tags that are mutually exclusive. With
3078curly braces@footnote{In @code{org-mode-alist} use
3079@code{'(:startgroup)} and @code{'(:endgroup)}, respectively. Several
3080groups are allowed.}
3081
3082@example
3083#+TAGS: @{ @@WORK(w) @@HOME(h) @@TENNISCLUB(t) @} Laptop(l) PC(p)
3084@end example
3085
3086@noindent you indicate that at most one of @samp{@@WORK}, @samp{@@HOME},
3087and @samp{@@TENNISCLUB} should be selected.
3088
3089@noindent Don't forget to press @kbd{C-c C-c} with the cursor in one of
3090these lines to activate any changes.
3091
3092If at least one tag has a selection key, pressing @kbd{C-c C-c} will
3093automatically present you with a special interface, listing inherited
3094tags, the tags of the current headline, and a list of all legal tags
3095with corresponding keys@footnote{Keys will automatically be assigned to
3096tags which have no configured keys.}. In this interface, you can use
3097the following keys:
3098
3099@table @kbd
3100@item a-z...
3101Pressing keys assigned to tags will add or remove them from the list of
3102tags in the current line. Selecting a tag in a group of mutually
3103exclusive tags will turn off any other tags from that group.
3104@kindex @key{TAB}
3105@item @key{TAB}
3106Enter a tag in the minibuffer, even if the tag is not in the predefined
3107list. You will be able to complete on all tags present in the buffer.
3108@kindex @key{SPC}
3109@item @key{SPC}
3110Clear all tags for this line.
3111@kindex @key{RET}
3112@item @key{RET}
3113Accept the modified set.
3114@item C-g
3115Abort without installing changes.
3116@item q
3117If @kbd{q} is not assigned to a tag, it aborts like @kbd{C-g}.
3118@item !
3119Turn off groups of mutually exclusive tags. Use this to (as an
3120exception) assign several tags from such a group.
3121@item C-c
3122Toggle auto-exit after the next change (see below).
3123If you are using expert mode, the first @kbd{C-c} will display the
3124selection window.
3125@end table
3126
3127@noindent
3128This method lets you assign tags to a headline with very few keys. With
3129the above setup, you could clear the current tags and set @samp{@@HOME},
3130@samp{Laptop} and @samp{PC} tags with just the following keys: @kbd{C-c
3131C-c @key{SPC} h l p @key{RET}}. Switching from @samp{@@HOME} to
3132@samp{@@WORK} would be done with @kbd{C-c C-c w @key{RET}} or
3133alternatively with @kbd{C-c C-c C-c w}. Adding the non-predefined tag
3134@samp{Sarah} could be done with @kbd{C-c C-c @key{TAB} S a r a h
3135@key{RET} @key{RET}}.
3136
3137If you find that most of the time, you need only a single keypress to
3138modify your list of tags, set the variable
3139@code{org-fast-tag-selection-single-key}. Then you no longer have to
3140press @key{RET} to exit fast tag selection - it will immediately exit
3141after the first change. If you then occasionally need more keys, press
3142@kbd{C-c} to turn off auto-exit for the current tag selection process
3143(in effect: start selection with @kbd{C-c C-c C-c} instead of @kbd{C-c
3144C-c}). If you set the variable to the value @code{expert}, the special
3145window is not even shown for single-key tag selection, it comes up only
3146when you press an extra @kbd{C-c}.
3147
3148@node Tag searches, , Setting tags, Tags
3149@section Tag searches
3150@cindex tag searches
3151@cindex searching for tags
3152
3153Once a tags system has been set up, it can be used to collect related
3154information into special lists.
3155
3156@table @kbd
3157@kindex C-c \
3158@item C-c \
3159Create a sparse tree with all headlines matching a tags search. With a
3160@kbd{C-u} prefix argument, ignore headlines that are not a TODO line.
3161@kindex C-c a m
3162@item C-c a m
3163Create a global list of tag matches from all agenda files.
3164@xref{Matching headline tags}.
3165@kindex C-c a M
3166@item C-c a M
3167Create a global list of tag matches from all agenda files, but check
3168only TODO items and force checking subitems (see variable
3169@code{org-tags-match-list-sublevels}).
3170@end table
3171
3172@cindex Boolean logic, for tag searches
3173A @i{tags} search string can use Boolean operators @samp{&} for AND and
3174@samp{|} for OR. @samp{&} binds more strongly than @samp{|}.
3175Parenthesis are currently not implemented. A tag may also be preceded
3176by @samp{-}, to select against it, and @samp{+} is syntactic sugar for
3177positive selection. The AND operator @samp{&} is optional when @samp{+}
3178or @samp{-} is present. Examples:
3179
3180@table @samp
3181@item +WORK-BOSS
3182Select headlines tagged @samp{:WORK:}, but discard those also tagged
3183@samp{:BOSS:}.
3184@item WORK|LAPTOP
3185Selects lines tagged @samp{:WORK:} or @samp{:LAPTOP:}.
3186@item WORK|LAPTOP&NIGHT
3187Like before, but require the @samp{:LAPTOP:} lines to be tagged also
3188@samp{NIGHT}.
3189@end table
3190
3191@cindex TODO keyword matching, with tags search
3192If you are using multi-state TODO keywords (@pxref{TODO extensions}), it
3193can be useful to also match on the TODO keyword. This can be done by
3194adding a condition after a slash to a tags match. The syntax is similar
3195to the tag matches, but should be applied with consideration: For
3196example, a positive selection on several TODO keywords can not
3197meaningfully be combined with boolean AND. However, @emph{negative
3198selection} combined with AND can be meaningful. To make sure that only
3199lines are checked that actually have any TODO keyword, use @kbd{C-c a
3200M}, or equivalently start the todo part after the slash with @samp{!}.
3201Examples:
3202
3203@table @samp
3204@item WORK/WAITING
3205Select @samp{:WORK:}-tagged TODO lines with the specific TODO
3206keyword @samp{WAITING}.
3207@item WORK/!-WAITING-NEXT
3208Select @samp{:WORK:}-tagged TODO lines that are neither @samp{WAITING}
3209nor @samp{NEXT}
3210@item WORK/+WAITING|+NEXT
3211Select @samp{:WORK:}-tagged TODO lines that are either @samp{WAITING} or
3212@samp{NEXT}.
3213@end table
3214
3215@cindex regular expressions, with tags search
3216Any element of the tag/todo match can be a regular expression - in this
3217case it must be enclosed in curly braces. For example,
3218@samp{WORK+@{^BOSS.*@}} matches headlines that contain the tag
3219@samp{WORK} and any tag @i{starting} with @samp{BOSS}.
3220
3221@cindex level, require for tags match
3222You can also require a headline to be of a certain level, by writing
3223instead of any TAG an expression like @samp{LEVEL=3}. For example, a
3224search @samp{+LEVEL=3+BOSS/-DONE} lists all level three headlines that
3225have the tag BOSS and are @emph{not} marked with the todo keyword DONE.
3226
3227@node Timestamps, Agenda views, Tags, Top
2964@chapter Timestamps 3228@chapter Timestamps
2965@cindex time stamps 3229@cindex time stamps
2966@cindex date stamps 3230@cindex date stamps
@@ -2984,12 +3248,13 @@ planning.
2984@cindex deadlines 3248@cindex deadlines
2985@cindex scheduling 3249@cindex scheduling
2986 3250
2987A time stamp is a specification of a date (possibly with time) in a 3251A time stamp is a specification of a date (possibly with time or a range
2988special format, either @samp{<2003-09-16 Tue>} or @samp{<2003-09-16 Tue 3252of times) in a special format, either @samp{<2003-09-16 Tue>} or
298909:39>}@footnote{This is the standard ISO date/time format. If you 3253@samp{<2003-09-16 Tue 09:39>} or @samp{<2003-09-16 Tue
2990cannot get used to these, see @ref{Custom time format}}. A time stamp 325412:00-12:30>}@footnote{This is the standard ISO date/time format. If
2991can appear anywhere in the headline or body of an org-tree entry. Its 3255you cannot get used to these, see @ref{Custom time format}}. A time
2992presence causes entries to be shown on specific dates in the agenda 3256stamp can appear anywhere in the headline or body of an org-tree entry.
3257Its presence causes entries to be shown on specific dates in the agenda
2993(@pxref{Weekly/Daily agenda}). We distinguish: 3258(@pxref{Weekly/Daily agenda}). We distinguish:
2994 3259
2995@table @var 3260@table @var
@@ -3003,6 +3268,7 @@ associated with a plain time stamp will be shown exactly on that date.
3003 3268
3004@example 3269@example
3005* Meet Peter at the movies <2006-11-01 Wed 19:15> 3270* Meet Peter at the movies <2006-11-01 Wed 19:15>
3271* Discussion on climate change <2006-11-02 Thu 20:00-22:00>
3006@end example 3272@end example
3007 3273
3008@item Time stamp with repeater interval 3274@item Time stamp with repeater interval
@@ -3227,6 +3493,9 @@ the stamp, @kbd{S-@key{up}/@key{down}} will change the stamp by one day,
3227just like @kbd{S-@key{left}/@key{right}}. At the end of the stamp, the 3493just like @kbd{S-@key{left}/@key{right}}. At the end of the stamp, the
3228time will be changed by one minute. 3494time will be changed by one minute.
3229@item 3495@item
3496If the time stamp contains a range of clock times or a repeater, these
3497will not be overlayed, but remain in the buffer as they were.
3498@item
3230When you delete a time stamp character-by-character, it will only 3499When you delete a time stamp character-by-character, it will only
3231disappear from the buffer after @emph{all} (invisible) characters 3500disappear from the buffer after @emph{all} (invisible) characters
3232belonging to the ISO timestamp have been removed. 3501belonging to the ISO timestamp have been removed.
@@ -3508,263 +3777,7 @@ The @kbd{l} key may be used in the timeline (@pxref{Timeline}) and in
3508the agenda (@pxref{Weekly/Daily agenda}) to show which tasks have been 3777the agenda (@pxref{Weekly/Daily agenda}) to show which tasks have been
3509worked on or closed during a day. 3778worked on or closed during a day.
3510 3779
3511@node Tags, Agenda views, Timestamps, Top 3780@node Agenda views, Embedded LaTeX, Timestamps, Top
3512@chapter Tags
3513@cindex tags
3514@cindex headline tagging
3515@cindex matching, tags
3516@cindex sparse tree, tag based
3517
3518If you wish to implement a system of labels and contexts for
3519cross-correlating information, an excellent way is to assign @i{tags} to
3520headlines. Org-mode has extensive support for using tags.
3521
3522Every headline can contain a list of tags, at the end of the headline.
3523Tags are normal words containing letters, numbers, @samp{_}, and
3524@samp{@@}. Tags must be preceded and followed by a single colon; like
3525@samp{:WORK:}. Several tags can be specified like @samp{:WORK:URGENT:}.
3526
3527@menu
3528* Tag inheritance:: Tags use the tree structure of the outline
3529* Setting tags:: How to assign tags to a headline
3530* Tag searches:: Searching for combinations of tags
3531@end menu
3532
3533@node Tag inheritance, Setting tags, Tags, Tags
3534@section Tag inheritance
3535@cindex inheritance, of tags
3536@cindex sublevels, inclusion into tags match
3537
3538@i{Tags} make use of the hierarchical structure of outline trees. If a
3539heading has a certain tag, all subheadings will inherit the tag as
3540well. For example, in the list
3541
3542@example
3543* Meeting with the French group :WORK:
3544** Summary by Frank :BOSS:NOTES:
3545*** TODO Prepare slides for him :ACTION:
3546@end example
3547
3548@noindent
3549the final heading will have the tags @samp{:WORK:}, @samp{:BOSS:},
3550@samp{:NOTES:}, and @samp{:ACTION:}. When executing tag searches and
3551Org-mode finds that a certain headline matches the search criterion, it
3552will not check any sublevel headline, assuming that these likely also
3553match, and that the list of matches can become very long. This may
3554not be what you want, however, and you can influence inheritance and
3555searching using the variables @code{org-use-tag-inheritance} and
3556@code{org-tags-match-list-sublevels}.
3557
3558@node Setting tags, Tag searches, Tag inheritance, Tags
3559@section Setting tags
3560@cindex setting tags
3561@cindex tags, setting
3562
3563@kindex M-@key{TAB}
3564Tags can simply be typed into the buffer at the end of a headline.
3565After a colon, @kbd{M-@key{TAB}} offers completion on tags. There is
3566also a special command for inserting tags:
3567
3568@table @kbd
3569@kindex C-c C-c
3570@item C-c C-c
3571@cindex completion, of tags
3572Enter new tags for the current headline. Org-mode will either offer
3573completion or a special single-key interface for setting tags, see
3574below. After pressing @key{RET}, the tags will be inserted and aligned
3575to @code{org-tags-column}. When called with a @kbd{C-u} prefix, all
3576tags in the current buffer will be aligned to that column, just to make
3577things look nice. TAGS are automatically realigned after promotion,
3578demotion, and TODO state changes (@pxref{TODO basics}).
3579@end table
3580
3581Org will support tag insertion based on a @emph{list of tags}. By
3582default this list is constructed dynamically, containing all tags
3583currently used in the buffer. You may also globally specify a hard list
3584of tags with the variable @code{org-tag-alist}. Finally you can set
3585the default tags for a given file with lines like
3586
3587@example
3588#+TAGS: @@WORK @@HOME @@TENNISCLUB
3589#+TAGS: Laptop Car PC Sailboat
3590@end example
3591
3592If you have globally defined your preferred set of tags using the
3593variable @code{org-tag-alist}, but would like to use a dynamic tag list
3594in a specific file: Just add an empty TAGS option line to that file:
3595
3596@example
3597#+TAGS:
3598@end example
3599
3600The default support method for entering tags is minibuffer completion.
3601However, Org-mode also implements a much better method: @emph{fast tag
3602selection}. This method allows to select and deselect tags with a
3603single key per tag. To function efficiently, you should assign unique
3604keys to most tags. This can be done globally with
3605
3606@lisp
3607(setq org-tag-alist '(("@@WORK" . ?w) ("@@HOME" . ?h) ("Laptop" . ?l)))
3608@end lisp
3609
3610@noindent or on a per-file basis with
3611
3612@example
3613#+TAGS: @@WORK(w) @@HOME(h) @@TENNISCLUB(t) Laptop(l) PC(p)
3614@end example
3615
3616@noindent
3617You can also group together tags that are mutually exclusive. With
3618curly braces@footnote{In @code{org-mode-alist} use
3619@code{'(:startgroup)} and @code{'(:endgroup)}, respectively. Several
3620groups are allowed.}
3621
3622@example
3623#+TAGS: @{ @@WORK(w) @@HOME(h) @@TENNISCLUB(t) @} Laptop(l) PC(p)
3624@end example
3625
3626@noindent you indicate that at most one of @samp{@@WORK}, @samp{@@HOME},
3627and @samp{@@TENNISCLUB} should be selected.
3628
3629@noindent Don't forget to press @kbd{C-c C-c} with the cursor in one of
3630these lines to activate any changes.
3631
3632If at least one tag has a selection key, pressing @kbd{C-c C-c} will
3633automatically present you with a special interface, listing inherited
3634tags, the tags of the current headline, and a list of all legal tags
3635with corresponding keys@footnote{Keys will automatically be assigned to
3636tags which have no configured keys.}. In this interface, you can use
3637the following keys:
3638
3639@table @kbd
3640@item a-z...
3641Pressing keys assigned to tags will add or remove them from the list of
3642tags in the current line. Selecting a tag in a group of mutually
3643exclusive tags will turn off any other tags from that group.
3644@kindex @key{TAB}
3645@item @key{TAB}
3646Enter a tag in the minibuffer, even if the tag is not in the predefined
3647list. You will be able to complete on all tags present in the buffer.
3648@kindex @key{SPC}
3649@item @key{SPC}
3650Clear all tags for this line.
3651@kindex @key{RET}
3652@item @key{RET}
3653Accept the modified set.
3654@item C-g
3655Abort without installing changes.
3656@item q
3657If @kbd{q} is not assigned to a tag, it aborts like @kbd{C-g}.
3658@item !
3659Turn off groups of mutually exclusive tags. Use this to (as an
3660exception) assign several tags from such a group.
3661@item C-c
3662Toggle auto-exit after the next change (see below).
3663If you are using expert mode, the first @kbd{C-c} will display the
3664selection window.
3665@end table
3666
3667@noindent
3668This method lets you assign tags to a headline with very few keys. With
3669the above setup, you could clear the current tags and set @samp{@@HOME},
3670@samp{Laptop} and @samp{PC} tags with just the following keys: @kbd{C-c
3671C-c @key{SPC} h l p @key{RET}}. Switching from @samp{@@HOME} to
3672@samp{@@WORK} would be done with @kbd{C-c C-c w @key{RET}} or
3673alternatively with @kbd{C-c C-c C-c w}. Adding the non-predefined tag
3674@samp{Sarah} could be done with @kbd{C-c C-c @key{TAB} S a r a h
3675@key{RET} @key{RET}}.
3676
3677If you find that most of the time, you need only a single keypress to
3678modify your list of tags, set the variable
3679@code{org-fast-tag-selection-single-key}. Then you no longer have to
3680press @key{RET} to exit fast tag selection - it will immediately exit
3681after the first change. If you then occasionally need more keys, press
3682@kbd{C-c} to turn off auto-exit for the current tag selection process
3683(in effect: start selection with @kbd{C-c C-c C-c} instead of @kbd{C-c
3684C-c}). If you set the variable to the value @code{expert}, the special
3685window is not even shown for single-key tag selection, it comes up only
3686when you press an extra @kbd{C-c}.
3687
3688@node Tag searches, , Setting tags, Tags
3689@section Tag searches
3690@cindex tag searches
3691@cindex searching for tags
3692
3693Once a tags system has been set up, it can be used to collect related
3694information into special lists.
3695
3696@table @kbd
3697@kindex C-c \
3698@item C-c \
3699Create a sparse tree with all headlines matching a tags search. With a
3700@kbd{C-u} prefix argument, ignore headlines that are not a TODO line.
3701@kindex C-c a m
3702@item C-c a m
3703Create a global list of tag matches from all agenda files.
3704@xref{Matching headline tags}.
3705@kindex C-c a M
3706@item C-c a M
3707Create a global list of tag matches from all agenda files, but check
3708only TODO items and force checking subitems (see variable
3709@code{org-tags-match-list-sublevels}).
3710@end table
3711
3712@cindex Boolean logic, for tag searches
3713A @i{tags} search string can use Boolean operators @samp{&} for AND and
3714@samp{|} for OR. @samp{&} binds more strongly than @samp{|}.
3715Parenthesis are currently not implemented. A tag may also be preceded
3716by @samp{-}, to select against it, and @samp{+} is syntactic sugar for
3717positive selection. The AND operator @samp{&} is optional when @samp{+}
3718or @samp{-} is present. Examples:
3719
3720@table @samp
3721@item +WORK-BOSS
3722Select headlines tagged @samp{:WORK:}, but discard those also tagged
3723@samp{:BOSS:}.
3724@item WORK|LAPTOP
3725Selects lines tagged @samp{:WORK:} or @samp{:LAPTOP:}.
3726@item WORK|LAPTOP&NIGHT
3727Like before, but require the @samp{:LAPTOP:} lines to be tagged also
3728@samp{NIGHT}.
3729@end table
3730
3731@cindex TODO keyword matching, with tags search
3732If you are using multi-state TODO keywords (@pxref{TODO extensions}), it
3733can be useful to also match on the TODO keyword. This can be done by
3734adding a condition after a slash to a tags match. The syntax is similar
3735to the tag matches, but should be applied with consideration: For
3736example, a positive selection on several TODO keywords can not
3737meaningfully be combined with boolean AND. However, @emph{negative
3738selection} combined with AND can be meaningful. To make sure that only
3739lines are checked that actually have any TODO keyword, use @kbd{C-c a
3740M}, or equivalently start the todo part after the slash with @samp{!}.
3741Examples:
3742
3743@table @samp
3744@item WORK/WAITING
3745Select @samp{:WORK:}-tagged TODO lines with the specific TODO
3746keyword @samp{WAITING}.
3747@item WORK/!-WAITING-NEXT
3748Select @samp{:WORK:}-tagged TODO lines that are neither @samp{WAITING}
3749nor @samp{NEXT}
3750@item WORK/+WAITING|+NEXT
3751Select @samp{:WORK:}-tagged TODO lines that are either @samp{WAITING} or
3752@samp{NEXT}.
3753@end table
3754
3755@cindex regular expressions, with tags search
3756Any element of the tag/todo match can be a regular expression - in this
3757case it must be enclosed in curly braces. For example,
3758@samp{WORK+@{^BOSS.*@}} matches headlines that contain the tag
3759@samp{WORK} and any tag @i{starting} with @samp{BOSS}.
3760
3761@cindex level, require for tags match
3762You can also require a headline to be of a certain level, by writing
3763instead of any TAG an expression like @samp{LEVEL=3}. For example, a
3764search @samp{+LEVEL=3+BOSS/-DONE} lists all level three headlines that
3765have the tag BOSS and are @emph{not} marked with the todo keyword DONE.
3766
3767@node Agenda views, Embedded LaTeX, Tags, Top
3768@chapter Agenda Views 3781@chapter Agenda Views
3769@cindex agenda views 3782@cindex agenda views
3770 3783
@@ -5578,8 +5591,8 @@ separator line will be formatted as table header fields.
5578@item 5591@item
5579If a headline starts with the word @samp{QUOTE}, the text below the 5592If a headline starts with the word @samp{QUOTE}, the text below the
5580headline will be typeset as fixed-width, to allow quoting of computer 5593headline will be typeset as fixed-width, to allow quoting of computer
5581codes etc. Lines starting with @samp{:} are also typeset in 5594codes etc. Lines starting with @samp{:} are also typeset in fixed-width
5582fixed-width font. 5595font.
5583@table @kbd 5596@table @kbd
5584@kindex C-c : 5597@kindex C-c :
5585@item C-c : 5598@item C-c :