1 ;;; org.el --- Outline-based notes management and organizer
2 ;; Carstens outline-mode for keeping track of everything.
3 ;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
4 ;; Free Software Foundation, Inc.
6 ;; Author: Carsten Dominik <carsten at orgmode dot org>
7 ;; Keywords: outlines, hypermedia, calendar, wp
8 ;; Homepage: http://orgmode.org
11 ;; This file is part of GNU Emacs.
13 ;; GNU Emacs is free software: you can redistribute it and/or modify
14 ;; it under the terms of the GNU General Public License as published by
15 ;; the Free Software Foundation, either version 3 of the License, or
16 ;; (at your option) any later version.
18 ;; GNU Emacs is distributed in the hope that it will be useful,
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;; GNU General Public License for more details.
23 ;; You should have received a copy of the GNU General Public License
24 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
25 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
29 ;; Org-mode is a mode for keeping notes, maintaining ToDo lists, and doing
30 ;; project planning with a fast and effective plain-text system.
32 ;; Org-mode develops organizational tasks around NOTES files that contain
33 ;; information about projects as plain text. Org-mode is implemented on
34 ;; top of outline-mode, which makes it possible to keep the content of
35 ;; large files well structured. Visibility cycling and structure editing
36 ;; help to work with the tree. Tables are easily created with a built-in
37 ;; table editor. Org-mode supports ToDo items, deadlines, time stamps,
38 ;; and scheduling. It dynamically compiles entries into an agenda that
39 ;; utilizes and smoothly integrates much of the Emacs calendar and diary.
40 ;; Plain text URL-like links connect to websites, emails, Usenet
41 ;; messages, BBDB entries, and any files related to the projects. For
42 ;; printing and sharing of notes, an Org-mode file can be exported as a
43 ;; structured ASCII file, as HTML, or (todo and agenda items only) as an
44 ;; iCalendar file. It can also serve as a publishing tool for a set of
47 ;; Installation and Activation
48 ;; ---------------------------
49 ;; See the corresponding sections in the manual at
51 ;; http://orgmode.org/org.html#Installation
55 ;; The documentation of Org-mode can be found in the TeXInfo file. The
56 ;; distribution also contains a PDF version of it. At the homepage of
57 ;; Org-mode, you can read the same text online as HTML. There is also an
58 ;; excellent reference card made by Philip Rooke. This card can be found
59 ;; in the etc/ directory of Emacs 22.
61 ;; A list of recent changes can be found at
62 ;; http://orgmode.org/Changes.html
66 (defvar org-inhibit-highlight-removal nil) ; dynamically scoped param
67 (defvar org-table-formula-constants-local nil
68 "Local version of `org-table-formula-constants'.")
69 (make-variable-buffer-local 'org-table-formula-constants-local)
71 ;;;; Require other packages
79 ;; Emacs 22 calendar compatibility: Make sure the new variables are available
80 (when (fboundp 'defvaralias)
81 (unless (boundp 'calendar-view-holidays-initially-flag)
82 (defvaralias 'calendar-view-holidays-initially-flag
83 'view-calendar-holidays-initially))
84 (unless (boundp 'calendar-view-diary-initially-flag)
85 (defvaralias 'calendar-view-diary-initially-flag
86 'view-diary-entries-initially))
87 (unless (boundp 'diary-fancy-buffer)
88 (defvaralias 'diary-fancy-buffer 'fancy-diary-buffer)))
90 (require 'outline) (require 'noutline)
91 ;; Other stuff we need.
93 (unless (fboundp 'time-subtract) (defalias 'time-subtract 'subtract-time))
98 (require 'org-entities)
102 (require 'org-pcomplete)
104 (require 'org-footnote)
106 (declare-function org-inlinetask-at-task-p "org-inlinetask" ())
107 (declare-function org-inlinetask-outline-regexp "org-inlinetask" ())
108 (declare-function org-inlinetask-toggle-visibility "org-inlinetask" ())
109 (declare-function org-pop-to-buffer-same-window "org-compat" (&optional buffer-or-name norecord label))
110 (declare-function org-at-clock-log-p "org-clock" ())
111 (declare-function org-clock-timestamps-up "org-clock" ())
112 (declare-function org-clock-timestamps-down "org-clock" ())
123 ;; load languages based on value of `org-babel-load-languages'
124 (defvar org-babel-load-languages)
126 (defun org-babel-do-load-languages (sym value)
127 "Load the languages defined in `org-babel-load-languages'."
128 (set-default sym value)
130 (let ((active (cdr pair)) (lang (symbol-name (car pair))))
133 (require (intern (concat "ob-" lang))))
135 (funcall 'fmakunbound
136 (intern (concat "org-babel-execute:" lang)))
137 (funcall 'fmakunbound
138 (intern (concat "org-babel-expand-body:" lang)))))))
139 org-babel-load-languages))
141 (defcustom org-babel-load-languages '((emacs-lisp . t))
142 "Languages which can be evaluated in Org-mode buffers.
143 This list can be used to load support for any of the languages
144 below, note that each language will depend on a different set of
145 system executables and/or Emacs modes. When a language is
146 \"loaded\", then code blocks in that language can be evaluated
147 with `org-babel-execute-src-block' bound by default to C-c
148 C-c (note the `org-babel-no-eval-on-ctrl-c-ctrl-c' variable can
149 be set to remove code block evaluation from the C-c C-c
150 keybinding. By default only Emacs Lisp (which has no
151 requirements) is loaded."
153 :set 'org-babel-do-load-languages
154 :type '(alist :tag "Babel Languages"
157 (const :tag "Awk" awk)
160 (const :tag "Asymptote" asymptote)
161 (const :tag "Calc" calc)
162 (const :tag "Clojure" clojure)
163 (const :tag "CSS" css)
164 (const :tag "Ditaa" ditaa)
165 (const :tag "Dot" dot)
166 (const :tag "Emacs Lisp" emacs-lisp)
167 (const :tag "Gnuplot" gnuplot)
168 (const :tag "Haskell" haskell)
169 (const :tag "Java" java)
170 (const :tag "Javascript" js)
171 (const :tag "Latex" latex)
172 (const :tag "Ledger" ledger)
173 (const :tag "Lilypond" lilypond)
174 (const :tag "Maxima" maxima)
175 (const :tag "Matlab" matlab)
176 (const :tag "Mscgen" mscgen)
177 (const :tag "Ocaml" ocaml)
178 (const :tag "Octave" octave)
179 (const :tag "Org" org)
180 (const :tag "Perl" perl)
181 (const :tag "PlantUML" plantuml)
182 (const :tag "Python" python)
183 (const :tag "Ruby" ruby)
184 (const :tag "Sass" sass)
185 (const :tag "Scheme" scheme)
186 (const :tag "Screen" screen)
187 (const :tag "Shell Script" sh)
188 (const :tag "Sql" sql)
189 (const :tag "Sqlite" sqlite))
190 :value-type (boolean :tag "Activate" :value t)))
192 ;;;; Customization variables
193 (defcustom org-clone-delete-id nil
194 "Remove ID property of clones of a subtree.
195 When non-nil, clones of a subtree don't inherit the ID property.
196 Otherwise they inherit the ID property with a new unique
203 (defconst org-version "7.6"
204 "The version number of the file org.el.")
206 (defun org-version (&optional here)
207 "Show the org-mode version in the echo area.
208 With prefix arg HERE, insert it at point."
210 (let* ((origin default-directory)
211 (version org-version)
213 (dir (concat (file-name-directory (locate-library "org")) "../" )))
214 (when (and (file-exists-p (expand-file-name ".git" dir))
215 (executable-find "git"))
219 (when (eql 0 (shell-command "git describe --abbrev=4 HEAD"))
220 (with-current-buffer "*Shell Command Output*"
221 (goto-char (point-min))
222 (setq git-version (buffer-substring (point) (point-at-eol))))
223 (subst-char-in-string ?- ?. git-version t)
224 (when (string-match "\\S-"
225 (shell-command-to-string
226 "git diff-index --name-only HEAD --"))
227 (setq git-version (concat git-version ".dirty")))
228 (setq version (concat version " (" git-version ")"))))
230 (setq version (format "Org-mode version %s" version))
231 (if here (insert version))
234 ;;; Compatibility constants
236 ;;; The custom variables
239 "Outline-based notes management and organizer."
244 (defcustom org-mode-hook nil
245 "Mode hook for Org-mode, run after the mode was turned on."
249 (defcustom org-load-hook nil
250 "Hook that is run after org.el has been loaded."
254 (defvar org-modules) ; defined below
255 (defvar org-modules-loaded nil
256 "Have the modules been loaded already?")
258 (defun org-load-modules-maybe (&optional force)
259 "Load all extensions listed in `org-modules'."
260 (when (or force (not org-modules-loaded))
262 (condition-case nil (require ext)
263 (error (message "Problems while trying to load feature `%s'" ext))))
265 (setq org-modules-loaded t)))
267 (defun org-set-modules (var value)
268 "Set VAR to VALUE and call `org-load-modules-maybe' with the force flag."
270 (when (featurep 'org)
271 (org-load-modules-maybe 'force)))
273 (when (org-bound-and-true-p org-modules)
274 (let ((a (member 'org-infojs org-modules)))
275 (and a (setcar a 'org-jsinfo))))
277 (defcustom org-modules '(org-bbdb org-bibtex org-docview org-gnus org-info org-jsinfo org-irc org-mew org-mhe org-rmail org-vm org-w3m org-wl)
278 "Modules that should always be loaded together with org.el.
279 If a description starts with <C>, the file is not part of Emacs
280 and loading it will require that you have downloaded and properly installed
281 the org-mode distribution.
283 You can also use this system to load external packages (i.e. neither Org
284 core modules, nor modules from the CONTRIB directory). Just add symbols
285 to the end of the list. If the package is called org-xyz.el, then you need
286 to add the symbol `xyz', and the package must have a call to
290 :set 'org-set-modules
293 (const :tag " bbdb: Links to BBDB entries" org-bbdb)
294 (const :tag " bibtex: Links to BibTeX entries" org-bibtex)
295 (const :tag " crypt: Encryption of subtrees" org-crypt)
296 (const :tag " ctags: Access to Emacs tags with links" org-ctags)
297 (const :tag " docview: Links to doc-view buffers" org-docview)
298 (const :tag " gnus: Links to GNUS folders/messages" org-gnus)
299 (const :tag " id: Global IDs for identifying entries" org-id)
300 (const :tag " info: Links to Info nodes" org-info)
301 (const :tag " jsinfo: Set up Sebastian Rose's JavaScript org-info.js" org-jsinfo)
302 (const :tag " habit: Track your consistency with habits" org-habit)
303 (const :tag " inlinetask: Tasks independent of outline hierarchy" org-inlinetask)
304 (const :tag " irc: Links to IRC/ERC chat sessions" org-irc)
305 (const :tag " mac-message: Links to messages in Apple Mail" org-mac-message)
306 (const :tag " mew Links to Mew folders/messages" org-mew)
307 (const :tag " mhe: Links to MHE folders/messages" org-mhe)
308 (const :tag " protocol: Intercept calls from emacsclient" org-protocol)
309 (const :tag " rmail: Links to RMAIL folders/messages" org-rmail)
310 (const :tag " special-blocks: Turn blocks into LaTeX envs and HTML divs" org-special-blocks)
311 (const :tag " vm: Links to VM folders/messages" org-vm)
312 (const :tag " wl: Links to Wanderlust folders/messages" org-wl)
313 (const :tag " w3m: Special cut/paste from w3m to Org-mode." org-w3m)
314 (const :tag " mouse: Additional mouse support" org-mouse)
315 (const :tag " TaskJuggler: Export tasks to a TaskJuggler project" org-taskjuggler)
317 (const :tag "C annotate-file: Annotate a file with org syntax" org-annotate-file)
318 (const :tag "C bookmark: Org-mode links to bookmarks" org-bookmark)
319 (const :tag "C checklist: Extra functions for checklists in repeated tasks" org-checklist)
320 (const :tag "C choose: Use TODO keywords to mark decisions states" org-choose)
321 (const :tag "C collector: Collect properties into tables" org-collector)
322 (const :tag "C depend: TODO dependencies for Org-mode\n\t\t\t(PARTIALLY OBSOLETE, see built-in dependency support))" org-depend)
323 (const :tag "C drill: Flashcards and spaced repetition for Org-mode" org-drill)
324 (const :tag "C elisp-symbol: Org-mode links to emacs-lisp symbols" org-elisp-symbol)
325 (const :tag "C eshell Support for links to working directories in eshell" org-eshell)
326 (const :tag "C eval: Include command output as text" org-eval)
327 (const :tag "C eval-light: Evaluate inbuffer-code on demand" org-eval-light)
328 (const :tag "C expiry: Expiry mechanism for Org-mode entries" org-expiry)
329 (const :tag "C exp-bibtex: Export citations using BibTeX" org-exp-bibtex)
330 (const :tag "C git-link: Provide org links to specific file version" org-git-link)
331 (const :tag "C interactive-query: Interactive modification of tags query\n\t\t\t(PARTIALLY OBSOLETE, see secondary filtering)" org-interactive-query)
333 (const :tag "C invoice: Help manage client invoices in Org-mode" org-invoice)
335 (const :tag "C jira: Add a jira:ticket protocol to Org-mode" org-jira)
336 (const :tag "C learn: SuperMemo's incremental learning algorithm" org-learn)
337 (const :tag "C mairix: Hook mairix search into Org-mode for different MUAs" org-mairix)
338 (const :tag "C notmuch: Provide org links to notmuch searches or messages" org-notmuch)
339 (const :tag "C mac-iCal Imports events from iCal.app to the Emacs diary" org-mac-iCal)
340 (const :tag "C mac-link-grabber Grab links and URLs from various Mac applications" org-mac-link-grabber)
341 (const :tag "C man: Support for links to manpages in Org-mode" org-man)
342 (const :tag "C mtags: Support for muse-like tags" org-mtags)
343 (const :tag "C odt: OpenDocumentText exporter for Org-mode" org-odt)
344 (const :tag "C panel: Simple routines for us with bad memory" org-panel)
345 (const :tag "C registry: A registry for Org-mode links" org-registry)
346 (const :tag "C org2rem: Convert org appointments into reminders" org2rem)
347 (const :tag "C screen: Visit screen sessions through Org-mode links" org-screen)
348 (const :tag "C secretary: Team management with org-mode" org-secretary)
349 (const :tag "C sqlinsert: Convert Org-mode tables to SQL insertions" orgtbl-sqlinsert)
350 (const :tag "C toc: Table of contents for Org-mode buffer" org-toc)
351 (const :tag "C track: Keep up with Org-mode development" org-track)
352 (const :tag "C velocity Something like Notational Velocity for Org" org-velocity)
353 (const :tag "C wikinodes: CamelCase wiki-like links" org-wikinodes)
354 (repeat :tag "External packages" :inline t (symbol :tag "Package"))))
356 (defcustom org-support-shift-select nil
357 "Non-nil means make shift-cursor commands select text when possible.
359 In Emacs 23, when `shift-select-mode' is on, shifted cursor keys start
360 selecting a region, or enlarge regions started in this way.
361 In Org-mode, in special contexts, these same keys are used for other
362 purposes, important enough to compete with shift selection. Org tries
363 to balance these needs by supporting `shift-select-mode' outside these
364 special contexts, under control of this variable.
366 The default of this variable is nil, to avoid confusing behavior. Shifted
367 cursor keys will then execute Org commands in the following contexts:
368 - on a headline, changing TODO state (left/right) and priority (up/down)
369 - on a time stamp, changing the time
370 - in a plain list item, changing the bullet type
371 - in a property definition line, switching between allowed values
372 - in the BEGIN line of a clock table (changing the time block).
373 Outside these contexts, the commands will throw an error.
375 When this variable is t and the cursor is not in a special context,
376 Org-mode will support shift-selection for making and enlarging regions.
377 To make this more effective, the bullet cycling will no longer happen
378 anywhere in an item line, but only if the cursor is exactly on the bullet.
380 If you set this variable to the symbol `always', then the keys
381 will not be special in headlines, property lines, and item lines, to make
382 shift selection work there as well. If this is what you want, you can
383 use the following alternative commands: `C-c C-t' and `C-c ,' to
384 change TODO state and priority, `C-u C-u C-c C-t' can be used to switch
385 TODO sets, `C-c -' to cycle item bullet types, and properties can be
386 edited by hand or in column view.
388 However, when the cursor is on a timestamp, shift-cursor commands
389 will still edit the time stamp - this is just too good to give up.
391 XEmacs user should have this variable set to nil, because shift-select-mode
395 (const :tag "Never" nil)
396 (const :tag "When outside special context" t)
397 (const :tag "Everywhere except timestamps" always)))
399 (defgroup org-startup nil
400 "Options concerning startup of Org-mode."
404 (defcustom org-startup-folded t
405 "Non-nil means entering Org-mode will switch to OVERVIEW.
406 This can also be configured on a per-file basis by adding one of
407 the following lines anywhere in the buffer:
409 #+STARTUP: fold (or `overview', this is equivalent)
410 #+STARTUP: nofold (or `showall', this is equivalent)
412 #+STARTUP: showeverything"
415 (const :tag "nofold: show all" nil)
416 (const :tag "fold: overview" t)
417 (const :tag "content: all headlines" content)
418 (const :tag "show everything, even drawers" showeverything)))
420 (defcustom org-startup-truncated t
421 "Non-nil means entering Org-mode will set `truncate-lines'.
422 This is useful since some lines containing links can be very long and
423 uninteresting. Also tables look terrible when wrapped."
427 (defcustom org-startup-indented nil
428 "Non-nil means turn on `org-indent-mode' on startup.
429 This can also be configured on a per-file basis by adding one of
430 the following lines anywhere in the buffer:
434 :group 'org-structure
436 (const :tag "Not" nil)
437 (const :tag "Globally (slow on startup in large files)" t)))
439 (defcustom org-use-sub-superscripts t
440 "Non-nil means interpret \"_\" and \"^\" for export.
441 When this option is turned on, you can use TeX-like syntax for sub- and
442 superscripts. Several characters after \"_\" or \"^\" will be
443 considered as a single item - so grouping with {} is normally not
444 needed. For example, the following things will be parsed as single
445 sub- or superscripts.
447 10^24 or 10^tau several digits will be considered 1 item.
448 10^-12 or 10^-tau a leading sign with digits or a word
449 x^2-y^3 will be read as x^2 - y^3, because items are
450 terminated by almost any nonword/nondigit char.
451 x_{i^2} or x^(2-i) braces or parenthesis do grouping.
453 Still, ambiguity is possible - so when in doubt use {} to enclose the
454 sub/superscript. If you set this variable to the symbol `{}',
455 the braces are *required* in order to trigger interpretations as
456 sub/superscript. This can be helpful in documents that need \"_\"
457 frequently in plain text.
459 Not all export backends support this, but HTML does.
461 This option can also be set with the +OPTIONS line, e.g. \"^:nil\"."
463 :group 'org-export-translation
465 (const :tag "Always interpret" t)
466 (const :tag "Only with braces" {})
467 (const :tag "Never interpret" nil)))
469 (if (fboundp 'defvaralias)
470 (defvaralias 'org-export-with-sub-superscripts 'org-use-sub-superscripts))
473 (defcustom org-startup-with-beamer-mode nil
474 "Non-nil means turn on `org-beamer-mode' on startup.
475 This can also be configured on a per-file basis by adding one of
476 the following lines anywhere in the buffer:
482 (defcustom org-startup-align-all-tables nil
483 "Non-nil means align all tables when visiting a file.
484 This is useful when the column width in tables is forced with <N> cookies
485 in table fields. Such tables will look correct only after the first re-align.
486 This can also be configured on a per-file basis by adding one of
487 the following lines anywhere in the buffer:
493 (defcustom org-startup-with-inline-images nil
494 "Non-nil means show inline images when loading a new Org file.
495 This can also be configured on a per-file basis by adding one of
496 the following lines anywhere in the buffer:
497 #+STARTUP: inlineimages
498 #+STARTUP: noinlineimages"
502 (defcustom org-insert-mode-line-in-empty-file nil
503 "Non-nil means insert the first line setting Org-mode in empty files.
504 When the function `org-mode' is called interactively in an empty file, this
505 normally means that the file name does not automatically trigger Org-mode.
506 To ensure that the file will always be in Org-mode in the future, a
507 line enforcing Org-mode will be inserted into the buffer, if this option
512 (defcustom org-replace-disputed-keys nil
513 "Non-nil means use alternative key bindings for some keys.
514 Org-mode uses S-<cursor> keys for changing timestamps and priorities.
515 These keys are also used by other packages like shift-selection-mode'
516 \(built into Emacs 23), `CUA-mode' or `windmove.el'.
517 If you want to use Org-mode together with one of these other modes,
518 or more generally if you would like to move some Org-mode commands to
519 other keys, set this variable and configure the keys with the variable
522 This option is only relevant at load-time of Org-mode, and must be set
523 *before* org.el is loaded. Changing it requires a restart of Emacs to
528 (defcustom org-use-extra-keys nil
529 "Non-nil means use extra key sequence definitions for certain commands.
530 This happens automatically if you run XEmacs or if `window-system'
531 is nil. This variable lets you do the same manually. You must
532 set it before loading org.
534 Example: on Carbon Emacs 22 running graphically, with an external
535 keyboard on a Powerbook, the default way of setting M-left might
536 not work for either Alt or ESC. Setting this variable will make
541 (if (fboundp 'defvaralias)
542 (defvaralias 'org-CUA-compatible 'org-replace-disputed-keys))
544 (defcustom org-disputed-keys
545 '(([(shift up)] . [(meta p)])
546 ([(shift down)] . [(meta n)])
547 ([(shift left)] . [(meta -)])
548 ([(shift right)] . [(meta +)])
549 ([(control shift right)] . [(meta shift +)])
550 ([(control shift left)] . [(meta shift -)]))
551 "Keys for which Org-mode and other modes compete.
552 This is an alist, cars are the default keys, second element specifies
553 the alternative to use when `org-replace-disputed-keys' is t.
555 Keys can be specified in any syntax supported by `define-key'.
556 The value of this option takes effect only at Org-mode's startup,
557 therefore you'll have to restart Emacs to apply it after changing."
562 "Select key according to `org-replace-disputed-keys' and `org-disputed-keys'.
563 Or return the original if not disputed.
564 Also apply the translations defined in `org-xemacs-key-equivalents'."
565 (when org-replace-disputed-keys
566 (let* ((nkey (key-description key))
567 (x (org-find-if (lambda (x)
568 (equal (key-description (car x)) nkey))
570 (setq key (if x (cdr x) key))))
571 (when (featurep 'xemacs)
572 (setq key (or (cdr (assoc key org-xemacs-key-equivalents)) key)))
575 (defun org-find-if (predicate seq)
578 (if (funcall predicate (car seq))
579 (throw 'exit (car seq))
582 (defun org-defkey (keymap key def)
583 "Define a key, possibly translated, as returned by `org-key'."
584 (define-key keymap (org-key key) def))
586 (defcustom org-ellipsis nil
587 "The ellipsis to use in the Org-mode outline.
588 When nil, just use the standard three dots. When a string, use that instead,
589 When a face, use the standard 3 dots, but with the specified face.
590 The change affects only Org-mode (which will then use its own display table).
591 Changing this requires executing `M-x org-mode' in a buffer to become
594 :type '(choice (const :tag "Default" nil)
595 (face :tag "Face" :value org-warning)
596 (string :tag "String" :value "...#")))
598 (defvar org-display-table nil
599 "The display table for org-mode, in case `org-ellipsis' is non-nil.")
601 (defgroup org-keywords nil
602 "Keywords in Org-mode."
606 (defcustom org-deadline-string "DEADLINE:"
607 "String to mark deadline entries.
608 A deadline is this string, followed by a time stamp. Should be a word,
609 terminated by a colon. You can insert a schedule keyword and
610 a timestamp with \\[org-deadline].
611 Changes become only effective after restarting Emacs."
615 (defcustom org-scheduled-string "SCHEDULED:"
616 "String to mark scheduled TODO entries.
617 A schedule is this string, followed by a time stamp. Should be a word,
618 terminated by a colon. You can insert a schedule keyword and
619 a timestamp with \\[org-schedule].
620 Changes become only effective after restarting Emacs."
624 (defcustom org-closed-string "CLOSED:"
625 "String used as the prefix for timestamps logging closing a TODO entry."
629 (defcustom org-clock-string "CLOCK:"
630 "String used as prefix for timestamps clocking work hours on an item."
634 (defcustom org-comment-string "COMMENT"
635 "Entries starting with this keyword will never be exported.
636 An entry can be toggled between COMMENT and normal with
637 \\[org-toggle-comment].
638 Changes become only effective after restarting Emacs."
642 (defcustom org-quote-string "QUOTE"
643 "Entries starting with this keyword will be exported in fixed-width font.
644 Quoting applies only to the text in the entry following the headline, and does
645 not extend beyond the next headline, even if that is lower level.
646 An entry can be toggled between QUOTE and normal with
647 \\[org-toggle-fixed-width-section]."
651 (defconst org-repeat-re
652 "<[0-9]\\{4\\}-[0-9][0-9]-[0-9][0-9] [^>\n]*?\\([.+]?\\+[0-9]+[dwmy]\\(/[0-9]+[dwmy]\\)?\\)"
653 "Regular expression for specifying repeated events.
654 After a match, group 1 contains the repeat expression.")
656 (defgroup org-structure nil
657 "Options concerning the general structure of Org-mode files."
661 (defgroup org-reveal-location nil
662 "Options about how to make context of a location visible."
663 :tag "Org Reveal Location"
664 :group 'org-structure)
666 (defconst org-context-choice
668 (const :tag "Always" t)
669 (const :tag "Never" nil)
670 (repeat :greedy t :tag "Individual contexts"
672 (choice :tag "Context"
679 (const bookmark-jump)
683 "Contexts for the reveal options.")
685 (defcustom org-show-hierarchy-above '((default . t))
686 "Non-nil means show full hierarchy when revealing a location.
687 Org-mode often shows locations in an org-mode file which might have
688 been invisible before. When this is set, the hierarchy of headings
689 above the exposed location is shown.
690 Turning this off for example for sparse trees makes them very compact.
691 Instead of t, this can also be an alist specifying this option for different
692 contexts. Valid contexts are
693 agenda when exposing an entry from the agenda
694 org-goto when using the command `org-goto' on key C-c C-j
695 occur-tree when using the command `org-occur' on key C-c /
696 tags-tree when constructing a sparse tree based on tags matches
697 link-search when exposing search matches associated with a link
698 mark-goto when exposing the jump goal of a mark
699 bookmark-jump when exposing a bookmark location
700 isearch when exiting from an incremental search
701 default default for all contexts not set explicitly"
702 :group 'org-reveal-location
703 :type org-context-choice)
705 (defcustom org-show-following-heading '((default . nil))
706 "Non-nil means show following heading when revealing a location.
707 Org-mode often shows locations in an org-mode file which might have
708 been invisible before. When this is set, the heading following the
710 Turning this off for example for sparse trees makes them very compact,
711 but makes it harder to edit the location of the match. In such a case,
712 use the command \\[org-reveal] to show more context.
713 Instead of t, this can also be an alist specifying this option for different
714 contexts. See `org-show-hierarchy-above' for valid contexts."
715 :group 'org-reveal-location
716 :type org-context-choice)
718 (defcustom org-show-siblings '((default . nil) (isearch t))
719 "Non-nil means show all sibling heading when revealing a location.
720 Org-mode often shows locations in an org-mode file which might have
721 been invisible before. When this is set, the sibling of the current entry
722 heading are all made visible. If `org-show-hierarchy-above' is t,
723 the same happens on each level of the hierarchy above the current entry.
725 By default this is on for the isearch context, off for all other contexts.
726 Turning this off for example for sparse trees makes them very compact,
727 but makes it harder to edit the location of the match. In such a case,
728 use the command \\[org-reveal] to show more context.
729 Instead of t, this can also be an alist specifying this option for different
730 contexts. See `org-show-hierarchy-above' for valid contexts."
731 :group 'org-reveal-location
732 :type org-context-choice)
734 (defcustom org-show-entry-below '((default . nil))
735 "Non-nil means show the entry below a headline when revealing a location.
736 Org-mode often shows locations in an org-mode file which might have
737 been invisible before. When this is set, the text below the headline that is
738 exposed is also shown.
740 By default this is off for all contexts.
741 Instead of t, this can also be an alist specifying this option for different
742 contexts. See `org-show-hierarchy-above' for valid contexts."
743 :group 'org-reveal-location
744 :type org-context-choice)
746 (defcustom org-indirect-buffer-display 'other-window
747 "How should indirect tree buffers be displayed?
748 This applies to indirect buffers created with the commands
749 \\[org-tree-to-indirect-buffer] and \\[org-agenda-tree-to-indirect-buffer].
751 current-window Display in the current window
752 other-window Just display in another window.
753 dedicated-frame Create one new frame, and re-use it each time.
754 new-frame Make a new frame each time. Note that in this case
755 previously-made indirect buffers are kept, and you need to
756 kill these buffers yourself."
757 :group 'org-structure
758 :group 'org-agenda-windows
760 (const :tag "In current window" current-window)
761 (const :tag "In current frame, other window" other-window)
762 (const :tag "Each time a new frame" new-frame)
763 (const :tag "One dedicated frame" dedicated-frame)))
765 (defcustom org-use-speed-commands nil
766 "Non-nil means activate single letter commands at beginning of a headline.
767 This may also be a function to test for appropriate locations where speed
768 commands should be active."
769 :group 'org-structure
771 (const :tag "Never" nil)
772 (const :tag "At beginning of headline stars" t)
775 (defcustom org-speed-commands-user nil
776 "Alist of additional speed commands.
777 This list will be checked before `org-speed-commands-default'
778 when the variable `org-use-speed-commands' is non-nil
779 and when the cursor is at the beginning of a headline.
780 The car if each entry is a string with a single letter, which must
781 be assigned to `self-insert-command' in the global map.
782 The cdr is either a command to be called interactively, a function
783 to be called, or a form to be evaluated.
784 An entry that is just a list with a single string will be interpreted
785 as a descriptive headline that will be added when listing the speed
786 commands in the Help buffer using the `?' speed command."
787 :group 'org-structure
788 :type '(repeat :value ("k" . ignore)
789 (choice :value ("k" . ignore)
790 (list :tag "Descriptive Headline" (string :tag "Headline"))
791 (cons :tag "Letter and Command"
792 (string :tag "Command letter")
797 (defgroup org-cycle nil
798 "Options concerning visibility cycling in Org-mode."
800 :group 'org-structure)
802 (defcustom org-cycle-skip-children-state-if-no-children t
803 "Non-nil means skip CHILDREN state in entries that don't have any."
807 (defcustom org-cycle-max-level nil
808 "Maximum level which should still be subject to visibility cycling.
809 Levels higher than this will, for cycling, be treated as text, not a headline.
810 When `org-odd-levels-only' is set, a value of N in this variable actually
811 means 2N-1 stars as the limiting headline.
812 When nil, cycle all levels.
813 Note that the limiting level of cycling is also influenced by
814 `org-inlinetask-min-level'. When `org-cycle-max-level' is not set but
815 `org-inlinetask-min-level' is, cycling will be limited to levels one less
819 (const :tag "No limit" nil)
820 (integer :tag "Maximum level")))
822 (defcustom org-drawers '("PROPERTIES" "CLOCK" "LOGBOOK")
823 "Names of drawers. Drawers are not opened by cycling on the headline above.
824 Drawers only open with a TAB on the drawer line itself. A drawer looks like
829 The drawer \"PROPERTIES\" is special for capturing properties through
832 Drawers can be defined on the per-file basis with a line like:
834 #+DRAWERS: HIDDEN STATE PROPERTIES"
835 :group 'org-structure
837 :type '(repeat (string :tag "Drawer Name")))
839 (defcustom org-hide-block-startup nil
840 "Non-nil means entering Org-mode will fold all blocks.
841 This can also be set in on a per-file basis with
843 #+STARTUP: hideblocks
844 #+STARTUP: showblocks"
849 (defcustom org-cycle-global-at-bob nil
850 "Cycle globally if cursor is at beginning of buffer and not at a headline.
851 This makes it possible to do global cycling without having to use S-TAB or
852 \\[universal-argument] TAB. For this special case to work, the first line \
854 must not be a headline - it may be empty or some other text. When used in
855 this way, `org-cycle-hook' is disables temporarily, to make sure the
856 cursor stays at the beginning of the buffer.
857 When this option is nil, don't do anything special at the beginning
862 (defcustom org-cycle-level-after-item/entry-creation t
863 "Non-nil means cycle entry level or item indentation in new empty entries.
865 When the cursor is at the end of an empty headline, i.e with only stars
866 and maybe a TODO keyword, TAB will then switch the entry to become a child,
867 and then all possible ancestor states, before returning to the original state.
868 This makes data entry extremely fast: M-RET to create a new headline,
869 on TAB to make it a child, two or more tabs to make it a (grand-)uncle.
871 When the cursor is at the end of an empty plain list item, one TAB will
872 make it a subitem, two or more tabs will back up to make this an item
873 higher up in the item hierarchy."
877 (defcustom org-cycle-emulate-tab t
878 "Where should `org-cycle' emulate TAB.
880 white Only in completely white lines
881 whitestart Only at the beginning of lines, before the first non-white char
882 t Everywhere except in headlines
883 exc-hl-bol Everywhere except at the start of a headline
884 If TAB is used in a place where it does not emulate TAB, the current subtree
885 visibility is cycled."
887 :type '(choice (const :tag "Never" nil)
888 (const :tag "Only in completely white lines" white)
889 (const :tag "Before first char in a line" whitestart)
890 (const :tag "Everywhere except in headlines" t)
891 (const :tag "Everywhere except at bol in headlines" exc-hl-bol)
894 (defcustom org-cycle-separator-lines 2
895 "Number of empty lines needed to keep an empty line between collapsed trees.
896 If you leave an empty line between the end of a subtree and the following
897 headline, this empty line is hidden when the subtree is folded.
898 Org-mode will leave (exactly) one empty line visible if the number of
899 empty lines is equal or larger to the number given in this variable.
900 So the default 2 means at least 2 empty lines after the end of a subtree
901 are needed to produce free space between a collapsed subtree and the
904 If the number is negative, and the number of empty lines is at least -N,
905 all empty lines are shown.
907 Special case: when 0, never leave empty lines in collapsed view."
910 (put 'org-cycle-separator-lines 'safe-local-variable 'integerp)
912 (defcustom org-pre-cycle-hook nil
913 "Hook that is run before visibility cycling is happening.
914 The function(s) in this hook must accept a single argument which indicates
915 the new state that will be set right after running this hook. The
916 argument is a symbol. Before a global state change, it can have the values
917 `overview', `content', or `all'. Before a local state change, it can have
918 the values `folded', `children', or `subtree'."
922 (defcustom org-cycle-hook '(org-cycle-hide-archived-subtrees
923 org-cycle-hide-drawers
924 org-cycle-show-empty-lines
925 org-optimize-window-after-visibility-change)
926 "Hook that is run after `org-cycle' has changed the buffer visibility.
927 The function(s) in this hook must accept a single argument which indicates
928 the new state that was set by the most recent `org-cycle' command. The
929 argument is a symbol. After a global state change, it can have the values
930 `overview', `content', or `all'. After a local state change, it can have
931 the values `folded', `children', or `subtree'."
935 (defgroup org-edit-structure nil
936 "Options concerning structure editing in Org-mode."
937 :tag "Org Edit Structure"
938 :group 'org-structure)
940 (defcustom org-odd-levels-only nil
941 "Non-nil means skip even levels and only use odd levels for the outline.
942 This has the effect that two stars are being added/taken away in
943 promotion/demotion commands. It also influences how levels are
944 handled by the exporters.
945 Changing it requires restart of `font-lock-mode' to become effective
946 for fontification also in regions already fontified.
947 You may also set this on a per-file basis by adding one of the following
952 :group 'org-edit-structure
953 :group 'org-appearance
956 (defcustom org-adapt-indentation t
957 "Non-nil means adapt indentation to outline node level.
959 When this variable is set, Org assumes that you write outlines by
960 indenting text in each node to align with the headline (after the stars).
961 The following issues are influenced by this variable:
963 - When this is set and the *entire* text in an entry is indented, the
964 indentation is increased by one space in a demotion command, and
965 decreased by one in a promotion command. If any line in the entry
966 body starts with text at column 0, indentation is not changed at all.
968 - Property drawers and planning information is inserted indented when
969 this variable s set. When nil, they will not be indented.
971 - TAB indents a line relative to context. The lines below a headline
972 will be indented when this variable is set.
974 Note that this is all about true indentation, by adding and removing
975 space characters. See also `org-indent.el' which does level-dependent
976 indentation in a virtual way, i.e. at display time in Emacs."
977 :group 'org-edit-structure
980 (defcustom org-special-ctrl-a/e nil
981 "Non-nil means `C-a' and `C-e' behave specially in headlines and items.
983 When t, `C-a' will bring back the cursor to the beginning of the
984 headline text, i.e. after the stars and after a possible TODO keyword.
985 In an item, this will be the position after the bullet.
986 When the cursor is already at that position, another `C-a' will bring
987 it to the beginning of the line.
989 `C-e' will jump to the end of the headline, ignoring the presence of tags
990 in the headline. A second `C-e' will then jump to the true end of the
991 line, after any tags. This also means that, when this variable is
992 non-nil, `C-e' also will never jump beyond the end of the heading of a
993 folded section, i.e. not after the ellipses.
995 When set to the symbol `reversed', the first `C-a' or `C-e' works normally,
996 going to the true line boundary first. Only a directly following, identical
997 keypress will bring the cursor to the special positions.
999 This may also be a cons cell where the behavior for `C-a' and `C-e' is
1001 :group 'org-edit-structure
1003 (const :tag "off" nil)
1004 (const :tag "on: after stars/bullet and before tags first" t)
1005 (const :tag "reversed: true line boundary first" reversed)
1006 (cons :tag "Set C-a and C-e separately"
1007 (choice :tag "Special C-a"
1008 (const :tag "off" nil)
1009 (const :tag "on: after stars/bullet first" t)
1010 (const :tag "reversed: before stars/bullet first" reversed))
1011 (choice :tag "Special C-e"
1012 (const :tag "off" nil)
1013 (const :tag "on: before tags first" t)
1014 (const :tag "reversed: after tags first" reversed)))))
1015 (if (fboundp 'defvaralias)
1016 (defvaralias 'org-special-ctrl-a 'org-special-ctrl-a/e))
1018 (defcustom org-special-ctrl-k nil
1019 "Non-nil means `C-k' will behave specially in headlines.
1020 When nil, `C-k' will call the default `kill-line' command.
1021 When t, the following will happen while the cursor is in the headline:
1023 - When the cursor is at the beginning of a headline, kill the entire
1024 line and possible the folded subtree below the line.
1025 - When in the middle of the headline text, kill the headline up to the tags.
1026 - When after the headline text, kill the tags."
1027 :group 'org-edit-structure
1030 (defcustom org-ctrl-k-protect-subtree nil
1031 "Non-nil means, do not delete a hidden subtree with C-k.
1032 When set to the symbol `error', simply throw an error when C-k is
1033 used to kill (part-of) a headline that has hidden text behind it.
1034 Any other non-nil value will result in a query to the user, if it is
1035 OK to kill that hidden subtree. When nil, kill without remorse."
1036 :group 'org-edit-structure
1038 (const :tag "Do not protect hidden subtrees" nil)
1039 (const :tag "Protect hidden subtrees with a security query" t)
1040 (const :tag "Never kill a hidden subtree with C-k" error)))
1042 (defcustom org-yank-folded-subtrees t
1043 "Non-nil means when yanking subtrees, fold them.
1044 If the kill is a single subtree, or a sequence of subtrees, i.e. if
1045 it starts with a heading and all other headings in it are either children
1046 or siblings, then fold all the subtrees. However, do this only if no
1047 text after the yank would be swallowed into a folded tree by this action."
1048 :group 'org-edit-structure
1051 (defcustom org-yank-adjusted-subtrees nil
1052 "Non-nil means when yanking subtrees, adjust the level.
1053 With this setting, `org-paste-subtree' is used to insert the subtree, see
1054 this function for details."
1055 :group 'org-edit-structure
1058 (defcustom org-M-RET-may-split-line '((default . t))
1059 "Non-nil means M-RET will split the line at the cursor position.
1060 When nil, it will go to the end of the line before making a
1062 You may also set this option in a different way for different
1063 contexts. Valid contexts are:
1065 headline when creating a new headline
1066 item when creating a new item
1067 table in a table field
1068 default the value to be used for all contexts not explicitly
1070 :group 'org-structure
1073 (const :tag "Always" t)
1074 (const :tag "Never" nil)
1075 (repeat :greedy t :tag "Individual contexts"
1077 (choice :tag "Context"
1085 (defcustom org-insert-heading-respect-content nil
1086 "Non-nil means insert new headings after the current subtree.
1087 When nil, the new heading is created directly after the current line.
1088 The commands \\[org-insert-heading-respect-content] and
1089 \\[org-insert-todo-heading-respect-content] turn this variable on
1090 for the duration of the command."
1091 :group 'org-structure
1094 (defcustom org-blank-before-new-entry '((heading . auto)
1095 (plain-list-item . auto))
1096 "Should `org-insert-heading' leave a blank line before new heading/item?
1097 The value is an alist, with `heading' and `plain-list-item' as CAR,
1098 and a boolean flag as CDR. The cdr may also be the symbol `auto', in
1099 which case Org will look at the surrounding headings/items and try to
1100 make an intelligent decision whether to insert a blank line or not.
1102 For plain lists, if the variable `org-empty-line-terminates-plain-lists' is
1103 set, the setting here is ignored and no empty line is inserted, to avoid
1104 breaking the list structure."
1105 :group 'org-edit-structure
1107 (cons (const heading)
1108 (choice (const :tag "Never" nil)
1109 (const :tag "Always" t)
1110 (const :tag "Auto" auto)))
1111 (cons (const plain-list-item)
1112 (choice (const :tag "Never" nil)
1113 (const :tag "Always" t)
1114 (const :tag "Auto" auto)))))
1116 (defcustom org-insert-heading-hook nil
1117 "Hook being run after inserting a new heading."
1118 :group 'org-edit-structure
1121 (defcustom org-enable-fixed-width-editor t
1122 "Non-nil means lines starting with \":\" are treated as fixed-width.
1123 This currently only means they are never auto-wrapped.
1124 When nil, such lines will be treated like ordinary lines.
1125 See also the QUOTE keyword."
1126 :group 'org-edit-structure
1129 (defcustom org-goto-auto-isearch t
1130 "Non-nil means typing characters in `org-goto' starts incremental search."
1131 :group 'org-edit-structure
1134 (defgroup org-sparse-trees nil
1135 "Options concerning sparse trees in Org-mode."
1136 :tag "Org Sparse Trees"
1137 :group 'org-structure)
1139 (defcustom org-highlight-sparse-tree-matches t
1140 "Non-nil means highlight all matches that define a sparse tree.
1141 The highlights will automatically disappear the next time the buffer is
1142 changed by an edit command."
1143 :group 'org-sparse-trees
1146 (defcustom org-remove-highlights-with-change t
1147 "Non-nil means any change to the buffer will remove temporary highlights.
1148 Such highlights are created by `org-occur' and `org-clock-display'.
1149 When nil, `C-c C-c needs to be used to get rid of the highlights.
1150 The highlights created by `org-preview-latex-fragment' always need
1151 `C-c C-c' to be removed."
1152 :group 'org-sparse-trees
1157 (defcustom org-occur-hook '(org-first-headline-recenter)
1158 "Hook that is run after `org-occur' has constructed a sparse tree.
1159 This can be used to recenter the window to show as much of the structure
1161 :group 'org-sparse-trees
1164 (defgroup org-imenu-and-speedbar nil
1165 "Options concerning imenu and speedbar in Org-mode."
1166 :tag "Org Imenu and Speedbar"
1167 :group 'org-structure)
1169 (defcustom org-imenu-depth 2
1170 "The maximum level for Imenu access to Org-mode headlines.
1171 This also applied for speedbar access."
1172 :group 'org-imenu-and-speedbar
1175 (defgroup org-table nil
1176 "Options concerning tables in Org-mode."
1180 (defcustom org-enable-table-editor 'optimized
1181 "Non-nil means lines starting with \"|\" are handled by the table editor.
1182 When nil, such lines will be treated like ordinary lines.
1184 When equal to the symbol `optimized', the table editor will be optimized to
1186 - Automatic overwrite mode in front of whitespace in table fields.
1187 This makes the structure of the table stay in tact as long as the edited
1188 field does not exceed the column width.
1189 - Minimize the number of realigns. Normally, the table is aligned each time
1190 TAB or RET are pressed to move to another field. With optimization this
1191 happens only if changes to a field might have changed the column width.
1192 Optimization requires replacing the functions `self-insert-command',
1193 `delete-char', and `backward-delete-char' in Org-mode buffers, with a
1194 slight (in fact: unnoticeable) speed impact for normal typing. Org-mode is
1195 very good at guessing when a re-align will be necessary, but you can always
1196 force one with \\[org-ctrl-c-ctrl-c].
1198 If you would like to use the optimized version in Org-mode, but the
1199 un-optimized version in OrgTbl-mode, see the variable `orgtbl-optimized'.
1201 This variable can be used to turn on and off the table editor during a session,
1202 but in order to toggle optimization, a restart is required.
1204 See also the variable `org-table-auto-blank-field'."
1207 (const :tag "off" nil)
1209 (const :tag "on, optimized" optimized)))
1211 (defcustom org-self-insert-cluster-for-undo t
1212 "Non-nil means cluster self-insert commands for undo when possible.
1213 If this is set, then, like in the Emacs command loop, 20 consecutive
1214 characters will be undone together.
1215 This is configurable, because there is some impact on typing performance."
1219 (defcustom org-table-tab-recognizes-table.el t
1220 "Non-nil means TAB will automatically notice a table.el table.
1221 When it sees such a table, it moves point into it and - if necessary -
1222 calls `table-recognize-table'."
1223 :group 'org-table-editing
1226 (defgroup org-link nil
1227 "Options concerning links in Org-mode."
1231 (defvar org-link-abbrev-alist-local nil
1232 "Buffer-local version of `org-link-abbrev-alist', which see.
1233 The value of this is taken from the #+LINK lines.")
1234 (make-variable-buffer-local 'org-link-abbrev-alist-local)
1236 (defcustom org-link-abbrev-alist nil
1237 "Alist of link abbreviations.
1238 The car of each element is a string, to be replaced at the start of a link.
1239 The cdrs are replacement values, like (\"linkkey\" . REPLACE). Abbreviated
1240 links in Org-mode buffers can have an optional tag after a double colon, e.g.
1242 [[linkkey:tag][description]]
1244 The 'linkkey' must be a word word, starting with a letter, followed
1245 by letters, numbers, '-' or '_'.
1247 If REPLACE is a string, the tag will simply be appended to create the link.
1248 If the string contains \"%s\", the tag will be inserted there. Alternatively,
1249 the placeholder \"%h\" will cause a url-encoded version of the tag to
1250 be inserted at that point (see the function `url-hexify-string').
1252 REPLACE may also be a function that will be called with the tag as the
1253 only argument to create the link, which should be returned as a string.
1255 See the manual for examples."
1259 (string :tag "Protocol")
1261 (string :tag "Format")
1264 (defcustom org-descriptive-links t
1265 "Non-nil means hide link part and only show description of bracket links.
1266 Bracket links are like [[link][description]]. This variable sets the initial
1267 state in new org-mode buffers. The setting can then be toggled on a
1268 per-buffer basis from the Org->Hyperlinks menu."
1272 (defcustom org-link-file-path-type 'adaptive
1273 "How the path name in file links should be stored.
1276 relative Relative to the current directory, i.e. the directory of the file
1277 into which the link is being inserted.
1278 absolute Absolute path, if possible with ~ for home directory.
1279 noabbrev Absolute path, no abbreviation of home directory.
1280 adaptive Use relative path for files in the current directory and sub-
1281 directories of it. For other files, use an absolute path."
1289 (defcustom org-activate-links '(bracket angle plain radio tag date footnote)
1290 "Types of links that should be activated in Org-mode files.
1291 This is a list of symbols, each leading to the activation of a certain link
1292 type. In principle, it does not hurt to turn on most link types - there may
1293 be a small gain when turning off unused link types. The types are:
1295 bracket The recommended [[link][description]] or [[link]] links with hiding.
1296 angle Links in angular brackets that may contain whitespace like
1297 <bbdb:Carsten Dominik>.
1298 plain Plain links in normal text, no whitespace, like http://google.com.
1299 radio Text that is matched by a radio target, see manual for details.
1300 tag Tag settings in a headline (link to tag search).
1301 date Time stamps (link to calendar).
1302 footnote Footnote labels.
1304 Changing this variable requires a restart of Emacs to become effective."
1306 :type '(set :greedy t
1307 (const :tag "Double bracket links" bracket)
1308 (const :tag "Angular bracket links" angle)
1309 (const :tag "Plain text links" plain)
1310 (const :tag "Radio target matches" radio)
1311 (const :tag "Tags" tag)
1312 (const :tag "Timestamps" date)
1313 (const :tag "Footnotes" footnote)))
1315 (defcustom org-make-link-description-function nil
1316 "Function to use to generate link descriptions from links.
1317 If nil the link location will be used. This function must take
1318 two parameters; the first is the link and the second the
1319 description `org-insert-link' has generated, and should return the
1320 description to use."
1324 (defgroup org-link-store nil
1325 "Options concerning storing links in Org-mode."
1326 :tag "Org Store Link"
1329 (defcustom org-email-link-description-format "Email %c: %.30s"
1330 "Format of the description part of a link to an email or usenet message.
1331 The following %-escapes will be replaced by corresponding information:
1333 %F full \"From\" field
1334 %f name, taken from \"From\" field, address if no name
1335 %T full \"To\" field
1336 %t first name in \"To\" field, address if no name
1337 %c correspondent. Usually \"from NAME\", but if you sent it yourself, it
1338 will be \"to NAME\". See also the variable `org-from-is-user-regexp'.
1343 You may use normal field width specification between the % and the letter.
1344 This is for example useful to limit the length of the subject.
1346 Examples: \"%f on: %.30s\", \"Email from %f\", \"Email %c\""
1347 :group 'org-link-store
1350 (defcustom org-from-is-user-regexp
1352 (when (and user-mail-address (not (string= user-mail-address "")))
1353 (setq r1 (concat "\\<" (regexp-quote user-mail-address) "\\>")))
1354 (when (and user-full-name (not (string= user-full-name "")))
1355 (setq r2 (concat "\\<" (regexp-quote user-full-name) "\\>")))
1356 (if (and r1 r2) (concat r1 "\\|" r2) (or r1 r2)))
1357 "Regexp matched against the \"From:\" header of an email or usenet message.
1358 It should match if the message is from the user him/herself."
1359 :group 'org-link-store
1362 (defcustom org-link-to-org-use-id 'create-if-interactive-and-no-custom-id
1363 "Non-nil means storing a link to an Org file will use entry IDs.
1365 Note that before this variable is even considered, org-id must be loaded,
1366 so please customize `org-modules' and turn it on.
1368 The variable can have the following values:
1370 t Create an ID if needed to make a link to the current entry.
1372 create-if-interactive
1373 If `org-store-link' is called directly (interactively, as a user
1374 command), do create an ID to support the link. But when doing the
1375 job for remember, only use the ID if it already exists. The
1376 purpose of this setting is to avoid proliferation of unwanted
1377 IDs, just because you happen to be in an Org file when you
1378 call `org-remember' that automatically and preemptively
1379 creates a link. If you do want to get an ID link in a remember
1380 template to an entry not having an ID, create it first by
1381 explicitly creating a link to it, using `C-c C-l' first.
1383 create-if-interactive-and-no-custom-id
1384 Like create-if-interactive, but do not create an ID if there is
1385 a CUSTOM_ID property defined in the entry. This is the default.
1388 Use existing ID, do not create one.
1390 nil Never use an ID to make a link, instead link using a text search for
1392 :group 'org-link-store
1394 (const :tag "Create ID to make link" t)
1395 (const :tag "Create if storing link interactively"
1396 create-if-interactive)
1397 (const :tag "Create if storing link interactively and no CUSTOM_ID is present"
1398 create-if-interactive-and-no-custom-id)
1399 (const :tag "Only use existing" use-existing)
1400 (const :tag "Do not use ID to create link" nil)))
1402 (defcustom org-context-in-file-links t
1403 "Non-nil means file links from `org-store-link' contain context.
1404 A search string will be added to the file name with :: as separator and
1405 used to find the context when the link is activated by the command
1406 `org-open-at-point'. When this option is t, the entire active region
1407 will be placed in the search string of the file link. If set to a
1408 positive integer, only the first n lines of context will be stored.
1410 Using a prefix arg to the command \\[org-store-link] (`org-store-link')
1411 negates this setting for the duration of the command."
1412 :group 'org-link-store
1413 :type '(choice boolean integer))
1415 (defcustom org-keep-stored-link-after-insertion nil
1416 "Non-nil means keep link in list for entire session.
1418 The command `org-store-link' adds a link pointing to the current
1419 location to an internal list. These links accumulate during a session.
1420 The command `org-insert-link' can be used to insert links into any
1421 Org-mode file (offering completion for all stored links). When this
1422 option is nil, every link which has been inserted once using \\[org-insert-link]
1423 will be removed from the list, to make completing the unused links
1425 :group 'org-link-store
1428 (defgroup org-link-follow nil
1429 "Options concerning following links in Org-mode."
1430 :tag "Org Follow Link"
1433 (defcustom org-link-translation-function nil
1434 "Function to translate links with different syntax to Org syntax.
1435 This can be used to translate links created for example by the Planner
1436 or emacs-wiki packages to Org syntax.
1437 The function must accept two parameters, a TYPE containing the link
1438 protocol name like \"rmail\" or \"gnus\" as a string, and the linked path,
1439 which is everything after the link protocol. It should return a cons
1440 with possibly modified values of type and path.
1441 Org contains a function for this, so if you set this variable to
1442 `org-translate-link-from-planner', you should be able follow many
1443 links created by planner."
1444 :group 'org-link-follow
1447 (defcustom org-follow-link-hook nil
1448 "Hook that is run after a link has been followed."
1449 :group 'org-link-follow
1452 (defcustom org-tab-follows-link nil
1453 "Non-nil means on links TAB will follow the link.
1454 Needs to be set before org.el is loaded.
1455 This really should not be used, it does not make sense, and the
1456 implementation is bad."
1457 :group 'org-link-follow
1460 (defcustom org-return-follows-link nil
1461 "Non-nil means on links RET will follow the link."
1462 :group 'org-link-follow
1465 (defcustom org-mouse-1-follows-link
1466 (if (boundp 'mouse-1-click-follows-link) mouse-1-click-follows-link t)
1467 "Non-nil means mouse-1 on a link will follow the link.
1468 A longer mouse click will still set point. Does not work on XEmacs.
1469 Needs to be set before org.el is loaded."
1470 :group 'org-link-follow
1473 (defcustom org-mark-ring-length 4
1474 "Number of different positions to be recorded in the ring.
1475 Changing this requires a restart of Emacs to work correctly."
1476 :group 'org-link-follow
1479 (defcustom org-link-search-must-match-exact-headline 'query-to-create
1480 "Non-nil means internal links in Org files must exactly match a headline.
1481 When nil, the link search tries to match a phrase with all words
1482 in the search text."
1483 :group 'org-link-follow
1485 (const :tag "Use fuzy text search" nil)
1486 (const :tag "Match only exact headline" t)
1487 (const :tag "Match extact headline or query to create it"
1490 (defcustom org-link-frame-setup
1491 '((vm . vm-visit-folder-other-frame)
1492 (gnus . org-gnus-no-new-news)
1493 (file . find-file-other-window)
1494 (wl . wl-other-frame))
1495 "Setup the frame configuration for following links.
1496 When following a link with Emacs, it may often be useful to display
1497 this link in another window or frame. This variable can be used to
1498 set this up for the different types of links.
1501 `vm-visit-folder-other-window'
1502 `vm-visit-folder-other-frame'
1503 For Gnus, use any of
1506 `org-gnus-no-new-news'
1507 For FILE, use any of
1509 `find-file-other-window'
1510 `find-file-other-frame'
1511 For Wanderlust use any of
1514 For the calendar, use the variable `calendar-setup'.
1515 For BBDB, it is currently only possible to display the matches in
1517 :group 'org-link-follow
1521 (const vm-visit-folder)
1522 (const vm-visit-folder-other-window)
1523 (const vm-visit-folder-other-frame)))
1527 (const gnus-other-frame)
1528 (const org-gnus-no-new-news)))
1532 (const find-file-other-window)
1533 (const find-file-other-frame)))
1537 (const wl-other-frame)))))
1539 (defcustom org-display-internal-link-with-indirect-buffer nil
1540 "Non-nil means use indirect buffer to display infile links.
1541 Activating internal links (from one location in a file to another location
1542 in the same file) normally just jumps to the location. When the link is
1543 activated with a \\[universal-argument] prefix (or with mouse-3), the link \
1545 another window. When this option is set, the other window actually displays
1546 an indirect buffer clone of the current buffer, to avoid any visibility
1547 changes to the current buffer."
1548 :group 'org-link-follow
1551 (defcustom org-open-non-existing-files nil
1552 "Non-nil means `org-open-file' will open non-existing files.
1553 When nil, an error will be generated.
1554 This variable applies only to external applications because they
1555 might choke on non-existing files. If the link is to a file that
1556 will be opened in Emacs, the variable is ignored."
1557 :group 'org-link-follow
1560 (defcustom org-open-directory-means-index-dot-org nil
1561 "Non-nil means a link to a directory really means to index.org.
1562 When nil, following a directory link will run dired or open a finder/explorer
1563 window on that directory."
1564 :group 'org-link-follow
1567 (defcustom org-link-mailto-program '(browse-url "mailto:%a?subject=%s")
1568 "Function and arguments to call for following mailto links.
1569 This is a list with the first element being a Lisp function, and the
1570 remaining elements being arguments to the function. In string arguments,
1571 %a will be replaced by the address, and %s will be replaced by the subject
1572 if one was given like in <mailto:arthur@galaxy.org::this subject>."
1573 :group 'org-link-follow
1575 (const :tag "browse-url" (browse-url-mail "mailto:%a?subject=%s"))
1576 (const :tag "compose-mail" (compose-mail "%a" "%s"))
1577 (const :tag "message-mail" (message-mail "%a" "%s"))
1578 (cons :tag "other" (function) (repeat :tag "argument" sexp))))
1580 (defcustom org-confirm-shell-link-function 'yes-or-no-p
1581 "Non-nil means ask for confirmation before executing shell links.
1582 Shell links can be dangerous: just think about a link
1584 [[shell:rm -rf ~/*][Google Search]]
1586 This link would show up in your Org-mode document as \"Google Search\",
1587 but really it would remove your entire home directory.
1588 Therefore we advise against setting this variable to nil.
1589 Just change it to `y-or-n-p' if you want to confirm with a
1590 single keystroke rather than having to type \"yes\"."
1591 :group 'org-link-follow
1593 (const :tag "with yes-or-no (safer)" yes-or-no-p)
1594 (const :tag "with y-or-n (faster)" y-or-n-p)
1595 (const :tag "no confirmation (dangerous)" nil)))
1596 (put 'org-confirm-shell-link-function
1597 'safe-local-variable
1598 #'(lambda (x) (member x '(yes-or-no-p y-or-n-p))))
1600 (defcustom org-confirm-shell-link-not-regexp ""
1601 "A regexp to skip confirmation for shell links."
1602 :group 'org-link-follow
1605 (defcustom org-confirm-elisp-link-function 'yes-or-no-p
1606 "Non-nil means ask for confirmation before executing Emacs Lisp links.
1607 Elisp links can be dangerous: just think about a link
1609 [[elisp:(shell-command \"rm -rf ~/*\")][Google Search]]
1611 This link would show up in your Org-mode document as \"Google Search\",
1612 but really it would remove your entire home directory.
1613 Therefore we advise against setting this variable to nil.
1614 Just change it to `y-or-n-p' if you want to confirm with a
1615 single keystroke rather than having to type \"yes\"."
1616 :group 'org-link-follow
1618 (const :tag "with yes-or-no (safer)" yes-or-no-p)
1619 (const :tag "with y-or-n (faster)" y-or-n-p)
1620 (const :tag "no confirmation (dangerous)" nil)))
1621 (put 'org-confirm-shell-link-function
1622 'safe-local-variable
1623 #'(lambda (x) (member x '(yes-or-no-p y-or-n-p))))
1625 (defcustom org-confirm-elisp-link-not-regexp ""
1626 "A regexp to skip confirmation for Elisp links."
1627 :group 'org-link-follow
1630 (defconst org-file-apps-defaults-gnu
1634 "Default file applications on a UNIX or GNU/Linux system.
1635 See `org-file-apps'.")
1637 (defconst org-file-apps-defaults-macosx
1640 (system . "open %s")
1642 ("eps.gz" . "gv %s")
1644 ("fig" . "xfig %s"))
1645 "Default file applications on a MacOS X system.
1646 The system \"open\" is known as a default, but we use X11 applications
1647 for some files for which the OS does not have a good default.
1648 See `org-file-apps'.")
1650 (defconst org-file-apps-defaults-windowsnt
1654 (list (if (featurep 'xemacs)
1655 'mswindows-shell-execute
1659 (list (if (featurep 'xemacs)
1660 'mswindows-shell-execute
1663 "Default file applications on a Windows NT system.
1664 The system \"open\" is used for most files.
1665 See `org-file-apps'.")
1667 (defcustom org-file-apps
1670 ("\\.mm\\'" . default)
1671 ("\\.x?html?\\'" . default)
1672 ("\\.pdf\\'" . default)
1674 "External applications for opening `file:path' items in a document.
1675 Org-mode uses system defaults for different file types, but
1676 you can use this variable to set the application for a given file
1677 extension. The entries in this list are cons cells where the car identifies
1678 files and the cdr the corresponding command. Possible values for the
1680 \"string\" A string as a file identifier can be interpreted in different
1681 ways, depending on its contents:
1683 - Alphanumeric characters only:
1684 Match links with this file extension.
1685 Example: (\"pdf\" . \"evince %s\")
1686 to open PDFs with evince.
1688 - Regular expression: Match links where the
1689 filename matches the regexp. If you want to
1690 use groups here, use shy groups.
1692 Example: (\"\\.x?html\\'\" . \"firefox %s\")
1693 (\"\\(?:xhtml\\|html\\)\" . \"firefox %s\")
1694 to open *.html and *.xhtml with firefox.
1696 - Regular expression which contains (non-shy) groups:
1697 Match links where the whole link, including \"::\", and
1698 anything after that, matches the regexp.
1699 In a custom command string, %1, %2, etc. are replaced with
1700 the parts of the link that were matched by the groups.
1701 For backwards compatibility, if a command string is given
1702 that does not use any of the group matches, this case is
1703 handled identically to the second one (i.e. match against
1705 In a custom lisp form, you can access the group matches with
1706 (match-string n link).
1708 Example: (\"\\.pdf::\\(\\d+\\)\\'\" . \"evince -p %1 %s\")
1709 to open [[file:document.pdf::5]] with evince at page 5.
1711 `directory' Matches a directory
1712 `remote' Matches a remote file, accessible through tramp or efs.
1713 Remote files most likely should be visited through Emacs
1714 because external applications cannot handle such paths.
1715 `auto-mode' Matches files that are matched by any entry in `auto-mode-alist',
1716 so all files Emacs knows how to handle. Using this with
1717 command `emacs' will open most files in Emacs. Beware that this
1718 will also open html files inside Emacs, unless you add
1719 (\"html\" . default) to the list as well.
1720 t Default for files not matched by any of the other options.
1721 `system' The system command to open files, like `open' on Windows
1722 and Mac OS X, and mailcap under GNU/Linux. This is the command
1723 that will be selected if you call `C-c C-o' with a double
1724 \\[universal-argument] \\[universal-argument] prefix.
1726 Possible values for the command are:
1727 `emacs' The file will be visited by the current Emacs process.
1728 `default' Use the default application for this file type, which is the
1729 association for t in the list, most likely in the system-specific
1731 This can be used to overrule an unwanted setting in the
1732 system-specific variable.
1733 `system' Use the system command for opening files, like \"open\".
1734 This command is specified by the entry whose car is `system'.
1735 Most likely, the system-specific version of this variable
1736 does define this command, but you can overrule/replace it
1738 string A command to be executed by a shell; %s will be replaced
1739 by the path to the file.
1740 sexp A Lisp form which will be evaluated. The file path will
1741 be available in the Lisp variable `file'.
1742 For more examples, see the system specific constants
1743 `org-file-apps-defaults-macosx'
1744 `org-file-apps-defaults-windowsnt'
1745 `org-file-apps-defaults-gnu'."
1746 :group 'org-link-follow
1748 (cons (choice :value ""
1749 (string :tag "Extension")
1750 (const :tag "System command to open files" system)
1751 (const :tag "Default for unrecognized files" t)
1752 (const :tag "Remote file" remote)
1753 (const :tag "Links to a directory" directory)
1754 (const :tag "Any files that have Emacs modes"
1757 (const :tag "Visit with Emacs" emacs)
1758 (const :tag "Use default" default)
1759 (const :tag "Use the system command" system)
1760 (string :tag "Command")
1761 (sexp :tag "Lisp form")))))
1765 (defgroup org-refile nil
1766 "Options concerning refiling entries in Org-mode."
1770 (defcustom org-directory "~/org"
1771 "Directory with org files.
1772 This is just a default location to look for Org files. There is no need
1773 at all to put your files into this directory. It is only used in the
1774 following situations:
1776 1. When a remember template specifies a target file that is not an
1777 absolute path. The path will then be interpreted relative to
1779 2. When a remember note is filed away in an interactive way (when exiting the
1780 note buffer with `C-1 C-c C-c'. The user is prompted for an org file,
1781 with `org-directory' as the default path."
1783 :group 'org-remember
1786 (defcustom org-default-notes-file (convert-standard-filename "~/.notes")
1787 "Default target for storing notes.
1788 Used as a fall back file for org-remember.el and org-capture.el, for
1789 templates that do not specify a target file."
1791 :group 'org-remember
1793 (const :tag "Default from remember-data-file" nil)
1796 (defcustom org-goto-interface 'outline
1797 "The default interface to be used for `org-goto'.
1799 outline The interface shows an outline of the relevant file
1800 and the correct heading is found by moving through
1801 the outline or by searching with incremental search.
1802 outline-path-completion Headlines in the current buffer are offered via
1803 completion. This is the interface also used by
1804 the refile command."
1807 (const :tag "Outline" outline)
1808 (const :tag "Outline-path-completion" outline-path-completion)))
1810 (defcustom org-goto-max-level 5
1811 "Maximum target level when running `org-goto' with refile interface."
1815 (defcustom org-reverse-note-order nil
1816 "Non-nil means store new notes at the beginning of a file or entry.
1817 When nil, new notes will be filed to the end of a file or entry.
1818 This can also be a list with cons cells of regular expressions that
1819 are matched against file names, and values."
1820 :group 'org-remember
1823 (const :tag "Reverse always" t)
1824 (const :tag "Reverse never" nil)
1825 (repeat :tag "By file name regexp"
1826 (cons regexp boolean))))
1828 (defcustom org-log-refile nil
1829 "Information to record when a task is refiled.
1831 Possible values are:
1833 nil Don't add anything
1834 time Add a time stamp to the task
1835 note Prompt for a note and add it with template `org-log-note-headings'
1837 This option can also be set with on a per-file-basis with
1839 #+STARTUP: nologrefile
1840 #+STARTUP: logrefile
1841 #+STARTUP: lognoterefile
1843 You can have local logging settings for a subtree by setting the LOGGING
1844 property to one or more of these keywords.
1846 When bulk-refiling from the agenda, the value `note' is forbidden and
1847 will temporarily be changed to `time'."
1849 :group 'org-progress
1851 (const :tag "No logging" nil)
1852 (const :tag "Record timestamp" time)
1853 (const :tag "Record timestamp with note." note)))
1855 (defcustom org-refile-targets nil
1856 "Targets for refiling entries with \\[org-refile].
1857 This is list of cons cells. Each cell contains:
1858 - a specification of the files to be considered, either a list of files,
1859 or a symbol whose function or variable value will be used to retrieve
1860 a file name or a list of file names. If you use `org-agenda-files' for
1861 that, all agenda files will be scanned for targets. Nil means consider
1862 headings in the current buffer.
1863 - A specification of how to find candidate refile targets. This may be
1865 - a cons cell (:tag . \"TAG\") to identify refile targets by a tag.
1866 This tag has to be present in all target headlines, inheritance will
1868 - a cons cell (:todo . \"KEYWORD\") to identify refile targets by
1870 - a cons cell (:regexp . \"REGEXP\") with a regular expression matching
1871 headlines that are refiling targets.
1872 - a cons cell (:level . N). Any headline of level N is considered a target.
1873 Note that, when `org-odd-levels-only' is set, level corresponds to
1874 order in hierarchy, not to the number of stars.
1875 - a cons cell (:maxlevel . N). Any headline with level <= N is a target.
1876 Note that, when `org-odd-levels-only' is set, level corresponds to
1877 order in hierarchy, not to the number of stars.
1879 You can set the variable `org-refile-target-verify-function' to a function
1880 to verify each headline found by the simple criteria above.
1882 When this variable is nil, all top-level headlines in the current buffer
1883 are used, equivalent to the value `((nil . (:level . 1))'."
1887 (choice :value org-agenda-files
1888 (const :tag "All agenda files" org-agenda-files)
1889 (const :tag "Current buffer" nil)
1890 (function) (variable) (file))
1891 (choice :tag "Identify target headline by"
1892 (cons :tag "Specific tag" (const :value :tag) (string))
1893 (cons :tag "TODO keyword" (const :value :todo) (string))
1894 (cons :tag "Regular expression" (const :value :regexp) (regexp))
1895 (cons :tag "Level number" (const :value :level) (integer))
1896 (cons :tag "Max Level number" (const :value :maxlevel) (integer))))))
1898 (defcustom org-refile-target-verify-function nil
1899 "Function to verify if the headline at point should be a refile target.
1900 The function will be called without arguments, with point at the
1901 beginning of the headline. It should return t and leave point
1902 where it is if the headline is a valid target for refiling.
1904 If the target should not be selected, the function must return nil.
1905 In addition to this, it may move point to a place from where the search
1906 should be continued. For example, the function may decide that the entire
1907 subtree of the current entry should be excluded and move point to the end
1912 (defcustom org-refile-use-cache nil
1913 "Non-nil means cache refile targets to speed up the process.
1914 The cache for a particular file will be updated automatically when
1915 the buffer has been killed, or when any of the marker used for flagging
1916 refile targets no longer points at a live buffer.
1917 If you have added new entries to a buffer that might themselves be targets,
1918 you need to clear the cache manually by pressing `C-0 C-c C-w' or, if you
1919 find that easier, `C-u C-u C-u C-c C-w'."
1923 (defcustom org-refile-use-outline-path nil
1924 "Non-nil means provide refile targets as paths.
1925 So a level 3 headline will be available as level1/level2/level3.
1927 When the value is `file', also include the file name (without directory)
1928 into the path. In this case, you can also stop the completion after
1929 the file name, to get entries inserted as top level in the file.
1931 When `full-file-path', include the full file path."
1934 (const :tag "Not" nil)
1935 (const :tag "Yes" t)
1936 (const :tag "Start with file name" file)
1937 (const :tag "Start with full file path" full-file-path)))
1939 (defcustom org-outline-path-complete-in-steps t
1940 "Non-nil means complete the outline path in hierarchical steps.
1941 When Org-mode uses the refile interface to select an outline path
1942 \(see variable `org-refile-use-outline-path'), the completion of
1943 the path can be done is a single go, or if can be done in steps down
1944 the headline hierarchy. Going in steps is probably the best if you
1945 do not use a special completion package like `ido' or `icicles'.
1946 However, when using these packages, going in one step can be very
1947 fast, while still showing the whole path to the entry."
1951 (defcustom org-refile-allow-creating-parent-nodes nil
1952 "Non-nil means allow to create new nodes as refile targets.
1953 New nodes are then created by adding \"/new node name\" to the completion
1954 of an existing node. When the value of this variable is `confirm',
1955 new node creation must be confirmed by the user (recommended)
1956 When nil, the completion must match an existing entry.
1958 Note that, if the new heading is not seen by the criteria
1959 listed in `org-refile-targets', multiple instances of the same
1960 heading would be created by trying again to file under the new
1964 (const :tag "Never" nil)
1965 (const :tag "Always" t)
1966 (const :tag "Prompt for confirmation" confirm)))
1968 (defgroup org-todo nil
1969 "Options concerning TODO items in Org-mode."
1973 (defgroup org-progress nil
1974 "Options concerning Progress logging in Org-mode."
1978 (defvar org-todo-interpretation-widgets
1979 '((:tag "Sequence (cycling hits every state)" sequence)
1980 (:tag "Type (cycling directly to DONE)" type))
1981 "The available interpretation symbols for customizing `org-todo-keywords'.
1982 Interested libraries should add to this list.")
1984 (defcustom org-todo-keywords '((sequence "TODO" "DONE"))
1985 "List of TODO entry keyword sequences and their interpretation.
1986 \\<org-mode-map>This is a list of sequences.
1988 Each sequence starts with a symbol, either `sequence' or `type',
1989 indicating if the keywords should be interpreted as a sequence of
1990 action steps, or as different types of TODO items. The first
1991 keywords are states requiring action - these states will select a headline
1992 for inclusion into the global TODO list Org-mode produces. If one of
1993 the \"keywords\" is the vertical bar, \"|\", the remaining keywords
1994 signify that no further action is necessary. If \"|\" is not found,
1995 the last keyword is treated as the only DONE state of the sequence.
1997 The command \\[org-todo] cycles an entry through these states, and one
1998 additional state where no keyword is present. For details about this
1999 cycling, see the manual.
2001 TODO keywords and interpretation can also be set on a per-file basis with
2002 the special #+SEQ_TODO and #+TYP_TODO lines.
2004 Each keyword can optionally specify a character for fast state selection
2005 \(in combination with the variable `org-use-fast-todo-selection')
2006 and specifiers for state change logging, using the same syntax
2007 that is used in the \"#+TODO:\" lines. For example, \"WAIT(w)\" says
2008 that the WAIT state can be selected with the \"w\" key. \"WAIT(w!)\"
2009 indicates to record a time stamp each time this state is selected.
2011 Each keyword may also specify if a timestamp or a note should be
2012 recorded when entering or leaving the state, by adding additional
2013 characters in the parenthesis after the keyword. This looks like this:
2014 \"WAIT(w@/!)\". \"@\" means to add a note (with time), \"!\" means to
2015 record only the time of the state change. With X and Y being either
2016 \"@\" or \"!\", \"X/Y\" means use X when entering the state, and use
2017 Y when leaving the state if and only if the *target* state does not
2018 define X. You may omit any of the fast-selection key or X or /Y,
2019 so WAIT(w@), WAIT(w/@) and WAIT(@/@) are all valid.
2021 For backward compatibility, this variable may also be just a list
2022 of keywords - in this case the interpretation (sequence or type) will be
2023 taken from the (otherwise obsolete) variable `org-todo-interpretation'."
2025 :group 'org-keywords
2027 (repeat :tag "Old syntax, just keywords"
2028 (string :tag "Keyword"))
2029 (repeat :tag "New syntax"
2032 :tag "Interpretation"
2033 ;;Quick and dirty way to see
2034 ;;`org-todo-interpretations'. This takes the
2035 ;;place of item arguments
2043 org-todo-interpretation-widgets))
2046 (string :tag "Keyword"))))))
2048 (defvar org-todo-keywords-1 nil
2049 "All TODO and DONE keywords active in a buffer.")
2050 (make-variable-buffer-local 'org-todo-keywords-1)
2051 (defvar org-todo-keywords-for-agenda nil)
2052 (defvar org-done-keywords-for-agenda nil)
2053 (defvar org-drawers-for-agenda nil)
2054 (defvar org-todo-keyword-alist-for-agenda nil)
2055 (defvar org-tag-alist-for-agenda nil)
2056 (defvar org-agenda-contributing-files nil)
2057 (defvar org-not-done-keywords nil)
2058 (make-variable-buffer-local 'org-not-done-keywords)
2059 (defvar org-done-keywords nil)
2060 (make-variable-buffer-local 'org-done-keywords)
2061 (defvar org-todo-heads nil)
2062 (make-variable-buffer-local 'org-todo-heads)
2063 (defvar org-todo-sets nil)
2064 (make-variable-buffer-local 'org-todo-sets)
2065 (defvar org-todo-log-states nil)
2066 (make-variable-buffer-local 'org-todo-log-states)
2067 (defvar org-todo-kwd-alist nil)
2068 (make-variable-buffer-local 'org-todo-kwd-alist)
2069 (defvar org-todo-key-alist nil)
2070 (make-variable-buffer-local 'org-todo-key-alist)
2071 (defvar org-todo-key-trigger nil)
2072 (make-variable-buffer-local 'org-todo-key-trigger)
2074 (defcustom org-todo-interpretation 'sequence
2075 "Controls how TODO keywords are interpreted.
2076 This variable is in principle obsolete and is only used for
2077 backward compatibility, if the interpretation of todo keywords is
2078 not given already in `org-todo-keywords'. See that variable for
2081 :group 'org-keywords
2082 :type '(choice (const sequence)
2085 (defcustom org-use-fast-todo-selection t
2086 "Non-nil means use the fast todo selection scheme with C-c C-t.
2087 This variable describes if and under what circumstances the cycling
2088 mechanism for TODO keywords will be replaced by a single-key, direct
2091 When nil, fast selection is never used.
2093 When the symbol `prefix', it will be used when `org-todo' is called with
2094 a prefix argument, i.e. `C-u C-c C-t' in an Org-mode buffer, and `C-u t'
2095 in an agenda buffer.
2097 When t, fast selection is used by default. In this case, the prefix
2098 argument forces cycling instead.
2100 In all cases, the special interface is only used if access keys have actually
2101 been assigned by the user, i.e. if keywords in the configuration are followed
2102 by a letter in parenthesis, like TODO(t)."
2105 (const :tag "Never" nil)
2106 (const :tag "By default" t)
2107 (const :tag "Only with C-u C-c C-t" prefix)))
2109 (defcustom org-provide-todo-statistics t
2110 "Non-nil means update todo statistics after insert and toggle.
2111 ALL-HEADLINES means update todo statistics by including headlines
2112 with no TODO keyword as well, counting them as not done.
2113 A list of TODO keywords means the same, but skip keywords that are
2116 When this is set, todo statistics is updated in the parent of the
2117 current entry each time a todo state is changed."
2120 (const :tag "Yes, only for TODO entries" t)
2121 (const :tag "Yes, including all entries" 'all-headlines)
2122 (repeat :tag "Yes, for TODOs in this list"
2123 (string :tag "TODO keyword"))
2124 (other :tag "No TODO statistics" nil)))
2126 (defcustom org-hierarchical-todo-statistics t
2127 "Non-nil means TODO statistics covers just direct children.
2128 When nil, all entries in the subtree are considered.
2129 This has only an effect if `org-provide-todo-statistics' is set.
2130 To set this to nil for only a single subtree, use a COOKIE_DATA
2131 property and include the word \"recursive\" into the value."
2135 (defcustom org-after-todo-state-change-hook nil
2136 "Hook which is run after the state of a TODO item was changed.
2137 The new state (a string with a TODO keyword, or nil) is available in the
2138 Lisp variable `state'."
2142 (defvar org-blocker-hook nil
2143 "Hook for functions that are allowed to block a state change.
2145 Each function gets as its single argument a property list, see
2146 `org-trigger-hook' for more information about this list.
2148 If any of the functions in this hook returns nil, the state change
2151 (defvar org-trigger-hook nil
2152 "Hook for functions that are triggered by a state change.
2154 Each function gets as its single argument a property list with at least
2155 the following elements:
2157 (:type type-of-change :position pos-at-entry-start
2158 :from old-state :to new-state)
2160 Depending on the type, more properties may be present.
2162 This mechanism is currently implemented for:
2166 :type todo-state-change
2167 :from previous state (keyword as a string), or nil, or a symbol
2168 'todo' or 'done', to indicate the general type of state.
2169 :to new state, like in :from")
2171 (defcustom org-enforce-todo-dependencies nil
2172 "Non-nil means undone TODO entries will block switching the parent to DONE.
2173 Also, if a parent has an :ORDERED: property, switching an entry to DONE will
2174 be blocked if any prior sibling is not yet done.
2175 Finally, if the parent is blocked because of ordered siblings of its own,
2176 the child will also be blocked.
2177 This variable needs to be set before org.el is loaded, and you need to
2178 restart Emacs after a change to make the change effective. The only way
2179 to change is while Emacs is running is through the customize interface."
2180 :set (lambda (var val)
2183 (add-hook 'org-blocker-hook
2184 'org-block-todo-from-children-or-siblings-or-parent)
2185 (remove-hook 'org-blocker-hook
2186 'org-block-todo-from-children-or-siblings-or-parent)))
2190 (defcustom org-enforce-todo-checkbox-dependencies nil
2191 "Non-nil means unchecked boxes will block switching the parent to DONE.
2192 When this is nil, checkboxes have no influence on switching TODO states.
2193 When non-nil, you first need to check off all check boxes before the TODO
2194 entry can be switched to DONE.
2195 This variable needs to be set before org.el is loaded, and you need to
2196 restart Emacs after a change to make the change effective. The only way
2197 to change is while Emacs is running is through the customize interface."
2198 :set (lambda (var val)
2201 (add-hook 'org-blocker-hook
2202 'org-block-todo-from-checkboxes)
2203 (remove-hook 'org-blocker-hook
2204 'org-block-todo-from-checkboxes)))
2208 (defcustom org-treat-insert-todo-heading-as-state-change nil
2209 "Non-nil means inserting a TODO heading is treated as state change.
2210 So when the command \\[org-insert-todo-heading] is used, state change
2211 logging will apply if appropriate. When nil, the new TODO item will
2212 be inserted directly, and no logging will take place."
2216 (defcustom org-treat-S-cursor-todo-selection-as-state-change t
2217 "Non-nil means switching TODO states with S-cursor counts as state change.
2218 This is the default behavior. However, setting this to nil allows a
2219 convenient way to select a TODO state and bypass any logging associated
2224 (defcustom org-todo-state-tags-triggers nil
2225 "Tag changes that should be triggered by TODO state changes.
2226 This is a list. Each entry is
2228 (state-change (tag . flag) .......)
2230 State-change can be a string with a state, and empty string to indicate the
2231 state that has no TODO keyword, or it can be one of the symbols `todo'
2232 or `done', meaning any not-done or done state, respectively."
2236 (cons (choice :tag "When changing to"
2237 (const :tag "Not-done state" todo)
2238 (const :tag "Done state" done)
2239 (string :tag "State"))
2241 (cons :tag "Tag action"
2243 (choice (const :tag "Add" t) (const :tag "Remove" nil)))))))
2245 (defcustom org-log-done nil
2246 "Information to record when a task moves to the DONE state.
2248 Possible values are:
2250 nil Don't add anything, just change the keyword
2251 time Add a time stamp to the task
2252 note Prompt for a note and add it with template `org-log-note-headings'
2254 This option can also be set with on a per-file-basis with
2256 #+STARTUP: nologdone
2258 #+STARTUP: lognotedone
2260 You can have local logging settings for a subtree by setting the LOGGING
2261 property to one or more of these keywords."
2263 :group 'org-progress
2265 (const :tag "No logging" nil)
2266 (const :tag "Record CLOSED timestamp" time)
2267 (const :tag "Record CLOSED timestamp with note." note)))
2269 ;; Normalize old uses of org-log-done.
2271 ((eq org-log-done t) (setq org-log-done 'time))
2272 ((and (listp org-log-done) (memq 'done org-log-done))
2273 (setq org-log-done 'note)))
2275 (defcustom org-log-reschedule nil
2276 "Information to record when the scheduling date of a tasks is modified.
2278 Possible values are:
2280 nil Don't add anything, just change the date
2281 time Add a time stamp to the task
2282 note Prompt for a note and add it with template `org-log-note-headings'
2284 This option can also be set with on a per-file-basis with
2286 #+STARTUP: nologreschedule
2287 #+STARTUP: logreschedule
2288 #+STARTUP: lognotereschedule"
2290 :group 'org-progress
2292 (const :tag "No logging" nil)
2293 (const :tag "Record timestamp" time)
2294 (const :tag "Record timestamp with note." note)))
2296 (defcustom org-log-redeadline nil
2297 "Information to record when the deadline date of a tasks is modified.
2299 Possible values are:
2301 nil Don't add anything, just change the date
2302 time Add a time stamp to the task
2303 note Prompt for a note and add it with template `org-log-note-headings'
2305 This option can also be set with on a per-file-basis with
2307 #+STARTUP: nologredeadline
2308 #+STARTUP: logredeadline
2309 #+STARTUP: lognoteredeadline
2311 You can have local logging settings for a subtree by setting the LOGGING
2312 property to one or more of these keywords."
2314 :group 'org-progress
2316 (const :tag "No logging" nil)
2317 (const :tag "Record timestamp" time)
2318 (const :tag "Record timestamp with note." note)))
2320 (defcustom org-log-note-clock-out nil
2321 "Non-nil means record a note when clocking out of an item.
2322 This can also be configured on a per-file basis by adding one of
2323 the following lines anywhere in the buffer:
2325 #+STARTUP: lognoteclock-out
2326 #+STARTUP: nolognoteclock-out"
2328 :group 'org-progress
2331 (defcustom org-log-done-with-time t
2332 "Non-nil means the CLOSED time stamp will contain date and time.
2333 When nil, only the date will be recorded."
2334 :group 'org-progress
2337 (defcustom org-log-note-headings
2338 '((done . "CLOSING NOTE %t")
2339 (state . "State %-12s from %-12S %t")
2340 (note . "Note taken on %t")
2341 (reschedule . "Rescheduled from %S on %t")
2342 (delschedule . "Not scheduled, was %S on %t")
2343 (redeadline . "New deadline from %S on %t")
2344 (deldeadline . "Removed deadline, was %S on %t")
2345 (refile . "Refiled on %t")
2347 "Headings for notes added to entries.
2348 The value is an alist, with the car being a symbol indicating the note
2349 context, and the cdr is the heading to be used. The heading may also be the
2351 %t in the heading will be replaced by a time stamp.
2352 %T will be an active time stamp instead the default inactive one
2353 %s will be replaced by the new TODO state, in double quotes.
2354 %S will be replaced by the old TODO state, in double quotes.
2355 %u will be replaced by the user name.
2356 %U will be replaced by the full user name.
2358 In fact, it is not a good idea to change the `state' entry, because
2359 agenda log mode depends on the format of these entries."
2361 :group 'org-progress
2362 :type '(list :greedy t
2363 (cons (const :tag "Heading when closing an item" done) string)
2365 "Heading when changing todo state (todo sequence only)"
2367 (cons (const :tag "Heading when just taking a note" note) string)
2368 (cons (const :tag "Heading when clocking out" clock-out) string)
2369 (cons (const :tag "Heading when an item is no longer scheduled" delschedule) string)
2370 (cons (const :tag "Heading when rescheduling" reschedule) string)
2371 (cons (const :tag "Heading when changing deadline" redeadline) string)
2372 (cons (const :tag "Heading when deleting a deadline" deldeadline) string)
2373 (cons (const :tag "Heading when refiling" refile) string)))
2375 (unless (assq 'note org-log-note-headings)
2376 (push '(note . "%t") org-log-note-headings))
2378 (defcustom org-log-into-drawer nil
2379 "Non-nil means insert state change notes and time stamps into a drawer.
2380 When nil, state changes notes will be inserted after the headline and
2381 any scheduling and clock lines, but not inside a drawer.
2383 The value of this variable should be the name of the drawer to use.
2384 LOGBOOK is proposed as the default drawer for this purpose, you can
2385 also set this to a string to define the drawer of your choice.
2387 A value of t is also allowed, representing \"LOGBOOK\".
2389 If this variable is set, `org-log-state-notes-insert-after-drawers'
2392 You can set the property LOG_INTO_DRAWER to overrule this setting for
2395 :group 'org-progress
2397 (const :tag "Not into a drawer" nil)
2398 (const :tag "LOGBOOK" t)
2399 (string :tag "Other")))
2401 (if (fboundp 'defvaralias)
2402 (defvaralias 'org-log-state-notes-into-drawer 'org-log-into-drawer))
2404 (defun org-log-into-drawer ()
2405 "Return the value of `org-log-into-drawer', but let properties overrule.
2406 If the current entry has or inherits a LOG_INTO_DRAWER property, it will be
2407 used instead of the default value."
2408 (let ((p (org-entry-get nil "LOG_INTO_DRAWER" 'inherit)))
2410 ((or (not p) (equal p "nil")) org-log-into-drawer)
2411 ((equal p "t") "LOGBOOK")
2414 (defcustom org-log-state-notes-insert-after-drawers nil
2415 "Non-nil means insert state change notes after any drawers in entry.
2416 Only the drawers that *immediately* follow the headline and the
2417 deadline/scheduled line are skipped.
2418 When nil, insert notes right after the heading and perhaps the line
2419 with deadline/scheduling if present.
2421 This variable will have no effect if `org-log-into-drawer' is
2424 :group 'org-progress
2427 (defcustom org-log-states-order-reversed t
2428 "Non-nil means the latest state note will be directly after heading.
2429 When nil, the state change notes will be ordered according to time."
2431 :group 'org-progress
2434 (defcustom org-todo-repeat-to-state nil
2435 "The TODO state to which a repeater should return the repeating task.
2436 By default this is the first task in a TODO sequence, or the previous state
2437 in a TODO_TYP set. But you can specify another task here.
2438 alternatively, set the :REPEAT_TO_STATE: property of the entry."
2440 :type '(choice (const :tag "Head of sequence" nil)
2441 (string :tag "Specific state")))
2443 (defcustom org-log-repeat 'time
2444 "Non-nil means record moving through the DONE state when triggering repeat.
2445 An auto-repeating task is immediately switched back to TODO when
2446 marked DONE. If you are not logging state changes (by adding \"@\"
2447 or \"!\" to the TODO keyword definition), or set `org-log-done' to
2448 record a closing note, there will be no record of the task moving
2449 through DONE. This variable forces taking a note anyway.
2451 nil Don't force a record
2452 time Record a time stamp
2455 This option can also be set with on a per-file-basis with
2457 #+STARTUP: logrepeat
2458 #+STARTUP: lognoterepeat
2459 #+STARTUP: nologrepeat
2461 You can have local logging settings for a subtree by setting the LOGGING
2462 property to one or more of these keywords."
2464 :group 'org-progress
2466 (const :tag "Don't force a record" nil)
2467 (const :tag "Force recording the DONE state" time)
2468 (const :tag "Force recording a note with the DONE state" note)))
2471 (defgroup org-priorities nil
2472 "Priorities in Org-mode."
2473 :tag "Org Priorities"
2476 (defcustom org-enable-priority-commands t
2477 "Non-nil means priority commands are active.
2478 When nil, these commands will be disabled, so that you never accidentally
2480 :group 'org-priorities
2483 (defcustom org-highest-priority ?A
2484 "The highest priority of TODO items. A character like ?A, ?B etc.
2485 Must have a smaller ASCII number than `org-lowest-priority'."
2486 :group 'org-priorities
2489 (defcustom org-lowest-priority ?C
2490 "The lowest priority of TODO items. A character like ?A, ?B etc.
2491 Must have a larger ASCII number than `org-highest-priority'."
2492 :group 'org-priorities
2495 (defcustom org-default-priority ?B
2496 "The default priority of TODO items.
2497 This is the priority an item gets if no explicit priority is given.
2498 When starting to cycle on an empty priority the first step in the cycle
2499 depends on `org-priority-start-cycle-with-default'. The resulting first
2500 step priority must not exceed the range from `org-highest-priority' to
2501 `org-lowest-priority' which means that `org-default-priority' has to be
2502 in this range exclusive or inclusive the range boundaries. Else the
2503 first step refuses to set the default and the second will fall back
2504 to (depending on the command used) the highest or lowest priority."
2505 :group 'org-priorities
2508 (defcustom org-priority-start-cycle-with-default t
2509 "Non-nil means start with default priority when starting to cycle.
2510 When this is nil, the first step in the cycle will be (depending on the
2511 command used) one higher or lower than the default priority.
2512 See also `org-default-priority'."
2513 :group 'org-priorities
2516 (defcustom org-get-priority-function nil
2517 "Function to extract the priority from a string.
2518 The string is normally the headline. If this is nil Org computes the
2519 priority from the priority cookie like [#A] in the headline. It returns
2520 an integer, increasing by 1000 for each priority level.
2521 The user can set a different function here, which should take a string
2522 as an argument and return the numeric priority."
2523 :group 'org-priorities
2526 (defgroup org-time nil
2527 "Options concerning time stamps and deadlines in Org-mode."
2531 (defcustom org-insert-labeled-timestamps-at-point nil
2532 "Non-nil means SCHEDULED and DEADLINE timestamps are inserted at point.
2533 When nil, these labeled time stamps are forces into the second line of an
2534 entry, just after the headline. When scheduling from the global TODO list,
2535 the time stamp will always be forced into the second line."
2539 (defconst org-time-stamp-formats '("<%Y-%m-%d %a>" . "<%Y-%m-%d %a %H:%M>")
2540 "Formats for `format-time-string' which are used for time stamps.
2541 It is not recommended to change this constant.")
2543 (defcustom org-time-stamp-rounding-minutes '(0 5)
2544 "Number of minutes to round time stamps to.
2545 These are two values, the first applies when first creating a time stamp.
2546 The second applies when changing it with the commands `S-up' and `S-down'.
2547 When changing the time stamp, this means that it will change in steps
2548 of N minutes, as given by the second value.
2550 When a setting is 0 or 1, insert the time unmodified. Useful rounding
2551 numbers should be factors of 60, so for example 5, 10, 15.
2553 When this is larger than 1, you can still force an exact time stamp by using
2554 a double prefix argument to a time stamp command like `C-c .' or `C-c !',
2555 and by using a prefix arg to `S-up/down' to specify the exact number
2556 of minutes to shift."
2558 :get #'(lambda (var) ; Make sure both elements are there
2559 (if (integerp (default-value var))
2560 (list (default-value var) 5)
2561 (default-value var)))
2563 (integer :tag "when inserting times")
2564 (integer :tag "when modifying times")))
2566 ;; Normalize old customizations of this variable.
2567 (when (integerp org-time-stamp-rounding-minutes)
2568 (setq org-time-stamp-rounding-minutes
2569 (list org-time-stamp-rounding-minutes
2570 org-time-stamp-rounding-minutes)))
2572 (defcustom org-display-custom-times nil
2573 "Non-nil means overlay custom formats over all time stamps.
2574 The formats are defined through the variable `org-time-stamp-custom-formats'.
2575 To turn this on on a per-file basis, insert anywhere in the file:
2576 #+STARTUP: customtime"
2580 (make-variable-buffer-local 'org-display-custom-times)
2582 (defcustom org-time-stamp-custom-formats
2583 '("<%m/%d/%y %a>" . "<%m/%d/%y %a %H:%M>") ; american
2584 "Custom formats for time stamps. See `format-time-string' for the syntax.
2585 These are overlayed over the default ISO format if the variable
2586 `org-display-custom-times' is set. Time like %H:%M should be at the
2587 end of the second format. The custom formats are also honored by export
2588 commands, if custom time display is turned on at the time of export."
2592 (defun org-time-stamp-format (&optional long inactive)
2593 "Get the right format for a time string."
2594 (let ((f (if long (cdr org-time-stamp-formats)
2595 (car org-time-stamp-formats))))
2597 (concat "[" (substring f 1 -1) "]")
2600 (defcustom org-time-clocksum-format "%d:%02d"
2601 "The format string used when creating CLOCKSUM lines.
2602 This is also used when org-mode generates a time duration."
2606 (defcustom org-time-clocksum-use-fractional nil
2607 "If non-nil, \\[org-clock-display] uses fractional times.
2608 org-mode generates a time duration."
2612 (defcustom org-time-clocksum-fractional-format "%.2f"
2613 "The format string used when creating CLOCKSUM lines, or when
2614 org-mode generates a time duration."
2618 (defcustom org-deadline-warning-days 14
2619 "No. of days before expiration during which a deadline becomes active.
2620 This variable governs the display in sparse trees and in the agenda.
2621 When 0 or negative, it means use this number (the absolute value of it)
2622 even if a deadline has a different individual lead time specified.
2624 Custom commands can set this variable in the options section."
2626 :group 'org-agenda-daily/weekly
2629 (defcustom org-read-date-prefer-future t
2630 "Non-nil means assume future for incomplete date input from user.
2631 This affects the following situations:
2632 1. The user gives a month but not a year.
2633 For example, if it is April and you enter \"feb 2\", this will be read
2634 as Feb 2, *next* year. \"May 5\", however, will be this year.
2635 2. The user gives a day, but no month.
2636 For example, if today is the 15th, and you enter \"3\", Org-mode will
2637 read this as the third of *next* month. However, if you enter \"17\",
2638 it will be considered as *this* month.
2640 If you set this variable to the symbol `time', then also the following
2643 3. If the user gives a time, but no day. If the time is before now,
2644 to will be interpreted as tomorrow.
2646 Currently none of this works for ISO week specifications.
2648 When this option is nil, the current day, month and year will always be
2651 See also `org-agenda-jump-prefer-future'."
2654 (const :tag "Never" nil)
2655 (const :tag "Check month and day" t)
2656 (const :tag "Check month, day, and time" time)))
2658 (defcustom org-agenda-jump-prefer-future 'org-read-date-prefer-future
2659 "Should the agenda jump command prefer the future for incomplete dates?
2660 The default is to do the same as configured in `org-read-date-prefer-future'.
2661 But you can also set a deviating value here.
2662 This may t or nil, or the symbol `org-read-date-prefer-future'."
2666 (const :tag "Use org-read-date-prefer-future"
2667 org-read-date-prefer-future)
2668 (const :tag "Never" nil)
2669 (const :tag "Always" t)))
2671 (defcustom org-read-date-force-compatible-dates t
2672 "Should date/time prompt force dates that are guaranteed to work in Emacs?
2674 Depending on the system Emacs is running on, certain dates cannot
2675 be represented with the type used internally to represent time.
2676 Dates between 1970-1-1 and 2038-1-1 can always be represented
2677 correctly. Some systems allow for earlier dates, some for later,
2678 some for both. One way to find out it to insert any date into an
2679 Org buffer, putting the cursor on the year and hitting S-up and
2680 S-down to test the range.
2682 When this variable is set to t, the date/time prompt will not let
2683 you specify dates outside the 1970-2037 range, so it is certain that
2684 these dates will work in whatever version of Emacs you are
2685 running, and also that you can move a file from one Emacs implementation
2686 to another. WHenever Org is forcing the year for you, it will display
2689 When this variable is nil, Org will check if the date is
2690 representable in the specific Emacs implementation you are using.
2691 If not, it will force a year, usually the current year, and beep
2692 to remind you. Currently this setting is not recommended because
2693 the likelihood that you will open your Org files in an Emacs that
2694 has limited date range is not negligible.
2696 A workaround for this problem is to use diary sexp dates for time
2697 stamps outside of this range."
2701 (defcustom org-read-date-display-live t
2702 "Non-nil means display current interpretation of date prompt live.
2703 This display will be in an overlay, in the minibuffer."
2707 (defcustom org-read-date-popup-calendar t
2708 "Non-nil means pop up a calendar when prompting for a date.
2709 In the calendar, the date can be selected with mouse-1. However, the
2710 minibuffer will also be active, and you can simply enter the date as well.
2711 When nil, only the minibuffer will be available."
2714 (if (fboundp 'defvaralias)
2715 (defvaralias 'org-popup-calendar-for-date-prompt
2716 'org-read-date-popup-calendar))
2718 (defcustom org-read-date-minibuffer-setup-hook nil
2719 "Hook to be used to set up keys for the date/time interface.
2720 Add key definitions to `minibuffer-local-map', which will be a temporary
2725 (defcustom org-extend-today-until 0
2726 "The hour when your day really ends. Must be an integer.
2727 This has influence for the following applications:
2728 - When switching the agenda to \"today\". It it is still earlier than
2729 the time given here, the day recognized as TODAY is actually yesterday.
2730 - When a date is read from the user and it is still before the time given
2731 here, the current date and time will be assumed to be yesterday, 23:59.
2732 Also, timestamps inserted in remember templates follow this rule.
2734 IMPORTANT: This is a feature whose implementation is and likely will
2735 remain incomplete. Really, it is only here because past midnight seems to
2736 be the favorite working time of John Wiegley :-)"
2740 (defcustom org-edit-timestamp-down-means-later nil
2741 "Non-nil means S-down will increase the time in a time stamp.
2742 When nil, S-up will increase."
2746 (defcustom org-calendar-follow-timestamp-change t
2747 "Non-nil means make the calendar window follow timestamp changes.
2748 When a timestamp is modified and the calendar window is visible, it will be
2749 moved to the new date."
2753 (defgroup org-tags nil
2754 "Options concerning tags in Org-mode."
2758 (defcustom org-tag-alist nil
2759 "List of tags allowed in Org-mode files.
2760 When this list is nil, Org-mode will base TAG input on what is already in the
2762 The value of this variable is an alist, the car of each entry must be a
2763 keyword as a string, the cdr may be a character that is used to select
2764 that tag through the fast-tag-selection interface.
2765 See the manual for details."
2769 (cons (string :tag "Tag name")
2770 (character :tag "Access char"))
2771 (list :tag "Start radio group"
2773 (option (string :tag "Group description")))
2774 (list :tag "End radio group"
2776 (option (string :tag "Group description")))
2777 (const :tag "New line" (:newline)))))
2779 (defcustom org-tag-persistent-alist nil
2780 "List of tags that will always appear in all Org-mode files.
2781 This is in addition to any in buffer settings or customizations
2783 When this list is nil, Org-mode will base TAG input on `org-tag-alist'.
2784 The value of this variable is an alist, the car of each entry must be a
2785 keyword as a string, the cdr may be a character that is used to select
2786 that tag through the fast-tag-selection interface.
2787 See the manual for details.
2788 To disable these tags on a per-file basis, insert anywhere in the file:
2793 (cons (string :tag "Tag name")
2794 (character :tag "Access char"))
2795 (const :tag "Start radio group" (:startgroup))
2796 (const :tag "End radio group" (:endgroup))
2797 (const :tag "New line" (:newline)))))
2799 (defcustom org-complete-tags-always-offer-all-agenda-tags nil
2800 "If non-nil, always offer completion for all tags of all agenda files.
2801 Instead of customizing this variable directly, you might want to
2802 set it locally for capture buffers, because there no list of
2803 tags in that file can be created dynamically (there are none).
2805 (add-hook 'org-capture-mode-hook
2807 (set (make-local-variable
2808 'org-complete-tags-always-offer-all-agenda-tags)
2813 (defvar org-file-tags nil
2814 "List of tags that can be inherited by all entries in the file.
2815 The tags will be inherited if the variable `org-use-tag-inheritance'
2816 says they should be.
2817 This variable is populated from #+FILETAGS lines.")
2819 (defcustom org-use-fast-tag-selection 'auto
2820 "Non-nil means use fast tag selection scheme.
2821 This is a special interface to select and deselect tags with single keys.
2822 When nil, fast selection is never used.
2823 When the symbol `auto', fast selection is used if and only if selection
2824 characters for tags have been configured, either through the variable
2825 `org-tag-alist' or through a #+TAGS line in the buffer.
2826 When t, fast selection is always used and selection keys are assigned
2827 automatically if necessary."
2830 (const :tag "Always" t)
2831 (const :tag "Never" nil)
2832 (const :tag "When selection characters are configured" 'auto)))
2834 (defcustom org-fast-tag-selection-single-key nil
2835 "Non-nil means fast tag selection exits after first change.
2836 When nil, you have to press RET to exit it.
2837 During fast tag selection, you can toggle this flag with `C-c'.
2838 This variable can also have the value `expert'. In this case, the window
2839 displaying the tags menu is not even shown, until you press C-c again."
2842 (const :tag "No" nil)
2843 (const :tag "Yes" t)
2844 (const :tag "Expert" expert)))
2846 (defvar org-fast-tag-selection-include-todo nil
2847 "Non-nil means fast tags selection interface will also offer TODO states.
2848 This is an undocumented feature, you should not rely on it.")
2850 (defcustom org-tags-column (if (featurep 'xemacs) -76 -77)
2851 "The column to which tags should be indented in a headline.
2852 If this number is positive, it specifies the column. If it is negative,
2853 it means that the tags should be flushright to that column. For example,
2854 -80 works well for a normal 80 character screen."
2858 (defcustom org-auto-align-tags t
2859 "Non-nil keeps tags aligned when modifying headlines.
2860 Some operations (i.e. demoting) change the length of a headline and
2861 therefore shift the tags around. With this option turned on, after
2862 each such operation the tags are again aligned to `org-tags-column'."
2866 (defcustom org-use-tag-inheritance t
2867 "Non-nil means tags in levels apply also for sublevels.
2868 When nil, only the tags directly given in a specific line apply there.
2869 This may also be a list of tags that should be inherited, or a regexp that
2870 matches tags that should be inherited. Additional control is possible
2871 with the variable `org-tags-exclude-from-inheritance' which gives an
2872 explicit list of tags to be excluded from inheritance., even if the value of
2873 `org-use-tag-inheritance' would select it for inheritance.
2875 If this option is t, a match early-on in a tree can lead to a large
2876 number of matches in the subtree when constructing the agenda or creating
2877 a sparse tree. If you only want to see the first match in a tree during
2878 a search, check out the variable `org-tags-match-list-sublevels'."
2881 (const :tag "Not" nil)
2882 (const :tag "Always" t)
2883 (repeat :tag "Specific tags" (string :tag "Tag"))
2884 (regexp :tag "Tags matched by regexp")))
2886 (defcustom org-tags-exclude-from-inheritance nil
2887 "List of tags that should never be inherited.
2888 This is a way to exclude a few tags from inheritance. For way to do
2889 the opposite, to actively allow inheritance for selected tags,
2890 see the variable `org-use-tag-inheritance'."
2892 :type '(repeat (string :tag "Tag")))
2894 (defun org-tag-inherit-p (tag)
2895 "Check if TAG is one that should be inherited."
2897 ((member tag org-tags-exclude-from-inheritance) nil)
2898 ((eq org-use-tag-inheritance t) t)
2899 ((not org-use-tag-inheritance) nil)
2900 ((stringp org-use-tag-inheritance)
2901 (string-match org-use-tag-inheritance tag))
2902 ((listp org-use-tag-inheritance)
2903 (member tag org-use-tag-inheritance))
2904 (t (error "Invalid setting of `org-use-tag-inheritance'"))))
2906 (defcustom org-tags-match-list-sublevels t
2907 "Non-nil means list also sublevels of headlines matching a search.
2908 This variable applies to tags/property searches, and also to stuck
2909 projects because this search is based on a tags match as well.
2911 When set to the symbol `indented', sublevels are indented with
2914 Because of tag inheritance (see variable `org-use-tag-inheritance'),
2915 the sublevels of a headline matching a tag search often also match
2916 the same search. Listing all of them can create very long lists.
2917 Setting this variable to nil causes subtrees of a match to be skipped.
2919 This variable is semi-obsolete and probably should always be true. It
2920 is better to limit inheritance to certain tags using the variables
2921 `org-use-tag-inheritance' and `org-tags-exclude-from-inheritance'."
2924 (const :tag "No, don't list them" nil)
2925 (const :tag "Yes, do list them" t)
2926 (const :tag "List them, indented with leading dots" indented)))
2928 (defcustom org-tags-sort-function nil
2929 "When set, tags are sorted using this function as a comparator."
2932 (const :tag "No sorting" nil)
2933 (const :tag "Alphabetical" string<)
2934 (const :tag "Reverse alphabetical" string>)
2935 (function :tag "Custom function" nil)))
2937 (defvar org-tags-history nil
2938 "History of minibuffer reads for tags.")
2939 (defvar org-last-tags-completion-table nil
2940 "The last used completion table for tags.")
2941 (defvar org-after-tags-change-hook nil
2942 "Hook that is run after the tags in a line have changed.")
2944 (defgroup org-properties nil
2945 "Options concerning properties in Org-mode."
2946 :tag "Org Properties"
2949 (defcustom org-property-format "%-10s %s"
2950 "How property key/value pairs should be formatted by `indent-line'.
2951 When `indent-line' hits a property definition, it will format the line
2952 according to this format, mainly to make sure that the values are
2953 lined-up with respect to each other."
2954 :group 'org-properties
2957 (defcustom org-use-property-inheritance nil
2958 "Non-nil means properties apply also for sublevels.
2960 This setting is chiefly used during property searches. Turning it on can
2961 cause significant overhead when doing a search, which is why it is not
2964 When nil, only the properties directly given in the current entry count.
2965 When t, every property is inherited. The value may also be a list of
2966 properties that should have inheritance, or a regular expression matching
2967 properties that should be inherited.
2969 However, note that some special properties use inheritance under special
2970 circumstances (not in searches). Examples are CATEGORY, ARCHIVE, COLUMNS,
2971 and the properties ending in \"_ALL\" when they are used as descriptor
2972 for valid values of a property.
2974 Note for programmers:
2975 When querying an entry with `org-entry-get', you can control if inheritance
2976 should be used. By default, `org-entry-get' looks only at the local
2977 properties. You can request inheritance by setting the inherit argument
2978 to t (to force inheritance) or to `selective' (to respect the setting
2980 :group 'org-properties
2982 (const :tag "Not" nil)
2983 (const :tag "Always" t)
2984 (repeat :tag "Specific properties" (string :tag "Property"))
2985 (regexp :tag "Properties matched by regexp")))
2987 (defun org-property-inherit-p (property)
2988 "Check if PROPERTY is one that should be inherited."
2990 ((eq org-use-property-inheritance t) t)
2991 ((not org-use-property-inheritance) nil)
2992 ((stringp org-use-property-inheritance)
2993 (string-match org-use-property-inheritance property))
2994 ((listp org-use-property-inheritance)
2995 (member property org-use-property-inheritance))
2996 (t (error "Invalid setting of `org-use-property-inheritance'"))))
2998 (defcustom org-columns-default-format "%25ITEM %TODO %3PRIORITY %TAGS"
2999 "The default column format, if no other format has been defined.
3000 This variable can be set on the per-file basis by inserting a line
3002 #+COLUMNS: %25ITEM ....."
3003 :group 'org-properties
3006 (defcustom org-columns-ellipses ".."
3007 "The ellipses to be used when a field in column view is truncated.
3008 When this is the empty string, as many characters as possible are shown,
3009 but then there will be no visual indication that the field has been truncated.
3010 When this is a string of length N, the last N characters of a truncated
3011 field are replaced by this string. If the column is narrower than the
3012 ellipses string, only part of the ellipses string will be shown."
3013 :group 'org-properties
3016 (defcustom org-columns-modify-value-for-display-function nil
3017 "Function that modifies values for display in column view.
3018 For example, it can be used to cut out a certain part from a time stamp.
3019 The function must take 2 arguments:
3021 column-title The title of the column (*not* the property name)
3022 value The value that should be modified.
3024 The function should return the value that should be displayed,
3025 or nil if the normal value should be used."
3026 :group 'org-properties
3029 (defcustom org-effort-property "Effort"
3030 "The property that is being used to keep track of effort estimates.
3031 Effort estimates given in this property need to have the format H:MM."
3032 :group 'org-properties
3033 :group 'org-progress
3034 :type '(string :tag "Property"))
3036 (defconst org-global-properties-fixed
3037 '(("VISIBILITY_ALL" . "folded children content all")
3038 ("CLOCK_MODELINE_TOTAL_ALL" . "current today repeat all auto"))
3039 "List of property/value pairs that can be inherited by any entry.
3041 These are fixed values, for the preset properties. The user variable
3042 that can be used to add to this list is `org-global-properties'.
3044 The entries in this list are cons cells where the car is a property
3045 name and cdr is a string with the value. If the value represents
3046 multiple items like an \"_ALL\" property, separate the items by
3049 (defcustom org-global-properties nil
3050 "List of property/value pairs that can be inherited by any entry.
3052 This list will be combined with the constant `org-global-properties-fixed'.
3054 The entries in this list are cons cells where the car is a property
3055 name and cdr is a string with the value.
3057 You can set buffer-local values for the same purpose in the variable
3058 `org-file-properties' this by adding lines like
3060 #+PROPERTY: NAME VALUE"
3061 :group 'org-properties
3063 (cons (string :tag "Property")
3064 (string :tag "Value"))))
3066 (defvar org-file-properties nil
3067 "List of property/value pairs that can be inherited by any entry.
3068 Valid for the current buffer.
3069 This variable is populated from #+PROPERTY lines.")
3070 (make-variable-buffer-local 'org-file-properties)
3072 (defgroup org-agenda nil
3073 "Options concerning agenda views in Org-mode."
3077 (defvar org-category nil
3078 "Variable used by org files to set a category for agenda display.
3079 Such files should use a file variable to set it, for example
3081 # -*- mode: org; org-category: \"ELisp\"
3083 or contain a special line
3087 If the file does not specify a category, then file's base name
3089 (make-variable-buffer-local 'org-category)
3090 (put 'org-category 'safe-local-variable #'(lambda (x) (or (symbolp x) (stringp x))))
3092 (defcustom org-agenda-files nil
3093 "The files to be used for agenda display.
3094 Entries may be added to this list with \\[org-agenda-file-to-front] and removed with
3095 \\[org-remove-file]. You can also use customize to edit the list.
3097 If an entry is a directory, all files in that directory that are matched by
3098 `org-agenda-file-regexp' will be part of the file list.
3100 If the value of the variable is not a list but a single file name, then
3101 the list of agenda files is actually stored and maintained in that file, one
3102 agenda file per line. In this file paths can be given relative to
3103 `org-directory'. Tilde expansion and environment variable substitution
3107 (repeat :tag "List of files and directories" file)
3108 (file :tag "Store list in a file\n" :value "~/.agenda_files")))
3110 (defcustom org-agenda-file-regexp "\\`[^.].*\\.org\\'"
3111 "Regular expression to match files for `org-agenda-files'.
3112 If any element in the list in that variable contains a directory instead
3113 of a normal file, all files in that directory that are matched by this
3114 regular expression will be included."
3118 (defcustom org-agenda-text-search-extra-files nil
3119 "List of extra files to be searched by text search commands.
3120 These files will be search in addition to the agenda files by the
3121 commands `org-search-view' (`C-c a s') and `org-occur-in-agenda-files'.
3122 Note that these files will only be searched for text search commands,
3123 not for the other agenda views like todo lists, tag searches or the weekly
3124 agenda. This variable is intended to list notes and possibly archive files
3125 that should also be searched by these two commands.
3126 In fact, if the first element in the list is the symbol `agenda-archives',
3127 than all archive files of all agenda files will be added to the search
3130 :type '(set :greedy t
3131 (const :tag "Agenda Archives" agenda-archives)
3132 (repeat :inline t (file))))
3134 (if (fboundp 'defvaralias)
3135 (defvaralias 'org-agenda-multi-occur-extra-files
3136 'org-agenda-text-search-extra-files))
3138 (defcustom org-agenda-skip-unavailable-files nil
3139 "Non-nil means to just skip non-reachable files in `org-agenda-files'.
3140 A nil value means to remove them, after a query, from the list."
3144 (defcustom org-calendar-to-agenda-key [?c]
3145 "The key to be installed in `calendar-mode-map' for switching to the agenda.
3146 The command `org-calendar-goto-agenda' will be bound to this key. The
3147 default is the character `c' because then `c' can be used to switch back and
3148 forth between agenda and calendar."
3152 (defcustom org-calendar-agenda-action-key [?k]
3153 "The key to be installed in `calendar-mode-map' for agenda-action.
3154 The command `org-agenda-action' will be bound to this key. The
3155 default is the character `k' because we use the same key in the agenda."
3159 (defcustom org-calendar-insert-diary-entry-key [?i]
3160 "The key to be installed in `calendar-mode-map' for adding diary entries.
3161 This option is irrelevant until `org-agenda-diary-file' has been configured
3162 to point to an Org-mode file. When that is the case, the command
3163 `org-agenda-diary-entry' will be bound to the key given here, by default
3164 `i'. In the calendar, `i' normally adds entries to `diary-file'. So
3165 if you want to continue doing this, you need to change this to a different
3170 (defcustom org-agenda-diary-file 'diary-file
3171 "File to which to add new entries with the `i' key in agenda and calendar.
3172 When this is the symbol `diary-file', the functionality in the Emacs
3173 calendar will be used to add entries to the `diary-file'. But when this
3174 points to a file, `org-agenda-diary-entry' will be used instead."
3177 (const :tag "The standard Emacs diary file" diary-file)
3178 (file :tag "Special Org file diary entries")))
3180 (eval-after-load "calendar"
3182 (org-defkey calendar-mode-map org-calendar-to-agenda-key
3183 'org-calendar-goto-agenda)
3184 (org-defkey calendar-mode-map org-calendar-agenda-action-key
3186 (add-hook 'calendar-mode-hook
3188 (unless (eq org-agenda-diary-file 'diary-file)
3189 (define-key calendar-mode-map
3190 org-calendar-insert-diary-entry-key
3191 'org-agenda-diary-entry))))))
3193 (defgroup org-latex nil
3194 "Options for embedding LaTeX code into Org-mode."
3198 (defcustom org-format-latex-options
3199 '(:foreground default :background default :scale 1.0
3200 :html-foreground "Black" :html-background "Transparent"
3201 :html-scale 1.0 :matchers ("begin" "$1" "$" "$$" "\\(" "\\["))
3202 "Options for creating images from LaTeX fragments.
3203 This is a property list with the following properties:
3204 :foreground the foreground color for images embedded in Emacs, e.g. \"Black\".
3205 `default' means use the foreground of the default face.
3206 :background the background color, or \"Transparent\".
3207 `default' means use the background of the default face.
3208 :scale a scaling factor for the size of the images, to get more pixels
3209 :html-foreground, :html-background, :html-scale
3210 the same numbers for HTML export.
3211 :matchers a list indicating which matchers should be used to
3212 find LaTeX fragments. Valid members of this list are:
3213 \"begin\" find environments
3214 \"$1\" find single characters surrounded by $.$
3215 \"$\" find math expressions surrounded by $...$
3216 \"$$\" find math expressions surrounded by $$....$$
3217 \"\\(\" find math expressions surrounded by \\(...\\)
3218 \"\\ [\" find math expressions surrounded by \\ [...\\]"
3222 (defcustom org-format-latex-signal-error t
3223 "Non-nil means signal an error when image creation of LaTeX snippets fails.
3224 When nil, just push out a message."
3228 (defcustom org-format-latex-header "\\documentclass{article}
3229 \\usepackage[usenames]{color}
3230 \\usepackage{amsmath}
3231 \\usepackage[mathscr]{eucal}
3232 \\pagestyle{empty} % do not remove
3235 % The settings below are copied from fullpage.sty
3236 \\setlength{\\textwidth}{\\paperwidth}
3237 \\addtolength{\\textwidth}{-3cm}
3238 \\setlength{\\oddsidemargin}{1.5cm}
3239 \\addtolength{\\oddsidemargin}{-2.54cm}
3240 \\setlength{\\evensidemargin}{\\oddsidemargin}
3241 \\setlength{\\textheight}{\\paperheight}
3242 \\addtolength{\\textheight}{-\\headheight}
3243 \\addtolength{\\textheight}{-\\headsep}
3244 \\addtolength{\\textheight}{-\\footskip}
3245 \\addtolength{\\textheight}{-3cm}
3246 \\setlength{\\topmargin}{1.5cm}
3247 \\addtolength{\\topmargin}{-2.54cm}"
3248 "The document header used for processing LaTeX fragments.
3249 It is imperative that this header make sure that no page number
3250 appears on the page. The package defined in the variables
3251 `org-export-latex-default-packages-alist' and `org-export-latex-packages-alist'
3252 will either replace the placeholder \"[PACKAGES]\" in this header, or they
3257 (defvar org-format-latex-header-extra nil)
3259 (defun org-set-packages-alist (var val)
3260 "Set the packages alist and make sure it has 3 elements per entry."
3261 (set var (mapcar (lambda (x)
3262 (if (and (consp x) (= (length x) 2))
3263 (list (car x) (nth 1 x) t)
3267 (defun org-get-packages-alist (var)
3269 "Get the packages alist and make sure it has 3 elements per entry."
3271 (if (and (consp x) (= (length x) 2))
3272 (list (car x) (nth 1 x) t)
3274 (default-value var)))
3276 ;; The following variables are defined here because is it also used
3277 ;; when formatting latex fragments. Originally it was part of the
3278 ;; LaTeX exporter, which is why the name includes "export".
3279 (defcustom org-export-latex-default-packages-alist
3280 '(("AUTO" "inputenc" t)
3284 ("" "longtable" nil)
3296 "Alist of default packages to be inserted in the header.
3297 Change this only if one of the packages here causes an incompatibility
3298 with another package you are using.
3299 The packages in this list are needed by one part or another of Org-mode
3300 to function properly.
3302 - inputenc, fontenc: for basic font and character selection
3303 - textcomp, marvosymb, wasysym, latexsym, amssym: for various symbols used
3304 for interpreting the entities in `org-entities'. You can skip some of these
3305 packages if you don't use any of the symbols in it.
3306 - graphicx: for including images
3307 - float, wrapfig: for figure placement
3308 - longtable: for long tables
3309 - hyperref: for cross references
3311 Therefore you should not modify this variable unless you know what you
3312 are doing. The one reason to change it anyway is that you might be loading
3313 some other package that conflicts with one of the default packages.
3314 Each cell is of the format \( \"options\" \"package\" snippet-flag\).
3315 If SNIPPET-FLAG is t, the package also needs to be included when
3316 compiling LaTeX snippets into images for inclusion into HTML."
3317 :group 'org-export-latex
3318 :set 'org-set-packages-alist
3319 :get 'org-get-packages-alist
3322 (list :tag "options/package pair"
3323 (string :tag "options")
3324 (string :tag "package")
3325 (boolean :tag "Snippet"))
3326 (string :tag "A line of LaTeX"))))
3328 (defcustom org-export-latex-packages-alist nil
3329 "Alist of packages to be inserted in every LaTeX header.
3330 These will be inserted after `org-export-latex-default-packages-alist'.
3331 Each cell is of the format \( \"options\" \"package\" snippet-flag \).
3332 SNIPPET-FLAG, when t, indicates that this package is also needed when
3333 turning LaTeX snippets into images for inclusion into HTML.
3334 Make sure that you only list packages here which:
3335 - you want in every file
3336 - do not conflict with the default packages in
3337 `org-export-latex-default-packages-alist'
3338 - do not conflict with the setup in `org-format-latex-header'."
3339 :group 'org-export-latex
3340 :set 'org-set-packages-alist
3341 :get 'org-get-packages-alist
3344 (list :tag "options/package pair"
3345 (string :tag "options")
3346 (string :tag "package")
3347 (boolean :tag "Snippet"))
3348 (string :tag "A line of LaTeX"))))
3351 (defgroup org-appearance nil
3352 "Settings for Org-mode appearance."
3353 :tag "Org Appearance"
3356 (defcustom org-level-color-stars-only nil
3357 "Non-nil means fontify only the stars in each headline.
3358 When nil, the entire headline is fontified.
3359 Changing it requires restart of `font-lock-mode' to become effective
3360 also in regions already fontified."
3361 :group 'org-appearance
3364 (defcustom org-hide-leading-stars nil
3365 "Non-nil means hide the first N-1 stars in a headline.
3366 This works by using the face `org-hide' for these stars. This
3367 face is white for a light background, and black for a dark
3368 background. You may have to customize the face `org-hide' to
3370 Changing it requires restart of `font-lock-mode' to become effective
3371 also in regions already fontified.
3372 You may also set this on a per-file basis by adding one of the following
3373 lines to the buffer:
3375 #+STARTUP: hidestars
3376 #+STARTUP: showstars"
3377 :group 'org-appearance
3380 (defcustom org-hidden-keywords nil
3381 "List of symbols corresponding to keywords to be hidden the org buffer.
3382 For example, a value '(title) for this list will make the document's title
3383 appear in the buffer without the initial #+TITLE: keyword."
3384 :group 'org-appearance
3385 :type '(set (const :tag "#+AUTHOR" author)
3386 (const :tag "#+DATE" date)
3387 (const :tag "#+EMAIL" email)
3388 (const :tag "#+TITLE" title)))
3390 (defcustom org-fontify-done-headline nil
3391 "Non-nil means change the face of a headline if it is marked DONE.
3392 Normally, only the TODO/DONE keyword indicates the state of a headline.
3393 When this is non-nil, the headline after the keyword is set to the
3394 `org-headline-done' as an additional indication."
3395 :group 'org-appearance
3398 (defcustom org-fontify-emphasized-text t
3399 "Non-nil means fontify *bold*, /italic/ and _underlined_ text.
3400 Changing this variable requires a restart of Emacs to take effect."
3401 :group 'org-appearance
3404 (defcustom org-fontify-whole-heading-line nil
3405 "Non-nil means fontify the whole line for headings.
3406 This is useful when setting a background color for the
3408 :group 'org-appearance
3411 (defcustom org-highlight-latex-fragments-and-specials nil
3412 "Non-nil means fontify what is treated specially by the exporters."
3413 :group 'org-appearance
3416 (defcustom org-hide-emphasis-markers nil
3417 "Non-nil mean font-lock should hide the emphasis marker characters."
3418 :group 'org-appearance
3421 (defcustom org-pretty-entities nil
3422 "Non-nil means show entities as UTF8 characters.
3423 When nil, the \\name form remains in the buffer."
3424 :group 'org-appearance
3427 (defcustom org-pretty-entities-include-sub-superscripts t
3428 "Non-nil means, pretty entity display includes formatting sub/superscripts."
3429 :group 'org-appearance
3432 (defvar org-emph-re nil
3433 "Regular expression for matching emphasis.
3434 After a match, the match groups contain these elements:
3435 0 The match of the full regular expression, including the characters
3436 before and after the proper match
3437 1 The character before the proper match, or empty at beginning of line
3438 2 The proper match, including the leading and trailing markers
3439 3 The leading marker like * or /, indicating the type of highlighting
3440 4 The text between the emphasis markers, not including the markers
3441 5 The character after the match, empty at the end of a line")
3442 (defvar org-verbatim-re nil
3443 "Regular expression for matching verbatim text.")
3444 (defvar org-emphasis-regexp-components) ; defined just below
3445 (defvar org-emphasis-alist) ; defined just below
3446 (defun org-set-emph-re (var val)
3447 "Set variable and compute the emphasis regular expression."
3449 (when (and (boundp 'org-emphasis-alist)
3450 (boundp 'org-emphasis-regexp-components)
3451 org-emphasis-alist org-emphasis-regexp-components)
3452 (let* ((e org-emphasis-regexp-components)
3458 (body1 (concat body "*?"))
3459 (markers (mapconcat 'car org-emphasis-alist ""))
3460 (vmarkers (mapconcat
3461 (lambda (x) (if (eq (nth 4 x) 'verbatim) (car x) ""))
3462 org-emphasis-alist "")))
3463 ;; make sure special characters appear at the right position in the class
3464 (if (string-match "\\^" markers)
3465 (setq markers (concat (replace-match "" t t markers) "^")))
3466 (if (string-match "-" markers)
3467 (setq markers (concat (replace-match "" t t markers) "-")))
3468 (if (string-match "\\^" vmarkers)
3469 (setq vmarkers (concat (replace-match "" t t vmarkers) "^")))
3470 (if (string-match "-" vmarkers)
3471 (setq vmarkers (concat (replace-match "" t t vmarkers) "-")))
3473 (setq body1 (concat body1 "\\(?:\n" body "*?\\)\\{0,"
3474 (int-to-string nl) "\\}")))
3477 (concat "\\([" pre "]\\|^\\)"
3479 "\\([" markers "]\\)"
3487 "\\([" post "]\\|$\\)"))
3488 (setq org-verbatim-re
3489 (concat "\\([" pre "]\\|^\\)"
3491 "\\([" vmarkers "]\\)"
3499 "\\([" post "]\\|$\\)")))))
3501 (defcustom org-emphasis-regexp-components
3502 '(" \t('\"{" "- \t.,:!?;'\")}\\" " \t\r\n,\"'" "." 1)
3503 "Components used to build the regular expression for emphasis.
3504 This is a list with five entries. Terminology: In an emphasis string
3505 like \" *strong word* \", we call the initial space PREMATCH, the final
3506 space POSTMATCH, the stars MARKERS, \"s\" and \"d\" are BORDER characters
3507 and \"trong wor\" is the body. The different components in this variable
3508 specify what is allowed/forbidden in each part:
3510 pre Chars allowed as prematch. Beginning of line will be allowed too.
3511 post Chars allowed as postmatch. End of line will be allowed too.
3512 border The chars *forbidden* as border characters.
3513 body-regexp A regexp like \".\" to match a body character. Don't use
3514 non-shy groups here, and don't allow newline here.
3515 newline The maximum number of newlines allowed in an emphasis exp.
3517 Use customize to modify this, or restart Emacs after changing it."
3518 :group 'org-appearance
3519 :set 'org-set-emph-re
3521 (sexp :tag "Allowed chars in pre ")
3522 (sexp :tag "Allowed chars in post ")
3523 (sexp :tag "Forbidden chars in border ")
3524 (sexp :tag "Regexp for body ")
3525 (integer :tag "number of newlines allowed")
3526 (option (boolean :tag "Please ignore this button"))))
3528 (defcustom org-emphasis-alist
3529 `(("*" bold "<b>" "</b>")
3530 ("/" italic "<i>" "</i>")
3531 ("_" underline "<span style=\"text-decoration:underline;\">" "</span>")
3532 ("=" org-code "<code>" "</code>" verbatim)
3533 ("~" org-verbatim "<code>" "</code>" verbatim)
3534 ("+" ,(if (featurep 'xemacs) 'org-table '(:strike-through t))
3537 "Special syntax for emphasized text.
3538 Text starting and ending with a special character will be emphasized, for
3539 example *bold*, _underlined_ and /italic/. This variable sets the marker
3540 characters, the face to be used by font-lock for highlighting in Org-mode
3541 Emacs buffers, and the HTML tags to be used for this.
3542 For LaTeX export, see the variable `org-export-latex-emphasis-alist'.
3543 For DocBook export, see the variable `org-export-docbook-emphasis-alist'.
3544 Use customize to modify this, or restart Emacs after changing it."
3545 :group 'org-appearance
3546 :set 'org-set-emph-re
3549 (string :tag "Marker character")
3551 (face :tag "Font-lock-face")
3552 (plist :tag "Face property list"))
3553 (string :tag "HTML start tag")
3554 (string :tag "HTML end tag")
3555 (option (const verbatim)))))
3557 (defvar org-protecting-blocks
3558 '("src" "example" "latex" "ascii" "html" "docbook" "ditaa" "dot" "r" "R")
3559 "Blocks that contain text that is quoted, i.e. not processed as Org syntax.
3560 This is needed for font-lock setup.")
3562 ;;; Miscellaneous options
3564 (defgroup org-completion nil
3565 "Completion in Org-mode."
3566 :tag "Org Completion"
3569 (defcustom org-completion-use-ido nil
3570 "Non-nil means use ido completion wherever possible.
3571 Note that `ido-mode' must be active for this variable to be relevant.
3572 If you decide to turn this variable on, you might well want to turn off
3573 `org-outline-path-complete-in-steps'.
3574 See also `org-completion-use-iswitchb'."
3575 :group 'org-completion
3578 (defcustom org-completion-use-iswitchb nil
3579 "Non-nil means use iswitchb completion wherever possible.
3580 Note that `iswitchb-mode' must be active for this variable to be relevant.
3581 If you decide to turn this variable on, you might well want to turn off
3582 `org-outline-path-complete-in-steps'.
3583 Note that this variable has only an effect if `org-completion-use-ido' is nil."
3584 :group 'org-completion
3587 (defcustom org-completion-fallback-command 'hippie-expand
3588 "The expansion command called by \\[pcomplete] in normal context.
3589 Normal means, no org-mode-specific context."
3590 :group 'org-completion
3593 ;;; Functions and variables from their packages
3594 ;; Declared here to avoid compiler warnings
3597 (defvar outline-mode-menu-heading)
3598 (defvar outline-mode-menu-show)
3599 (defvar outline-mode-menu-hide)
3600 (defvar zmacs-regions) ; XEmacs regions
3603 (defvar mark-active)
3606 (declare-function calendar-absolute-from-iso "cal-iso" (date))
3607 (declare-function calendar-forward-day "cal-move" (arg))
3608 (declare-function calendar-goto-date "cal-move" (date))
3609 (declare-function calendar-goto-today "cal-move" ())
3610 (declare-function calendar-iso-from-absolute "cal-iso" (date))
3611 (defvar calc-embedded-close-formula)
3612 (defvar calc-embedded-open-formula)
3613 (declare-function cdlatex-tab "ext:cdlatex" ())
3614 (declare-function dired-get-filename "dired" (&optional localp no-error-if-not-filep))
3615 (defvar font-lock-unfontify-region-function)
3616 (declare-function iswitchb-read-buffer "iswitchb"
3617 (prompt &optional default require-match start matches-set))
3618 (defvar iswitchb-temp-buflist)
3619 (declare-function org-gnus-follow-link "org-gnus" (&optional group article))
3620 (defvar org-agenda-tags-todo-honor-ignore-options)
3621 (declare-function org-agenda-skip "org-agenda" ())
3623 org-format-agenda-item "org-agenda"
3624 (extra txt &optional category tags dotime noprefix remove-re habitp))
3625 (declare-function org-agenda-new-marker "org-agenda" (&optional pos))
3626 (declare-function org-agenda-change-all-lines "org-agenda"
3627 (newhead hdmarker &optional fixface just-this))
3628 (declare-function org-agenda-set-restriction-lock "org-agenda" (&optional type))
3629 (declare-function org-agenda-maybe-redo "org-agenda" ())
3630 (declare-function org-agenda-save-markers-for-cut-and-paste "org-agenda"
3632 (declare-function org-agenda-copy-local-variable "org-agenda" (var))
3633 (declare-function org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item
3634 "org-agenda" (&optional end))
3635 (declare-function org-inlinetask-remove-END-maybe "org-inlinetask" ())
3636 (declare-function org-inlinetask-in-task-p "org-inlinetask" ())
3637 (declare-function org-inlinetask-goto-beginning "org-inlinetask" ())
3638 (declare-function org-inlinetask-goto-end "org-inlinetask" ())
3639 (declare-function org-indent-mode "org-indent" (&optional arg))
3640 (declare-function parse-time-string "parse-time" (string))
3641 (declare-function org-attach-reveal "org-attach" (&optional if-exists))
3642 (declare-function org-export-latex-fix-inputenc "org-latex" ())
3643 (declare-function orgtbl-send-table "org-table" (&optional maybe))
3644 (defvar remember-data-file)
3645 (defvar texmathp-why)
3646 (declare-function speedbar-line-directory "speedbar" (&optional depth))
3647 (declare-function table--at-cell-p "table" (position &optional object at-column))