+@table @kbd
+@kindex C-c C-c
+@item C-c C-c
+@cindex completion, of tags
+Enter new tags for the current headline. Org-mode will either offer
+completion or a special single-key interface for setting tags, see
+below. After pressing @key{RET}, the tags will be inserted and aligned
+to @code{org-tags-column}. When called with a @kbd{C-u} prefix, all
+tags in the current buffer will be aligned to that column, just to make
+things look nice. TAGS are automatically realigned after promotion,
+demotion, and TODO state changes (@pxref{TODO basics}).
+@end table
+
+Org will support tag insertion based on a @emph{list of tags}. By
+default this list is constructed dynamically, containing all tags
+currently used in the buffer. You may also globally specify a hard list
+of tags with the variable @code{org-tag-alist}. Finally you can set
+the default tags for a given file with lines like
+
+@example
+#+TAGS: @@WORK @@HOME @@TENNISCLUB
+#+TAGS: Laptop Car PC Sailboat
+@end example
+
+If you have globally defined your preferred set of tags using the
+variable @code{org-tag-alist}, but would like to use a dynamic tag list
+in a specific file: Just add an empty TAGS option line to that file:
+
+@example
+#+TAGS:
+@end example
+
+The default support method for entering tags is minibuffer completion.
+However, Org-mode also implements a much better method: @emph{fast tag
+selection}. This method allows to select and deselect tags with a
+single key per tag. To function efficiently, you should assign unique
+keys to most tags. This can be done globally with
+
+@lisp
+(setq org-tag-alist '(("@@WORK" . ?w) ("@@HOME" . ?h) ("Laptop" . ?l)))
+@end lisp
+
+@noindent or on a per-file basis with
+
+@example
+#+TAGS: @@WORK(w) @@HOME(h) @@TENNISCLUB(t) Laptop(l) PC(p)
+@end example
+
+@noindent
+You can also group together tags that are mutually exclusive. With
+curly braces@footnote{In @code{org-mode-alist} use
+@code{'(:startgroup)} and @code{'(:endgroup)}, respectively. Several
+groups are allowed.}
+
+@example
+#+TAGS: @{ @@WORK(w) @@HOME(h) @@TENNISCLUB(t) @} Laptop(l) PC(p)
+@end example
+
+@noindent you indicate that at most one of @samp{@@WORK}, @samp{@@HOME},
+and @samp{@@TENNISCLUB} should be selected.
+
+@noindent Don't forget to press @kbd{C-c C-c} with the cursor in one of
+these lines to activate any changes.
+
+If at least one tag has a selection key, pressing @kbd{C-c C-c} will
+automatically present you with a special interface, listing inherited
+tags, the tags of the current headline, and a list of all legal tags
+with corresponding keys@footnote{Keys will automatically be assigned to
+tags which have no configured keys.}. In this interface, you can use
+the following keys:
+
+@table @kbd
+@item a-z...
+Pressing keys assigned to tags will add or remove them from the list of
+tags in the current line. Selecting a tag in a group of mutually
+exclusive tags will turn off any other tags from that group.
+@kindex @key{TAB}
+@item @key{TAB}
+Enter a tag in the minibuffer, even if the tag is not in the predefined
+list. You will be able to complete on all tags present in the buffer.
+@kindex @key{SPC}
+@item @key{SPC}
+Clear all tags for this line.
+@kindex @key{RET}
+@item @key{RET}
+Accept the modified set.
+@item C-g
+Abort without installing changes.
+@item q
+If @kbd{q} is not assigned to a tag, it aborts like @kbd{C-g}.
+@item !
+Turn of groups of mutually exclusive tags. Use this to (as an
+exception) assign several tags from such a group.
+@item C-c
+Toggle auto-exit after the next change (see below).
+@end table
+
+@noindent
+This method lets you assign tags to a headline with very few keys. With
+the above setup, you could clear the current tags and set @samp{@@HOME},
+@samp{Laptop} and @samp{PC} tags with just the following keys: @kbd{C-c
+C-c @key{SPC} h l p @key{RET}}. Switching from @samp{@@HOME} to
+@samp{@@WORK} would be done with @kbd{C-c C-c w @key{RET}} or
+alternatively with @kbd{C-c C-c C-c w}. Adding the non-predefined tag
+@samp{Sarah} could be done with @kbd{C-c C-c @key{TAB} S a r a h
+@key{RET} @key{RET}}.
+
+If you find that most of the time, you need only a single keypress to
+modify your list of tags, set the variable
+@code{org-fast-tag-selection-single-key}. Then you no longer have to
+press @key{RET} to exit fast tag selection - it will immediately exit
+after the first change. If you then occasionally need more keys, press
+@kbd{C-c} to turn off auto-exit for the current tag selection process.
+
+@node Tag searches, , Setting tags, Tags
+@section Tag searches
+@cindex tag searches
+@cindex searching for tags
+
+Once a tags system has been set up, it can be used to collect related
+information into special lists.
+
+@table @kbd
+@kindex C-c \
+@item C-c \
+Create a sparse tree with all headlines matching a tags search.
+@kindex C-c a m
+@item C-c a m
+Create a global list of tag matches from all agenda files.
+@xref{Matching headline tags}.
+@kindex C-c a M
+@item C-c a M
+Create a global list of tag matches from all agenda files, but check
+only TODO items and force checking subitems (see variable
+@code{org-tags-match-list-sublevels}).
+@end table
+
+@cindex Boolean logic, for tag searches
+A @i{tags} search string can use Boolean operators @samp{&} for AND and
+@samp{|} for OR. @samp{&} binds more strongly than @samp{|}.
+Parenthesis are currently not implemented. A tag may also be preceded
+by @samp{-}, to select against it, and @samp{+} is syntactic sugar for
+positive selection. The AND operator @samp{&} is optional when @samp{+}
+or @samp{-} is present. Examples:
+
+@table @samp
+@item +WORK-BOSS
+Select all headlines that are tagged @samp{:WORK:}, but discard those also tagged
+@samp{:BOSS:}.
+@item WORK|LAPTOP
+Selects lines tagged @samp{:WORK:} or @samp{:LAPTOP:}.
+@item WORK|LAPTOP&NIGHT
+Like the previous example, but require the @samp{:LAPTOP:} lines to be
+tagged also @samp{NIGHT}.
+@end table
+
+@cindex TODO keyword matching, with tags search
+If you are using multi-state TODO keywords (@pxref{TODO extensions}), it
+can be useful to also match on the TODO keyword. This can be done by
+adding a condition after a slash to a tags match. The syntax is similar
+to the tag matches, but should be applied with consideration: For
+example, a positive selection on several TODO keywords can not
+meaningfully be combined with boolean AND. However, @emph{negative
+selection} combined with AND can be meaningful. Examples:
+
+@table @samp
+@item WORK/WAITING
+Select @samp{:WORK:}-tagged TODO lines with the specific TODO
+keyword @samp{WAITING}.
+@item WORK/-WAITING-NEXT
+Select @samp{:WORK:}-tagged TODO lines that are neither @samp{WAITING}
+nor @samp{NEXT}
+@item WORK/+WAITING|+NEXT
+Select @samp{:WORK:}-tagged TODO lines that are either @samp{WAITING} or
+@samp{NEXT}.
+@end table
+
+@node Agenda views, Embedded LaTeX, Tags, Top
+@chapter Agenda Views
+@cindex agenda views
+
+Due to the way Org-mode works, TODO items, time-stamped items, and
+tagged headlines can be scattered throughout a file or even a number of
+files. To get an overview over open action items, or over events that
+are important for a particular date, this information must be collected,
+sorted and displayed in an organized way.
+
+Org-mode can select items based on various criteria, and display them
+in a separate buffer. Five different view types are provided:
+
+@itemize @bullet
+@item
+an @emph{agenda} that is like a calendar and shows information
+for specific dates
+@item
+a @emph{TODO list} that covers all unfinished
+action items,
+@item
+a @emph{tags view} that shows information based on
+the tags associated with headlines in the outline tree,
+@item
+a @emph{timeline view} that shows all events in a single Org-mode file,
+in time-sorted view
+@item
+@emph{custom views} that are special tag and keyword searches and
+combinations of different views.
+@end itemize
+
+@noindent
+The extracted information is displayed in a special @emph{agenda
+buffer}. This buffer is read-only, but provides commands to visit the
+corresponding locations in the original Org-mode files, and even to
+edit these files remotely.
+
+Two variables control how the agenda buffer is displayed and whether the
+window configuration is restored when the agenda exits:
+@code{org-agenda-window-setup} and
+@code{org-agenda-restore-windows-after-quit}.
+
+@menu
+* Agenda files:: Files being searched for agenda information
+* Agenda dispatcher:: Keyboard access to agenda views
+* Weekly/Daily agenda:: The calendar page with current tasks
+* Global TODO list:: All unfinished action items
+* Matching headline tags:: Structured information with fine-tuned search
+* Timeline:: Time-sorted view for single file
+* Presentation and sorting:: How agenda items are prepared for display
+* Agenda commands:: Remote editing of org trees
+* Custom agenda views:: Defining special searches and views
+@end menu
+
+@node Agenda files, Agenda dispatcher, Agenda views, Agenda views
+@section Agenda files
+@cindex agenda files
+@cindex files for agenda
+
+The information to be shown is collected from all @emph{agenda files},
+the files listed in the variable @code{org-agenda-files}@footnote{If the
+value of that variable is not a list, but a single file name, then the
+list of agenda files will be maintained in that external file.}. Thus even
+if you only work with a single Org-mode file, this file should be put
+into that list@footnote{When using the dispatcher, pressing @kbd{1}
+before selecting a command will actually limit the command to the
+current file, and ignore @code{org-agenda-files} until the next
+dispatcher command.}. You can customize @code{org-agenda-files}, but
+the easiest way to maintain it is through the following commands
+
+@cindex files, adding to agenda list
+@table @kbd
+@kindex C-c [
+@item C-c [
+Add current file to the list of agenda files. The file is added to
+the front of the list. If it was already in the list, it is moved to
+the front. With prefix arg, file is added/moved to the end.
+@kindex C-c ]
+@item C-c ]
+Remove current file from the list of agenda files.
+@kindex C-,
+@item C-,
+Cycle through agenda file list, visiting one file after the other.
+@end table
+
+@noindent
+The Org menu contains the current list of files and can be used
+to visit any of them.
+
+@node Agenda dispatcher, Weekly/Daily agenda, Agenda files, Agenda views
+@section The agenda dispatcher
+@cindex agenda dispatcher
+@cindex dispatching agenda commands
+The views are created through a dispatcher that should be bound to a
+global key, for example @kbd{C-c a} (@pxref{Installation}). In the
+following we will assume that @kbd{C-c a} is indeed how the dispatcher
+is accessed and list keyboard access to commands accordingly. After
+pressing @kbd{C-c a}, an additional letter is required to execute a
+command. The dispatcher offers the following default commands:
+@table @kbd
+@item a
+Create the calendar-like agenda (@pxref{Weekly/Daily agenda}).
+@item t / T
+Create a list of all TODO items (@pxref{Global TODO list}).
+@item m / M
+Create a list of headlines matching a TAGS expression (@pxref{Matching
+headline tags}).
+@item L
+Create the timeline view for the current buffer (@pxref{Timeline}).
+@item 1
+Restrict an agenda command to the current buffer. After pressing
+@kbd{1}, you still need to press the character selecting the command.
+@item 0
+If there is an active region, restrict the following agenda command to
+the region. Otherwise, restrict it to the current subtree. After
+pressing @kbd{0}, you still need to press the character selecting the
+command.
+@end table
+
+You can also define custom commands that will be accessible through the
+dispatcher, just like the default commands. This includes the
+possibility to create extended agenda buffers that contain several
+blocks together, for example the weekly agenda, the global TODO list and
+a number of special tags matches. @xref{Custom agenda views}.
+
+@node Weekly/Daily agenda, Global TODO list, Agenda dispatcher, Agenda views
+@section The weekly/daily agenda
+@cindex agenda
+@cindex weekly agenda
+@cindex daily agenda
+
+The purpose of the weekly/daily @emph{agenda} is to act like a page of a
+paper agenda, showing all the tasks for the current week or day.
+
+@table @kbd
+@cindex org-agenda, command
+@kindex C-c a a
+@item C-c a a
+Compile an agenda for the current week from a list of org files. The
+agenda shows the entries for each day. With a @kbd{C-u} prefix (or
+when the variable @code{org-agenda-include-all-todo} is @code{t}), all
+unfinished TODO items (including those without a date) are also listed at
+the beginning of the buffer, before the first date.@*
+@end table
+
+Remote editing from the agenda buffer means, for example, that you can
+change the dates of deadlines and appointments from the agenda buffer.
+The commands available in the Agenda buffer are listed in @ref{Agenda
+commands}.
+
+@menu
+* Calendar/Diary integration:: Integrating Anniversaries and more
+@end menu
+
+
+@node Calendar/Diary integration, , Weekly/Daily agenda, Weekly/Daily agenda
+@subsection Calendar/Diary integration
+@cindex calendar integration
+@cindex diary integration
+
+Emacs contains the calendar and diary by Edward M. Reingold. The
+calendar displays a three-month calendar with holidays from different
+countries and cultures. The diary allows you to keep track of
+anniversaries, lunar phases, sunrise/set, recurrent appointments
+(weekly, monthly) and more. In this way, it is quite complementary to
+Org-mode. It can be very useful to combine output from Org-mode with
+the diary.
+
+In order to include entries from the Emacs diary into Org-mode's
+agenda, you only need to customize the variable
+
+@lisp
+(setq org-agenda-include-diary t)
+@end lisp
+
+@noindent After that, everything will happen automatically. All diary
+entries including holidays, anniversaries etc will be included in the
+agenda buffer created by Org-mode. @key{SPC}, @key{TAB}, and
+@key{RET} can be used from the agenda buffer to jump to the diary
+file in order to edit existing diary entries. The @kbd{i} command to
+insert new entries for the current date works in the agenda buffer, as
+well as the commands @kbd{S}, @kbd{M}, and @kbd{C} to display
+Sunrise/Sunset times, show lunar phases and to convert to other
+calendars, respectively. @kbd{c} can be used to switch back and forth
+between calendar and agenda.
+
+
+@node Global TODO list, Matching headline tags, Weekly/Daily agenda, Agenda views
+@section The global TODO list
+@cindex global TODO list
+@cindex TODO list, global
+
+The global TODO list contains all unfinished TODO items, formatted and
+collected into a single place.
+
+@table @kbd
+@kindex C-c a t
+@item C-c a t
+Show the global TODO list. This collects the TODO items from all
+agenda files (@pxref{Agenda views}) into a single buffer. The buffer is in
+@code{agenda-mode}, so there are commands to examine and manipulate
+the TODO entries directly from that buffer (@pxref{Agenda commands}).
+@kindex C-c a T
+@item C-c a T
+@cindex TODO keyword matching
+Like the above, but allows selection of a specific TODO keyword. You can
+also do this by specifying a prefix argument to @kbd{C-c a t}. With a
+@kbd{C-u} prefix you are prompted for a keyword. With a numeric
+prefix, the Nth keyword in @code{org-todo-keywords} is selected.
+@kindex r
+The @kbd{r} key in the agenda buffer regenerates it, and you can give
+a prefix argument to this command to change the selected TODO keyword,
+for example @kbd{3 r}. If you often need a search for a specific
+keyword, define a custom command for it (@pxref{Agenda dispatcher}).@*
+Matching specific TODO keywords can also be done as part of a tags
+search (@pxref{Tag searches}).
+@end table
+
+Remote editing of TODO items means that you can change the state of a
+TODO entry with a single key press. The commands available in the
+TODO list are described in @ref{Agenda commands}.
+
+@cindex sublevels, inclusion into todo list
+Normally the global todo list simply shows all headlines with TODO
+keywords. This list can become very long. There are two ways to keep
+it more compact:
+@itemize @minus
+@item
+Some people view a TODO item that has been @emph{scheduled} for
+execution (@pxref{Time stamps}) as no longer @emph{open}. Configure the
+variable @code{org-agenda-todo-ignore-scheduled} to exclude scheduled
+items from the global TODO list.
+@item
+TODO items may have sublevels to break up the task into subtasks. In
+such cases it may be enough to list only the highest level TODO headline
+and omit the sublevels from the global list. Configure the variable
+@code{org-agenda-todo-list-sublevels} to get this behavior.
+@end itemize
+
+@node Matching headline tags, Timeline, Global TODO list, Agenda views
+@section Matching headline tags
+@cindex matching, of tags
+@cindex tags view
+
+If headlines in the agenda files are marked with @emph{tags}
+(@pxref{Tags}), you can select headlines based on the tags that apply
+to them and collect them into an agenda buffer.
+
+@table @kbd
+@kindex C-c a m
+@item C-c a m
+Produce a list of all headlines that match a given set of tags. The
+command prompts for a selection criterion, which is a boolean logic
+expression with tags, like @samp{+WORK+URGENT-WITHBOSS} or
+@samp{WORK|HOME} (@pxref{Tags}). If you often need a specific search,
+define a custom command for it (@pxref{Agenda dispatcher}).
+@kindex C-c a M
+@item C-c a M
+Like @kbd{C-c a m}, but only select headlines that are also TODO items
+and force checking subitems (see variable
+@code{org-tags-match-list-sublevels}). Matching specific todo keywords
+together with a tags match is also possible, see @ref{Tag searches}.
+@end table
+
+The commands available in the tags list are described in @ref{Agenda
+commands}.
+
+@node Timeline, Presentation and sorting, Matching headline tags, Agenda views
+@section Timeline for a single file
+@cindex timeline, single file
+@cindex time-sorted view
+
+The timeline summarizes all time-stamped items from a single Org-mode
+file in a @emph{time-sorted view}. The main purpose of this command is
+to give an overview over events in a project.
+
+@table @kbd
+@kindex C-a a L
+@item C-c a L
+Show a time-sorted view of the org file, with all time-stamped items.
+When called with a @kbd{C-u} prefix, all unfinished TODO entries
+(scheduled or not) are also listed under the current date.
+@end table
+
+@noindent
+The commands available in the timeline buffer are listed in
+@ref{Agenda commands}.
+
+
+@node Presentation and sorting, Agenda commands, Timeline, Agenda views
+@section Presentation and sorting
+@cindex presentation, of agenda items
+
+Before displaying items in an agenda view, Org-mode visually prepares
+the items and sorts them. Each item occupies a single line. The line
+starts with a @emph{prefix} that contains the @emph{category}
+(@pxref{Categories}) of the item and other important information. You can
+customize the prefix using the option @code{org-agenda-prefix-format}.
+The prefix is followed by a cleaned-up version of the outline headline
+associated with the item.
+
+@menu
+* Categories:: Not all tasks are equal
+* Time-of-day specifications:: How the agenda knows the time
+* Sorting of agenda items:: The order of things
+@end menu
+
+@node Categories, Time-of-day specifications, Presentation and sorting, Presentation and sorting
+@subsection Categories
+
+@cindex category
+The category is a broad label assigned to each agenda item. By default,
+the category is simply derived from the file name, but you can also
+specify it with a special line in the buffer, like this:
+
+@example
+#+CATEGORY: Thesis
+@end example
+
+If there are several such lines in a file, each specifies the category
+for the text below it (but the first category also applies to any text
+before the first CATEGORY line). The display in the agenda buffer looks
+best if the category is not longer than 10 characters.
+
+@node Time-of-day specifications, Sorting of agenda items, Categories, Presentation and sorting
+@subsection Time-of-Day Specifications
+@cindex time-of-day specification
+
+Org-mode checks each agenda item for a time-of-day specification. The
+time can be part of the time stamp that triggered inclusion into the
+agenda, for example as in @w{@samp{<2005-05-10 Tue 19:00>}}. Time
+ranges can be specified with two time stamps, like
+@c
+@w{@samp{<2005-05-10 Tue 20:30>--<2005-05-10 Tue 22:15>}}.
+
+In the headline of the entry itself, a time(range) may also appear as
+plain text (like @samp{12:45} or a @samp{8:30-1pm}. If the agenda
+integrates the Emacs diary (@pxref{Calendar/Diary integration}), time
+specifications in diary entries are recognized as well.
+
+For agenda display, Org-mode extracts the time and displays it in a
+standard 24 hour format as part of the prefix. The example times in
+the previous paragraphs would end up in the agenda like this:
+
+@example
+ 8:30-13:00 Arthur Dent lies in front of the bulldozer
+ 12:45...... Ford Prefect arrives and takes Arthur to the pub
+ 19:00...... The Vogon reads his poem
+ 20:30-22:15 Marwin escorts the Hitchhikers to the bridge
+@end example
+
+@cindex time grid
+If the agenda is in single-day mode, or for the display of today, the
+timed entries are embedded in a time grid, like
+
+@example
+ 8:00...... ------------------
+ 8:30-13:00 Arthur Dent lies in front of the bulldozer
+ 10:00...... ------------------
+ 12:00...... ------------------
+ 12:45...... Ford Prefect arrives and takes Arthur to the pub
+ 14:00...... ------------------
+ 16:00...... ------------------
+ 18:00...... ------------------
+ 19:00...... The Vogon reads his poem
+ 20:00...... ------------------
+ 20:30-22:15 Marwin escorts the Hitchhikers to the bridge
+@end example
+
+The time grid can be turned on and off with the variable
+@code{org-agenda-use-time-grid}, and can be configured with
+@code{org-agenda-time-grid}.
+
+@node Sorting of agenda items, , Time-of-day specifications, Presentation and sorting