Function: org-mode
org-mode is an autoloaded, interactive and byte-compiled function
defined in org.el.gz.
Signature
(org-mode)
Documentation
Outline-based notes management and organizer, alias
"Carsten's outline-mode for keeping track of everything."
Org mode develops organizational tasks around a NOTES file which contains information about projects as plain text. Org mode is implemented on top of Outline mode, which is ideal to keep the content of large files well structured. It supports ToDo items, deadlines and time stamps, which magically appear in the diary listing of the Emacs calendar. Tables are easily created with a built-in table editor. Plain text URL-like links connect to websites, emails (VM), Usenet messages (Gnus), BBDB entries, and any files related to the project. For printing and sharing of notes, an Org file (or a part of it) can be exported as a structured ASCII or HTML file.
The following commands are available:
org-backward-heading-same-level
org-ctrl-c-ret
org-demote-subtree
org-fold-show-children
org-fold-show-subtree
org-forward-heading-same-level
org-kill-note-or-show-branches
org-mark-subtree
org-next-visible-heading
org-previous-visible-heading
org-promote-subtree
<backtab> org-shifttab
<backtab> outline-cycle-buffer
<down-mouse-1> org-mouse-down-mouse
<drag-mouse-3> org-mouse-yank-link
<mouse-3> org-mouse-show-context-menu
C-# org-table-rotate-recalc-marks
C-' org-cycle-agenda-files
C-, org-cycle-agenda-files
C-<return> org-insert-heading-respect-content(var)/org-insert-heading-respect-content(fun)
C-M-<down-mouse-1> foldout-mouse-zoom
C-M-<down-mouse-2> foldout-mouse-show
C-M-<down-mouse-3> foldout-mouse-hide-or-exit
C-M-S-<left> org-decrease-number-at-point
C-M-S-<right> org-increase-number-at-point
C-M-i ispell-complete-word
C-M-i nil
C-M-t org-transpose-element
C-S-<down> org-shiftcontroldown
C-S-<left> org-shiftcontrolleft
C-S-<return> org-insert-todo-heading-respect-content
C-S-<right> org-shiftcontrolright
C-S-<up> org-shiftcontrolup
C-a org-beginning-of-line
C-c ! org-time-stamp-inactive
C-c " a orgtbl-ascii-plot
C-c " g org-plot/gnuplot
C-c # org-update-statistics-cookies
C-c $ org-archive-subtree
C-c % org-mark-ring-push
C-c & org-mark-ring-goto
C-c ' org-edit-special
C-c * org-ctrl-c-star
C-c + org-table-sum
C-c , org-priority
C-c - org-ctrl-c-minus
C-c . org-time-stamp
C-c / org-sparse-tree
C-c : org-toggle-fixed-width
C-c ; org-toggle-comment
C-c < org-date-from-calendar
C-c <down> org-shiftdown
C-c <left> org-shiftleft
C-c <right> org-shiftright
C-c <up> org-shiftup
C-c = org-table-eval-formula
C-c > org-goto-calendar
C-c ? org-table-field-info
C-c @ org-mark-subtree
C-c @ outline-mark-subtree
C-c C-* org-list-make-subtree
C-c C-, org-insert-structure-template
C-c C-< outline-promote
C-c C-<tab> org-cycle-force-archived
C-c C-> outline-demote
C-c C-@ hycontrol-windows-grid
C-c C-M-l org-insert-all-links
C-c C-M-w org-refile-reverse
C-c C-^ org-up-element
C-c C-^ outline-move-subtree-up
C-c C-_ org-down-element
C-c C-a org-attach
C-c C-a outline-show-all
C-c C-b org-backward-heading-same-level
C-c C-b outline-backward-same-level
C-c C-c org-ctrl-c-ctrl-c
C-c C-c outline-hide-entry
C-c C-d org-deadline
C-c C-d outline-hide-subtree
C-c C-e org-export-dispatch
C-c C-e outline-show-entry
C-c C-f org-forward-heading-same-level
C-c C-f outline-forward-same-level
C-c C-j org-goto
C-c C-k org-kill-note-or-show-branches
C-c C-k outline-show-branches
C-c C-l org-insert-link
C-c C-l outline-hide-leaves
C-c C-n outline-next-visible-heading
C-c C-o org-open-at-point
C-c C-o outline-hide-other
C-c C-p outline-previous-visible-heading
C-c C-q org-set-tags-command
C-c C-q outline-hide-sublevels
C-c C-r org-fold-reveal
C-c C-s org-schedule
C-c C-s outline-show-subtree
C-c C-t org-todo
C-c C-t outline-hide-body
C-c C-u outline-up-heading
C-c C-v outline-move-subtree-down
C-c C-v C-M-h org-babel-mark-block
C-c C-v C-a org-babel-sha1-hash
C-c C-v C-b org-babel-execute-buffer
C-c C-v C-c org-babel-check-src-block
C-c C-v C-d org-babel-demarcate-block
C-c C-v C-e org-babel-execute-maybe
C-c C-v C-f org-babel-tangle-file
C-c C-v C-j org-babel-insert-header-arg
C-c C-v C-l org-babel-load-in-session
C-c C-v C-n org-babel-next-src-block
C-c C-v C-o org-babel-open-src-block-result
C-c C-v C-p org-babel-previous-src-block
C-c C-v C-r org-babel-goto-named-result
C-c C-v C-s org-babel-execute-subtree
C-c C-v C-t org-babel-tangle
C-c C-v C-u org-babel-goto-src-block-head
C-c C-v C-v org-babel-expand-src-block
C-c C-v C-x org-babel-do-key-sequence-in-edit-buffer
C-c C-v C-z org-babel-switch-to-session
C-c C-v I org-babel-view-src-block-info
C-c C-v TAB org-babel-view-src-block-info
C-c C-v a org-babel-sha1-hash
C-c C-v b org-babel-execute-buffer
C-c C-v c org-babel-check-src-block
C-c C-v d org-babel-demarcate-block
C-c C-v e org-babel-execute-maybe
C-c C-v f org-babel-tangle-file
C-c C-v g org-babel-goto-named-src-block
C-c C-v h org-babel-describe-bindings
C-c C-v i org-babel-lob-ingest
C-c C-v j org-babel-insert-header-arg
C-c C-v k org-babel-remove-result-one-or-many
C-c C-v l org-babel-load-in-session
C-c C-v n org-babel-next-src-block
C-c C-v o org-babel-open-src-block-result
C-c C-v p org-babel-previous-src-block
C-c C-v r org-babel-goto-named-result
C-c C-v s org-babel-execute-subtree
C-c C-v t org-babel-tangle
C-c C-v u org-babel-goto-src-block-head
C-c C-v v org-babel-expand-src-block
C-c C-v x org-babel-do-key-sequence-in-edit-buffer
C-c C-v z org-babel-switch-to-session-with-code
C-c C-w org-refile
C-c C-x foldout-exit-fold
C-c C-x ! org-reload
C-c C-x , org-timer-pause-or-continue
C-c C-x - org-timer-item
C-c C-x . org-timer
C-c C-x 0 org-timer-start
C-c C-x ; org-timer-set-timer
C-c C-x < org-agenda-set-restriction-lock
C-c C-x <left> org-shiftcontrolleft
C-c C-x <right> org-shiftcontrolright
C-c C-x > org-agenda-remove-restriction-lock
C-c C-x @ org-cite-insert
C-c C-x A org-archive-to-archive-sibling
C-c C-x C-M-v org-redisplay-inline-images
C-c C-x C-a org-archive-subtree-default
C-c C-x C-b org-toggle-checkbox
C-c C-x C-c org-columns
C-c C-x C-d org-clock-display
C-c C-x C-e org-clock-modify-effort-estimate
C-c C-x C-f org-emphasize
C-c C-x C-j org-clock-goto
C-c C-x C-l org-latex-preview
C-c C-x C-n org-next-link
C-c C-x C-o org-clock-out
C-c C-x C-p org-previous-link
C-c C-x C-q org-clock-cancel
C-c C-x C-r org-toggle-radio-button
C-c C-x C-s org-archive-subtree
C-c C-x C-t org-toggle-time-stamp-overlays
C-c C-x C-u org-dblock-update
C-c C-x C-v org-toggle-inline-images
C-c C-x C-w org-cut-special
C-c C-x C-x org-clock-in-last
C-c C-x C-y org-paste-special
C-c C-x C-z org-resolve-clocks
C-c C-x D org-shiftmetadown
C-c C-x E org-inc-effort
C-c C-x G org-feed-goto-inbox
C-c C-x I org-info-find-node
C-c C-x L org-shiftmetaleft
C-c C-x M org-insert-todo-heading
C-c C-x M-w org-copy-special
C-c C-x P org-set-property-and-value
C-c C-x R org-shiftmetaright
C-c C-x RET org-meta-return
C-c C-x TAB org-clock-in
C-c C-x U org-shiftmetaup
C-c C-x [ org-reftex-citation
C-c C-x \ org-toggle-pretty-entities
C-c C-x _ org-timer-stop
C-c C-x a org-toggle-archive-tag
C-c C-x b org-tree-to-indirect-buffer
C-c C-x c org-clone-subtree-with-time-shift
C-c C-x d org-insert-drawer
C-c C-x e org-set-effort
C-c C-x f org-footnote-action
C-c C-x g org-feed-update-all
C-c C-x l org-metaleft
C-c C-x m org-meta-return
C-c C-x o org-toggle-ordered-property
C-c C-x p org-set-property
C-c C-x q org-toggle-tags-groups
C-c C-x r org-metaright
C-c C-x t org-inlinetask-insert-task
C-c C-x u org-metaup
C-c C-x v org-copy-visible
C-c C-x x org-dynamic-block-insert-dblock
C-c C-y org-evaluate-time-range
C-c C-z foldout-zoom-subtree
C-c C-z org-add-note
C-c M-b org-previous-block
C-c M-f org-next-block
C-c M-l org-insert-last-stored-link
C-c M-w org-refile-copy
C-c RET org-ctrl-c-ret
C-c RET outline-insert-heading
C-c TAB org-ctrl-c-tab
C-c TAB outline-show-children
C-c [ org-agenda-file-to-front
C-c \ org-match-sparse-tree
C-c ] org-remove-file
C-c ^ org-sort
C-c ` org-table-edit-field
C-c { org-table-toggle-formula-debugger
C-c | org-table-create-or-convert-from-region
C-c } org-table-toggle-coordinate-overlays
C-c ~ org-table-create-with-table.el
C-d org-delete-char
C-e org-end-of-line
C-j org-return-and-maybe-indent
C-k org-kill-line
C-o org-open-line
C-x n b org-narrow-to-block
C-x n e org-narrow-to-element
C-x n s org-narrow-to-subtree
C-y org-yank
DEL org-delete-backward-char
ESC <down> org-metadown
ESC <left> org-metaleft
ESC <right> org-metaright
ESC <up> org-metaup
ESC S-<down> org-shiftmetadown
ESC S-<left> org-shiftmetaleft
ESC S-<right> org-shiftmetaright
ESC S-<up> org-shiftmetaup
M-; org-comment-dwim
M-<down> org-metadown
M-<left> org-metaleft
M-<right> org-metaright
M-<up> org-metaup
M-RET org-meta-return
M-S-<down> org-shiftmetadown
M-S-<left> org-shiftmetaleft
M-S-<return> org-insert-todo-heading
M-S-<right> org-shiftmetaright
M-S-<up> org-shiftmetaup
M-S-RET org-insert-todo-heading
M-^ org-delete-indentation
M-a org-backward-sentence
M-e org-forward-sentence
M-h org-mark-element
M-q org-fill-paragraph
M-t org-transpose-words
M-{ org-backward-element
M-{ org-backward-paragraph
M-} org-forward-element
M-} org-forward-paragraph
RET org-return
S-<down> org-shiftdown
S-<left> org-shiftleft
S-<mouse-2> org-mouse-yank-link
S-<return> org-table-copy-down
S-<right> org-shiftright
S-<up> org-shiftup
S-RET org-table-copy-down
S-TAB org-shifttab
SPC..~ org-self-insert-command
TAB org-cycle
| org-force-self-insert
In addition to any hooks its parent mode outline-mode might have
run, this mode runs the hook org-mode-hook, as the final or
penultimate step during initialization.
Probably introduced at or before Emacs version 22.1.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/org/org.el.gz
;;;###autoload
(define-derived-mode org-mode outline-mode "Org"
"Outline-based notes management and organizer, alias
\"Carsten's outline-mode for keeping track of everything.\"
Org mode develops organizational tasks around a NOTES file which
contains information about projects as plain text. Org mode is
implemented on top of Outline mode, which is ideal to keep the content
of large files well structured. It supports ToDo items, deadlines and
time stamps, which magically appear in the diary listing of the Emacs
calendar. Tables are easily created with a built-in table editor.
Plain text URL-like links connect to websites, emails (VM), Usenet
messages (Gnus), BBDB entries, and any files related to the project.
For printing and sharing of notes, an Org file (or a part of it)
can be exported as a structured ASCII or HTML file.
The following commands are available:
\\{org-mode-map}"
(setq-local org-mode-loading t)
(org-load-modules-maybe)
(when org-agenda-file-menu-enabled
(org-install-agenda-files-menu))
(when (and org-link-descriptive
(eq org-fold-core-style 'overlays))
(add-to-invisibility-spec '(org-link)))
(org-fold-initialize (or (and (stringp org-ellipsis) (not (equal "" org-ellipsis)) org-ellipsis)
"..."))
(make-local-variable 'org-link-descriptive)
(when (eq org-fold-core-style 'overlays) (add-to-invisibility-spec '(org-hide-block . t)))
(if org-link-descriptive
(org-fold-core-set-folding-spec-property (car org-link--link-folding-spec) :visible nil)
(org-fold-core-set-folding-spec-property (car org-link--link-folding-spec) :visible t))
(setq-local outline-regexp org-outline-regexp)
(setq-local outline-level 'org-outline-level)
(when (and (stringp org-ellipsis) (not (equal "" org-ellipsis)))
(unless org-display-table
(setq org-display-table (make-display-table)))
(set-display-table-slot
org-display-table 4
(vconcat (mapcar (lambda (c) (make-glyph-code c 'org-ellipsis))
org-ellipsis)))
(setq buffer-display-table org-display-table))
(org-set-regexps-and-options)
(org-set-font-lock-defaults)
(when (and org-tag-faces (not org-tags-special-faces-re))
;; tag faces set outside customize.... force initialization.
(org-set-tag-faces 'org-tag-faces org-tag-faces))
;; Calc embedded
(setq-local calc-embedded-open-mode "# ")
;; Modify a few syntax entries
(modify-syntax-entry ?\" "\"")
(modify-syntax-entry ?\\ "_")
(modify-syntax-entry ?~ "_")
(modify-syntax-entry ?< "(>")
(modify-syntax-entry ?> ")<")
(setq-local font-lock-unfontify-region-function 'org-unfontify-region)
;; Activate before-change-function
(setq-local org-table-may-need-update t)
(add-hook 'before-change-functions 'org-before-change-function nil 'local)
;; Check for running clock before killing a buffer
(add-hook 'kill-buffer-hook 'org-check-running-clock nil 'local)
;; Initialize cache.
(org-element-cache-reset)
(when (and org-element-cache-persistent
org-element-use-cache)
(org-persist-load 'org-element--cache (current-buffer) t))
;; Initialize macros templates.
(org-macro-initialize-templates)
;; Initialize radio targets.
(org-update-radio-target-regexp)
;; Indentation.
(setq-local indent-line-function 'org-indent-line)
(setq-local indent-region-function 'org-indent-region)
;; Filling and auto-filling.
(org-setup-filling)
;; Comments.
(org-setup-comments-handling)
;; Beginning/end of defun
(setq-local beginning-of-defun-function 'org-backward-element)
(setq-local end-of-defun-function
(lambda ()
(if (not (org-at-heading-p))
(org-forward-element)
(org-forward-element)
(forward-char -1))))
;; Next error for sparse trees
(setq-local next-error-function 'org-occur-next-match)
;; Make commit log messages from Org documents easier.
(setq-local add-log-current-defun-function #'org-add-log-current-headline)
;; Make sure dependence stuff works reliably, even for users who set it
;; too late :-(
(if org-enforce-todo-dependencies
(add-hook 'org-blocker-hook
'org-block-todo-from-children-or-siblings-or-parent)
(remove-hook 'org-blocker-hook
'org-block-todo-from-children-or-siblings-or-parent))
(if org-enforce-todo-checkbox-dependencies
(add-hook 'org-blocker-hook
'org-block-todo-from-checkboxes)
(remove-hook 'org-blocker-hook
'org-block-todo-from-checkboxes))
;; Align options lines
(setq-local
align-mode-rules-list
'((org-in-buffer-settings
(regexp . "^[ \t]*#\\+[A-Z_]+:\\(\\s-*\\)\\S-+")
(modes . '(org-mode)))))
;; Setup the pcomplete hooks
(setq-local pcomplete-command-completion-function #'org-pcomplete-initial)
(setq-local pcomplete-command-name-function #'org-command-at-point)
(setq-local pcomplete-default-completion-function #'ignore)
(setq-local pcomplete-parse-arguments-function #'org-parse-arguments)
(setq-local pcomplete-termination-string "")
(add-hook 'completion-at-point-functions
#'pcomplete-completions-at-point nil t)
(setq-local buffer-face-mode-face 'org-default)
;; If empty file that did not turn on Org mode automatically, make
;; it to.
(when (and org-insert-mode-line-in-empty-file
(called-interactively-p 'any)
(= (point-min) (point-max)))
(insert "# -*- mode: org -*-\n\n"))
(unless org-inhibit-startup
(when (or org-startup-align-all-tables org-startup-shrink-all-tables)
(org-table-map-tables
(cond ((and org-startup-align-all-tables
org-startup-shrink-all-tables)
(lambda () (org-table-align) (org-table-shrink)))
(org-startup-align-all-tables #'org-table-align)
(t #'org-table-shrink))
t))
;; Suppress modification hooks to speed up the startup.
;; However, do it only when text properties/overlays, but not
;; buffer text are actually modified. We still need to track text
;; modifications to make cache updates work reliably.
(org-unmodified
(when org-startup-with-beamer-mode (org-beamer-mode))
(when org-startup-with-inline-images (org-display-inline-images))
(when org-startup-with-latex-preview (org-latex-preview '(16)))
(unless org-inhibit-startup-visibility-stuff (org-cycle-set-startup-visibility))
(when org-startup-truncated (setq truncate-lines t))
(when org-startup-numerated (require 'org-num) (org-num-mode 1))
(when org-startup-indented (require 'org-indent) (org-indent-mode 1))))
;; Add a custom keymap for `visual-line-mode' so that activating
;; this minor mode does not override Org's keybindings.
;; FIXME: Probably `visual-line-mode' should take care of this.
(let ((oldmap (cdr (assoc 'visual-line-mode minor-mode-map-alist)))
(newmap (make-sparse-keymap)))
(set-keymap-parent newmap oldmap)
(define-key newmap [remap move-beginning-of-line] nil)
(define-key newmap [remap move-end-of-line] nil)
(define-key newmap [remap kill-line] nil)
(make-local-variable 'minor-mode-overriding-map-alist)
(push `(visual-line-mode . ,newmap) minor-mode-overriding-map-alist))
;; Activate `org-table-header-line-mode'
(when org-table-header-line-p
(org-table-header-line-mode 1))
;; Try to set `org-hide' face correctly.
(let ((foreground (org-find-invisible-foreground)))
(when foreground
(set-face-foreground 'org-hide foreground)))
;; Set face extension as requested.
(org--set-faces-extend '(org-block-begin-line org-block-end-line)
org-fontify-whole-block-delimiter-line)
(org--set-faces-extend org-level-faces org-fontify-whole-heading-line)
(setq-local org-mode-loading nil))