By default, use relative name for compilation
[org-mode.git] / lisp / org.el
blob6f7a2c7efb41899403130162d81878d1a1c40c27
1 ;;; org.el --- Outline-based notes management and organizer -*- lexical-binding: t; -*-
3 ;; Carstens outline-mode for keeping track of everything.
4 ;; Copyright (C) 2004-2016 Free Software Foundation, Inc.
5 ;;
6 ;; Author: Carsten Dominik <carsten at orgmode dot org>
7 ;; Maintainer: Carsten Dominik <carsten at orgmode dot org>
8 ;; Keywords: outlines, hypermedia, calendar, wp
9 ;; 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/>.
26 ;;; Commentary:
28 ;; Org-mode is a mode for keeping notes, maintaining ToDo lists, and doing
29 ;; project planning with a fast and effective plain-text system.
31 ;; Org-mode develops organizational tasks around NOTES files that contain
32 ;; information about projects as plain text. Org-mode is implemented on
33 ;; top of outline-mode, which makes it possible to keep the content of
34 ;; large files well structured. Visibility cycling and structure editing
35 ;; help to work with the tree. Tables are easily created with a built-in
36 ;; table editor. Org-mode supports ToDo items, deadlines, time stamps,
37 ;; and scheduling. It dynamically compiles entries into an agenda that
38 ;; utilizes and smoothly integrates much of the Emacs calendar and diary.
39 ;; Plain text URL-like links connect to websites, emails, Usenet
40 ;; messages, BBDB entries, and any files related to the projects. For
41 ;; printing and sharing of notes, an Org-mode file can be exported as a
42 ;; structured ASCII file, as HTML, or (todo and agenda items only) as an
43 ;; iCalendar file. It can also serve as a publishing tool for a set of
44 ;; linked webpages.
46 ;; Installation and Activation
47 ;; ---------------------------
48 ;; See the corresponding sections in the manual at
50 ;; http://orgmode.org/org.html#Installation
52 ;; Documentation
53 ;; -------------
54 ;; The documentation of Org-mode can be found in the TeXInfo file. The
55 ;; distribution also contains a PDF version of it. At the homepage of
56 ;; Org-mode, you can read the same text online as HTML. There is also an
57 ;; excellent reference card made by Philip Rooke. This card can be found
58 ;; in the etc/ directory of Emacs 22.
60 ;; A list of recent changes can be found at
61 ;; http://orgmode.org/Changes.html
63 ;;; Code:
65 (defvar org-inhibit-highlight-removal nil) ; dynamically scoped param
66 (defvar-local org-table-formula-constants-local nil
67 "Local version of `org-table-formula-constants'.")
69 ;;;; Require other packages
71 (require 'cl-lib)
73 (eval-when-compile (require 'gnus-sum))
75 (require 'calendar)
76 (require 'find-func)
77 (require 'format-spec)
79 (or (equal this-command 'eval-buffer)
80 (condition-case nil
81 (load (concat (file-name-directory load-file-name)
82 "org-loaddefs.el")
83 nil t t t)
84 (error
85 (message "WARNING: No org-loaddefs.el file could be found from where org.el is loaded.")
86 (sit-for 3)
87 (message "You need to run \"make\" or \"make autoloads\" from Org lisp directory")
88 (sit-for 3))))
90 (require 'org-macs)
91 (require 'org-compat)
93 ;; `org-outline-regexp' ought to be a defconst but is let-bound in
94 ;; some places -- e.g. see the macro `org-with-limited-levels'.
96 ;; In Org buffers, the value of `outline-regexp' is that of
97 ;; `org-outline-regexp'. The only function still directly relying on
98 ;; `outline-regexp' is `org-overview' so that `org-cycle' can do its
99 ;; job when `orgstruct-mode' is active.
100 (defvar org-outline-regexp "\\*+ "
101 "Regexp to match Org headlines.")
103 (defvar org-outline-regexp-bol "^\\*+ "
104 "Regexp to match Org headlines.
105 This is similar to `org-outline-regexp' but additionally makes
106 sure that we are at the beginning of the line.")
108 (defvar org-heading-regexp "^\\(\\*+\\)\\(?: +\\(.*?\\)\\)?[ \t]*$"
109 "Matches a headline, putting stars and text into groups.
110 Stars are put in group 1 and the trimmed body in group 2.")
112 (declare-function calendar-check-holidays "holidays" (date))
113 (declare-function cdlatex-environment "ext:cdlatex" (environment item))
114 (declare-function isearch-no-upper-case-p "isearch" (string regexp-flag))
115 (declare-function org-add-archive-files "org-archive" (files))
116 (declare-function org-agenda-entry-get-agenda-timestamp "org-agenda" (pom))
117 (declare-function org-agenda-list "org-agenda"
118 (&optional arg start-day span with-hour))
119 (declare-function org-agenda-redo "org-agenda" (&optional all))
120 (declare-function org-babel-do-in-edit-buffer "ob-core" (&rest body) t)
121 (declare-function org-babel-tangle-file "ob-tangle" (file &optional target-file lang))
122 (declare-function org-beamer-mode "ox-beamer" (&optional prefix) t)
123 (declare-function org-clock-get-last-clock-out-time "org-clock" ())
124 (declare-function org-clock-out "org-clock" (&optional switch-to-state fail-quietly at-time))
125 (declare-function org-clock-remove-overlays "org-clock" (&optional beg end noremove))
126 (declare-function org-clock-sum "org-clock" (&optional tstart tend headline-filter propname))
127 (declare-function org-clock-sum-current-item "org-clock" (&optional tstart))
128 (declare-function org-clock-timestamps-down "org-clock" (&optional n))
129 (declare-function org-clock-timestamps-up "org-clock" (&optional n))
130 (declare-function org-clock-update-time-maybe "org-clock" ())
131 (declare-function org-clocktable-shift "org-clock" (dir n))
132 (declare-function org-element-at-point "org-element" ())
133 (declare-function org-element-cache-refresh "org-element" (pos))
134 (declare-function org-element-cache-reset "org-element" (&optional all))
135 (declare-function org-element-contents "org-element" (element))
136 (declare-function org-element-context "org-element" (&optional element))
137 (declare-function org-element-copy "org-element" (datum))
138 (declare-function org-element-interpret-data "org-element" (data))
139 (declare-function org-element-lineage "org-element" (blob &optional types with-self))
140 (declare-function org-element-nested-p "org-element" (elem-a elem-b))
141 (declare-function org-element-parse-buffer "org-element" (&optional granularity visible-only))
142 (declare-function org-element-property "org-element" (property element))
143 (declare-function org-element-put-property "org-element" (element property value))
144 (declare-function org-element-swap-A-B "org-element" (elem-a elem-b))
145 (declare-function org-element-type "org-element" (element))
146 (declare-function org-element-update-syntax "org-element" ())
147 (declare-function org-id-find-id-file "org-id" (id))
148 (declare-function org-id-get-create "org-id" (&optional force))
149 (declare-function org-inlinetask-at-task-p "org-inlinetask" ())
150 (declare-function org-inlinetask-outline-regexp "org-inlinetask" ())
151 (declare-function org-inlinetask-toggle-visibility "org-inlinetask" ())
152 (declare-function org-plot/gnuplot "org-plot" (&optional params))
153 (declare-function org-pop-to-buffer-same-window "org-compat" (&optional buffer-or-name norecord label))
154 (declare-function org-table-align "org-table" ())
155 (declare-function org-table-begin "org-table" (&optional table-type))
156 (declare-function org-table-beginning-of-field "org-table" (&optional n))
157 (declare-function org-table-blank-field "org-table" ())
158 (declare-function org-table-calc-current-TBLFM "org-table" (&optional arg))
159 (declare-function org-table-edit-field "org-table" (arg))
160 (declare-function org-table-end "org-table" (&optional table-type))
161 (declare-function org-table-end-of-field "org-table" (&optional n))
162 (declare-function org-table-insert-row "org-table" (&optional arg))
163 (declare-function org-table-justify-field-maybe "org-table" (&optional new))
164 (declare-function org-table-maybe-eval-formula "org-table" ())
165 (declare-function org-table-maybe-recalculate-line "org-table" ())
166 (declare-function org-table-next-row "org-table" ())
167 (declare-function org-table-paste-rectangle "org-table" ())
168 (declare-function org-table-wrap-region "org-table" (arg))
169 (declare-function org-tags-view "org-agenda" (&optional todo-only match))
170 (declare-function orgtbl-ascii-plot "org-table" (&optional ask))
171 (declare-function orgtbl-mode "org-table" (&optional arg))
173 (defsubst org-uniquify (list)
174 "Non-destructively remove duplicate elements from LIST."
175 (let ((res (copy-sequence list))) (delete-dups res)))
177 (defsubst org-get-at-bol (property)
178 "Get text property PROPERTY at the beginning of line."
179 (get-text-property (point-at-bol) property))
181 (defsubst org-trim (s)
182 "Remove whitespace at the beginning and the end of string S."
183 (replace-regexp-in-string
184 "\\`[ \t\n\r]+" ""
185 (replace-regexp-in-string "[ \t\n\r]+\\'" "" s)))
187 ;; load languages based on value of `org-babel-load-languages'
188 (defvar org-babel-load-languages)
190 ;;;###autoload
191 (defun org-babel-do-load-languages (sym value)
192 "Load the languages defined in `org-babel-load-languages'."
193 (set-default sym value)
194 (dolist (pair org-babel-load-languages)
195 (let ((active (cdr pair)) (lang (symbol-name (car pair))))
196 (if active
197 (require (intern (concat "ob-" lang)))
198 (funcall 'fmakunbound
199 (intern (concat "org-babel-execute:" lang)))
200 (funcall 'fmakunbound
201 (intern (concat "org-babel-expand-body:" lang)))))))
203 (declare-function org-babel-tangle-file "ob-tangle" (file &optional target-file lang))
204 ;;;###autoload
205 (defun org-babel-load-file (file &optional compile)
206 "Load Emacs Lisp source code blocks in the Org-mode FILE.
207 This function exports the source code using `org-babel-tangle'
208 and then loads the resulting file using `load-file'. With prefix
209 arg (noninteractively: 2nd arg) COMPILE the tangled Emacs Lisp
210 file to byte-code before it is loaded."
211 (interactive "fFile to load: \nP")
212 (let* ((age (lambda (file)
213 (float-time
214 (time-subtract (current-time)
215 (nth 5 (or (file-attributes (file-truename file))
216 (file-attributes file)))))))
217 (base-name (file-name-sans-extension file))
218 (exported-file (concat base-name ".el")))
219 ;; tangle if the org-mode file is newer than the elisp file
220 (unless (and (file-exists-p exported-file)
221 (> (funcall age file) (funcall age exported-file)))
222 ;; Tangle-file traversal returns reversed list of tangled files
223 ;; and we want to evaluate the first target.
224 (setq exported-file
225 (car (last (org-babel-tangle-file file exported-file "emacs-lisp")))))
226 (message "%s %s"
227 (if compile
228 (progn (byte-compile-file exported-file 'load)
229 "Compiled and loaded")
230 (progn (load-file exported-file) "Loaded"))
231 exported-file)))
233 (defcustom org-babel-load-languages '((emacs-lisp . t))
234 "Languages which can be evaluated in Org-mode buffers.
235 This list can be used to load support for any of the languages
236 below, note that each language will depend on a different set of
237 system executables and/or Emacs modes. When a language is
238 \"loaded\", then code blocks in that language can be evaluated
239 with `org-babel-execute-src-block' bound by default to C-c
240 C-c (note the `org-babel-no-eval-on-ctrl-c-ctrl-c' variable can
241 be set to remove code block evaluation from the C-c C-c
242 keybinding. By default only Emacs Lisp (which has no
243 requirements) is loaded."
244 :group 'org-babel
245 :set 'org-babel-do-load-languages
246 :version "24.1"
247 :type '(alist :tag "Babel Languages"
248 :key-type
249 (choice
250 (const :tag "Awk" awk)
251 (const :tag "C" C)
252 (const :tag "R" R)
253 (const :tag "Asymptote" asymptote)
254 (const :tag "Calc" calc)
255 (const :tag "Clojure" clojure)
256 (const :tag "CSS" css)
257 (const :tag "Ditaa" ditaa)
258 (const :tag "Dot" dot)
259 (const :tag "Emacs Lisp" emacs-lisp)
260 (const :tag "Forth" forth)
261 (const :tag "Fortran" fortran)
262 (const :tag "Gnuplot" gnuplot)
263 (const :tag "Haskell" haskell)
264 (const :tag "IO" io)
265 (const :tag "J" J)
266 (const :tag "Java" java)
267 (const :tag "Javascript" js)
268 (const :tag "LaTeX" latex)
269 (const :tag "Ledger" ledger)
270 (const :tag "Lilypond" lilypond)
271 (const :tag "Lisp" lisp)
272 (const :tag "Makefile" makefile)
273 (const :tag "Maxima" maxima)
274 (const :tag "Matlab" matlab)
275 (const :tag "Mscgen" mscgen)
276 (const :tag "Ocaml" ocaml)
277 (const :tag "Octave" octave)
278 (const :tag "Org" org)
279 (const :tag "Perl" perl)
280 (const :tag "Pico Lisp" picolisp)
281 (const :tag "PlantUML" plantuml)
282 (const :tag "Python" python)
283 (const :tag "Ruby" ruby)
284 (const :tag "Sass" sass)
285 (const :tag "Scala" scala)
286 (const :tag "Scheme" scheme)
287 (const :tag "Screen" screen)
288 (const :tag "Shell Script" shell)
289 (const :tag "Shen" shen)
290 (const :tag "Sql" sql)
291 (const :tag "Sqlite" sqlite)
292 (const :tag "Stan" stan)
293 (const :tag "ebnf2ps" ebnf2ps))
294 :value-type (boolean :tag "Activate" :value t)))
296 ;;;; Customization variables
297 (defcustom org-clone-delete-id nil
298 "Remove ID property of clones of a subtree.
299 When non-nil, clones of a subtree don't inherit the ID property.
300 Otherwise they inherit the ID property with a new unique
301 identifier."
302 :type 'boolean
303 :version "24.1"
304 :group 'org-id)
306 ;;; Version
307 (org-check-version)
309 ;;;###autoload
310 (defun org-version (&optional here full message)
311 "Show the org-mode version.
312 Interactively, or when MESSAGE is non-nil, show it in echo area.
313 With prefix argument, or when HERE is non-nil, insert it at point.
314 In non-interactive uses, a reduced version string is output unless
315 FULL is given."
316 (interactive (list current-prefix-arg t (not current-prefix-arg)))
317 (let ((org-dir (ignore-errors (org-find-library-dir "org")))
318 (save-load-suffixes (when (boundp 'load-suffixes) load-suffixes))
319 (load-suffixes (list ".el"))
320 (org-install-dir
321 (ignore-errors (org-find-library-dir "org-loaddefs"))))
322 (unless (and (fboundp 'org-release) (fboundp 'org-git-version))
323 (org-load-noerror-mustsuffix (concat org-dir "org-version")))
324 (let* ((load-suffixes save-load-suffixes)
325 (release (org-release))
326 (git-version (org-git-version))
327 (version (format "Org-mode version %s (%s @ %s)"
328 release
329 git-version
330 (if org-install-dir
331 (if (string= org-dir org-install-dir)
332 org-install-dir
333 (concat "mixed installation! "
334 org-install-dir
335 " and "
336 org-dir))
337 "org-loaddefs.el can not be found!")))
338 (version1 (if full version release)))
339 (when here (insert version1))
340 (when message (message "%s" version1))
341 version1)))
343 (defconst org-version (org-version))
346 ;;; Syntax Constants
348 ;;;; Block
350 (defconst org-block-regexp
351 "^[ \t]*#\\+begin_?\\([^ \n]+\\)\\(\\([^\n]+\\)\\)?\n\\([^\000]+?\\)#\\+end_?\\1[ \t]*$"
352 "Regular expression for hiding blocks.")
354 (defconst org-dblock-start-re
355 "^[ \t]*#\\+\\(?:BEGIN\\|begin\\):[ \t]+\\(\\S-+\\)\\([ \t]+\\(.*\\)\\)?"
356 "Matches the start line of a dynamic block, with parameters.")
358 (defconst org-dblock-end-re "^[ \t]*#\\+\\(?:END\\|end\\)\\([: \t\r\n]\\|$\\)"
359 "Matches the end of a dynamic block.")
361 ;;;; Clock and Planning
363 (defconst org-clock-string "CLOCK:"
364 "String used as prefix for timestamps clocking work hours on an item.")
366 (defvar org-closed-string "CLOSED:"
367 "String used as the prefix for timestamps logging closing a TODO entry.")
369 (defvar org-deadline-string "DEADLINE:"
370 "String to mark deadline entries.
371 A deadline is this string, followed by a time stamp. Should be a word,
372 terminated by a colon. You can insert a schedule keyword and
373 a timestamp with \\[org-deadline].")
375 (defvar org-scheduled-string "SCHEDULED:"
376 "String to mark scheduled TODO entries.
377 A schedule is this string, followed by a time stamp. Should be a word,
378 terminated by a colon. You can insert a schedule keyword and
379 a timestamp with \\[org-schedule].")
381 (defconst org-ds-keyword-length
382 (+ 2
383 (apply #'max
384 (mapcar #'length
385 (list org-deadline-string org-scheduled-string
386 org-clock-string org-closed-string))))
387 "Maximum length of the DEADLINE and SCHEDULED keywords.")
389 (defconst org-planning-line-re
390 (concat "^[ \t]*"
391 (regexp-opt
392 (list org-closed-string org-deadline-string org-scheduled-string)
394 "Matches a line with planning info.
395 Matched keyword is in group 1.")
397 (defconst org-clock-line-re
398 (concat "^[ \t]*" org-clock-string)
399 "Matches a line with clock info.")
401 (defconst org-deadline-regexp (concat "\\<" org-deadline-string)
402 "Matches the DEADLINE keyword.")
404 (defconst org-deadline-time-regexp
405 (concat "\\<" org-deadline-string " *<\\([^>]+\\)>")
406 "Matches the DEADLINE keyword together with a time stamp.")
408 (defconst org-deadline-time-hour-regexp
409 (concat "\\<" org-deadline-string
410 " *<\\([^>]+[0-9]\\{1,2\\}:[0-9]\\{2\\}[0-9-+:hdwmy \t.]*\\)>")
411 "Matches the DEADLINE keyword together with a time-and-hour stamp.")
413 (defconst org-deadline-line-regexp
414 (concat "\\<\\(" org-deadline-string "\\).*")
415 "Matches the DEADLINE keyword and the rest of the line.")
417 (defconst org-scheduled-regexp (concat "\\<" org-scheduled-string)
418 "Matches the SCHEDULED keyword.")
420 (defconst org-scheduled-time-regexp
421 (concat "\\<" org-scheduled-string " *<\\([^>]+\\)>")
422 "Matches the SCHEDULED keyword together with a time stamp.")
424 (defconst org-scheduled-time-hour-regexp
425 (concat "\\<" org-scheduled-string
426 " *<\\([^>]+[0-9]\\{1,2\\}:[0-9]\\{2\\}[0-9-+:hdwmy \t.]*\\)>")
427 "Matches the SCHEDULED keyword together with a time-and-hour stamp.")
429 (defconst org-closed-time-regexp
430 (concat "\\<" org-closed-string " *\\[\\([^]]+\\)\\]")
431 "Matches the CLOSED keyword together with a time stamp.")
433 (defconst org-keyword-time-regexp
434 (concat "\\<"
435 (regexp-opt
436 (list org-scheduled-string org-deadline-string org-closed-string
437 org-clock-string)
439 " *[[<]\\([^]>]+\\)[]>]")
440 "Matches any of the 4 keywords, together with the time stamp.")
442 (defconst org-keyword-time-not-clock-regexp
443 (concat
444 "\\<"
445 (regexp-opt
446 (list org-scheduled-string org-deadline-string org-closed-string) t)
447 " *[[<]\\([^]>]+\\)[]>]")
448 "Matches any of the 3 keywords, together with the time stamp.")
450 (defconst org-maybe-keyword-time-regexp
451 (concat "\\(\\<"
452 (regexp-opt
453 (list org-scheduled-string org-deadline-string org-closed-string
454 org-clock-string)
456 "\\)?"
457 " *\\([[<][0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} ?[^]\r\n>]*?[]>]"
458 "\\|"
459 "<%%([^\r\n>]*>\\)")
460 "Matches a timestamp, possibly preceded by a keyword.")
462 (defconst org-all-time-keywords
463 (mapcar (lambda (w) (substring w 0 -1))
464 (list org-scheduled-string org-deadline-string
465 org-clock-string org-closed-string))
466 "List of time keywords.")
468 ;;;; Drawer
470 (defconst org-drawer-regexp "^[ \t]*:\\(\\(?:\\w\\|[-_]\\)+\\):[ \t]*$"
471 "Matches first or last line of a hidden block.
472 Group 1 contains drawer's name or \"END\".")
474 (defconst org-property-start-re "^[ \t]*:PROPERTIES:[ \t]*$"
475 "Regular expression matching the first line of a property drawer.")
477 (defconst org-property-end-re "^[ \t]*:END:[ \t]*$"
478 "Regular expression matching the last line of a property drawer.")
480 (defconst org-clock-drawer-start-re "^[ \t]*:CLOCK:[ \t]*$"
481 "Regular expression matching the first line of a clock drawer.")
483 (defconst org-clock-drawer-end-re "^[ \t]*:END:[ \t]*$"
484 "Regular expression matching the last line of a clock drawer.")
486 (defconst org-property-drawer-re
487 (concat "^[ \t]*:PROPERTIES:[ \t]*\n"
488 "\\(?:[ \t]*:\\S-+:\\(?: .*\\)?[ \t]*\n\\)*?"
489 "[ \t]*:END:[ \t]*$")
490 "Matches an entire property drawer.")
492 (defconst org-clock-drawer-re
493 (concat "\\(" org-clock-drawer-start-re "\\)[^\000]*?\\("
494 org-clock-drawer-end-re "\\)\n?")
495 "Matches an entire clock drawer.")
497 ;;;; Headline
499 (defconst org-heading-keyword-regexp-format
500 "^\\(\\*+\\)\\(?: +%s\\)\\(?: +\\(.*?\\)\\)?[ \t]*$"
501 "Printf format for a regexp matching a headline with some keyword.
502 This regexp will match the headline of any node which has the
503 exact keyword that is put into the format. The keyword isn't in
504 any group by default, but the stars and the body are.")
506 (defconst org-heading-keyword-maybe-regexp-format
507 "^\\(\\*+\\)\\(?: +%s\\)?\\(?: +\\(.*?\\)\\)?[ \t]*$"
508 "Printf format for a regexp matching a headline, possibly with some keyword.
509 This regexp can match any headline with the specified keyword, or
510 without a keyword. The keyword isn't in any group by default,
511 but the stars and the body are.")
513 (defconst org-archive-tag "ARCHIVE"
514 "The tag that marks a subtree as archived.
515 An archived subtree does not open during visibility cycling, and does
516 not contribute to the agenda listings.")
518 (defconst org-comment-string "COMMENT"
519 "Entries starting with this keyword will never be exported.
520 An entry can be toggled between COMMENT and normal with
521 \\[org-toggle-comment].")
524 ;;;; LaTeX Environments and Fragments
526 (defconst org-latex-regexps
527 '(("begin" "^[ \t]*\\(\\\\begin{\\([a-zA-Z0-9\\*]+\\)[^\000]+?\\\\end{\\2}\\)" 1 t)
528 ;; ("$" "\\([ (]\\|^\\)\\(\\(\\([$]\\)\\([^ \r\n,.$].*?\\(\n.*?\\)\\{0,5\\}[^ \r\n,.$]\\)\\4\\)\\)\\([ .,?;:'\")]\\|$\\)" 2 nil)
529 ;; \000 in the following regex is needed for org-inside-LaTeX-fragment-p
530 ("$1" "\\([^$]\\|^\\)\\(\\$[^ \r\n,;.$]\\$\\)\\(\\s.\\|\\s-\\|\\s(\\|\\s)\\|\\s\"\\|\000\\|$\\)" 2 nil)
531 ("$" "\\([^$]\\|^\\)\\(\\(\\$\\([^ \r\n,;.$][^$\n\r]*?\\(\n[^$\n\r]*?\\)\\{0,2\\}[^ \r\n,.$]\\)\\$\\)\\)\\(\\s.\\|\\s-\\|\\s(\\|\\s)\\|\\s\"\\|\000\\|$\\)" 2 nil)
532 ("\\(" "\\\\([^\000]*?\\\\)" 0 nil)
533 ("\\[" "\\\\\\[[^\000]*?\\\\\\]" 0 nil)
534 ("$$" "\\$\\$[^\000]*?\\$\\$" 0 nil))
535 "Regular expressions for matching embedded LaTeX.")
537 ;;;; Node Property
539 (defconst org-effort-property "Effort"
540 "The property that is being used to keep track of effort estimates.
541 Effort estimates given in this property need to have the format H:MM.")
543 ;;;; Table
545 (defconst org-table-any-line-regexp "^[ \t]*\\(|\\|\\+-[-+]\\)"
546 "Detect an org-type or table-type table.")
548 (defconst org-table-line-regexp "^[ \t]*|"
549 "Detect an org-type table line.")
551 (defconst org-table-dataline-regexp "^[ \t]*|[^-]"
552 "Detect an org-type table line.")
554 (defconst org-table-hline-regexp "^[ \t]*|-"
555 "Detect an org-type table hline.")
557 (defconst org-table1-hline-regexp "^[ \t]*\\+-[-+]"
558 "Detect a table-type table hline.")
560 (defconst org-table-any-border-regexp "^[ \t]*[^|+ \t]"
561 "Detect the first line outside a table when searching from within it.
562 This works for both table types.")
564 (defconst org-TBLFM-regexp "^[ \t]*#\\+TBLFM: "
565 "Detect a #+TBLFM line.")
567 ;;;; Timestamp
569 (defconst org-ts-regexp "<\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} ?[^\r\n>]*?\\)>"
570 "Regular expression for fast time stamp matching.")
572 (defconst org-ts-regexp-inactive
573 "\\[\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} ?[^\r\n>]*?\\)\\]"
574 "Regular expression for fast inactive time stamp matching.")
576 (defconst org-ts-regexp-both "[[<]\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} ?[^]\r\n>]*?\\)[]>]"
577 "Regular expression for fast time stamp matching.")
579 (defconst org-ts-regexp0
580 "\\(\\([0-9]\\{4\\}\\)-\\([0-9]\\{2\\}\\)-\\([0-9]\\{2\\}\\)\\( +[^]+0-9>\r\n -]+\\)?\\( +\\([0-9]\\{1,2\\}\\):\\([0-9]\\{2\\}\\)\\)?\\)"
581 "Regular expression matching time strings for analysis.
582 This one does not require the space after the date, so it can be used
583 on a string that terminates immediately after the date.")
585 (defconst org-ts-regexp1 "\\(\\([0-9]\\{4\\}\\)-\\([0-9]\\{2\\}\\)-\\([0-9]\\{2\\}\\) *\\([^]+0-9>\r\n -]*\\)\\( \\([0-9]\\{1,2\\}\\):\\([0-9]\\{2\\}\\)\\)?\\)"
586 "Regular expression matching time strings for analysis.")
588 (defconst org-ts-regexp2 (concat "<" org-ts-regexp1 "[^>\n]\\{0,16\\}>")
589 "Regular expression matching time stamps, with groups.")
591 (defconst org-ts-regexp3 (concat "[[<]" org-ts-regexp1 "[^]>\n]\\{0,16\\}[]>]")
592 "Regular expression matching time stamps (also [..]), with groups.")
594 (defconst org-tr-regexp (concat org-ts-regexp "--?-?" org-ts-regexp)
595 "Regular expression matching a time stamp range.")
597 (defconst org-tr-regexp-both
598 (concat org-ts-regexp-both "--?-?" org-ts-regexp-both)
599 "Regular expression matching a time stamp range.")
601 (defconst org-tsr-regexp (concat org-ts-regexp "\\(--?-?"
602 org-ts-regexp "\\)?")
603 "Regular expression matching a time stamp or time stamp range.")
605 (defconst org-tsr-regexp-both
606 (concat org-ts-regexp-both "\\(--?-?"
607 org-ts-regexp-both "\\)?")
608 "Regular expression matching a time stamp or time stamp range.
609 The time stamps may be either active or inactive.")
611 (defconst org-repeat-re
612 "<[0-9]\\{4\\}-[0-9][0-9]-[0-9][0-9] [^>\n]*?\\([.+]?\\+[0-9]+[hdwmy]\\(/[0-9]+[hdwmy]\\)?\\)"
613 "Regular expression for specifying repeated events.
614 After a match, group 1 contains the repeat expression.")
616 (defconst org-time-stamp-formats '("<%Y-%m-%d %a>" . "<%Y-%m-%d %a %H:%M>")
617 "Formats for `format-time-string' which are used for time stamps.")
620 ;;; The custom variables
622 (defgroup org nil
623 "Outline-based notes management and organizer."
624 :tag "Org"
625 :group 'outlines
626 :group 'calendar)
628 (defcustom org-mode-hook nil
629 "Mode hook for Org-mode, run after the mode was turned on."
630 :group 'org
631 :type 'hook)
633 (defcustom org-load-hook nil
634 "Hook that is run after org.el has been loaded."
635 :group 'org
636 :type 'hook)
638 (defcustom org-log-buffer-setup-hook nil
639 "Hook that is run after an Org log buffer is created."
640 :group 'org
641 :version "24.1"
642 :type 'hook)
644 (defvar org-modules) ; defined below
645 (defvar org-modules-loaded nil
646 "Have the modules been loaded already?")
648 (defun org-load-modules-maybe (&optional force)
649 "Load all extensions listed in `org-modules'."
650 (when (or force (not org-modules-loaded))
651 (dolist (ext org-modules)
652 (condition-case nil (require ext)
653 (error (message "Problems while trying to load feature `%s'" ext))))
654 (setq org-modules-loaded t)))
656 (defun org-set-modules (var value)
657 "Set VAR to VALUE and call `org-load-modules-maybe' with the force flag."
658 (set var value)
659 (when (featurep 'org)
660 (org-load-modules-maybe 'force)
661 (org-element-cache-reset 'all)))
663 (defcustom org-modules '(org-w3m org-bbdb org-bibtex org-docview org-gnus org-info org-irc org-mhe org-rmail)
664 "Modules that should always be loaded together with org.el.
666 If a description starts with <C>, the file is not part of Emacs
667 and loading it will require that you have downloaded and properly
668 installed the Org mode distribution.
670 You can also use this system to load external packages (i.e. neither Org
671 core modules, nor modules from the CONTRIB directory). Just add symbols
672 to the end of the list. If the package is called org-xyz.el, then you need
673 to add the symbol `xyz', and the package must have a call to:
675 (provide \\='org-xyz)
677 For export specific modules, see also `org-export-backends'."
678 :group 'org
679 :set 'org-set-modules
680 :version "24.4"
681 :package-version '(Org . "8.0")
682 :type
683 '(set :greedy t
684 (const :tag " bbdb: Links to BBDB entries" org-bbdb)
685 (const :tag " bibtex: Links to BibTeX entries" org-bibtex)
686 (const :tag " crypt: Encryption of subtrees" org-crypt)
687 (const :tag " ctags: Access to Emacs tags with links" org-ctags)
688 (const :tag " docview: Links to doc-view buffers" org-docview)
689 (const :tag " gnus: Links to GNUS folders/messages" org-gnus)
690 (const :tag " habit: Track your consistency with habits" org-habit)
691 (const :tag " id: Global IDs for identifying entries" org-id)
692 (const :tag " info: Links to Info nodes" org-info)
693 (const :tag " inlinetask: Tasks independent of outline hierarchy" org-inlinetask)
694 (const :tag " irc: Links to IRC/ERC chat sessions" org-irc)
695 (const :tag " mhe: Links to MHE folders/messages" org-mhe)
696 (const :tag " mouse: Additional mouse support" org-mouse)
697 (const :tag " protocol: Intercept calls from emacsclient" org-protocol)
698 (const :tag " rmail: Links to RMAIL folders/messages" org-rmail)
699 (const :tag " w3m: Special cut/paste from w3m to Org-mode." org-w3m)
701 (const :tag "C annotate-file: Annotate a file with org syntax" org-annotate-file)
702 (const :tag "C bookmark: Org-mode links to bookmarks" org-bookmark)
703 (const :tag "C bullets: Add overlays to headlines stars" org-bullets)
704 (const :tag "C checklist: Extra functions for checklists in repeated tasks" org-checklist)
705 (const :tag "C choose: Use TODO keywords to mark decisions states" org-choose)
706 (const :tag "C collector: Collect properties into tables" org-collector)
707 (const :tag "C depend: TODO dependencies for Org-mode\n\t\t\t(PARTIALLY OBSOLETE, see built-in dependency support))" org-depend)
708 (const :tag "C drill: Flashcards and spaced repetition for Org-mode" org-drill)
709 (const :tag "C elisp-symbol: Org-mode links to emacs-lisp symbols" org-elisp-symbol)
710 (const :tag "C eshell Support for links to working directories in eshell" org-eshell)
711 (const :tag "C eval-light: Evaluate inbuffer-code on demand" org-eval-light)
712 (const :tag "C eval: Include command output as text" org-eval)
713 (const :tag "C eww: Store link to url of eww" org-eww)
714 (const :tag "C expiry: Expiry mechanism for Org-mode entries" org-expiry)
715 (const :tag "C favtable: Lookup table of favorite references and links" org-favtable)
716 (const :tag "C git-link: Provide org links to specific file version" org-git-link)
717 (const :tag "C interactive-query: Interactive modification of tags query\n\t\t\t(PARTIALLY OBSOLETE, see secondary filtering)" org-interactive-query)
718 (const :tag "C invoice: Help manage client invoices in Org-mode" org-invoice)
719 (const :tag "C learn: SuperMemo's incremental learning algorithm" org-learn)
720 (const :tag "C mac-iCal Imports events from iCal.app to the Emacs diary" org-mac-iCal)
721 (const :tag "C mac-link: Grab links and url from various mac Applications" org-mac-link)
722 (const :tag "C mairix: Hook mairix search into Org-mode for different MUAs" org-mairix)
723 (const :tag "C man: Support for links to manpages in Org-mode" org-man)
724 (const :tag "C mew: Links to Mew folders/messages" org-mew)
725 (const :tag "C mtags: Support for muse-like tags" org-mtags)
726 (const :tag "C notmuch: Provide org links to notmuch searches or messages" org-notmuch)
727 (const :tag "C panel: Simple routines for us with bad memory" org-panel)
728 (const :tag "C registry: A registry for Org-mode links" org-registry)
729 (const :tag "C screen: Visit screen sessions through Org-mode links" org-screen)
730 (const :tag "C secretary: Team management with org-mode" org-secretary)
731 (const :tag "C sqlinsert: Convert Org-mode tables to SQL insertions" orgtbl-sqlinsert)
732 (const :tag "C toc: Table of contents for Org-mode buffer" org-toc)
733 (const :tag "C track: Keep up with Org-mode development" org-track)
734 (const :tag "C velocity Something like Notational Velocity for Org" org-velocity)
735 (const :tag "C vm: Links to VM folders/messages" org-vm)
736 (const :tag "C wikinodes: CamelCase wiki-like links" org-wikinodes)
737 (const :tag "C wl: Links to Wanderlust folders/messages" org-wl)
738 (repeat :tag "External packages" :inline t (symbol :tag "Package"))))
740 (defvar org-export-registered-backends) ; From ox.el.
741 (declare-function org-export-derived-backend-p "ox" (backend &rest backends))
742 (declare-function org-export-backend-name "ox" (backend) t)
743 (defcustom org-export-backends '(ascii html icalendar latex odt)
744 "List of export back-ends that should be always available.
746 If a description starts with <C>, the file is not part of Emacs
747 and loading it will require that you have downloaded and properly
748 installed the Org mode distribution.
750 Unlike to `org-modules', libraries in this list will not be
751 loaded along with Org, but only once the export framework is
752 needed.
754 This variable needs to be set before org.el is loaded. If you
755 need to make a change while Emacs is running, use the customize
756 interface or run the following code, where VAL stands for the new
757 value of the variable, after updating it:
759 (progn
760 (setq org-export-registered-backends
761 (cl-remove-if-not
762 (lambda (backend)
763 (let ((name (org-export-backend-name backend)))
764 (or (memq name val)
765 (catch \\='parentp
766 (dolist (b val)
767 (and (org-export-derived-backend-p b name)
768 (throw \\='parentp t)))))))
769 org-export-registered-backends))
770 (let ((new-list (mapcar #\\='org-export-backend-name
771 org-export-registered-backends)))
772 (dolist (backend val)
773 (cond
774 ((not (load (format \"ox-%s\" backend) t t))
775 (message \"Problems while trying to load export back-end \\=`%s\\='\"
776 backend))
777 ((not (memq backend new-list)) (push backend new-list))))
778 (set-default \\='org-export-backends new-list)))
780 Adding a back-end to this list will also pull the back-end it
781 depends on, if any."
782 :group 'org
783 :group 'org-export
784 :version "25.1"
785 :package-version '(Org . "9.0")
786 :initialize 'custom-initialize-set
787 :set (lambda (var val)
788 (if (not (featurep 'ox)) (set-default var val)
789 ;; Any back-end not required anymore (not present in VAL and not
790 ;; a parent of any back-end in the new value) is removed from the
791 ;; list of registered back-ends.
792 (setq org-export-registered-backends
793 (cl-remove-if-not
794 (lambda (backend)
795 (let ((name (org-export-backend-name backend)))
796 (or (memq name val)
797 (catch 'parentp
798 (dolist (b val)
799 (and (org-export-derived-backend-p b name)
800 (throw 'parentp t)))))))
801 org-export-registered-backends))
802 ;; Now build NEW-LIST of both new back-ends and required
803 ;; parents.
804 (let ((new-list (mapcar #'org-export-backend-name
805 org-export-registered-backends)))
806 (dolist (backend val)
807 (cond
808 ((not (load (format "ox-%s" backend) t t))
809 (message "Problems while trying to load export back-end `%s'"
810 backend))
811 ((not (memq backend new-list)) (push backend new-list))))
812 ;; Set VAR to that list with fixed dependencies.
813 (set-default var new-list))))
814 :type '(set :greedy t
815 (const :tag " ascii Export buffer to ASCII format" ascii)
816 (const :tag " beamer Export buffer to Beamer presentation" beamer)
817 (const :tag " html Export buffer to HTML format" html)
818 (const :tag " icalendar Export buffer to iCalendar format" icalendar)
819 (const :tag " latex Export buffer to LaTeX format" latex)
820 (const :tag " man Export buffer to MAN format" man)
821 (const :tag " md Export buffer to Markdown format" md)
822 (const :tag " odt Export buffer to ODT format" odt)
823 (const :tag " org Export buffer to Org format" org)
824 (const :tag " texinfo Export buffer to Texinfo format" texinfo)
825 (const :tag "C confluence Export buffer to Confluence Wiki format" confluence)
826 (const :tag "C deck Export buffer to deck.js presentations" deck)
827 (const :tag "C freemind Export buffer to Freemind mindmap format" freemind)
828 (const :tag "C groff Export buffer to Groff format" groff)
829 (const :tag "C koma-letter Export buffer to KOMA Scrlttrl2 format" koma-letter)
830 (const :tag "C RSS 2.0 Export buffer to RSS 2.0 format" rss)
831 (const :tag "C s5 Export buffer to s5 presentations" s5)
832 (const :tag "C taskjuggler Export buffer to TaskJuggler format" taskjuggler)))
834 (eval-after-load 'ox
835 '(dolist (backend org-export-backends)
836 (condition-case nil (require (intern (format "ox-%s" backend)))
837 (error (message "Problems while trying to load export back-end `%s'"
838 backend)))))
840 (defcustom org-support-shift-select nil
841 "Non-nil means make shift-cursor commands select text when possible.
842 \\<org-mode-map>\
844 In Emacs 23, when `shift-select-mode' is on, shifted cursor keys
845 start selecting a region, or enlarge regions started in this way.
846 In Org-mode, in special contexts, these same keys are used for
847 other purposes, important enough to compete with shift selection.
848 Org tries to balance these needs by supporting `shift-select-mode'
849 outside these special contexts, under control of this variable.
851 The default of this variable is nil, to avoid confusing behavior. Shifted
852 cursor keys will then execute Org commands in the following contexts:
853 - on a headline, changing TODO state (left/right) and priority (up/down)
854 - on a time stamp, changing the time
855 - in a plain list item, changing the bullet type
856 - in a property definition line, switching between allowed values
857 - in the BEGIN line of a clock table (changing the time block).
858 Outside these contexts, the commands will throw an error.
860 When this variable is t and the cursor is not in a special
861 context, Org-mode will support shift-selection for making and
862 enlarging regions. To make this more effective, the bullet
863 cycling will no longer happen anywhere in an item line, but only
864 if the cursor is exactly on the bullet.
866 If you set this variable to the symbol `always', then the keys
867 will not be special in headlines, property lines, and item lines,
868 to make shift selection work there as well. If this is what you
869 want, you can use the following alternative commands:
870 `\\[org-todo]' and `\\[org-priority]' \
871 to change TODO state and priority,
872 `\\[universal-argument] \\[universal-argument] \\[org-todo]' \
873 can be used to switch TODO sets,
874 `\\[org-ctrl-c-minus]' to cycle item bullet types,
875 and properties can be edited by hand or in column view.
877 However, when the cursor is on a timestamp, shift-cursor commands
878 will still edit the time stamp - this is just too good to give up."
879 :group 'org
880 :type '(choice
881 (const :tag "Never" nil)
882 (const :tag "When outside special context" t)
883 (const :tag "Everywhere except timestamps" always)))
885 (defcustom org-loop-over-headlines-in-active-region nil
886 "Shall some commands act upon headlines in the active region?
888 When set to t, some commands will be performed in all headlines
889 within the active region.
891 When set to `start-level', some commands will be performed in all
892 headlines within the active region, provided that these headlines
893 are of the same level than the first one.
895 When set to a string, those commands will be performed on the
896 matching headlines within the active region. Such string must be
897 a tags/property/todo match as it is used in the agenda tags view.
899 The list of commands is: `org-schedule', `org-deadline',
900 `org-todo', `org-archive-subtree', `org-archive-set-tag' and
901 `org-archive-to-archive-sibling'. The archiving commands skip
902 already archived entries."
903 :type '(choice (const :tag "Don't loop" nil)
904 (const :tag "All headlines in active region" t)
905 (const :tag "In active region, headlines at the same level than the first one" start-level)
906 (string :tag "Tags/Property/Todo matcher"))
907 :version "24.1"
908 :group 'org-todo
909 :group 'org-archive)
911 (defgroup org-startup nil
912 "Options concerning startup of Org-mode."
913 :tag "Org Startup"
914 :group 'org)
916 (defcustom org-startup-folded t
917 "Non-nil means entering Org-mode will switch to OVERVIEW.
918 This can also be configured on a per-file basis by adding one of
919 the following lines anywhere in the buffer:
921 #+STARTUP: fold (or `overview', this is equivalent)
922 #+STARTUP: nofold (or `showall', this is equivalent)
923 #+STARTUP: content
924 #+STARTUP: showeverything
926 By default, this option is ignored when Org opens agenda files
927 for the first time. If you want the agenda to honor the startup
928 option, set `org-agenda-inhibit-startup' to nil."
929 :group 'org-startup
930 :type '(choice
931 (const :tag "nofold: show all" nil)
932 (const :tag "fold: overview" t)
933 (const :tag "content: all headlines" content)
934 (const :tag "show everything, even drawers" showeverything)))
936 (defcustom org-startup-truncated t
937 "Non-nil means entering Org-mode will set `truncate-lines'.
938 This is useful since some lines containing links can be very long and
939 uninteresting. Also tables look terrible when wrapped."
940 :group 'org-startup
941 :type 'boolean)
943 (defcustom org-startup-indented nil
944 "Non-nil means turn on `org-indent-mode' on startup.
945 This can also be configured on a per-file basis by adding one of
946 the following lines anywhere in the buffer:
948 #+STARTUP: indent
949 #+STARTUP: noindent"
950 :group 'org-structure
951 :type '(choice
952 (const :tag "Not" nil)
953 (const :tag "Globally (slow on startup in large files)" t)))
955 (defcustom org-use-sub-superscripts t
956 "Non-nil means interpret \"_\" and \"^\" for display.
958 If you want to control how Org exports those characters, see
959 `org-export-with-sub-superscripts'. `org-use-sub-superscripts'
960 used to be an alias for `org-export-with-sub-superscripts' in
961 Org <8.0, it is not anymore.
963 When this option is turned on, you can use TeX-like syntax for
964 sub- and superscripts within the buffer. Several characters after
965 \"_\" or \"^\" will be considered as a single item - so grouping
966 with {} is normally not needed. For example, the following things
967 will be parsed as single sub- or superscripts:
969 10^24 or 10^tau several digits will be considered 1 item.
970 10^-12 or 10^-tau a leading sign with digits or a word
971 x^2-y^3 will be read as x^2 - y^3, because items are
972 terminated by almost any nonword/nondigit char.
973 x_{i^2} or x^(2-i) braces or parenthesis do grouping.
975 Still, ambiguity is possible. So when in doubt, use {} to enclose
976 the sub/superscript. If you set this variable to the symbol `{}',
977 the braces are *required* in order to trigger interpretations as
978 sub/superscript. This can be helpful in documents that need \"_\"
979 frequently in plain text."
980 :group 'org-startup
981 :version "24.4"
982 :package-version '(Org . "8.0")
983 :type '(choice
984 (const :tag "Always interpret" t)
985 (const :tag "Only with braces" {})
986 (const :tag "Never interpret" nil)))
988 (defcustom org-startup-with-beamer-mode nil
989 "Non-nil means turn on `org-beamer-mode' on startup.
990 This can also be configured on a per-file basis by adding one of
991 the following lines anywhere in the buffer:
993 #+STARTUP: beamer"
994 :group 'org-startup
995 :version "24.1"
996 :type 'boolean)
998 (defcustom org-startup-align-all-tables nil
999 "Non-nil means align all tables when visiting a file.
1000 This is useful when the column width in tables is forced with <N> cookies
1001 in table fields. Such tables will look correct only after the first re-align.
1002 This can also be configured on a per-file basis by adding one of
1003 the following lines anywhere in the buffer:
1004 #+STARTUP: align
1005 #+STARTUP: noalign"
1006 :group 'org-startup
1007 :type 'boolean)
1009 (defcustom org-startup-with-inline-images nil
1010 "Non-nil means show inline images when loading a new Org file.
1011 This can also be configured on a per-file basis by adding one of
1012 the following lines anywhere in the buffer:
1013 #+STARTUP: inlineimages
1014 #+STARTUP: noinlineimages"
1015 :group 'org-startup
1016 :version "24.1"
1017 :type 'boolean)
1019 (defcustom org-startup-with-latex-preview nil
1020 "Non-nil means preview LaTeX fragments when loading a new Org file.
1022 This can also be configured on a per-file basis by adding one of
1023 the following lines anywhere in the buffer:
1024 #+STARTUP: latexpreview
1025 #+STARTUP: nolatexpreview"
1026 :group 'org-startup
1027 :version "24.4"
1028 :package-version '(Org . "8.0")
1029 :type 'boolean)
1031 (defcustom org-insert-mode-line-in-empty-file nil
1032 "Non-nil means insert the first line setting Org-mode in empty files.
1033 When the function `org-mode' is called interactively in an empty file, this
1034 normally means that the file name does not automatically trigger Org-mode.
1035 To ensure that the file will always be in Org-mode in the future, a
1036 line enforcing Org-mode will be inserted into the buffer, if this option
1037 has been set."
1038 :group 'org-startup
1039 :type 'boolean)
1041 (defcustom org-replace-disputed-keys nil
1042 "Non-nil means use alternative key bindings for some keys.
1043 Org-mode uses S-<cursor> keys for changing timestamps and priorities.
1044 These keys are also used by other packages like shift-selection-mode'
1045 \(built into Emacs 23), `CUA-mode' or `windmove.el'.
1046 If you want to use Org-mode together with one of these other modes,
1047 or more generally if you would like to move some Org-mode commands to
1048 other keys, set this variable and configure the keys with the variable
1049 `org-disputed-keys'.
1051 This option is only relevant at load-time of Org-mode, and must be set
1052 *before* org.el is loaded. Changing it requires a restart of Emacs to
1053 become effective."
1054 :group 'org-startup
1055 :type 'boolean)
1057 (defcustom org-use-extra-keys nil
1058 "Non-nil means use extra key sequence definitions for certain commands.
1059 This happens automatically if `window-system' is nil. This
1060 variable lets you do the same manually. You must set it before
1061 loading org.
1063 Example: on Carbon Emacs 22 running graphically, with an external
1064 keyboard on a Powerbook, the default way of setting M-left might
1065 not work for either Alt or ESC. Setting this variable will make
1066 it work for ESC."
1067 :group 'org-startup
1068 :type 'boolean)
1070 (org-defvaralias 'org-CUA-compatible 'org-replace-disputed-keys)
1072 (defcustom org-disputed-keys
1073 '(([(shift up)] . [(meta p)])
1074 ([(shift down)] . [(meta n)])
1075 ([(shift left)] . [(meta -)])
1076 ([(shift right)] . [(meta +)])
1077 ([(control shift right)] . [(meta shift +)])
1078 ([(control shift left)] . [(meta shift -)]))
1079 "Keys for which Org-mode and other modes compete.
1080 This is an alist, cars are the default keys, second element specifies
1081 the alternative to use when `org-replace-disputed-keys' is t.
1083 Keys can be specified in any syntax supported by `define-key'.
1084 The value of this option takes effect only at Org-mode's startup,
1085 therefore you'll have to restart Emacs to apply it after changing."
1086 :group 'org-startup
1087 :type 'alist)
1089 (defun org-key (key)
1090 "Select key according to `org-replace-disputed-keys' and `org-disputed-keys'.
1091 Or return the original if not disputed."
1092 (when org-replace-disputed-keys
1093 (let* ((nkey (key-description key))
1094 (x (org-find-if (lambda (x)
1095 (equal (key-description (car x)) nkey))
1096 org-disputed-keys)))
1097 (setq key (if x (cdr x) key))))
1098 key)
1100 (defun org-find-if (predicate seq)
1101 (catch 'exit
1102 (while seq
1103 (if (funcall predicate (car seq))
1104 (throw 'exit (car seq))
1105 (pop seq)))))
1107 (defun org-defkey (keymap key def)
1108 "Define a key, possibly translated, as returned by `org-key'."
1109 (define-key keymap (org-key key) def))
1111 (defcustom org-ellipsis nil
1112 "The ellipsis to use in the Org-mode outline.
1113 When nil, just use the standard three dots.
1114 When a string, use that string instead.
1115 When a face, use the standard 3 dots, but with the specified face.
1116 The change affects only Org-mode (which will then use its own display table).
1117 Changing this requires executing \\[org-mode] in a buffer to become
1118 effective."
1119 :group 'org-startup
1120 :type '(choice (const :tag "Default" nil)
1121 (face :tag "Face" :value org-warning)
1122 (string :tag "String" :value "...#")))
1124 (defvar org-display-table nil
1125 "The display table for org-mode, in case `org-ellipsis' is non-nil.")
1127 (defgroup org-keywords nil
1128 "Keywords in Org-mode."
1129 :tag "Org Keywords"
1130 :group 'org)
1132 (defcustom org-closed-keep-when-no-todo nil
1133 "Remove CLOSED: time-stamp when switching back to a non-todo state?"
1134 :group 'org-todo
1135 :group 'org-keywords
1136 :version "24.4"
1137 :package-version '(Org . "8.0")
1138 :type 'boolean)
1140 (defgroup org-structure nil
1141 "Options concerning the general structure of Org-mode files."
1142 :tag "Org Structure"
1143 :group 'org)
1145 (defgroup org-reveal-location nil
1146 "Options about how to make context of a location visible."
1147 :tag "Org Reveal Location"
1148 :group 'org-structure)
1150 (defcustom org-show-context-detail '((agenda . local)
1151 (bookmark-jump . lineage)
1152 (isearch . lineage)
1153 (default . ancestors))
1154 "Alist between context and visibility span when revealing a location.
1156 \\<org-mode-map>Some actions may move point into invisible
1157 locations. As a consequence, Org always expose a neighborhood
1158 around point. How much is shown depends on the initial action,
1159 or context. Valid contexts are
1161 agenda when exposing an entry from the agenda
1162 org-goto when using the command `org-goto' (\\[org-goto])
1163 occur-tree when using the command `org-occur' (\\[org-sparse-tree] /)
1164 tags-tree when constructing a sparse tree based on tags matches
1165 link-search when exposing search matches associated with a link
1166 mark-goto when exposing the jump goal of a mark
1167 bookmark-jump when exposing a bookmark location
1168 isearch when exiting from an incremental search
1169 default default for all contexts not set explicitly
1171 Allowed visibility spans are
1173 minimal show current headline; if point is not on headline,
1174 also show entry
1176 local show current headline, entry and next headline
1178 ancestors show current headline and its direct ancestors; if
1179 point is not on headline, also show entry
1181 lineage show current headline, its direct ancestors and all
1182 their children; if point is not on headline, also show
1183 entry and first child
1185 tree show current headline, its direct ancestors and all
1186 their children; if point is not on headline, also show
1187 entry and all children
1189 canonical show current headline, its direct ancestors along with
1190 their entries and children; if point is not located on
1191 the headline, also show current entry and all children
1193 As special cases, a nil or t value means show all contexts in
1194 `minimal' or `canonical' view, respectively.
1196 Some views can make displayed information very compact, but also
1197 make it harder to edit the location of the match. In such
1198 a case, use the command `org-reveal' (\\[org-reveal]) to show
1199 more context."
1200 :group 'org-reveal-location
1201 :version "25.2"
1202 :package-version '(Org . "9.0")
1203 :type '(choice
1204 (const :tag "Canonical" t)
1205 (const :tag "Minimal" nil)
1206 (repeat :greedy t :tag "Individual contexts"
1207 (cons
1208 (choice :tag "Context"
1209 (const agenda)
1210 (const org-goto)
1211 (const occur-tree)
1212 (const tags-tree)
1213 (const link-search)
1214 (const mark-goto)
1215 (const bookmark-jump)
1216 (const isearch)
1217 (const default))
1218 (choice :tag "Detail level"
1219 (const minimal)
1220 (const local)
1221 (const ancestors)
1222 (const lineage)
1223 (const tree)
1224 (const canonical))))))
1226 (defcustom org-indirect-buffer-display 'other-window
1227 "How should indirect tree buffers be displayed?
1228 This applies to indirect buffers created with the commands
1229 \\[org-tree-to-indirect-buffer] and \\[org-agenda-tree-to-indirect-buffer].
1230 Valid values are:
1231 current-window Display in the current window
1232 other-window Just display in another window.
1233 dedicated-frame Create one new frame, and re-use it each time.
1234 new-frame Make a new frame each time. Note that in this case
1235 previously-made indirect buffers are kept, and you need to
1236 kill these buffers yourself."
1237 :group 'org-structure
1238 :group 'org-agenda-windows
1239 :type '(choice
1240 (const :tag "In current window" current-window)
1241 (const :tag "In current frame, other window" other-window)
1242 (const :tag "Each time a new frame" new-frame)
1243 (const :tag "One dedicated frame" dedicated-frame)))
1245 (defcustom org-use-speed-commands nil
1246 "Non-nil means activate single letter commands at beginning of a headline.
1247 This may also be a function to test for appropriate locations where speed
1248 commands should be active.
1250 For example, to activate speed commands when the point is on any
1251 star at the beginning of the headline, you can do this:
1253 (setq org-use-speed-commands
1254 (lambda () (and (looking-at org-outline-regexp) (looking-back \"^\\**\"))))"
1255 :group 'org-structure
1256 :type '(choice
1257 (const :tag "Never" nil)
1258 (const :tag "At beginning of headline stars" t)
1259 (function)))
1261 (defcustom org-speed-commands-user nil
1262 "Alist of additional speed commands.
1263 This list will be checked before `org-speed-commands-default'
1264 when the variable `org-use-speed-commands' is non-nil
1265 and when the cursor is at the beginning of a headline.
1266 The car if each entry is a string with a single letter, which must
1267 be assigned to `self-insert-command' in the global map.
1268 The cdr is either a command to be called interactively, a function
1269 to be called, or a form to be evaluated.
1270 An entry that is just a list with a single string will be interpreted
1271 as a descriptive headline that will be added when listing the speed
1272 commands in the Help buffer using the `?' speed command."
1273 :group 'org-structure
1274 :type '(repeat :value ("k" . ignore)
1275 (choice :value ("k" . ignore)
1276 (list :tag "Descriptive Headline" (string :tag "Headline"))
1277 (cons :tag "Letter and Command"
1278 (string :tag "Command letter")
1279 (choice
1280 (function)
1281 (sexp))))))
1283 (defcustom org-bookmark-names-plist
1284 '(:last-capture "org-capture-last-stored"
1285 :last-refile "org-refile-last-stored"
1286 :last-capture-marker "org-capture-last-stored-marker")
1287 "Names for bookmarks automatically set by some Org commands.
1288 This can provide strings as names for a number of bookmarks Org sets
1289 automatically. The following keys are currently implemented:
1290 :last-capture
1291 :last-capture-marker
1292 :last-refile
1293 When a key does not show up in the property list, the corresponding bookmark
1294 is not set."
1295 :group 'org-structure
1296 :type 'plist)
1298 (defgroup org-cycle nil
1299 "Options concerning visibility cycling in Org-mode."
1300 :tag "Org Cycle"
1301 :group 'org-structure)
1303 (defcustom org-cycle-skip-children-state-if-no-children t
1304 "Non-nil means skip CHILDREN state in entries that don't have any."
1305 :group 'org-cycle
1306 :type 'boolean)
1308 (defcustom org-cycle-max-level nil
1309 "Maximum level which should still be subject to visibility cycling.
1310 Levels higher than this will, for cycling, be treated as text, not a headline.
1311 When `org-odd-levels-only' is set, a value of N in this variable actually
1312 means 2N-1 stars as the limiting headline.
1313 When nil, cycle all levels.
1314 Note that the limiting level of cycling is also influenced by
1315 `org-inlinetask-min-level'. When `org-cycle-max-level' is not set but
1316 `org-inlinetask-min-level' is, cycling will be limited to levels one less
1317 than its value."
1318 :group 'org-cycle
1319 :type '(choice
1320 (const :tag "No limit" nil)
1321 (integer :tag "Maximum level")))
1323 (defcustom org-hide-block-startup nil
1324 "Non-nil means entering Org-mode will fold all blocks.
1325 This can also be set in on a per-file basis with
1327 #+STARTUP: hideblocks
1328 #+STARTUP: showblocks"
1329 :group 'org-startup
1330 :group 'org-cycle
1331 :type 'boolean)
1333 (defcustom org-cycle-global-at-bob nil
1334 "Cycle globally if cursor is at beginning of buffer and not at a headline.
1335 This makes it possible to do global cycling without having to use S-TAB or
1336 \\[universal-argument] TAB. For this special case to work, the first line
1337 of the buffer must not be a headline -- it may be empty or some other text.
1338 When used in this way, `org-cycle-hook' is disabled temporarily to make
1339 sure the cursor stays at the beginning of the buffer. When this option is
1340 nil, don't do anything special at the beginning of the buffer."
1341 :group 'org-cycle
1342 :type 'boolean)
1344 (defcustom org-cycle-level-after-item/entry-creation t
1345 "Non-nil means cycle entry level or item indentation in new empty entries.
1347 When the cursor is at the end of an empty headline, i.e., with only stars
1348 and maybe a TODO keyword, TAB will then switch the entry to become a child,
1349 and then all possible ancestor states, before returning to the original state.
1350 This makes data entry extremely fast: M-RET to create a new headline,
1351 on TAB to make it a child, two or more tabs to make it a (grand-)uncle.
1353 When the cursor is at the end of an empty plain list item, one TAB will
1354 make it a subitem, two or more tabs will back up to make this an item
1355 higher up in the item hierarchy."
1356 :group 'org-cycle
1357 :type 'boolean)
1359 (defcustom org-cycle-emulate-tab t
1360 "Where should `org-cycle' emulate TAB.
1361 nil Never
1362 white Only in completely white lines
1363 whitestart Only at the beginning of lines, before the first non-white char
1364 t Everywhere except in headlines
1365 exc-hl-bol Everywhere except at the start of a headline
1366 If TAB is used in a place where it does not emulate TAB, the current subtree
1367 visibility is cycled."
1368 :group 'org-cycle
1369 :type '(choice (const :tag "Never" nil)
1370 (const :tag "Only in completely white lines" white)
1371 (const :tag "Before first char in a line" whitestart)
1372 (const :tag "Everywhere except in headlines" t)
1373 (const :tag "Everywhere except at bol in headlines" exc-hl-bol)))
1375 (defcustom org-cycle-separator-lines 2
1376 "Number of empty lines needed to keep an empty line between collapsed trees.
1377 If you leave an empty line between the end of a subtree and the following
1378 headline, this empty line is hidden when the subtree is folded.
1379 Org-mode will leave (exactly) one empty line visible if the number of
1380 empty lines is equal or larger to the number given in this variable.
1381 So the default 2 means at least 2 empty lines after the end of a subtree
1382 are needed to produce free space between a collapsed subtree and the
1383 following headline.
1385 If the number is negative, and the number of empty lines is at least -N,
1386 all empty lines are shown.
1388 Special case: when 0, never leave empty lines in collapsed view."
1389 :group 'org-cycle
1390 :type 'integer)
1391 (put 'org-cycle-separator-lines 'safe-local-variable 'integerp)
1393 (defcustom org-pre-cycle-hook nil
1394 "Hook that is run before visibility cycling is happening.
1395 The function(s) in this hook must accept a single argument which indicates
1396 the new state that will be set right after running this hook. The
1397 argument is a symbol. Before a global state change, it can have the values
1398 `overview', `content', or `all'. Before a local state change, it can have
1399 the values `folded', `children', or `subtree'."
1400 :group 'org-cycle
1401 :type 'hook)
1403 (defcustom org-cycle-hook '(org-cycle-hide-archived-subtrees
1404 org-cycle-hide-drawers
1405 org-cycle-show-empty-lines
1406 org-optimize-window-after-visibility-change)
1407 "Hook that is run after `org-cycle' has changed the buffer visibility.
1408 The function(s) in this hook must accept a single argument which indicates
1409 the new state that was set by the most recent `org-cycle' command. The
1410 argument is a symbol. After a global state change, it can have the values
1411 `overview', `contents', or `all'. After a local state change, it can have
1412 the values `folded', `children', or `subtree'."
1413 :group 'org-cycle
1414 :type 'hook
1415 :version "25.1"
1416 :package-version '(Org . "8.3"))
1418 (defgroup org-edit-structure nil
1419 "Options concerning structure editing in Org-mode."
1420 :tag "Org Edit Structure"
1421 :group 'org-structure)
1423 (defcustom org-odd-levels-only nil
1424 "Non-nil means skip even levels and only use odd levels for the outline.
1425 This has the effect that two stars are being added/taken away in
1426 promotion/demotion commands. It also influences how levels are
1427 handled by the exporters.
1428 Changing it requires restart of `font-lock-mode' to become effective
1429 for fontification also in regions already fontified.
1430 You may also set this on a per-file basis by adding one of the following
1431 lines to the buffer:
1433 #+STARTUP: odd
1434 #+STARTUP: oddeven"
1435 :group 'org-edit-structure
1436 :group 'org-appearance
1437 :type 'boolean)
1439 (defcustom org-adapt-indentation t
1440 "Non-nil means adapt indentation to outline node level.
1442 When this variable is set, Org assumes that you write outlines by
1443 indenting text in each node to align with the headline (after the
1444 stars). The following issues are influenced by this variable:
1446 - The indentation is increased by one space in a demotion
1447 command, and decreased by one in a promotion command. However,
1448 in the latter case, if shifting some line in the entry body
1449 would alter document structure (e.g., insert a new headline),
1450 indentation is not changed at all.
1452 - Property drawers and planning information is inserted indented
1453 when this variable is set. When nil, they will not be indented.
1455 - TAB indents a line relative to current level. The lines below
1456 a headline will be indented when this variable is set.
1458 Note that this is all about true indentation, by adding and
1459 removing space characters. See also `org-indent.el' which does
1460 level-dependent indentation in a virtual way, i.e. at display
1461 time in Emacs."
1462 :group 'org-edit-structure
1463 :type 'boolean)
1465 (defcustom org-special-ctrl-a/e nil
1466 "Non-nil means `C-a' and `C-e' behave specially in headlines and items.
1468 When t, `C-a' will bring back the cursor to the beginning of the
1469 headline text, i.e. after the stars and after a possible TODO
1470 keyword. In an item, this will be the position after bullet and
1471 check-box, if any. When the cursor is already at that position,
1472 another `C-a' will bring it to the beginning of the line.
1474 `C-e' will jump to the end of the headline, ignoring the presence
1475 of tags in the headline. A second `C-e' will then jump to the
1476 true end of the line, after any tags. This also means that, when
1477 this variable is non-nil, `C-e' also will never jump beyond the
1478 end of the heading of a folded section, i.e. not after the
1479 ellipses.
1481 When set to the symbol `reversed', the first `C-a' or `C-e' works
1482 normally, going to the true line boundary first. Only a directly
1483 following, identical keypress will bring the cursor to the
1484 special positions.
1486 This may also be a cons cell where the behavior for `C-a' and
1487 `C-e' is set separately."
1488 :group 'org-edit-structure
1489 :type '(choice
1490 (const :tag "off" nil)
1491 (const :tag "on: after stars/bullet and before tags first" t)
1492 (const :tag "reversed: true line boundary first" reversed)
1493 (cons :tag "Set C-a and C-e separately"
1494 (choice :tag "Special C-a"
1495 (const :tag "off" nil)
1496 (const :tag "on: after stars/bullet first" t)
1497 (const :tag "reversed: before stars/bullet first" reversed))
1498 (choice :tag "Special C-e"
1499 (const :tag "off" nil)
1500 (const :tag "on: before tags first" t)
1501 (const :tag "reversed: after tags first" reversed)))))
1502 (org-defvaralias 'org-special-ctrl-a 'org-special-ctrl-a/e)
1504 (defcustom org-special-ctrl-k nil
1505 "Non-nil means `C-k' will behave specially in headlines.
1506 When nil, `C-k' will call the default `kill-line' command.
1507 When t, the following will happen while the cursor is in the headline:
1509 - When the cursor is at the beginning of a headline, kill the entire
1510 line and possible the folded subtree below the line.
1511 - When in the middle of the headline text, kill the headline up to the tags.
1512 - When after the headline text, kill the tags."
1513 :group 'org-edit-structure
1514 :type 'boolean)
1516 (defcustom org-ctrl-k-protect-subtree nil
1517 "Non-nil means, do not delete a hidden subtree with C-k.
1518 When set to the symbol `error', simply throw an error when C-k is
1519 used to kill (part-of) a headline that has hidden text behind it.
1520 Any other non-nil value will result in a query to the user, if it is
1521 OK to kill that hidden subtree. When nil, kill without remorse."
1522 :group 'org-edit-structure
1523 :version "24.1"
1524 :type '(choice
1525 (const :tag "Do not protect hidden subtrees" nil)
1526 (const :tag "Protect hidden subtrees with a security query" t)
1527 (const :tag "Never kill a hidden subtree with C-k" error)))
1529 (defcustom org-special-ctrl-o t
1530 "Non-nil means, make `C-o' insert a row in tables."
1531 :group 'org-edit-structure
1532 :type 'boolean)
1534 (defcustom org-catch-invisible-edits nil
1535 "Check if in invisible region before inserting or deleting a character.
1536 Valid values are:
1538 nil Do not check, so just do invisible edits.
1539 error Throw an error and do nothing.
1540 show Make point visible, and do the requested edit.
1541 show-and-error Make point visible, then throw an error and abort the edit.
1542 smart Make point visible, and do insertion/deletion if it is
1543 adjacent to visible text and the change feels predictable.
1544 Never delete a previously invisible character or add in the
1545 middle or right after an invisible region. Basically, this
1546 allows insertion and backward-delete right before ellipses.
1547 FIXME: maybe in this case we should not even show?"
1548 :group 'org-edit-structure
1549 :version "24.1"
1550 :type '(choice
1551 (const :tag "Do not check" nil)
1552 (const :tag "Throw error when trying to edit" error)
1553 (const :tag "Unhide, but do not do the edit" show-and-error)
1554 (const :tag "Show invisible part and do the edit" show)
1555 (const :tag "Be smart and do the right thing" smart)))
1557 (defcustom org-yank-folded-subtrees t
1558 "Non-nil means when yanking subtrees, fold them.
1559 If the kill is a single subtree, or a sequence of subtrees, i.e. if
1560 it starts with a heading and all other headings in it are either children
1561 or siblings, then fold all the subtrees. However, do this only if no
1562 text after the yank would be swallowed into a folded tree by this action."
1563 :group 'org-edit-structure
1564 :type 'boolean)
1566 (defcustom org-yank-adjusted-subtrees nil
1567 "Non-nil means when yanking subtrees, adjust the level.
1568 With this setting, `org-paste-subtree' is used to insert the subtree, see
1569 this function for details."
1570 :group 'org-edit-structure
1571 :type 'boolean)
1573 (defcustom org-M-RET-may-split-line '((default . t))
1574 "Non-nil means M-RET will split the line at the cursor position.
1575 When nil, it will go to the end of the line before making a
1576 new line.
1577 You may also set this option in a different way for different
1578 contexts. Valid contexts are:
1580 headline when creating a new headline
1581 item when creating a new item
1582 table in a table field
1583 default the value to be used for all contexts not explicitly
1584 customized"
1585 :group 'org-structure
1586 :group 'org-table
1587 :type '(choice
1588 (const :tag "Always" t)
1589 (const :tag "Never" nil)
1590 (repeat :greedy t :tag "Individual contexts"
1591 (cons
1592 (choice :tag "Context"
1593 (const headline)
1594 (const item)
1595 (const table)
1596 (const default))
1597 (boolean)))))
1600 (defcustom org-insert-heading-respect-content nil
1601 "Non-nil means insert new headings after the current subtree.
1602 When nil, the new heading is created directly after the current line.
1603 The commands \\[org-insert-heading-respect-content] and \\[org-insert-todo-heading-respect-content] turn
1604 this variable on for the duration of the command."
1605 :group 'org-structure
1606 :type 'boolean)
1608 (defcustom org-blank-before-new-entry '((heading . auto)
1609 (plain-list-item . auto))
1610 "Should `org-insert-heading' leave a blank line before new heading/item?
1611 The value is an alist, with `heading' and `plain-list-item' as CAR,
1612 and a boolean flag as CDR. The cdr may also be the symbol `auto', in
1613 which case Org will look at the surrounding headings/items and try to
1614 make an intelligent decision whether to insert a blank line or not."
1615 :group 'org-edit-structure
1616 :type '(list
1617 (cons (const heading)
1618 (choice (const :tag "Never" nil)
1619 (const :tag "Always" t)
1620 (const :tag "Auto" auto)))
1621 (cons (const plain-list-item)
1622 (choice (const :tag "Never" nil)
1623 (const :tag "Always" t)
1624 (const :tag "Auto" auto)))))
1626 (defcustom org-insert-heading-hook nil
1627 "Hook being run after inserting a new heading."
1628 :group 'org-edit-structure
1629 :type 'hook)
1631 (defcustom org-enable-fixed-width-editor t
1632 "Non-nil means lines starting with \":\" are treated as fixed-width.
1633 This currently only means they are never auto-wrapped.
1634 When nil, such lines will be treated like ordinary lines."
1635 :group 'org-edit-structure
1636 :type 'boolean)
1638 (defcustom org-goto-auto-isearch t
1639 "Non-nil means typing characters in `org-goto' starts incremental search.
1640 When nil, you can use these keybindings to navigate the buffer:
1642 q Quit the org-goto interface
1643 n Go to the next visible heading
1644 p Go to the previous visible heading
1645 f Go one heading forward on same level
1646 b Go one heading backward on same level
1647 u Go one heading up"
1648 :group 'org-edit-structure
1649 :type 'boolean)
1651 (defgroup org-sparse-trees nil
1652 "Options concerning sparse trees in Org-mode."
1653 :tag "Org Sparse Trees"
1654 :group 'org-structure)
1656 (defcustom org-highlight-sparse-tree-matches t
1657 "Non-nil means highlight all matches that define a sparse tree.
1658 The highlights will automatically disappear the next time the buffer is
1659 changed by an edit command."
1660 :group 'org-sparse-trees
1661 :type 'boolean)
1663 (defcustom org-remove-highlights-with-change t
1664 "Non-nil means any change to the buffer will remove temporary highlights.
1665 \\<org-mode-map>\
1666 Such highlights are created by `org-occur' and `org-clock-display'.
1667 When nil, `\\[org-ctrl-c-ctrl-c]' needs to be used \
1668 to get rid of the highlights.
1669 The highlights created by `org-toggle-latex-fragment' always need
1670 `\\[org-toggle-latex-fragment]' to be removed."
1671 :group 'org-sparse-trees
1672 :group 'org-time
1673 :type 'boolean)
1675 (defcustom org-occur-case-fold-search t
1676 "Non-nil means `org-occur' should be case-insensitive.
1677 If set to `smart' the search will be case-insensitive only if it
1678 doesn't specify any upper case character."
1679 :group 'org-sparse-trees
1680 :version "25.1"
1681 :type '(choice
1682 (const :tag "Case-sensitive" nil)
1683 (const :tag "Case-insensitive" t)
1684 (const :tag "Case-insensitive for lower case searches only" 'smart)))
1686 (defcustom org-occur-hook '(org-first-headline-recenter)
1687 "Hook that is run after `org-occur' has constructed a sparse tree.
1688 This can be used to recenter the window to show as much of the structure
1689 as possible."
1690 :group 'org-sparse-trees
1691 :type 'hook)
1693 (defgroup org-imenu-and-speedbar nil
1694 "Options concerning imenu and speedbar in Org-mode."
1695 :tag "Org Imenu and Speedbar"
1696 :group 'org-structure)
1698 (defcustom org-imenu-depth 2
1699 "The maximum level for Imenu access to Org-mode headlines.
1700 This also applied for speedbar access."
1701 :group 'org-imenu-and-speedbar
1702 :type 'integer)
1704 (defgroup org-table nil
1705 "Options concerning tables in Org-mode."
1706 :tag "Org Table"
1707 :group 'org)
1709 (defcustom org-enable-table-editor 'optimized
1710 "Non-nil means lines starting with \"|\" are handled by the table editor.
1711 When nil, such lines will be treated like ordinary lines.
1713 When equal to the symbol `optimized', the table editor will be optimized to
1714 do the following:
1715 - Automatic overwrite mode in front of whitespace in table fields.
1716 This makes the structure of the table stay in tact as long as the edited
1717 field does not exceed the column width.
1718 - Minimize the number of realigns. Normally, the table is aligned each time
1719 TAB or RET are pressed to move to another field. With optimization this
1720 happens only if changes to a field might have changed the column width.
1721 Optimization requires replacing the functions `self-insert-command',
1722 `delete-char', and `backward-delete-char' in Org-mode buffers, with a
1723 slight (in fact: unnoticeable) speed impact for normal typing. Org-mode is
1724 very good at guessing when a re-align will be necessary, but you can always
1725 force one with \\[org-ctrl-c-ctrl-c].
1727 If you would like to use the optimized version in Org-mode, but the
1728 un-optimized version in OrgTbl-mode, see the variable `orgtbl-optimized'.
1730 This variable can be used to turn on and off the table editor during a session,
1731 but in order to toggle optimization, a restart is required.
1733 See also the variable `org-table-auto-blank-field'."
1734 :group 'org-table
1735 :type '(choice
1736 (const :tag "off" nil)
1737 (const :tag "on" t)
1738 (const :tag "on, optimized" optimized)))
1740 (defcustom org-self-insert-cluster-for-undo nil
1741 "Non-nil means cluster self-insert commands for undo when possible.
1742 If this is set, then, like in the Emacs command loop, 20 consecutive
1743 characters will be undone together.
1744 This is configurable, because there is some impact on typing performance."
1745 :group 'org-table
1746 :type 'boolean)
1748 (defcustom org-table-tab-recognizes-table.el t
1749 "Non-nil means TAB will automatically notice a table.el table.
1750 When it sees such a table, it moves point into it and - if necessary -
1751 calls `table-recognize-table'."
1752 :group 'org-table-editing
1753 :type 'boolean)
1755 (defgroup org-link nil
1756 "Options concerning links in Org-mode."
1757 :tag "Org Link"
1758 :group 'org)
1760 (defvar-local org-link-abbrev-alist-local nil
1761 "Buffer-local version of `org-link-abbrev-alist', which see.
1762 The value of this is taken from the #+LINK lines.")
1764 (defcustom org-link-abbrev-alist nil
1765 "Alist of link abbreviations.
1766 The car of each element is a string, to be replaced at the start of a link.
1767 The cdrs are replacement values, like (\"linkkey\" . REPLACE). Abbreviated
1768 links in Org-mode buffers can have an optional tag after a double colon, e.g.
1770 [[linkkey:tag][description]]
1772 The `linkkey' must be a word word, starting with a letter, followed
1773 by letters, numbers, `-' or `_'.
1775 If REPLACE is a string, the tag will simply be appended to create the link.
1776 If the string contains \"%s\", the tag will be inserted there. If the string
1777 contains \"%h\", it will cause a url-encoded version of the tag to be inserted
1778 at that point (see the function `url-hexify-string'). If the string contains
1779 the specifier \"%(my-function)\", then the custom function `my-function' will
1780 be invoked: this function takes the tag as its only argument and must return
1781 a string.
1783 REPLACE may also be a function that will be called with the tag as the
1784 only argument to create the link, which should be returned as a string.
1786 See the manual for examples."
1787 :group 'org-link
1788 :type '(repeat
1789 (cons
1790 (string :tag "Protocol")
1791 (choice
1792 (string :tag "Format")
1793 (function)))))
1795 (defcustom org-descriptive-links t
1796 "Non-nil means Org will display descriptive links.
1797 E.g. [[http://orgmode.org][Org website]] will be displayed as
1798 \"Org Website\", hiding the link itself and just displaying its
1799 description. When set to nil, Org will display the full links
1800 literally.
1802 You can interactively set the value of this variable by calling
1803 `org-toggle-link-display' or from the menu Org>Hyperlinks menu."
1804 :group 'org-link
1805 :type 'boolean)
1807 (defcustom org-link-file-path-type 'adaptive
1808 "How the path name in file links should be stored.
1809 Valid values are:
1811 relative Relative to the current directory, i.e. the directory of the file
1812 into which the link is being inserted.
1813 absolute Absolute path, if possible with ~ for home directory.
1814 noabbrev Absolute path, no abbreviation of home directory.
1815 adaptive Use relative path for files in the current directory and sub-
1816 directories of it. For other files, use an absolute path."
1817 :group 'org-link
1818 :type '(choice
1819 (const relative)
1820 (const absolute)
1821 (const noabbrev)
1822 (const adaptive)))
1824 (defvaralias 'org-activate-links 'org-highlight-links)
1825 (defcustom org-highlight-links '(bracket angle plain radio tag date footnote)
1826 "Types of links that should be highlighted in Org-mode files.
1828 This is a list of symbols, each one of them leading to the
1829 highlighting of a certain link type.
1831 You can still open links that are not highlighted.
1833 In principle, it does not hurt to turn on highlighting for all
1834 link types. There may be a small gain when turning off unused
1835 link types. The types are:
1837 bracket The recommended [[link][description]] or [[link]] links with hiding.
1838 angle Links in angular brackets that may contain whitespace like
1839 <bbdb:Carsten Dominik>.
1840 plain Plain links in normal text, no whitespace, like http://google.com.
1841 radio Text that is matched by a radio target, see manual for details.
1842 tag Tag settings in a headline (link to tag search).
1843 date Time stamps (link to calendar).
1844 footnote Footnote labels.
1846 If you set this variable during an Emacs session, use `org-mode-restart'
1847 in the Org buffer so that the change takes effect."
1848 :group 'org-link
1849 :group 'org-appearance
1850 :type '(set :greedy t
1851 (const :tag "Double bracket links" bracket)
1852 (const :tag "Angular bracket links" angle)
1853 (const :tag "Plain text links" plain)
1854 (const :tag "Radio target matches" radio)
1855 (const :tag "Tags" tag)
1856 (const :tag "Timestamps" date)
1857 (const :tag "Footnotes" footnote)))
1859 (defcustom org-make-link-description-function nil
1860 "Function to use for generating link descriptions from links.
1861 When nil, the link location will be used. This function must take
1862 two parameters: the first one is the link, the second one is the
1863 description generated by `org-insert-link'. The function should
1864 return the description to use."
1865 :group 'org-link
1866 :type '(choice (const nil) (function)))
1868 (defgroup org-link-store nil
1869 "Options concerning storing links in Org-mode."
1870 :tag "Org Store Link"
1871 :group 'org-link)
1873 (defcustom org-url-hexify-p t
1874 "When non-nil, hexify URL when creating a link."
1875 :type 'boolean
1876 :version "24.3"
1877 :group 'org-link-store)
1879 (defcustom org-email-link-description-format "Email %c: %.30s"
1880 "Format of the description part of a link to an email or usenet message.
1881 The following %-escapes will be replaced by corresponding information:
1883 %F full \"From\" field
1884 %f name, taken from \"From\" field, address if no name
1885 %T full \"To\" field
1886 %t first name in \"To\" field, address if no name
1887 %c correspondent. Usually \"from NAME\", but if you sent it yourself, it
1888 will be \"to NAME\". See also the variable `org-from-is-user-regexp'.
1889 %s subject
1890 %d date
1891 %m message-id.
1893 You may use normal field width specification between the % and the letter.
1894 This is for example useful to limit the length of the subject.
1896 Examples: \"%f on: %.30s\", \"Email from %f\", \"Email %c\""
1897 :group 'org-link-store
1898 :type 'string)
1900 (defcustom org-from-is-user-regexp
1901 (let (r1 r2)
1902 (when (and user-mail-address (not (string= user-mail-address "")))
1903 (setq r1 (concat "\\<" (regexp-quote user-mail-address) "\\>")))
1904 (when (and user-full-name (not (string= user-full-name "")))
1905 (setq r2 (concat "\\<" (regexp-quote user-full-name) "\\>")))
1906 (if (and r1 r2) (concat r1 "\\|" r2) (or r1 r2)))
1907 "Regexp matched against the \"From:\" header of an email or usenet message.
1908 It should match if the message is from the user him/herself."
1909 :group 'org-link-store
1910 :type 'regexp)
1912 (defcustom org-context-in-file-links t
1913 "Non-nil means file links from `org-store-link' contain context.
1914 A search string will be added to the file name with :: as separator and
1915 used to find the context when the link is activated by the command
1916 `org-open-at-point'. When this option is t, the entire active region
1917 will be placed in the search string of the file link. If set to a
1918 positive integer, only the first n lines of context will be stored.
1920 Using a prefix arg to the command \\[org-store-link] (`org-store-link')
1921 negates this setting for the duration of the command."
1922 :group 'org-link-store
1923 :type '(choice boolean integer))
1925 (defcustom org-keep-stored-link-after-insertion nil
1926 "Non-nil means keep link in list for entire session.
1928 The command `org-store-link' adds a link pointing to the current
1929 location to an internal list. These links accumulate during a session.
1930 The command `org-insert-link' can be used to insert links into any
1931 Org-mode file (offering completion for all stored links). When this
1932 option is nil, every link which has been inserted once using \\[org-insert-link]
1933 will be removed from the list, to make completing the unused links
1934 more efficient."
1935 :group 'org-link-store
1936 :type 'boolean)
1938 (defgroup org-link-follow nil
1939 "Options concerning following links in Org-mode."
1940 :tag "Org Follow Link"
1941 :group 'org-link)
1943 (defcustom org-link-translation-function nil
1944 "Function to translate links with different syntax to Org syntax.
1945 This can be used to translate links created for example by the Planner
1946 or emacs-wiki packages to Org syntax.
1947 The function must accept two parameters, a TYPE containing the link
1948 protocol name like \"rmail\" or \"gnus\" as a string, and the linked path,
1949 which is everything after the link protocol. It should return a cons
1950 with possibly modified values of type and path.
1951 Org contains a function for this, so if you set this variable to
1952 `org-translate-link-from-planner', you should be able follow many
1953 links created by planner."
1954 :group 'org-link-follow
1955 :type '(choice (const nil) (function)))
1957 (defcustom org-follow-link-hook nil
1958 "Hook that is run after a link has been followed."
1959 :group 'org-link-follow
1960 :type 'hook)
1962 (defcustom org-tab-follows-link nil
1963 "Non-nil means on links TAB will follow the link.
1964 Needs to be set before org.el is loaded.
1965 This really should not be used, it does not make sense, and the
1966 implementation is bad."
1967 :group 'org-link-follow
1968 :type 'boolean)
1970 (defcustom org-return-follows-link nil
1971 "Non-nil means on links RET will follow the link.
1972 In tables, the special behavior of RET has precedence."
1973 :group 'org-link-follow
1974 :type 'boolean)
1976 (defcustom org-mouse-1-follows-link
1977 (if (boundp 'mouse-1-click-follows-link) mouse-1-click-follows-link t)
1978 "Non-nil means mouse-1 on a link will follow the link.
1979 A longer mouse click will still set point. Needs to be set
1980 before org.el is loaded."
1981 :group 'org-link-follow
1982 :version "24.4"
1983 :package-version '(Org . "8.3")
1984 :type '(choice
1985 (const :tag "A double click follows the link" double)
1986 (const :tag "Unconditionally follow the link with mouse-1" t)
1987 (integer :tag "mouse-1 click does not follow the link if longer than N ms" 450)))
1989 (defcustom org-mark-ring-length 4
1990 "Number of different positions to be recorded in the ring.
1991 Changing this requires a restart of Emacs to work correctly."
1992 :group 'org-link-follow
1993 :type 'integer)
1995 (defcustom org-link-search-must-match-exact-headline 'query-to-create
1996 "Non-nil means internal links in Org files must exactly match a headline.
1997 When nil, the link search tries to match a phrase with all words
1998 in the search text."
1999 :group 'org-link-follow
2000 :version "24.1"
2001 :type '(choice
2002 (const :tag "Use fuzzy text search" nil)
2003 (const :tag "Match only exact headline" t)
2004 (const :tag "Match exact headline or query to create it"
2005 query-to-create)))
2007 (defcustom org-link-frame-setup
2008 '((vm . vm-visit-folder-other-frame)
2009 (vm-imap . vm-visit-imap-folder-other-frame)
2010 (gnus . org-gnus-no-new-news)
2011 (file . find-file-other-window)
2012 (wl . wl-other-frame))
2013 "Setup the frame configuration for following links.
2014 When following a link with Emacs, it may often be useful to display
2015 this link in another window or frame. This variable can be used to
2016 set this up for the different types of links.
2017 For VM, use any of
2018 `vm-visit-folder'
2019 `vm-visit-folder-other-window'
2020 `vm-visit-folder-other-frame'
2021 For Gnus, use any of
2022 `gnus'
2023 `gnus-other-frame'
2024 `org-gnus-no-new-news'
2025 For FILE, use any of
2026 `find-file'
2027 `find-file-other-window'
2028 `find-file-other-frame'
2029 For Wanderlust use any of
2030 `wl'
2031 `wl-other-frame'
2032 For the calendar, use the variable `calendar-setup'.
2033 For BBDB, it is currently only possible to display the matches in
2034 another window."
2035 :group 'org-link-follow
2036 :type '(list
2037 (cons (const vm)
2038 (choice
2039 (const vm-visit-folder)
2040 (const vm-visit-folder-other-window)
2041 (const vm-visit-folder-other-frame)))
2042 (cons (const vm-imap)
2043 (choice
2044 (const vm-visit-imap-folder)
2045 (const vm-visit-imap-folder-other-window)
2046 (const vm-visit-imap-folder-other-frame)))
2047 (cons (const gnus)
2048 (choice
2049 (const gnus)
2050 (const gnus-other-frame)
2051 (const org-gnus-no-new-news)))
2052 (cons (const file)
2053 (choice
2054 (const find-file)
2055 (const find-file-other-window)
2056 (const find-file-other-frame)))
2057 (cons (const wl)
2058 (choice
2059 (const wl)
2060 (const wl-other-frame)))))
2062 (defcustom org-display-internal-link-with-indirect-buffer nil
2063 "Non-nil means use indirect buffer to display infile links.
2064 Activating internal links (from one location in a file to another location
2065 in the same file) normally just jumps to the location. When the link is
2066 activated with a \\[universal-argument] prefix (or with mouse-3), the link \
2067 is displayed in
2068 another window. When this option is set, the other window actually displays
2069 an indirect buffer clone of the current buffer, to avoid any visibility
2070 changes to the current buffer."
2071 :group 'org-link-follow
2072 :type 'boolean)
2074 (defcustom org-open-non-existing-files nil
2075 "Non-nil means `org-open-file' will open non-existing files.
2076 When nil, an error will be generated.
2077 This variable applies only to external applications because they
2078 might choke on non-existing files. If the link is to a file that
2079 will be opened in Emacs, the variable is ignored."
2080 :group 'org-link-follow
2081 :type 'boolean)
2083 (defcustom org-open-directory-means-index-dot-org nil
2084 "Non-nil means a link to a directory really means to index.org.
2085 When nil, following a directory link will run dired or open a finder/explorer
2086 window on that directory."
2087 :group 'org-link-follow
2088 :type 'boolean)
2090 (defcustom org-confirm-shell-link-function 'yes-or-no-p
2091 "Non-nil means ask for confirmation before executing shell links.
2092 Shell links can be dangerous: just think about a link
2094 [[shell:rm -rf ~/*][Google Search]]
2096 This link would show up in your Org-mode document as \"Google Search\",
2097 but really it would remove your entire home directory.
2098 Therefore we advise against setting this variable to nil.
2099 Just change it to `y-or-n-p' if you want to confirm with a
2100 single keystroke rather than having to type \"yes\"."
2101 :group 'org-link-follow
2102 :type '(choice
2103 (const :tag "with yes-or-no (safer)" yes-or-no-p)
2104 (const :tag "with y-or-n (faster)" y-or-n-p)
2105 (const :tag "no confirmation (dangerous)" nil)))
2106 (put 'org-confirm-shell-link-function
2107 'safe-local-variable
2108 (lambda (x) (member x '(yes-or-no-p y-or-n-p))))
2110 (defcustom org-confirm-shell-link-not-regexp ""
2111 "A regexp to skip confirmation for shell links."
2112 :group 'org-link-follow
2113 :version "24.1"
2114 :type 'regexp)
2116 (defcustom org-confirm-elisp-link-function 'yes-or-no-p
2117 "Non-nil means ask for confirmation before executing Emacs Lisp links.
2118 Elisp links can be dangerous: just think about a link
2120 [[elisp:(shell-command \"rm -rf ~/*\")][Google Search]]
2122 This link would show up in your Org-mode document as \"Google Search\",
2123 but really it would remove your entire home directory.
2124 Therefore we advise against setting this variable to nil.
2125 Just change it to `y-or-n-p' if you want to confirm with a
2126 single keystroke rather than having to type \"yes\"."
2127 :group 'org-link-follow
2128 :type '(choice
2129 (const :tag "with yes-or-no (safer)" yes-or-no-p)
2130 (const :tag "with y-or-n (faster)" y-or-n-p)
2131 (const :tag "no confirmation (dangerous)" nil)))
2132 (put 'org-confirm-shell-link-function
2133 'safe-local-variable
2134 (lambda (x) (member x '(yes-or-no-p y-or-n-p))))
2136 (defcustom org-confirm-elisp-link-not-regexp ""
2137 "A regexp to skip confirmation for Elisp links."
2138 :group 'org-link-follow
2139 :version "24.1"
2140 :type 'regexp)
2142 (defconst org-file-apps-defaults-gnu
2143 '((remote . emacs)
2144 (system . mailcap)
2145 (t . mailcap))
2146 "Default file applications on a UNIX or GNU/Linux system.
2147 See `org-file-apps'.")
2149 (defconst org-file-apps-defaults-macosx
2150 '((remote . emacs)
2151 (system . "open %s")
2152 ("ps.gz" . "gv %s")
2153 ("eps.gz" . "gv %s")
2154 ("dvi" . "xdvi %s")
2155 ("fig" . "xfig %s")
2156 (t . "open %s"))
2157 "Default file applications on a MacOS X system.
2158 The system \"open\" is known as a default, but we use X11 applications
2159 for some files for which the OS does not have a good default.
2160 See `org-file-apps'.")
2162 (defconst org-file-apps-defaults-windowsnt
2163 (list '(remote . emacs)
2164 (cons 'system (lambda (file _path)
2165 (with-no-warnings (w32-shell-execute "open" file))))
2166 (cons t (lambda (file _path)
2167 (with-no-warnings (w32-shell-execute "open" file)))))
2168 "Default file applications on a Windows NT system.
2169 The system \"open\" is used for most files.
2170 See `org-file-apps'.")
2172 (defcustom org-file-apps
2173 '((auto-mode . emacs)
2174 ("\\.mm\\'" . default)
2175 ("\\.x?html?\\'" . default)
2176 ("\\.pdf\\'" . default))
2177 "External applications for opening `file:path' items in a document.
2178 \\<org-mode-map>\
2179 Org mode uses system defaults for different file types, but
2180 you can use this variable to set the application for a given file
2181 extension. The entries in this list are cons cells where the car identifies
2182 files and the cdr the corresponding command. Possible values for the
2183 file identifier are
2184 \"string\" A string as a file identifier can be interpreted in different
2185 ways, depending on its contents:
2187 - Alphanumeric characters only:
2188 Match links with this file extension.
2189 Example: (\"pdf\" . \"evince %s\")
2190 to open PDFs with evince.
2192 - Regular expression: Match links where the
2193 filename matches the regexp. If you want to
2194 use groups here, use shy groups.
2196 Example: (\"\\.x?html\\\\='\" . \"firefox %s\")
2197 \(\"\\(?:xhtml\\|html\\)\" . \"firefox %s\")
2198 to open *.html and *.xhtml with firefox.
2200 - Regular expression which contains (non-shy) groups:
2201 Match links where the whole link, including \"::\", and
2202 anything after that, matches the regexp.
2203 In a custom command string, %1, %2, etc. are replaced with
2204 the parts of the link that were matched by the groups.
2205 For backwards compatibility, if a command string is given
2206 that does not use any of the group matches, this case is
2207 handled identically to the second one (i.e. match against
2208 file name only).
2209 In a custom function, you can access the group matches with
2210 \(match-string n link).
2212 Example: (\"\\.pdf::\\(\\d+\\)\\\\='\" . \"evince -p %1 %s\")
2213 to open [[file:document.pdf::5]] with evince at page 5.
2215 `directory' Matches a directory
2216 `remote' Matches a remote file, accessible through tramp or efs.
2217 Remote files most likely should be visited through Emacs
2218 because external applications cannot handle such paths.
2219 `auto-mode' Matches files that are matched by any entry in `auto-mode-alist',
2220 so all files Emacs knows how to handle. Using this with
2221 command `emacs' will open most files in Emacs. Beware that this
2222 will also open html files inside Emacs, unless you add
2223 \(\"html\" . default) to the list as well.
2224 `system' The system command to open files, like `open' on Windows
2225 and Mac OS X, and mailcap under GNU/Linux. This is the command
2226 that will be selected if you call \\[org-open-at-point] with a double
2227 \\[universal-argument] \\[universal-argument] prefix.
2228 t Default for files not matched by any of the other options.
2230 Possible values for the command are:
2231 `emacs' The file will be visited by the current Emacs process.
2232 `default' Use the default application for this file type, which is the
2233 association for t in the list, most likely in the system-specific
2234 part. This can be used to overrule an unwanted setting in the
2235 system-specific variable.
2236 `system' Use the system command for opening files, like \"open\".
2237 This command is specified by the entry whose car is `system'.
2238 Most likely, the system-specific version of this variable
2239 does define this command, but you can overrule/replace it
2240 here.
2241 `mailcap' Use command specified in the mailcaps.
2242 string A command to be executed by a shell; %s will be replaced
2243 by the path to the file.
2245 function A Lisp function, which will be called with two arguments:
2246 the file path and the original link string, without the
2247 \"file:\" prefix.
2249 For more examples, see the system specific constants
2250 `org-file-apps-defaults-macosx'
2251 `org-file-apps-defaults-windowsnt'
2252 `org-file-apps-defaults-gnu'."
2253 :group 'org-link-follow
2254 :type '(repeat
2255 (cons (choice :value ""
2256 (string :tag "Extension")
2257 (const :tag "System command to open files" system)
2258 (const :tag "Default for unrecognized files" t)
2259 (const :tag "Remote file" remote)
2260 (const :tag "Links to a directory" directory)
2261 (const :tag "Any files that have Emacs modes"
2262 auto-mode))
2263 (choice :value ""
2264 (const :tag "Visit with Emacs" emacs)
2265 (const :tag "Use default" default)
2266 (const :tag "Use the system command" system)
2267 (string :tag "Command")
2268 (function :tag "Function")))))
2270 (defcustom org-doi-server-url "http://dx.doi.org/"
2271 "The URL of the DOI server."
2272 :type 'string
2273 :version "24.3"
2274 :group 'org-link-follow)
2276 (defgroup org-refile nil
2277 "Options concerning refiling entries in Org-mode."
2278 :tag "Org Refile"
2279 :group 'org)
2281 (defcustom org-directory "~/org"
2282 "Directory with Org files.
2283 This is just a default location to look for Org files. There is no need
2284 at all to put your files into this directory. It is used in the
2285 following situations:
2287 1. When a capture template specifies a target file that is not an
2288 absolute path. The path will then be interpreted relative to
2289 `org-directory'
2290 2. When the value of variable `org-agenda-files' is a single file, any
2291 relative paths in this file will be taken as relative to
2292 `org-directory'."
2293 :group 'org-refile
2294 :group 'org-capture
2295 :type 'directory)
2297 (defcustom org-default-notes-file (convert-standard-filename "~/.notes")
2298 "Default target for storing notes.
2299 Used as a fall back file for org-capture.el, for templates that
2300 do not specify a target file."
2301 :group 'org-refile
2302 :group 'org-capture
2303 :type 'file)
2305 (defcustom org-goto-interface 'outline
2306 "The default interface to be used for `org-goto'.
2307 Allowed values are:
2308 outline The interface shows an outline of the relevant file
2309 and the correct heading is found by moving through
2310 the outline or by searching with incremental search.
2311 outline-path-completion Headlines in the current buffer are offered via
2312 completion. This is the interface also used by
2313 the refile command."
2314 :group 'org-refile
2315 :type '(choice
2316 (const :tag "Outline" outline)
2317 (const :tag "Outline-path-completion" outline-path-completion)))
2319 (defcustom org-goto-max-level 5
2320 "Maximum target level when running `org-goto' with refile interface."
2321 :group 'org-refile
2322 :type 'integer)
2324 (defcustom org-reverse-note-order nil
2325 "Non-nil means store new notes at the beginning of a file or entry.
2326 When nil, new notes will be filed to the end of a file or entry.
2327 This can also be a list with cons cells of regular expressions that
2328 are matched against file names, and values."
2329 :group 'org-capture
2330 :group 'org-refile
2331 :type '(choice
2332 (const :tag "Reverse always" t)
2333 (const :tag "Reverse never" nil)
2334 (repeat :tag "By file name regexp"
2335 (cons regexp boolean))))
2337 (defcustom org-log-refile nil
2338 "Information to record when a task is refiled.
2340 Possible values are:
2342 nil Don't add anything
2343 time Add a time stamp to the task
2344 note Prompt for a note and add it with template `org-log-note-headings'
2346 This option can also be set with on a per-file-basis with
2348 #+STARTUP: nologrefile
2349 #+STARTUP: logrefile
2350 #+STARTUP: lognoterefile
2352 You can have local logging settings for a subtree by setting the LOGGING
2353 property to one or more of these keywords.
2355 When bulk-refiling from the agenda, the value `note' is forbidden and
2356 will temporarily be changed to `time'."
2357 :group 'org-refile
2358 :group 'org-progress
2359 :version "24.1"
2360 :type '(choice
2361 (const :tag "No logging" nil)
2362 (const :tag "Record timestamp" time)
2363 (const :tag "Record timestamp with note." note)))
2365 (defcustom org-refile-targets nil
2366 "Targets for refiling entries with \\[org-refile].
2367 This is a list of cons cells. Each cell contains:
2368 - a specification of the files to be considered, either a list of files,
2369 or a symbol whose function or variable value will be used to retrieve
2370 a file name or a list of file names. If you use `org-agenda-files' for
2371 that, all agenda files will be scanned for targets. Nil means consider
2372 headings in the current buffer.
2373 - A specification of how to find candidate refile targets. This may be
2374 any of:
2375 - a cons cell (:tag . \"TAG\") to identify refile targets by a tag.
2376 This tag has to be present in all target headlines, inheritance will
2377 not be considered.
2378 - a cons cell (:todo . \"KEYWORD\") to identify refile targets by
2379 todo keyword.
2380 - a cons cell (:regexp . \"REGEXP\") with a regular expression matching
2381 headlines that are refiling targets.
2382 - a cons cell (:level . N). Any headline of level N is considered a target.
2383 Note that, when `org-odd-levels-only' is set, level corresponds to
2384 order in hierarchy, not to the number of stars.
2385 - a cons cell (:maxlevel . N). Any headline with level <= N is a target.
2386 Note that, when `org-odd-levels-only' is set, level corresponds to
2387 order in hierarchy, not to the number of stars.
2389 Each element of this list generates a set of possible targets.
2390 The union of these sets is presented (with completion) to
2391 the user by `org-refile'.
2393 You can set the variable `org-refile-target-verify-function' to a function
2394 to verify each headline found by the simple criteria above.
2396 When this variable is nil, all top-level headlines in the current buffer
2397 are used, equivalent to the value `((nil . (:level . 1))'."
2398 :group 'org-refile
2399 :type '(repeat
2400 (cons
2401 (choice :value org-agenda-files
2402 (const :tag "All agenda files" org-agenda-files)
2403 (const :tag "Current buffer" nil)
2404 (function) (variable) (file))
2405 (choice :tag "Identify target headline by"
2406 (cons :tag "Specific tag" (const :value :tag) (string))
2407 (cons :tag "TODO keyword" (const :value :todo) (string))
2408 (cons :tag "Regular expression" (const :value :regexp) (regexp))
2409 (cons :tag "Level number" (const :value :level) (integer))
2410 (cons :tag "Max Level number" (const :value :maxlevel) (integer))))))
2412 (defcustom org-refile-target-verify-function nil
2413 "Function to verify if the headline at point should be a refile target.
2414 The function will be called without arguments, with point at the
2415 beginning of the headline. It should return t and leave point
2416 where it is if the headline is a valid target for refiling.
2418 If the target should not be selected, the function must return nil.
2419 In addition to this, it may move point to a place from where the search
2420 should be continued. For example, the function may decide that the entire
2421 subtree of the current entry should be excluded and move point to the end
2422 of the subtree."
2423 :group 'org-refile
2424 :type '(choice
2425 (const nil)
2426 (function)))
2428 (defcustom org-refile-use-cache nil
2429 "Non-nil means cache refile targets to speed up the process.
2430 \\<org-mode-map>\
2431 The cache for a particular file will be updated automatically when
2432 the buffer has been killed, or when any of the marker used for flagging
2433 refile targets no longer points at a live buffer.
2434 If you have added new entries to a buffer that might themselves be targets,
2435 you need to clear the cache manually by pressing `C-0 \\[org-refile]' or,
2436 if you find that easier, \
2437 `\\[universal-argument] \\[universal-argument] \\[universal-argument] \
2438 \\[org-refile]'."
2439 :group 'org-refile
2440 :version "24.1"
2441 :type 'boolean)
2443 (defcustom org-refile-use-outline-path nil
2444 "Non-nil means provide refile targets as paths.
2445 So a level 3 headline will be available as level1/level2/level3.
2447 When the value is `file', also include the file name (without directory)
2448 into the path. In this case, you can also stop the completion after
2449 the file name, to get entries inserted as top level in the file.
2451 When `full-file-path', include the full file path."
2452 :group 'org-refile
2453 :type '(choice
2454 (const :tag "Not" nil)
2455 (const :tag "Yes" t)
2456 (const :tag "Start with file name" file)
2457 (const :tag "Start with full file path" full-file-path)))
2459 (defcustom org-outline-path-complete-in-steps t
2460 "Non-nil means complete the outline path in hierarchical steps.
2461 When Org-mode uses the refile interface to select an outline path
2462 \(see variable `org-refile-use-outline-path'), the completion of
2463 the path can be done in a single go, or it can be done in steps down
2464 the headline hierarchy. Going in steps is probably the best if you
2465 do not use a special completion package like `ido' or `icicles'.
2466 However, when using these packages, going in one step can be very
2467 fast, while still showing the whole path to the entry."
2468 :group 'org-refile
2469 :type 'boolean)
2471 (defcustom org-refile-allow-creating-parent-nodes nil
2472 "Non-nil means allow the creation of new nodes as refile targets.
2473 New nodes are then created by adding \"/new node name\" to the completion
2474 of an existing node. When the value of this variable is `confirm',
2475 new node creation must be confirmed by the user (recommended).
2476 When nil, the completion must match an existing entry.
2478 Note that, if the new heading is not seen by the criteria
2479 listed in `org-refile-targets', multiple instances of the same
2480 heading would be created by trying again to file under the new
2481 heading."
2482 :group 'org-refile
2483 :type '(choice
2484 (const :tag "Never" nil)
2485 (const :tag "Always" t)
2486 (const :tag "Prompt for confirmation" confirm)))
2488 (defcustom org-refile-active-region-within-subtree nil
2489 "Non-nil means also refile active region within a subtree.
2491 By default `org-refile' doesn't allow refiling regions if they
2492 don't contain a set of subtrees, but it might be convenient to
2493 do so sometimes: in that case, the first line of the region is
2494 converted to a headline before refiling."
2495 :group 'org-refile
2496 :version "24.1"
2497 :type 'boolean)
2499 (defgroup org-todo nil
2500 "Options concerning TODO items in Org-mode."
2501 :tag "Org TODO"
2502 :group 'org)
2504 (defgroup org-progress nil
2505 "Options concerning Progress logging in Org-mode."
2506 :tag "Org Progress"
2507 :group 'org-time)
2509 (defvar org-todo-interpretation-widgets
2510 '((:tag "Sequence (cycling hits every state)" sequence)
2511 (:tag "Type (cycling directly to DONE)" type))
2512 "The available interpretation symbols for customizing `org-todo-keywords'.
2513 Interested libraries should add to this list.")
2515 (defcustom org-todo-keywords '((sequence "TODO" "DONE"))
2516 "List of TODO entry keyword sequences and their interpretation.
2517 \\<org-mode-map>This is a list of sequences.
2519 Each sequence starts with a symbol, either `sequence' or `type',
2520 indicating if the keywords should be interpreted as a sequence of
2521 action steps, or as different types of TODO items. The first
2522 keywords are states requiring action - these states will select a headline
2523 for inclusion into the global TODO list Org-mode produces. If one of
2524 the \"keywords\" is the vertical bar, \"|\", the remaining keywords
2525 signify that no further action is necessary. If \"|\" is not found,
2526 the last keyword is treated as the only DONE state of the sequence.
2528 The command \\[org-todo] cycles an entry through these states, and one
2529 additional state where no keyword is present. For details about this
2530 cycling, see the manual.
2532 TODO keywords and interpretation can also be set on a per-file basis with
2533 the special #+SEQ_TODO and #+TYP_TODO lines.
2535 Each keyword can optionally specify a character for fast state selection
2536 \(in combination with the variable `org-use-fast-todo-selection')
2537 and specifiers for state change logging, using the same syntax that
2538 is used in the \"#+TODO:\" lines. For example, \"WAIT(w)\" says that
2539 the WAIT state can be selected with the \"w\" key. \"WAIT(w!)\"
2540 indicates to record a time stamp each time this state is selected.
2542 Each keyword may also specify if a timestamp or a note should be
2543 recorded when entering or leaving the state, by adding additional
2544 characters in the parenthesis after the keyword. This looks like this:
2545 \"WAIT(w@/!)\". \"@\" means to add a note (with time), \"!\" means to
2546 record only the time of the state change. With X and Y being either
2547 \"@\" or \"!\", \"X/Y\" means use X when entering the state, and use
2548 Y when leaving the state if and only if the *target* state does not
2549 define X. You may omit any of the fast-selection key or X or /Y,
2550 so WAIT(w@), WAIT(w/@) and WAIT(@/@) are all valid.
2552 For backward compatibility, this variable may also be just a list
2553 of keywords. In this case the interpretation (sequence or type) will be
2554 taken from the (otherwise obsolete) variable `org-todo-interpretation'."
2555 :group 'org-todo
2556 :group 'org-keywords
2557 :type '(choice
2558 (repeat :tag "Old syntax, just keywords"
2559 (string :tag "Keyword"))
2560 (repeat :tag "New syntax"
2561 (cons
2562 (choice
2563 :tag "Interpretation"
2564 ;;Quick and dirty way to see
2565 ;;`org-todo-interpretations'. This takes the
2566 ;;place of item arguments
2567 :convert-widget
2568 (lambda (widget)
2569 (widget-put widget
2570 :args (mapcar
2571 (lambda (x)
2572 (widget-convert
2573 (cons 'const x)))
2574 org-todo-interpretation-widgets))
2575 widget))
2576 (repeat
2577 (string :tag "Keyword"))))))
2579 (defvar-local org-todo-keywords-1 nil
2580 "All TODO and DONE keywords active in a buffer.")
2581 (defvar org-todo-keywords-for-agenda nil)
2582 (defvar org-done-keywords-for-agenda nil)
2583 (defvar org-todo-keyword-alist-for-agenda nil)
2584 (defvar org-tag-alist-for-agenda nil
2585 "Alist of all tags from all agenda files.")
2586 (defvar org-tag-groups-alist-for-agenda nil
2587 "Alist of all groups tags from all current agenda files.")
2588 (defvar-local org-tag-groups-alist nil)
2589 (defvar org-agenda-contributing-files nil)
2590 (defvar-local org-current-tag-alist nil
2591 "Alist of all tag groups in current buffer.
2592 This variable takes into consideration `org-tag-alist',
2593 `org-tag-persistent-alist' and TAGS keywords in the buffer.")
2594 (defvar-local org-not-done-keywords nil)
2595 (defvar-local org-done-keywords nil)
2596 (defvar-local org-todo-heads nil)
2597 (defvar-local org-todo-sets nil)
2598 (defvar-local org-todo-log-states nil)
2599 (defvar-local org-todo-kwd-alist nil)
2600 (defvar-local org-todo-key-alist nil)
2601 (defvar-local org-todo-key-trigger nil)
2603 (defcustom org-todo-interpretation 'sequence
2604 "Controls how TODO keywords are interpreted.
2605 This variable is in principle obsolete and is only used for
2606 backward compatibility, if the interpretation of todo keywords is
2607 not given already in `org-todo-keywords'. See that variable for
2608 more information."
2609 :group 'org-todo
2610 :group 'org-keywords
2611 :type '(choice (const sequence)
2612 (const type)))
2614 (defcustom org-use-fast-todo-selection t
2615 "\\<org-mode-map>\
2616 Non-nil means use the fast todo selection scheme with \\[org-todo].
2617 This variable describes if and under what circumstances the cycling
2618 mechanism for TODO keywords will be replaced by a single-key, direct
2619 selection scheme.
2621 When nil, fast selection is never used.
2623 When the symbol `prefix', it will be used when `org-todo' is called
2624 with a prefix argument, i.e. `\\[universal-argument] \\[org-todo]' \
2625 in an Org-mode buffer, and
2626 `\\[universal-argument] t' in an agenda buffer.
2628 When t, fast selection is used by default. In this case, the prefix
2629 argument forces cycling instead.
2631 In all cases, the special interface is only used if access keys have
2632 actually been assigned by the user, i.e. if keywords in the configuration
2633 are followed by a letter in parenthesis, like TODO(t)."
2634 :group 'org-todo
2635 :type '(choice
2636 (const :tag "Never" nil)
2637 (const :tag "By default" t)
2638 (const :tag "Only with C-u C-c C-t" prefix)))
2640 (defcustom org-provide-todo-statistics t
2641 "Non-nil means update todo statistics after insert and toggle.
2642 ALL-HEADLINES means update todo statistics by including headlines
2643 with no TODO keyword as well, counting them as not done.
2644 A list of TODO keywords means the same, but skip keywords that are
2645 not in this list.
2646 When set to a list of two lists, the first list contains keywords
2647 to consider as TODO keywords, the second list contains keywords
2648 to consider as DONE keywords.
2650 When this is set, todo statistics is updated in the parent of the
2651 current entry each time a todo state is changed."
2652 :group 'org-todo
2653 :type '(choice
2654 (const :tag "Yes, only for TODO entries" t)
2655 (const :tag "Yes, including all entries" all-headlines)
2656 (repeat :tag "Yes, for TODOs in this list"
2657 (string :tag "TODO keyword"))
2658 (list :tag "Yes, for TODOs and DONEs in these lists"
2659 (repeat (string :tag "TODO keyword"))
2660 (repeat (string :tag "DONE keyword")))
2661 (other :tag "No TODO statistics" nil)))
2663 (defcustom org-hierarchical-todo-statistics t
2664 "Non-nil means TODO statistics covers just direct children.
2665 When nil, all entries in the subtree are considered.
2666 This has only an effect if `org-provide-todo-statistics' is set.
2667 To set this to nil for only a single subtree, use a COOKIE_DATA
2668 property and include the word \"recursive\" into the value."
2669 :group 'org-todo
2670 :type 'boolean)
2672 (defcustom org-after-todo-state-change-hook nil
2673 "Hook which is run after the state of a TODO item was changed.
2674 The new state (a string with a TODO keyword, or nil) is available in the
2675 Lisp variable `org-state'."
2676 :group 'org-todo
2677 :type 'hook)
2679 (defvar org-blocker-hook nil
2680 "Hook for functions that are allowed to block a state change.
2682 Functions in this hook should not modify the buffer.
2683 Each function gets as its single argument a property list,
2684 see `org-trigger-hook' for more information about this list.
2686 If any of the functions in this hook returns nil, the state change
2687 is blocked.")
2689 (defvar org-trigger-hook nil
2690 "Hook for functions that are triggered by a state change.
2692 Each function gets as its single argument a property list with at
2693 least the following elements:
2695 (:type type-of-change :position pos-at-entry-start
2696 :from old-state :to new-state)
2698 Depending on the type, more properties may be present.
2700 This mechanism is currently implemented for:
2702 TODO state changes
2703 ------------------
2704 :type todo-state-change
2705 :from previous state (keyword as a string), or nil, or a symbol
2706 `todo' or `done', to indicate the general type of state.
2707 :to new state, like in :from")
2709 (defcustom org-enforce-todo-dependencies nil
2710 "Non-nil means undone TODO entries will block switching the parent to DONE.
2711 Also, if a parent has an :ORDERED: property, switching an entry to DONE will
2712 be blocked if any prior sibling is not yet done.
2713 Finally, if the parent is blocked because of ordered siblings of its own,
2714 the child will also be blocked."
2715 :set (lambda (var val)
2716 (set var val)
2717 (if val
2718 (add-hook 'org-blocker-hook
2719 'org-block-todo-from-children-or-siblings-or-parent)
2720 (remove-hook 'org-blocker-hook
2721 'org-block-todo-from-children-or-siblings-or-parent)))
2722 :group 'org-todo
2723 :type 'boolean)
2725 (defcustom org-enforce-todo-checkbox-dependencies nil
2726 "Non-nil means unchecked boxes will block switching the parent to DONE.
2727 When this is nil, checkboxes have no influence on switching TODO states.
2728 When non-nil, you first need to check off all check boxes before the TODO
2729 entry can be switched to DONE.
2730 This variable needs to be set before org.el is loaded, and you need to
2731 restart Emacs after a change to make the change effective. The only way
2732 to change is while Emacs is running is through the customize interface."
2733 :set (lambda (var val)
2734 (set var val)
2735 (if val
2736 (add-hook 'org-blocker-hook
2737 'org-block-todo-from-checkboxes)
2738 (remove-hook 'org-blocker-hook
2739 'org-block-todo-from-checkboxes)))
2740 :group 'org-todo
2741 :type 'boolean)
2743 (defcustom org-treat-insert-todo-heading-as-state-change nil
2744 "Non-nil means inserting a TODO heading is treated as state change.
2745 So when the command \\[org-insert-todo-heading] is used, state change
2746 logging will apply if appropriate. When nil, the new TODO item will
2747 be inserted directly, and no logging will take place."
2748 :group 'org-todo
2749 :type 'boolean)
2751 (defcustom org-treat-S-cursor-todo-selection-as-state-change t
2752 "Non-nil means switching TODO states with S-cursor counts as state change.
2753 This is the default behavior. However, setting this to nil allows a
2754 convenient way to select a TODO state and bypass any logging associated
2755 with that."
2756 :group 'org-todo
2757 :type 'boolean)
2759 (defcustom org-todo-state-tags-triggers nil
2760 "Tag changes that should be triggered by TODO state changes.
2761 This is a list. Each entry is
2763 (state-change (tag . flag) .......)
2765 State-change can be a string with a state, and empty string to indicate the
2766 state that has no TODO keyword, or it can be one of the symbols `todo'
2767 or `done', meaning any not-done or done state, respectively."
2768 :group 'org-todo
2769 :group 'org-tags
2770 :type '(repeat
2771 (cons (choice :tag "When changing to"
2772 (const :tag "Not-done state" todo)
2773 (const :tag "Done state" done)
2774 (string :tag "State"))
2775 (repeat
2776 (cons :tag "Tag action"
2777 (string :tag "Tag")
2778 (choice (const :tag "Add" t) (const :tag "Remove" nil)))))))
2780 (defcustom org-log-done nil
2781 "Information to record when a task moves to the DONE state.
2783 Possible values are:
2785 nil Don't add anything, just change the keyword
2786 time Add a time stamp to the task
2787 note Prompt for a note and add it with template `org-log-note-headings'
2789 This option can also be set with on a per-file-basis with
2791 #+STARTUP: nologdone
2792 #+STARTUP: logdone
2793 #+STARTUP: lognotedone
2795 You can have local logging settings for a subtree by setting the LOGGING
2796 property to one or more of these keywords."
2797 :group 'org-todo
2798 :group 'org-progress
2799 :type '(choice
2800 (const :tag "No logging" nil)
2801 (const :tag "Record CLOSED timestamp" time)
2802 (const :tag "Record CLOSED timestamp with note." note)))
2804 ;; Normalize old uses of org-log-done.
2805 (cond
2806 ((eq org-log-done t) (setq org-log-done 'time))
2807 ((and (listp org-log-done) (memq 'done org-log-done))
2808 (setq org-log-done 'note)))
2810 (defcustom org-log-reschedule nil
2811 "Information to record when the scheduling date of a tasks is modified.
2813 Possible values are:
2815 nil Don't add anything, just change the date
2816 time Add a time stamp to the task
2817 note Prompt for a note and add it with template `org-log-note-headings'
2819 This option can also be set with on a per-file-basis with
2821 #+STARTUP: nologreschedule
2822 #+STARTUP: logreschedule
2823 #+STARTUP: lognotereschedule"
2824 :group 'org-todo
2825 :group 'org-progress
2826 :type '(choice
2827 (const :tag "No logging" nil)
2828 (const :tag "Record timestamp" time)
2829 (const :tag "Record timestamp with note." note)))
2831 (defcustom org-log-redeadline nil
2832 "Information to record when the deadline date of a tasks is modified.
2834 Possible values are:
2836 nil Don't add anything, just change the date
2837 time Add a time stamp to the task
2838 note Prompt for a note and add it with template `org-log-note-headings'
2840 This option can also be set with on a per-file-basis with
2842 #+STARTUP: nologredeadline
2843 #+STARTUP: logredeadline
2844 #+STARTUP: lognoteredeadline
2846 You can have local logging settings for a subtree by setting the LOGGING
2847 property to one or more of these keywords."
2848 :group 'org-todo
2849 :group 'org-progress
2850 :type '(choice
2851 (const :tag "No logging" nil)
2852 (const :tag "Record timestamp" time)
2853 (const :tag "Record timestamp with note." note)))
2855 (defcustom org-log-note-clock-out nil
2856 "Non-nil means record a note when clocking out of an item.
2857 This can also be configured on a per-file basis by adding one of
2858 the following lines anywhere in the buffer:
2860 #+STARTUP: lognoteclock-out
2861 #+STARTUP: nolognoteclock-out"
2862 :group 'org-todo
2863 :group 'org-progress
2864 :type 'boolean)
2866 (defcustom org-log-done-with-time t
2867 "Non-nil means the CLOSED time stamp will contain date and time.
2868 When nil, only the date will be recorded."
2869 :group 'org-progress
2870 :type 'boolean)
2872 (defcustom org-log-note-headings
2873 '((done . "CLOSING NOTE %t")
2874 (state . "State %-12s from %-12S %t")
2875 (note . "Note taken on %t")
2876 (reschedule . "Rescheduled from %S on %t")
2877 (delschedule . "Not scheduled, was %S on %t")
2878 (redeadline . "New deadline from %S on %t")
2879 (deldeadline . "Removed deadline, was %S on %t")
2880 (refile . "Refiled on %t")
2881 (clock-out . ""))
2882 "Headings for notes added to entries.
2884 The value is an alist, with the car being a symbol indicating the
2885 note context, and the cdr is the heading to be used. The heading
2886 may also be the empty string. The following placeholders can be
2887 used:
2889 %t a time stamp.
2890 %T an active time stamp instead the default inactive one
2891 %d a short-format time stamp.
2892 %D an active short-format time stamp.
2893 %s the new TODO state or time stamp (inactive), in double quotes.
2894 %S the old TODO state or time stamp (inactive), in double quotes.
2895 %u the user name.
2896 %U full user name.
2898 In fact, it is not a good idea to change the `state' entry,
2899 because Agenda Log mode depends on the format of these entries."
2900 :group 'org-todo
2901 :group 'org-progress
2902 :type '(list :greedy t
2903 (cons (const :tag "Heading when closing an item" done) string)
2904 (cons (const :tag
2905 "Heading when changing todo state (todo sequence only)"
2906 state) string)
2907 (cons (const :tag "Heading when just taking a note" note) string)
2908 (cons (const :tag "Heading when rescheduling" reschedule) string)
2909 (cons (const :tag "Heading when an item is no longer scheduled" delschedule) string)
2910 (cons (const :tag "Heading when changing deadline" redeadline) string)
2911 (cons (const :tag "Heading when deleting a deadline" deldeadline) string)
2912 (cons (const :tag "Heading when refiling" refile) string)
2913 (cons (const :tag "Heading when clocking out" clock-out) string)))
2915 (unless (assq 'note org-log-note-headings)
2916 (push '(note . "%t") org-log-note-headings))
2918 (defcustom org-log-into-drawer nil
2919 "Non-nil means insert state change notes and time stamps into a drawer.
2920 When nil, state changes notes will be inserted after the headline and
2921 any scheduling and clock lines, but not inside a drawer.
2923 The value of this variable should be the name of the drawer to use.
2924 LOGBOOK is proposed as the default drawer for this purpose, you can
2925 also set this to a string to define the drawer of your choice.
2927 A value of t is also allowed, representing \"LOGBOOK\".
2929 A value of t or nil can also be set with on a per-file-basis with
2931 #+STARTUP: logdrawer
2932 #+STARTUP: nologdrawer
2934 If this variable is set, `org-log-state-notes-insert-after-drawers'
2935 will be ignored.
2937 You can set the property LOG_INTO_DRAWER to overrule this setting for
2938 a subtree.
2940 Do not check directly this variable in a Lisp program. Call
2941 function `org-log-into-drawer' instead."
2942 :group 'org-todo
2943 :group 'org-progress
2944 :type '(choice
2945 (const :tag "Not into a drawer" nil)
2946 (const :tag "LOGBOOK" t)
2947 (string :tag "Other")))
2949 (org-defvaralias 'org-log-state-notes-into-drawer 'org-log-into-drawer)
2951 (defun org-log-into-drawer ()
2952 "Name of the log drawer, as a string, or nil.
2953 This is the value of `org-log-into-drawer'. However, if the
2954 current entry has or inherits a LOG_INTO_DRAWER property, it will
2955 be used instead of the default value."
2956 (let ((p (org-entry-get nil "LOG_INTO_DRAWER" 'inherit t)))
2957 (cond ((equal p "nil") nil)
2958 ((equal p "t") "LOGBOOK")
2959 ((stringp p) p)
2960 (p "LOGBOOK")
2961 ((stringp org-log-into-drawer) org-log-into-drawer)
2962 (org-log-into-drawer "LOGBOOK"))))
2964 (defcustom org-log-state-notes-insert-after-drawers nil
2965 "Non-nil means insert state change notes after any drawers in entry.
2966 Only the drawers that *immediately* follow the headline and the
2967 deadline/scheduled line are skipped.
2968 When nil, insert notes right after the heading and perhaps the line
2969 with deadline/scheduling if present.
2971 This variable will have no effect if `org-log-into-drawer' is
2972 set."
2973 :group 'org-todo
2974 :group 'org-progress
2975 :type 'boolean)
2977 (defcustom org-log-states-order-reversed t
2978 "Non-nil means the latest state note will be directly after heading.
2979 When nil, the state change notes will be ordered according to time.
2981 This option can also be set with on a per-file-basis with
2983 #+STARTUP: logstatesreversed
2984 #+STARTUP: nologstatesreversed"
2985 :group 'org-todo
2986 :group 'org-progress
2987 :type 'boolean)
2989 (defcustom org-todo-repeat-to-state nil
2990 "The TODO state to which a repeater should return the repeating task.
2991 By default this is the first task in a TODO sequence, or the previous state
2992 in a TODO_TYP set. But you can specify another task here.
2993 alternatively, set the :REPEAT_TO_STATE: property of the entry."
2994 :group 'org-todo
2995 :version "24.1"
2996 :type '(choice (const :tag "Head of sequence" nil)
2997 (string :tag "Specific state")))
2999 (defcustom org-log-repeat 'time
3000 "Non-nil means record moving through the DONE state when triggering repeat.
3001 An auto-repeating task is immediately switched back to TODO when
3002 marked DONE. If you are not logging state changes (by adding \"@\"
3003 or \"!\" to the TODO keyword definition), or set `org-log-done' to
3004 record a closing note, there will be no record of the task moving
3005 through DONE. This variable forces taking a note anyway.
3007 nil Don't force a record
3008 time Record a time stamp
3009 note Prompt for a note and add it with template `org-log-note-headings'
3011 This option can also be set with on a per-file-basis with
3013 #+STARTUP: nologrepeat
3014 #+STARTUP: logrepeat
3015 #+STARTUP: lognoterepeat
3017 You can have local logging settings for a subtree by setting the LOGGING
3018 property to one or more of these keywords."
3019 :group 'org-todo
3020 :group 'org-progress
3021 :type '(choice
3022 (const :tag "Don't force a record" nil)
3023 (const :tag "Force recording the DONE state" time)
3024 (const :tag "Force recording a note with the DONE state" note)))
3027 (defgroup org-priorities nil
3028 "Priorities in Org-mode."
3029 :tag "Org Priorities"
3030 :group 'org-todo)
3032 (defcustom org-enable-priority-commands t
3033 "Non-nil means priority commands are active.
3034 When nil, these commands will be disabled, so that you never accidentally
3035 set a priority."
3036 :group 'org-priorities
3037 :type 'boolean)
3039 (defcustom org-highest-priority ?A
3040 "The highest priority of TODO items. A character like ?A, ?B etc.
3041 Must have a smaller ASCII number than `org-lowest-priority'."
3042 :group 'org-priorities
3043 :type 'character)
3045 (defcustom org-lowest-priority ?C
3046 "The lowest priority of TODO items. A character like ?A, ?B etc.
3047 Must have a larger ASCII number than `org-highest-priority'."
3048 :group 'org-priorities
3049 :type 'character)
3051 (defcustom org-default-priority ?B
3052 "The default priority of TODO items.
3053 This is the priority an item gets if no explicit priority is given.
3054 When starting to cycle on an empty priority the first step in the cycle
3055 depends on `org-priority-start-cycle-with-default'. The resulting first
3056 step priority must not exceed the range from `org-highest-priority' to
3057 `org-lowest-priority' which means that `org-default-priority' has to be
3058 in this range exclusive or inclusive the range boundaries. Else the
3059 first step refuses to set the default and the second will fall back
3060 to (depending on the command used) the highest or lowest priority."
3061 :group 'org-priorities
3062 :type 'character)
3064 (defcustom org-priority-start-cycle-with-default t
3065 "Non-nil means start with default priority when starting to cycle.
3066 When this is nil, the first step in the cycle will be (depending on the
3067 command used) one higher or lower than the default priority.
3068 See also `org-default-priority'."
3069 :group 'org-priorities
3070 :type 'boolean)
3072 (defcustom org-get-priority-function nil
3073 "Function to extract the priority from a string.
3074 The string is normally the headline. If this is nil Org computes the
3075 priority from the priority cookie like [#A] in the headline. It returns
3076 an integer, increasing by 1000 for each priority level.
3077 The user can set a different function here, which should take a string
3078 as an argument and return the numeric priority."
3079 :group 'org-priorities
3080 :version "24.1"
3081 :type '(choice
3082 (const nil)
3083 (function)))
3085 (defgroup org-time nil
3086 "Options concerning time stamps and deadlines in Org-mode."
3087 :tag "Org Time"
3088 :group 'org)
3090 (defcustom org-time-stamp-rounding-minutes '(0 5)
3091 "Number of minutes to round time stamps to.
3092 \\<org-mode-map>\
3093 These are two values, the first applies when first creating a time stamp.
3094 The second applies when changing it with the commands `S-up' and `S-down'.
3095 When changing the time stamp, this means that it will change in steps
3096 of N minutes, as given by the second value.
3098 When a setting is 0 or 1, insert the time unmodified. Useful rounding
3099 numbers should be factors of 60, so for example 5, 10, 15.
3101 When this is larger than 1, you can still force an exact time stamp by using
3102 a double prefix argument to a time stamp command like \
3103 `\\[org-time-stamp]' or `\\[org-time-stamp-inactive],
3104 and by using a prefix arg to `S-up/down' to specify the exact number
3105 of minutes to shift."
3106 :group 'org-time
3107 :get (lambda (var) ; Make sure both elements are there
3108 (if (integerp (default-value var))
3109 (list (default-value var) 5)
3110 (default-value var)))
3111 :type '(list
3112 (integer :tag "when inserting times")
3113 (integer :tag "when modifying times")))
3115 ;; Normalize old customizations of this variable.
3116 (when (integerp org-time-stamp-rounding-minutes)
3117 (setq org-time-stamp-rounding-minutes
3118 (list org-time-stamp-rounding-minutes
3119 org-time-stamp-rounding-minutes)))
3121 (defcustom org-display-custom-times nil
3122 "Non-nil means overlay custom formats over all time stamps.
3123 The formats are defined through the variable `org-time-stamp-custom-formats'.
3124 To turn this on on a per-file basis, insert anywhere in the file:
3125 #+STARTUP: customtime"
3126 :group 'org-time
3127 :set 'set-default
3128 :type 'sexp)
3129 (make-variable-buffer-local 'org-display-custom-times)
3131 (defcustom org-time-stamp-custom-formats
3132 '("<%m/%d/%y %a>" . "<%m/%d/%y %a %H:%M>") ; american
3133 "Custom formats for time stamps. See `format-time-string' for the syntax.
3134 These are overlaid over the default ISO format if the variable
3135 `org-display-custom-times' is set. Time like %H:%M should be at the
3136 end of the second format. The custom formats are also honored by export
3137 commands, if custom time display is turned on at the time of export."
3138 :group 'org-time
3139 :type 'sexp)
3141 (defun org-time-stamp-format (&optional long inactive)
3142 "Get the right format for a time string."
3143 (let ((f (if long (cdr org-time-stamp-formats)
3144 (car org-time-stamp-formats))))
3145 (if inactive
3146 (concat "[" (substring f 1 -1) "]")
3147 f)))
3149 (defcustom org-time-clocksum-format
3150 '(:days "%dd " :hours "%d" :require-hours t :minutes ":%02d" :require-minutes t)
3151 "The format string used when creating CLOCKSUM lines.
3152 This is also used when Org mode generates a time duration.
3154 The value can be a single format string containing two
3155 %-sequences, which will be filled with the number of hours and
3156 minutes in that order.
3158 Alternatively, the value can be a plist associating any of the
3159 keys :years, :months, :weeks, :days, :hours or :minutes with
3160 format strings. The time duration is formatted using only the
3161 time components that are needed and concatenating the results.
3162 If a time unit in absent, it falls back to the next smallest
3163 unit.
3165 The keys :require-years, :require-months, :require-days,
3166 :require-weeks, :require-hours, :require-minutes are also
3167 meaningful. A non-nil value for these keys indicates that the
3168 corresponding time component should always be included, even if
3169 its value is 0.
3172 For example,
3174 (:days \"%dd\" :hours \"%d\" :require-hours t :minutes \":%02d\"
3175 :require-minutes t)
3177 means durations longer than a day will be expressed in days,
3178 hours and minutes, and durations less than a day will always be
3179 expressed in hours and minutes (even for durations less than an
3180 hour).
3182 The value
3184 (:days \"%dd\" :minutes \"%dm\")
3186 means durations longer than a day will be expressed in days and
3187 minutes, and durations less than a day will be expressed entirely
3188 in minutes (even for durations longer than an hour)."
3189 :group 'org-time
3190 :group 'org-clock
3191 :version "24.4"
3192 :package-version '(Org . "8.0")
3193 :type '(choice (string :tag "Format string")
3194 (set :tag "Plist"
3195 (group :inline t (const :tag "Years" :years)
3196 (string :tag "Format string"))
3197 (group :inline t
3198 (const :tag "Always show years" :require-years)
3199 (const t))
3200 (group :inline t (const :tag "Months" :months)
3201 (string :tag "Format string"))
3202 (group :inline t
3203 (const :tag "Always show months" :require-months)
3204 (const t))
3205 (group :inline t (const :tag "Weeks" :weeks)
3206 (string :tag "Format string"))
3207 (group :inline t
3208 (const :tag "Always show weeks" :require-weeks)
3209 (const t))
3210 (group :inline t (const :tag "Days" :days)
3211 (string :tag "Format string"))
3212 (group :inline t
3213 (const :tag "Always show days" :require-days)
3214 (const t))
3215 (group :inline t (const :tag "Hours" :hours)
3216 (string :tag "Format string"))
3217 (group :inline t
3218 (const :tag "Always show hours" :require-hours)
3219 (const t))
3220 (group :inline t (const :tag "Minutes" :minutes)
3221 (string :tag "Format string"))
3222 (group :inline t
3223 (const :tag "Always show minutes" :require-minutes)
3224 (const t)))))
3226 (defcustom org-time-clocksum-use-fractional nil
3227 "When non-nil, \\[org-clock-display] uses fractional times.
3228 See `org-time-clocksum-format' for more on time clock formats."
3229 :group 'org-time
3230 :group 'org-clock
3231 :version "24.3"
3232 :type 'boolean)
3234 (defcustom org-time-clocksum-use-effort-durations nil
3235 "When non-nil, \\[org-clock-display] uses effort durations.
3236 E.g. by default, one day is considered to be a 8 hours effort,
3237 so a task that has been clocked for 16 hours will be displayed
3238 as during 2 days in the clock display or in the clocktable.
3240 See `org-effort-durations' on how to set effort durations
3241 and `org-time-clocksum-format' for more on time clock formats."
3242 :group 'org-time
3243 :group 'org-clock
3244 :version "24.4"
3245 :package-version '(Org . "8.0")
3246 :type 'boolean)
3248 (defcustom org-time-clocksum-fractional-format "%.2f"
3249 "The format string used when creating CLOCKSUM lines,
3250 or when Org mode generates a time duration, if
3251 `org-time-clocksum-use-fractional' is enabled.
3253 The value can be a single format string containing one
3254 %-sequence, which will be filled with the number of hours as
3255 a float.
3257 Alternatively, the value can be a plist associating any of the
3258 keys :years, :months, :weeks, :days, :hours or :minutes with
3259 a format string. The time duration is formatted using the
3260 largest time unit which gives a non-zero integer part. If all
3261 specified formats have zero integer part, the smallest time unit
3262 is used."
3263 :group 'org-time
3264 :type '(choice (string :tag "Format string")
3265 (set (group :inline t (const :tag "Years" :years)
3266 (string :tag "Format string"))
3267 (group :inline t (const :tag "Months" :months)
3268 (string :tag "Format string"))
3269 (group :inline t (const :tag "Weeks" :weeks)
3270 (string :tag "Format string"))
3271 (group :inline t (const :tag "Days" :days)
3272 (string :tag "Format string"))
3273 (group :inline t (const :tag "Hours" :hours)
3274 (string :tag "Format string"))
3275 (group :inline t (const :tag "Minutes" :minutes)
3276 (string :tag "Format string")))))
3278 (defcustom org-deadline-warning-days 14
3279 "Number of days before expiration during which a deadline becomes active.
3280 This variable governs the display in sparse trees and in the agenda.
3281 When 0 or negative, it means use this number (the absolute value of it)
3282 even if a deadline has a different individual lead time specified.
3284 Custom commands can set this variable in the options section."
3285 :group 'org-time
3286 :group 'org-agenda-daily/weekly
3287 :type 'integer)
3289 (defcustom org-scheduled-delay-days 0
3290 "Number of days before a scheduled item becomes active.
3291 This variable governs the display in sparse trees and in the agenda.
3292 The default value (i.e. 0) means: don't delay scheduled item.
3293 When negative, it means use this number (the absolute value of it)
3294 even if a scheduled item has a different individual delay time
3295 specified.
3297 Custom commands can set this variable in the options section."
3298 :group 'org-time
3299 :group 'org-agenda-daily/weekly
3300 :version "24.4"
3301 :package-version '(Org . "8.0")
3302 :type 'integer)
3304 (defcustom org-read-date-prefer-future t
3305 "Non-nil means assume future for incomplete date input from user.
3306 This affects the following situations:
3307 1. The user gives a month but not a year.
3308 For example, if it is April and you enter \"feb 2\", this will be read
3309 as Feb 2, *next* year. \"May 5\", however, will be this year.
3310 2. The user gives a day, but no month.
3311 For example, if today is the 15th, and you enter \"3\", Org-mode will
3312 read this as the third of *next* month. However, if you enter \"17\",
3313 it will be considered as *this* month.
3315 If you set this variable to the symbol `time', then also the following
3316 will work:
3318 3. If the user gives a time.
3319 If the time is before now, it will be interpreted as tomorrow.
3321 Currently none of this works for ISO week specifications.
3323 When this option is nil, the current day, month and year will always be
3324 used as defaults.
3326 See also `org-agenda-jump-prefer-future'."
3327 :group 'org-time
3328 :type '(choice
3329 (const :tag "Never" nil)
3330 (const :tag "Check month and day" t)
3331 (const :tag "Check month, day, and time" time)))
3333 (defcustom org-agenda-jump-prefer-future 'org-read-date-prefer-future
3334 "Should the agenda jump command prefer the future for incomplete dates?
3335 The default is to do the same as configured in `org-read-date-prefer-future'.
3336 But you can also set a deviating value here.
3337 This may t or nil, or the symbol `org-read-date-prefer-future'."
3338 :group 'org-agenda
3339 :group 'org-time
3340 :version "24.1"
3341 :type '(choice
3342 (const :tag "Use org-read-date-prefer-future"
3343 org-read-date-prefer-future)
3344 (const :tag "Never" nil)
3345 (const :tag "Always" t)))
3347 (defcustom org-read-date-force-compatible-dates t
3348 "Should date/time prompt force dates that are guaranteed to work in Emacs?
3350 Depending on the system Emacs is running on, certain dates cannot
3351 be represented with the type used internally to represent time.
3352 Dates between 1970-1-1 and 2038-1-1 can always be represented
3353 correctly. Some systems allow for earlier dates, some for later,
3354 some for both. One way to find out it to insert any date into an
3355 Org buffer, putting the cursor on the year and hitting S-up and
3356 S-down to test the range.
3358 When this variable is set to t, the date/time prompt will not let
3359 you specify dates outside the 1970-2037 range, so it is certain that
3360 these dates will work in whatever version of Emacs you are
3361 running, and also that you can move a file from one Emacs implementation
3362 to another. WHenever Org is forcing the year for you, it will display
3363 a message and beep.
3365 When this variable is nil, Org will check if the date is
3366 representable in the specific Emacs implementation you are using.
3367 If not, it will force a year, usually the current year, and beep
3368 to remind you. Currently this setting is not recommended because
3369 the likelihood that you will open your Org files in an Emacs that
3370 has limited date range is not negligible.
3372 A workaround for this problem is to use diary sexp dates for time
3373 stamps outside of this range."
3374 :group 'org-time
3375 :version "24.1"
3376 :type 'boolean)
3378 (defcustom org-read-date-display-live t
3379 "Non-nil means display current interpretation of date prompt live.
3380 This display will be in an overlay, in the minibuffer."
3381 :group 'org-time
3382 :type 'boolean)
3384 (defcustom org-read-date-popup-calendar t
3385 "Non-nil means pop up a calendar when prompting for a date.
3386 In the calendar, the date can be selected with mouse-1. However, the
3387 minibuffer will also be active, and you can simply enter the date as well.
3388 When nil, only the minibuffer will be available."
3389 :group 'org-time
3390 :type 'boolean)
3391 (org-defvaralias 'org-popup-calendar-for-date-prompt
3392 'org-read-date-popup-calendar)
3394 (make-obsolete-variable
3395 'org-read-date-minibuffer-setup-hook
3396 "Set `org-read-date-minibuffer-local-map' instead." "24.4")
3397 (defcustom org-read-date-minibuffer-setup-hook nil
3398 "Hook to be used to set up keys for the date/time interface.
3399 Add key definitions to `minibuffer-local-map', which will be a
3400 temporary copy.
3402 WARNING: This option is obsolete, you should use
3403 `org-read-date-minibuffer-local-map' to set up keys."
3404 :group 'org-time
3405 :type 'hook)
3407 (defcustom org-extend-today-until 0
3408 "The hour when your day really ends. Must be an integer.
3409 This has influence for the following applications:
3410 - When switching the agenda to \"today\". It it is still earlier than
3411 the time given here, the day recognized as TODAY is actually yesterday.
3412 - When a date is read from the user and it is still before the time given
3413 here, the current date and time will be assumed to be yesterday, 23:59.
3414 Also, timestamps inserted in capture templates follow this rule.
3416 IMPORTANT: This is a feature whose implementation is and likely will
3417 remain incomplete. Really, it is only here because past midnight seems to
3418 be the favorite working time of John Wiegley :-)"
3419 :group 'org-time
3420 :type 'integer)
3422 (defcustom org-use-effective-time nil
3423 "If non-nil, consider `org-extend-today-until' when creating timestamps.
3424 For example, if `org-extend-today-until' is 8, and it's 4am, then the
3425 \"effective time\" of any timestamps between midnight and 8am will be
3426 23:59 of the previous day."
3427 :group 'org-time
3428 :version "24.1"
3429 :type 'boolean)
3431 (defcustom org-use-last-clock-out-time-as-effective-time nil
3432 "When non-nil, use the last clock out time for `org-todo'.
3433 Note that this option has precedence over the combined use of
3434 `org-use-effective-time' and `org-extend-today-until'."
3435 :group 'org-time
3436 :version "24.4"
3437 :package-version '(Org . "8.0")
3438 :type 'boolean)
3440 (defcustom org-edit-timestamp-down-means-later nil
3441 "Non-nil means S-down will increase the time in a time stamp.
3442 When nil, S-up will increase."
3443 :group 'org-time
3444 :type 'boolean)
3446 (defcustom org-calendar-follow-timestamp-change t
3447 "Non-nil means make the calendar window follow timestamp changes.
3448 When a timestamp is modified and the calendar window is visible, it will be
3449 moved to the new date."
3450 :group 'org-time
3451 :type 'boolean)
3453 (defgroup org-tags nil
3454 "Options concerning tags in Org-mode."
3455 :tag "Org Tags"
3456 :group 'org)
3458 (defcustom org-tag-alist nil
3459 "Default tags available in Org files.
3461 The value of this variable is an alist. Associations either:
3463 (TAG)
3464 (TAG . SELECT)
3465 (SPECIAL)
3467 where TAG is a tag as a string, SELECT is a character, used to
3468 select that tag through the fast tag selection interface, and
3469 SPECIAL is one of the following keywords: `:startgroup',
3470 `:startgrouptag', `:grouptags', `:engroup', `:endgrouptag' or
3471 `:newline'. These keywords are used to define a hierarchy of
3472 tags. See manual for details.
3474 When this variable is nil, Org mode bases tag input on what is
3475 already in the buffer. The value can be overridden locally by
3476 using a TAGS keyword, e.g.,
3478 #+TAGS: tag1 tag2
3480 See also `org-tag-persistent-alist' to sidestep this behavior."
3481 :group 'org-tags
3482 :type '(repeat
3483 (choice
3484 (cons (string :tag "Tag name")
3485 (character :tag "Access char"))
3486 (const :tag "Start radio group" (:startgroup))
3487 (const :tag "Start tag group, non distinct" (:startgrouptag))
3488 (const :tag "Group tags delimiter" (:grouptags))
3489 (const :tag "End radio group" (:endgroup))
3490 (const :tag "End tag group, non distinct" (:endgrouptag))
3491 (const :tag "New line" (:newline)))))
3493 (defcustom org-tag-persistent-alist nil
3494 "Tags always available in Org files.
3496 The value of this variable is an alist. Associations either:
3498 (TAG)
3499 (TAG . SELECT)
3500 (SPECIAL)
3502 where TAG is a tag as a string, SELECT is a character, used to
3503 select that tag through the fast tag selection interface, and
3504 SPECIAL is one of the following keywords: `:startgroup',
3505 `:startgrouptag', `:grouptags', `:engroup', `:endgrouptag' or
3506 `:newline'. These keywords are used to define a hierarchy of
3507 tags. See manual for details.
3509 Unlike to `org-tag-alist', tags defined in this variable do not
3510 depend on a local TAGS keyword. Instead, to disable these tags
3511 on a per-file basis, insert anywhere in the file:
3513 #+STARTUP: noptag"
3514 :group 'org-tags
3515 :type '(repeat
3516 (choice
3517 (cons (string :tag "Tag name")
3518 (character :tag "Access char"))
3519 (const :tag "Start radio group" (:startgroup))
3520 (const :tag "Start tag group, non distinct" (:startgrouptag))
3521 (const :tag "Group tags delimiter" (:grouptags))
3522 (const :tag "End radio group" (:endgroup))
3523 (const :tag "End tag group, non distinct" (:endgrouptag))
3524 (const :tag "New line" (:newline)))))
3526 (defcustom org-complete-tags-always-offer-all-agenda-tags nil
3527 "If non-nil, always offer completion for all tags of all agenda files.
3528 Instead of customizing this variable directly, you might want to
3529 set it locally for capture buffers, because there no list of
3530 tags in that file can be created dynamically (there are none).
3532 (add-hook \\='org-capture-mode-hook
3533 (lambda ()
3534 (setq-local org-complete-tags-always-offer-all-agenda-tags t)))"
3535 :group 'org-tags
3536 :version "24.1"
3537 :type 'boolean)
3539 (defvar org-file-tags nil
3540 "List of tags that can be inherited by all entries in the file.
3541 The tags will be inherited if the variable `org-use-tag-inheritance'
3542 says they should be.
3543 This variable is populated from #+FILETAGS lines.")
3545 (defcustom org-use-fast-tag-selection 'auto
3546 "Non-nil means use fast tag selection scheme.
3547 This is a special interface to select and deselect tags with single keys.
3548 When nil, fast selection is never used.
3549 When the symbol `auto', fast selection is used if and only if selection
3550 characters for tags have been configured, either through the variable
3551 `org-tag-alist' or through a #+TAGS line in the buffer.
3552 When t, fast selection is always used and selection keys are assigned
3553 automatically if necessary."
3554 :group 'org-tags
3555 :type '(choice
3556 (const :tag "Always" t)
3557 (const :tag "Never" nil)
3558 (const :tag "When selection characters are configured" auto)))
3560 (defcustom org-fast-tag-selection-single-key nil
3561 "Non-nil means fast tag selection exits after first change.
3562 When nil, you have to press RET to exit it.
3563 During fast tag selection, you can toggle this flag with `C-c'.
3564 This variable can also have the value `expert'. In this case, the window
3565 displaying the tags menu is not even shown, until you press C-c again."
3566 :group 'org-tags
3567 :type '(choice
3568 (const :tag "No" nil)
3569 (const :tag "Yes" t)
3570 (const :tag "Expert" expert)))
3572 (defvar org-fast-tag-selection-include-todo nil
3573 "Non-nil means fast tags selection interface will also offer TODO states.
3574 This is an undocumented feature, you should not rely on it.")
3576 (defcustom org-tags-column -77
3577 "The column to which tags should be indented in a headline.
3578 If this number is positive, it specifies the column. If it is negative,
3579 it means that the tags should be flushright to that column. For example,
3580 -80 works well for a normal 80 character screen.
3581 When 0, place tags directly after headline text, with only one space in
3582 between."
3583 :group 'org-tags
3584 :type 'integer)
3586 (defcustom org-auto-align-tags t
3587 "Non-nil keeps tags aligned when modifying headlines.
3588 Some operations (i.e. demoting) change the length of a headline and
3589 therefore shift the tags around. With this option turned on, after
3590 each such operation the tags are again aligned to `org-tags-column'."
3591 :group 'org-tags
3592 :type 'boolean)
3594 (defcustom org-use-tag-inheritance t
3595 "Non-nil means tags in levels apply also for sublevels.
3596 When nil, only the tags directly given in a specific line apply there.
3597 This may also be a list of tags that should be inherited, or a regexp that
3598 matches tags that should be inherited. Additional control is possible
3599 with the variable `org-tags-exclude-from-inheritance' which gives an
3600 explicit list of tags to be excluded from inheritance, even if the value of
3601 `org-use-tag-inheritance' would select it for inheritance.
3603 If this option is t, a match early-on in a tree can lead to a large
3604 number of matches in the subtree when constructing the agenda or creating
3605 a sparse tree. If you only want to see the first match in a tree during
3606 a search, check out the variable `org-tags-match-list-sublevels'."
3607 :group 'org-tags
3608 :type '(choice
3609 (const :tag "Not" nil)
3610 (const :tag "Always" t)
3611 (repeat :tag "Specific tags" (string :tag "Tag"))
3612 (regexp :tag "Tags matched by regexp")))
3614 (defcustom org-tags-exclude-from-inheritance nil
3615 "List of tags that should never be inherited.
3616 This is a way to exclude a few tags from inheritance. For way to do
3617 the opposite, to actively allow inheritance for selected tags,
3618 see the variable `org-use-tag-inheritance'."
3619 :group 'org-tags
3620 :type '(repeat (string :tag "Tag")))
3622 (defun org-tag-inherit-p (tag)
3623 "Check if TAG is one that should be inherited."
3624 (cond
3625 ((member tag org-tags-exclude-from-inheritance) nil)
3626 ((eq org-use-tag-inheritance t) t)
3627 ((not org-use-tag-inheritance) nil)
3628 ((stringp org-use-tag-inheritance)
3629 (string-match org-use-tag-inheritance tag))
3630 ((listp org-use-tag-inheritance)
3631 (member tag org-use-tag-inheritance))
3632 (t (error "Invalid setting of `org-use-tag-inheritance'"))))
3634 (defcustom org-tags-match-list-sublevels t
3635 "Non-nil means list also sublevels of headlines matching a search.
3636 This variable applies to tags/property searches, and also to stuck
3637 projects because this search is based on a tags match as well.
3639 When set to the symbol `indented', sublevels are indented with
3640 leading dots.
3642 Because of tag inheritance (see variable `org-use-tag-inheritance'),
3643 the sublevels of a headline matching a tag search often also match
3644 the same search. Listing all of them can create very long lists.
3645 Setting this variable to nil causes subtrees of a match to be skipped.
3647 This variable is semi-obsolete and probably should always be true. It
3648 is better to limit inheritance to certain tags using the variables
3649 `org-use-tag-inheritance' and `org-tags-exclude-from-inheritance'."
3650 :group 'org-tags
3651 :type '(choice
3652 (const :tag "No, don't list them" nil)
3653 (const :tag "Yes, do list them" t)
3654 (const :tag "List them, indented with leading dots" indented)))
3656 (defcustom org-tags-sort-function nil
3657 "When set, tags are sorted using this function as a comparator."
3658 :group 'org-tags
3659 :type '(choice
3660 (const :tag "No sorting" nil)
3661 (const :tag "Alphabetical" string<)
3662 (const :tag "Reverse alphabetical" string>)
3663 (function :tag "Custom function" nil)))
3665 (defvar org-tags-history nil
3666 "History of minibuffer reads for tags.")
3667 (defvar org-last-tags-completion-table nil
3668 "The last used completion table for tags.")
3669 (defvar org-after-tags-change-hook nil
3670 "Hook that is run after the tags in a line have changed.")
3672 (defgroup org-properties nil
3673 "Options concerning properties in Org-mode."
3674 :tag "Org Properties"
3675 :group 'org)
3677 (defcustom org-property-format "%-10s %s"
3678 "How property key/value pairs should be formatted by `indent-line'.
3679 When `indent-line' hits a property definition, it will format the line
3680 according to this format, mainly to make sure that the values are
3681 lined-up with respect to each other."
3682 :group 'org-properties
3683 :type 'string)
3685 (defcustom org-properties-postprocess-alist nil
3686 "Alist of properties and functions to adjust inserted values.
3687 Elements of this alist must be of the form
3689 ([string] [function])
3691 where [string] must be a property name and [function] must be a
3692 lambda expression: this lambda expression must take one argument,
3693 the value to adjust, and return the new value as a string.
3695 For example, this element will allow the property \"Remaining\"
3696 to be updated wrt the relation between the \"Effort\" property
3697 and the clock summary:
3699 ((\"Remaining\" (lambda(value)
3700 (let ((clocksum (org-clock-sum-current-item))
3701 (effort (org-duration-string-to-minutes
3702 (org-entry-get (point) \"Effort\"))))
3703 (org-minutes-to-clocksum-string (- effort clocksum))))))"
3704 :group 'org-properties
3705 :version "24.1"
3706 :type '(alist :key-type (string :tag "Property")
3707 :value-type (function :tag "Function")))
3709 (defcustom org-use-property-inheritance nil
3710 "Non-nil means properties apply also for sublevels.
3712 This setting is chiefly used during property searches. Turning it on can
3713 cause significant overhead when doing a search, which is why it is not
3714 on by default.
3716 When nil, only the properties directly given in the current entry count.
3717 When t, every property is inherited. The value may also be a list of
3718 properties that should have inheritance, or a regular expression matching
3719 properties that should be inherited.
3721 However, note that some special properties use inheritance under special
3722 circumstances (not in searches). Examples are CATEGORY, ARCHIVE, COLUMNS,
3723 and the properties ending in \"_ALL\" when they are used as descriptor
3724 for valid values of a property.
3726 Note for programmers:
3727 When querying an entry with `org-entry-get', you can control if inheritance
3728 should be used. By default, `org-entry-get' looks only at the local
3729 properties. You can request inheritance by setting the inherit argument
3730 to t (to force inheritance) or to `selective' (to respect the setting
3731 in this variable)."
3732 :group 'org-properties
3733 :type '(choice
3734 (const :tag "Not" nil)
3735 (const :tag "Always" t)
3736 (repeat :tag "Specific properties" (string :tag "Property"))
3737 (regexp :tag "Properties matched by regexp")))
3739 (defun org-property-inherit-p (property)
3740 "Check if PROPERTY is one that should be inherited."
3741 (cond
3742 ((eq org-use-property-inheritance t) t)
3743 ((not org-use-property-inheritance) nil)
3744 ((stringp org-use-property-inheritance)
3745 (string-match org-use-property-inheritance property))
3746 ((listp org-use-property-inheritance)
3747 (member property org-use-property-inheritance))
3748 (t (error "Invalid setting of `org-use-property-inheritance'"))))
3750 (defcustom org-columns-default-format "%25ITEM %TODO %3PRIORITY %TAGS"
3751 "The default column format, if no other format has been defined.
3752 This variable can be set on the per-file basis by inserting a line
3754 #+COLUMNS: %25ITEM ....."
3755 :group 'org-properties
3756 :type 'string)
3758 (defcustom org-columns-ellipses ".."
3759 "The ellipses to be used when a field in column view is truncated.
3760 When this is the empty string, as many characters as possible are shown,
3761 but then there will be no visual indication that the field has been truncated.
3762 When this is a string of length N, the last N characters of a truncated
3763 field are replaced by this string. If the column is narrower than the
3764 ellipses string, only part of the ellipses string will be shown."
3765 :group 'org-properties
3766 :type 'string)
3768 (defconst org-global-properties-fixed
3769 '(("VISIBILITY_ALL" . "folded children content all")
3770 ("CLOCK_MODELINE_TOTAL_ALL" . "current today repeat all auto"))
3771 "List of property/value pairs that can be inherited by any entry.
3773 These are fixed values, for the preset properties. The user variable
3774 that can be used to add to this list is `org-global-properties'.
3776 The entries in this list are cons cells where the car is a property
3777 name and cdr is a string with the value. If the value represents
3778 multiple items like an \"_ALL\" property, separate the items by
3779 spaces.")
3781 (defcustom org-global-properties nil
3782 "List of property/value pairs that can be inherited by any entry.
3784 This list will be combined with the constant `org-global-properties-fixed'.
3786 The entries in this list are cons cells where the car is a property
3787 name and cdr is a string with the value.
3789 You can set buffer-local values for the same purpose in the variable
3790 `org-file-properties' this by adding lines like
3792 #+PROPERTY: NAME VALUE"
3793 :group 'org-properties
3794 :type '(repeat
3795 (cons (string :tag "Property")
3796 (string :tag "Value"))))
3798 (defvar-local org-file-properties nil
3799 "List of property/value pairs that can be inherited by any entry.
3800 Valid for the current buffer.
3801 This variable is populated from #+PROPERTY lines.")
3803 (defgroup org-agenda nil
3804 "Options concerning agenda views in Org-mode."
3805 :tag "Org Agenda"
3806 :group 'org)
3808 (defvar-local org-category nil
3809 "Variable used by org files to set a category for agenda display.
3810 Such files should use a file variable to set it, for example
3812 # -*- mode: org; org-category: \"ELisp\"
3814 or contain a special line
3816 #+CATEGORY: ELisp
3818 If the file does not specify a category, then file's base name
3819 is used instead.")
3820 (put 'org-category 'safe-local-variable (lambda (x) (or (symbolp x) (stringp x))))
3822 (defcustom org-agenda-files nil
3823 "The files to be used for agenda display.
3824 Entries may be added to this list with \\[org-agenda-file-to-front] and removed with
3825 \\[org-remove-file]. You can also use customize to edit the list.
3827 If an entry is a directory, all files in that directory that are matched by
3828 `org-agenda-file-regexp' will be part of the file list.
3830 If the value of the variable is not a list but a single file name, then
3831 the list of agenda files is actually stored and maintained in that file, one
3832 agenda file per line. In this file paths can be given relative to
3833 `org-directory'. Tilde expansion and environment variable substitution
3834 are also made."
3835 :group 'org-agenda
3836 :type '(choice
3837 (repeat :tag "List of files and directories" file)
3838 (file :tag "Store list in a file\n" :value "~/.agenda_files")))
3840 (defcustom org-agenda-file-regexp "\\`[^.].*\\.org\\'"
3841 "Regular expression to match files for `org-agenda-files'.
3842 If any element in the list in that variable contains a directory instead
3843 of a normal file, all files in that directory that are matched by this
3844 regular expression will be included."
3845 :group 'org-agenda
3846 :type 'regexp)
3848 (defcustom org-agenda-text-search-extra-files nil
3849 "List of extra files to be searched by text search commands.
3850 These files will be searched in addition to the agenda files by the
3851 commands `org-search-view' (`\\[org-agenda] s') \
3852 and `org-occur-in-agenda-files'.
3853 Note that these files will only be searched for text search commands,
3854 not for the other agenda views like todo lists, tag searches or the weekly
3855 agenda. This variable is intended to list notes and possibly archive files
3856 that should also be searched by these two commands.
3857 In fact, if the first element in the list is the symbol `agenda-archives',
3858 then all archive files of all agenda files will be added to the search
3859 scope."
3860 :group 'org-agenda
3861 :type '(set :greedy t
3862 (const :tag "Agenda Archives" agenda-archives)
3863 (repeat :inline t (file))))
3865 (org-defvaralias 'org-agenda-multi-occur-extra-files
3866 'org-agenda-text-search-extra-files)
3868 (defcustom org-agenda-skip-unavailable-files nil
3869 "Non-nil means to just skip non-reachable files in `org-agenda-files'.
3870 A nil value means to remove them, after a query, from the list."
3871 :group 'org-agenda
3872 :type 'boolean)
3874 (defcustom org-calendar-to-agenda-key [?c]
3875 "The key to be installed in `calendar-mode-map' for switching to the agenda.
3876 The command `org-calendar-goto-agenda' will be bound to this key. The
3877 default is the character `c' because then `c' can be used to switch back and
3878 forth between agenda and calendar."
3879 :group 'org-agenda
3880 :type 'sexp)
3882 (defcustom org-calendar-insert-diary-entry-key [?i]
3883 "The key to be installed in `calendar-mode-map' for adding diary entries.
3884 This option is irrelevant until `org-agenda-diary-file' has been configured
3885 to point to an Org-mode file. When that is the case, the command
3886 `org-agenda-diary-entry' will be bound to the key given here, by default
3887 `i'. In the calendar, `i' normally adds entries to `diary-file'. So
3888 if you want to continue doing this, you need to change this to a different
3889 key."
3890 :group 'org-agenda
3891 :type 'sexp)
3893 (defcustom org-agenda-diary-file 'diary-file
3894 "File to which to add new entries with the `i' key in agenda and calendar.
3895 When this is the symbol `diary-file', the functionality in the Emacs
3896 calendar will be used to add entries to the `diary-file'. But when this
3897 points to a file, `org-agenda-diary-entry' will be used instead."
3898 :group 'org-agenda
3899 :type '(choice
3900 (const :tag "The standard Emacs diary file" diary-file)
3901 (file :tag "Special Org file diary entries")))
3903 (eval-after-load "calendar"
3904 '(progn
3905 (org-defkey calendar-mode-map org-calendar-to-agenda-key
3906 'org-calendar-goto-agenda)
3907 (add-hook 'calendar-mode-hook
3908 (lambda ()
3909 (unless (eq org-agenda-diary-file 'diary-file)
3910 (define-key calendar-mode-map
3911 org-calendar-insert-diary-entry-key
3912 'org-agenda-diary-entry))))))
3914 (defgroup org-latex nil
3915 "Options for embedding LaTeX code into Org-mode."
3916 :tag "Org LaTeX"
3917 :group 'org)
3919 (defcustom org-format-latex-options
3920 '(:foreground default :background default :scale 1.0
3921 :html-foreground "Black" :html-background "Transparent"
3922 :html-scale 1.0 :matchers ("begin" "$1" "$" "$$" "\\(" "\\["))
3923 "Options for creating images from LaTeX fragments.
3924 This is a property list with the following properties:
3925 :foreground the foreground color for images embedded in Emacs, e.g. \"Black\".
3926 `default' means use the foreground of the default face.
3927 `auto' means use the foreground from the text face.
3928 :background the background color, or \"Transparent\".
3929 `default' means use the background of the default face.
3930 `auto' means use the background from the text face.
3931 :scale a scaling factor for the size of the images, to get more pixels
3932 :html-foreground, :html-background, :html-scale
3933 the same numbers for HTML export.
3934 :matchers a list indicating which matchers should be used to
3935 find LaTeX fragments. Valid members of this list are:
3936 \"begin\" find environments
3937 \"$1\" find single characters surrounded by $.$
3938 \"$\" find math expressions surrounded by $...$
3939 \"$$\" find math expressions surrounded by $$....$$
3940 \"\\(\" find math expressions surrounded by \\(...\\)
3941 \"\\=\\[\" find math expressions surrounded by \\=\\[...\\]"
3942 :group 'org-latex
3943 :type 'plist)
3945 (defcustom org-format-latex-signal-error t
3946 "Non-nil means signal an error when image creation of LaTeX snippets fails.
3947 When nil, just push out a message."
3948 :group 'org-latex
3949 :version "24.1"
3950 :type 'boolean)
3952 (defcustom org-latex-to-mathml-jar-file nil
3953 "Value of\"%j\" in `org-latex-to-mathml-convert-command'.
3954 Use this to specify additional executable file say a jar file.
3956 When using MathToWeb as the converter, specify the full-path to
3957 your mathtoweb.jar file."
3958 :group 'org-latex
3959 :version "24.1"
3960 :type '(choice
3961 (const :tag "None" nil)
3962 (file :tag "JAR file" :must-match t)))
3964 (defcustom org-latex-to-mathml-convert-command nil
3965 "Command to convert LaTeX fragments to MathML.
3966 Replace format-specifiers in the command as noted below and use
3967 `shell-command' to convert LaTeX to MathML.
3968 %j: Executable file in fully expanded form as specified by
3969 `org-latex-to-mathml-jar-file'.
3970 %I: Input LaTeX file in fully expanded form.
3971 %i: The latex fragment to be converted.
3972 %o: Output MathML file.
3974 This command is used by `org-create-math-formula'.
3976 When using MathToWeb as the converter, set this option to
3977 \"java -jar %j -unicode -force -df %o %I\".
3979 When using LaTeXML set this option to
3980 \"latexmlmath \"%i\" --presentationmathml=%o\"."
3981 :group 'org-latex
3982 :version "24.1"
3983 :type '(choice
3984 (const :tag "None" nil)
3985 (string :tag "\nShell command")))
3987 (define-obsolete-variable-alias
3988 'org-latex-create-formula-image-program
3989 'org-preview-latex-default-process "25.1")
3991 (defcustom org-preview-latex-default-process 'dvipng
3992 "The default process to convert LaTeX fragments to image files.
3993 All available processes and theirs documents can be found in
3994 `org-preview-latex-process-alist', which see."
3995 :group 'org-latex
3996 :version "25.2"
3997 :package-version '(Org . "9.0")
3998 :type 'symbol)
4000 (defcustom org-preview-latex-process-alist
4001 '((dvipng
4002 :programs ("latex" "dvipng" "gs")
4003 :description "dvi > png"
4004 :message "you need to install the programs: latex, dvipng and ghostscript."
4005 :image-input-type "dvi"
4006 :image-output-type "png"
4007 :image-size-adjust (1.0 . 1.0)
4008 :latex-compiler ("latex -interaction nonstopmode -output-directory %o %f")
4009 :image-converter ("dvipng -fg %F -bg %B -D %D -T tight -o %b.png %f"))
4010 (dvisvgm
4011 :programs ("latex" "dvisvgm" "gs")
4012 :description "dvi > svg"
4013 :message "you need to install the programs: latex, dvisvgm and ghostscript."
4014 :use-xcolor t
4015 :image-input-type "dvi"
4016 :image-output-type "svg"
4017 :image-size-adjust (1.7 . 1.5)
4018 :latex-compiler ("latex -interaction nonstopmode -output-directory %o %f")
4019 :image-converter ("dvisvgm %f -n -b min -c %S -o %b.svg"))
4020 (imagemagick
4021 :programs ("latex" "convert" "gs")
4022 :description "pdf > png"
4023 :message
4024 "you need to install the programs: latex, imagemagick and ghostscript."
4025 :use-xcolor t
4026 :image-input-type "pdf"
4027 :image-output-type "png"
4028 :image-size-adjust (1.0 . 1.0)
4029 :latex-compiler ("pdflatex -interaction nonstopmode -output-directory %o %f")
4030 :image-converter
4031 ("convert -density %D -trim -antialias %f -quality 100 %b.png")))
4032 "Definitions of external processes for LaTeX previewing.
4033 Org mode can use some external commands to generate TeX snippet's images for
4034 previewing or inserting into HTML files, e.g., \"dvipng\". This variable tells
4035 `org-create-formula-image' how to call them.
4037 The value is an alist with the pattern (NAME . PROPERTIES). NAME is a symbol.
4038 PROPERTIES accepts the following attributes:
4040 :programs list of strings, required programs.
4041 :description string, describe the process.
4042 :message string, message it when required programs cannot be found.
4043 :image-input-type string, input file type of image converter (e.g., \"dvi\").
4044 :image-output-type string, output file type of image converter (e.g., \"png\").
4045 :use-xcolor boolean, when non-nil, LaTeX \"xcolor\" macro is used to
4046 deal with background and foreground color of image.
4047 Otherwise, dvipng style background and foregroud color
4048 format are generated. You may then refer to them in
4049 command options with \"%F\" and \"%B\".
4050 :image-size-adjust cons of numbers, the car element is used to adjust LaTeX
4051 image size showed in buffer and the cdr element is for
4052 HTML file. This option is only useful for process
4053 developers, users should use variable
4054 `org-format-latex-options' instead.
4055 :post-clean list of strings, files matched are to be cleaned up once
4056 the image is generated. When nil, the files with \".dvi\",
4057 \".xdv\", \".pdf\", \".tex\", \".aux\", \".log\", \".svg\",
4058 \".png\", \".jpg\", \".jpeg\" or \".out\" extension will
4059 be cleaned up.
4060 :latex-header list of strings, the LaTeX header of the snippet file.
4061 When nil, the fallback value is used instead, which is
4062 controlled by `org-format-latex-header',
4063 `org-latex-default-packages-alist' and
4064 `org-latex-packages-alist', which see.
4065 :latex-compiler list of LaTeX commands, as strings. Each of them is given
4066 to the shell. Place-holders \"%t\", \"%b\" and \"%o\" are
4067 replaced with values defined below.
4068 :image-converter list of image converter commands strings. Each of them is
4069 given to the shell and supports any of the following
4070 place-holders defined below.
4072 Place-holders used by `:image-converter' and `:latex-compiler':
4074 %f input file name.
4075 %b base name of input file.
4076 %o base directory of input file.
4078 Place-holders only used by `:image-converter':
4080 %F foreground of image
4081 %B background of image
4082 %D dpi, which is used to adjust image size by some processing commands.
4083 %S the image size scale ratio, which is used to adjust image size by some
4084 processing commands."
4085 :group 'org-latex
4086 :version "25.2"
4087 :package-version '(Org . "9.0")
4088 :type '(alist :tag "LaTeX to image backends"
4089 :value-type (plist)))
4091 (define-obsolete-variable-alias
4092 'org-latex-preview-ltxpng-directory
4093 'org-preview-latex-image-directory "25.1")
4095 (defcustom org-preview-latex-image-directory "ltximg/"
4096 "Path to store latex preview images.
4097 A relative path here creates many directories relative to the
4098 processed org files paths. An absolute path puts all preview
4099 images at the same place."
4100 :group 'org-latex
4101 :version "25.1"
4102 :package-version '(Org . "9.0")
4103 :type 'string)
4105 (defun org-format-latex-mathml-available-p ()
4106 "Return t if `org-latex-to-mathml-convert-command' is usable."
4107 (save-match-data
4108 (when (and (boundp 'org-latex-to-mathml-convert-command)
4109 org-latex-to-mathml-convert-command)
4110 (let ((executable (car (split-string
4111 org-latex-to-mathml-convert-command))))
4112 (when (executable-find executable)
4113 (if (string-match
4114 "%j" org-latex-to-mathml-convert-command)
4115 (file-readable-p org-latex-to-mathml-jar-file)
4116 t))))))
4118 (defcustom org-format-latex-header "\\documentclass{article}
4119 \\usepackage[usenames]{color}
4120 \[PACKAGES]
4121 \[DEFAULT-PACKAGES]
4122 \\pagestyle{empty} % do not remove
4123 % The settings below are copied from fullpage.sty
4124 \\setlength{\\textwidth}{\\paperwidth}
4125 \\addtolength{\\textwidth}{-3cm}
4126 \\setlength{\\oddsidemargin}{1.5cm}
4127 \\addtolength{\\oddsidemargin}{-2.54cm}
4128 \\setlength{\\evensidemargin}{\\oddsidemargin}
4129 \\setlength{\\textheight}{\\paperheight}
4130 \\addtolength{\\textheight}{-\\headheight}
4131 \\addtolength{\\textheight}{-\\headsep}
4132 \\addtolength{\\textheight}{-\\footskip}
4133 \\addtolength{\\textheight}{-3cm}
4134 \\setlength{\\topmargin}{1.5cm}
4135 \\addtolength{\\topmargin}{-2.54cm}"
4136 "The document header used for processing LaTeX fragments.
4137 It is imperative that this header make sure that no page number
4138 appears on the page. The package defined in the variables
4139 `org-latex-default-packages-alist' and `org-latex-packages-alist'
4140 will either replace the placeholder \"[PACKAGES]\" in this
4141 header, or they will be appended."
4142 :group 'org-latex
4143 :type 'string)
4145 (defun org-set-packages-alist (var val)
4146 "Set the packages alist and make sure it has 3 elements per entry."
4147 (set var (mapcar (lambda (x)
4148 (if (and (consp x) (= (length x) 2))
4149 (list (car x) (nth 1 x) t)
4151 val)))
4153 (defun org-get-packages-alist (var)
4154 "Get the packages alist and make sure it has 3 elements per entry."
4155 (mapcar (lambda (x)
4156 (if (and (consp x) (= (length x) 2))
4157 (list (car x) (nth 1 x) t)
4159 (default-value var)))
4161 (defcustom org-latex-default-packages-alist
4162 '(("AUTO" "inputenc" t ("pdflatex"))
4163 ("T1" "fontenc" t ("pdflatex"))
4164 ("" "graphicx" t)
4165 ("" "grffile" t)
4166 ("" "longtable" nil)
4167 ("" "wrapfig" nil)
4168 ("" "rotating" nil)
4169 ("normalem" "ulem" t)
4170 ("" "amsmath" t)
4171 ("" "textcomp" t)
4172 ("" "amssymb" t)
4173 ("" "capt-of" nil)
4174 ("" "hyperref" nil))
4175 "Alist of default packages to be inserted in the header.
4177 Change this only if one of the packages here causes an
4178 incompatibility with another package you are using.
4180 The packages in this list are needed by one part or another of
4181 Org mode to function properly:
4183 - inputenc, fontenc: for basic font and character selection
4184 - graphicx: for including images
4185 - grffile: allow periods and spaces in graphics file names
4186 - longtable: For multipage tables
4187 - wrapfig: for figure placement
4188 - rotating: for sideways figures and tables
4189 - ulem: for underline and strike-through
4190 - amsmath: for subscript and superscript and math environments
4191 - textcomp, amssymb: for various symbols used
4192 for interpreting the entities in `org-entities'. You can skip
4193 some of these packages if you don't use any of their symbols.
4194 - capt-of: for captions outside of floats
4195 - hyperref: for cross references
4197 Therefore you should not modify this variable unless you know
4198 what you are doing. The one reason to change it anyway is that
4199 you might be loading some other package that conflicts with one
4200 of the default packages. Each element is either a cell or
4201 a string.
4203 A cell is of the format
4205 (\"options\" \"package\" SNIPPET-FLAG COMPILERS)
4207 If SNIPPET-FLAG is non-nil, the package also needs to be included
4208 when compiling LaTeX snippets into images for inclusion into
4209 non-LaTeX output. COMPILERS is a list of compilers that should
4210 include the package, see `org-latex-compiler'. If the document
4211 compiler is not in the list, and the list is non-nil, the package
4212 will not be inserted in the final document.
4214 A string will be inserted as-is in the header of the document."
4215 :group 'org-latex
4216 :group 'org-export-latex
4217 :set 'org-set-packages-alist
4218 :get 'org-get-packages-alist
4219 :version "25.1"
4220 :package-version '(Org . "8.3")
4221 :type '(repeat
4222 (choice
4223 (list :tag "options/package pair"
4224 (string :tag "options")
4225 (string :tag "package")
4226 (boolean :tag "Snippet"))
4227 (string :tag "A line of LaTeX"))))
4229 (defcustom org-latex-packages-alist nil
4230 "Alist of packages to be inserted in every LaTeX header.
4232 These will be inserted after `org-latex-default-packages-alist'.
4233 Each element is either a cell or a string.
4235 A cell is of the format:
4237 (\"options\" \"package\" SNIPPET-FLAG)
4239 SNIPPET-FLAG, when non-nil, indicates that this package is also
4240 needed when turning LaTeX snippets into images for inclusion into
4241 non-LaTeX output.
4243 A string will be inserted as-is in the header of the document.
4245 Make sure that you only list packages here which:
4247 - you want in every file;
4248 - do not conflict with the setup in `org-format-latex-header';
4249 - do not conflict with the default packages in
4250 `org-latex-default-packages-alist'."
4251 :group 'org-latex
4252 :group 'org-export-latex
4253 :set 'org-set-packages-alist
4254 :get 'org-get-packages-alist
4255 :type '(repeat
4256 (choice
4257 (list :tag "options/package pair"
4258 (string :tag "options")
4259 (string :tag "package")
4260 (boolean :tag "Snippet"))
4261 (string :tag "A line of LaTeX"))))
4263 (defgroup org-appearance nil
4264 "Settings for Org-mode appearance."
4265 :tag "Org Appearance"
4266 :group 'org)
4268 (defcustom org-level-color-stars-only nil
4269 "Non-nil means fontify only the stars in each headline.
4270 When nil, the entire headline is fontified.
4271 Changing it requires restart of `font-lock-mode' to become effective
4272 also in regions already fontified."
4273 :group 'org-appearance
4274 :type 'boolean)
4276 (defcustom org-hide-leading-stars nil
4277 "Non-nil means hide the first N-1 stars in a headline.
4278 This works by using the face `org-hide' for these stars. This
4279 face is white for a light background, and black for a dark
4280 background. You may have to customize the face `org-hide' to
4281 make this work.
4282 Changing it requires restart of `font-lock-mode' to become effective
4283 also in regions already fontified.
4284 You may also set this on a per-file basis by adding one of the following
4285 lines to the buffer:
4287 #+STARTUP: hidestars
4288 #+STARTUP: showstars"
4289 :group 'org-appearance
4290 :type 'boolean)
4292 (defcustom org-hidden-keywords nil
4293 "List of symbols corresponding to keywords to be hidden the org buffer.
4294 For example, a value \\='(title) for this list will make the document's title
4295 appear in the buffer without the initial #+TITLE: keyword."
4296 :group 'org-appearance
4297 :version "24.1"
4298 :type '(set (const :tag "#+AUTHOR" author)
4299 (const :tag "#+DATE" date)
4300 (const :tag "#+EMAIL" email)
4301 (const :tag "#+TITLE" title)))
4303 (defcustom org-custom-properties nil
4304 "List of properties (as strings) with a special meaning.
4305 The default use of these custom properties is to let the user
4306 hide them with `org-toggle-custom-properties-visibility'."
4307 :group 'org-properties
4308 :group 'org-appearance
4309 :version "24.3"
4310 :type '(repeat (string :tag "Property Name")))
4312 (defcustom org-fontify-done-headline nil
4313 "Non-nil means change the face of a headline if it is marked DONE.
4314 Normally, only the TODO/DONE keyword indicates the state of a headline.
4315 When this is non-nil, the headline after the keyword is set to the
4316 `org-headline-done' as an additional indication."
4317 :group 'org-appearance
4318 :type 'boolean)
4320 (defcustom org-fontify-emphasized-text t
4321 "Non-nil means fontify *bold*, /italic/ and _underlined_ text.
4322 Changing this variable requires a restart of Emacs to take effect."
4323 :group 'org-appearance
4324 :type 'boolean)
4326 (defcustom org-fontify-whole-heading-line nil
4327 "Non-nil means fontify the whole line for headings.
4328 This is useful when setting a background color for the
4329 org-level-* faces."
4330 :group 'org-appearance
4331 :type 'boolean)
4333 (defcustom org-highlight-latex-and-related nil
4334 "Non-nil means highlight LaTeX related syntax in the buffer.
4335 When non nil, the value should be a list containing any of the
4336 following symbols:
4337 `latex' Highlight LaTeX snippets and environments.
4338 `script' Highlight subscript and superscript.
4339 `entities' Highlight entities."
4340 :group 'org-appearance
4341 :version "24.4"
4342 :package-version '(Org . "8.0")
4343 :type '(choice
4344 (const :tag "No highlighting" nil)
4345 (set :greedy t :tag "Highlight"
4346 (const :tag "LaTeX snippets and environments" latex)
4347 (const :tag "Subscript and superscript" script)
4348 (const :tag "Entities" entities))))
4350 (defcustom org-hide-emphasis-markers nil
4351 "Non-nil mean font-lock should hide the emphasis marker characters."
4352 :group 'org-appearance
4353 :type 'boolean)
4355 (defcustom org-hide-macro-markers nil
4356 "Non-nil mean font-lock should hide the brackets marking macro calls."
4357 :group 'org-appearance
4358 :type 'boolean)
4360 (defcustom org-pretty-entities nil
4361 "Non-nil means show entities as UTF8 characters.
4362 When nil, the \\name form remains in the buffer."
4363 :group 'org-appearance
4364 :version "24.1"
4365 :type 'boolean)
4367 (defcustom org-pretty-entities-include-sub-superscripts t
4368 "Non-nil means, pretty entity display includes formatting sub/superscripts."
4369 :group 'org-appearance
4370 :version "24.1"
4371 :type 'boolean)
4373 (defvar org-emph-re nil
4374 "Regular expression for matching emphasis.
4375 After a match, the match groups contain these elements:
4376 0 The match of the full regular expression, including the characters
4377 before and after the proper match
4378 1 The character before the proper match, or empty at beginning of line
4379 2 The proper match, including the leading and trailing markers
4380 3 The leading marker like * or /, indicating the type of highlighting
4381 4 The text between the emphasis markers, not including the markers
4382 5 The character after the match, empty at the end of a line")
4383 (defvar org-verbatim-re nil
4384 "Regular expression for matching verbatim text.")
4385 (defvar org-emphasis-regexp-components) ; defined just below
4386 (defvar org-emphasis-alist) ; defined just below
4387 (defun org-set-emph-re (var val)
4388 "Set variable and compute the emphasis regular expression."
4389 (set var val)
4390 (when (and (boundp 'org-emphasis-alist)
4391 (boundp 'org-emphasis-regexp-components)
4392 org-emphasis-alist org-emphasis-regexp-components)
4393 (let* ((e org-emphasis-regexp-components)
4394 (pre (car e))
4395 (post (nth 1 e))
4396 (border (nth 2 e))
4397 (body (nth 3 e))
4398 (nl (nth 4 e))
4399 (body1 (concat body "*?"))
4400 (markers (mapconcat 'car org-emphasis-alist ""))
4401 (vmarkers (mapconcat
4402 (lambda (x) (if (eq (nth 2 x) 'verbatim) (car x) ""))
4403 org-emphasis-alist "")))
4404 ;; make sure special characters appear at the right position in the class
4405 (if (string-match "\\^" markers)
4406 (setq markers (concat (replace-match "" t t markers) "^")))
4407 (if (string-match "-" markers)
4408 (setq markers (concat (replace-match "" t t markers) "-")))
4409 (if (string-match "\\^" vmarkers)
4410 (setq vmarkers (concat (replace-match "" t t vmarkers) "^")))
4411 (if (string-match "-" vmarkers)
4412 (setq vmarkers (concat (replace-match "" t t vmarkers) "-")))
4413 (if (> nl 0)
4414 (setq body1 (concat body1 "\\(?:\n" body "*?\\)\\{0,"
4415 (int-to-string nl) "\\}")))
4416 ;; Make the regexp
4417 (setq org-emph-re
4418 (concat "\\([" pre "]\\|^\\)"
4419 "\\("
4420 "\\([" markers "]\\)"
4421 "\\("
4422 "[^" border "]\\|"
4423 "[^" border "]"
4424 body1
4425 "[^" border "]"
4426 "\\)"
4427 "\\3\\)"
4428 "\\([" post "]\\|$\\)"))
4429 (setq org-verbatim-re
4430 (concat "\\([" pre "]\\|^\\)"
4431 "\\("
4432 "\\([" vmarkers "]\\)"
4433 "\\("
4434 "[^" border "]\\|"
4435 "[^" border "]"
4436 body1
4437 "[^" border "]"
4438 "\\)"
4439 "\\3\\)"
4440 "\\([" post "]\\|$\\)")))))
4442 ;; This used to be a defcustom (Org <8.0) but allowing the users to
4443 ;; set this option proved cumbersome. See this message/thread:
4444 ;; http://article.gmane.org/gmane.emacs.orgmode/68681
4445 (defvar org-emphasis-regexp-components
4446 '(" \t('\"{" "- \t.,:!?;'\")}\\[" " \t\r\n" "." 1)
4447 "Components used to build the regular expression for emphasis.
4448 This is a list with five entries. Terminology: In an emphasis string
4449 like \" *strong word* \", we call the initial space PREMATCH, the final
4450 space POSTMATCH, the stars MARKERS, \"s\" and \"d\" are BORDER characters
4451 and \"trong wor\" is the body. The different components in this variable
4452 specify what is allowed/forbidden in each part:
4454 pre Chars allowed as prematch. Beginning of line will be allowed too.
4455 post Chars allowed as postmatch. End of line will be allowed too.
4456 border The chars *forbidden* as border characters.
4457 body-regexp A regexp like \".\" to match a body character. Don't use
4458 non-shy groups here, and don't allow newline here.
4459 newline The maximum number of newlines allowed in an emphasis exp.
4461 You need to reload Org or to restart Emacs after customizing this.")
4463 (defcustom org-emphasis-alist
4464 '(("*" bold)
4465 ("/" italic)
4466 ("_" underline)
4467 ("=" org-verbatim verbatim)
4468 ("~" org-code verbatim)
4469 ("+" (:strike-through t)))
4470 "Alist of characters and faces to emphasize text.
4471 Text starting and ending with a special character will be emphasized,
4472 for example *bold*, _underlined_ and /italic/. This variable sets the
4473 marker characters and the face to be used by font-lock for highlighting
4474 in Org-mode Emacs buffers.
4476 You need to reload Org or to restart Emacs after customizing this."
4477 :group 'org-appearance
4478 :set 'org-set-emph-re
4479 :version "24.4"
4480 :package-version '(Org . "8.0")
4481 :type '(repeat
4482 (list
4483 (string :tag "Marker character")
4484 (choice
4485 (face :tag "Font-lock-face")
4486 (plist :tag "Face property list"))
4487 (option (const verbatim)))))
4489 (defvar org-protecting-blocks '("src" "example" "export")
4490 "Blocks that contain text that is quoted, i.e. not processed as Org syntax.
4491 This is needed for font-lock setup.")
4493 ;;; Functions and variables from their packages
4494 ;; Declared here to avoid compiler warnings
4495 (defvar mark-active)
4497 ;; Various packages
4498 (declare-function calc-eval "calc" (str &optional separator &rest args))
4499 (declare-function calendar-forward-day "cal-move" (arg))
4500 (declare-function calendar-goto-date "cal-move" (date))
4501 (declare-function calendar-goto-today "cal-move" ())
4502 (declare-function calendar-iso-from-absolute "cal-iso" (date))
4503 (declare-function calendar-iso-to-absolute "cal-iso" (date))
4504 (declare-function cdlatex-compute-tables "ext:cdlatex" ())
4505 (declare-function cdlatex-tab "ext:cdlatex" ())
4506 (declare-function dired-get-filename
4507 "dired"
4508 (&optional localp no-error-if-not-filep))
4509 (declare-function iswitchb-read-buffer
4510 "iswitchb"
4511 (prompt &optional
4512 default require-match _predicate start matches-set))
4513 (declare-function org-agenda-change-all-lines
4514 "org-agenda"
4515 (newhead hdmarker &optional fixface just-this))
4516 (declare-function org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item
4517 "org-agenda"
4518 (&optional end))
4519 (declare-function org-agenda-copy-local-variable "org-agenda" (var))
4520 (declare-function org-agenda-format-item
4521 "org-agenda"
4522 (extra txt &optional level category tags dotime
4523 remove-re habitp))
4524 (declare-function org-agenda-maybe-redo "org-agenda" ())
4525 (declare-function org-agenda-new-marker "org-agenda" (&optional pos))
4526 (declare-function org-agenda-save-markers-for-cut-and-paste
4527 "org-agenda"
4528 (beg end))
4529 (declare-function org-agenda-set-restriction-lock "org-agenda" (&optional type))
4530 (declare-function org-agenda-skip "org-agenda" ())
4531 (declare-function org-attach-reveal "org-attach" (&optional if-exists))
4532 (declare-function org-gnus-follow-link "org-gnus" (&optional group article))
4533 (declare-function org-indent-mode "org-indent" (&optional arg))
4534 (declare-function org-inlinetask-goto-beginning "org-inlinetask" ())
4535 (declare-function org-inlinetask-goto-end "org-inlinetask" ())
4536 (declare-function org-inlinetask-in-task-p "org-inlinetask" ())
4537 (declare-function org-inlinetask-remove-END-maybe "org-inlinetask" ())
4538 (declare-function orgtbl-send-table "org-table" (&optional maybe))
4539 (declare-function parse-time-string "parse-time" (string))
4540 (declare-function speedbar-line-directory "speedbar" (&optional depth))
4541 (declare-function table--at-cell-p
4542 "table"
4543 (position &optional object at-column))
4545 (defvar align-mode-rules-list)
4546 (defvar calc-embedded-close-formula)
4547 (defvar calc-embedded-open-formula)
4548 (defvar calc-embedded-open-mode)
4549 (defvar font-lock-unfontify-region-function)
4550 (defvar iswitchb-temp-buflist)
4551 (defvar org-agenda-tags-todo-honor-ignore-options)
4552 (defvar remember-data-file)
4553 (defvar texmathp-why)
4555 ;;;###autoload
4556 (defun turn-on-orgtbl ()
4557 "Unconditionally turn on `orgtbl-mode'."
4558 (require 'org-table)
4559 (orgtbl-mode 1))
4561 (defun org-at-table-p (&optional table-type)
4562 "Non-nil if the cursor is inside an Org table.
4563 If TABLE-TYPE is non-nil, also check for table.el-type tables.
4564 If `org-enable-table-editor' is nil, return nil unconditionally."
4565 (and
4566 org-enable-table-editor
4567 (save-excursion
4568 (beginning-of-line)
4569 (looking-at-p (if table-type "[ \t]*[|+]" "[ \t]*|")))
4570 (or (not (derived-mode-p 'org-mode))
4571 (let ((e (org-element-lineage (org-element-at-point) '(table) t)))
4572 (and e (or table-type (eq (org-element-property :type e) 'org)))))))
4573 (define-obsolete-function-alias 'org-table-p 'org-at-table-p "Org 9.0")
4575 (defun org-at-table.el-p ()
4576 "Non-nil when point is at a table.el table."
4577 (and (save-excursion (beginning-of-line) (looking-at "[ \t]*[|+]"))
4578 (let ((element (org-element-at-point)))
4579 (and (eq (org-element-type element) 'table)
4580 (eq (org-element-property :type element) 'table.el)))))
4582 (defun org-table-recognize-table.el ()
4583 "If there is a table.el table nearby, recognize it and move into it."
4584 (when (and org-table-tab-recognizes-table.el (org-at-table.el-p))
4585 (beginning-of-line)
4586 (unless (or (looking-at org-table-dataline-regexp)
4587 (not (looking-at org-table1-hline-regexp)))
4588 (forward-line)
4589 (when (looking-at org-table-any-border-regexp)
4590 (forward-line -2)))
4591 (if (re-search-forward "|" (org-table-end t) t)
4592 (progn
4593 (require 'table)
4594 (if (table--at-cell-p (point)) t
4595 (message "recognizing table.el table...")
4596 (table-recognize-table)
4597 (message "recognizing table.el table...done")))
4598 (error "This should not happen"))))
4599 ;;; This function is not used by org core since commit 6d1e3082, Feb 2010
4600 (make-obsolete 'org-table-recognize-table.el
4601 "please notify the org mailing list if you use this function."
4602 "Org 9.0")
4604 (defun org-at-table-hline-p ()
4605 "Non-nil when point is inside a hline in a table.
4606 Assume point is already in a table. If `org-enable-table-editor'
4607 is nil, return nil unconditionally."
4608 (and org-enable-table-editor
4609 (save-excursion
4610 (beginning-of-line)
4611 (looking-at org-table-hline-regexp))))
4613 (defun org-table-map-tables (function &optional quietly)
4614 "Apply FUNCTION to the start of all tables in the buffer."
4615 (save-excursion
4616 (save-restriction
4617 (widen)
4618 (goto-char (point-min))
4619 (while (re-search-forward org-table-any-line-regexp nil t)
4620 (unless quietly
4621 (message "Mapping tables: %d%%"
4622 (floor (* 100.0 (point)) (buffer-size))))
4623 (beginning-of-line 1)
4624 (when (and (looking-at org-table-line-regexp)
4625 ;; Exclude tables in src/example/verbatim/clocktable blocks
4626 (not (org-in-block-p '("src" "example" "verbatim" "clocktable"))))
4627 (save-excursion (funcall function))
4628 (or (looking-at org-table-line-regexp)
4629 (forward-char 1)))
4630 (re-search-forward org-table-any-border-regexp nil 1))))
4631 (unless quietly (message "Mapping tables: done")))
4633 (declare-function org-clock-save-markers-for-cut-and-paste "org-clock" (beg end))
4634 (declare-function org-clock-update-mode-line "org-clock" ())
4635 (declare-function org-resolve-clocks "org-clock"
4636 (&optional also-non-dangling-p prompt last-valid))
4638 (defun org-at-TBLFM-p (&optional pos)
4639 "Non-nil when point (or POS) is in #+TBLFM line."
4640 (save-excursion
4641 (goto-char (or pos (point)))
4642 (beginning-of-line)
4643 (and (let ((case-fold-search t)) (looking-at org-TBLFM-regexp))
4644 (eq (org-element-type (org-element-at-point)) 'table))))
4646 (defvar org-clock-start-time)
4647 (defvar org-clock-marker (make-marker