5 |
;; Author: Carsten Dominik <dominik at science dot uva dot nl> |
;; Author: Carsten Dominik <dominik at science dot uva dot nl> |
6 |
;; Keywords: outlines, hypermedia, calendar |
;; Keywords: outlines, hypermedia, calendar |
7 |
;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/ |
;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/ |
8 |
;; Version: 3.15 |
;; Version: 3.16 |
9 |
;; |
;; |
10 |
;; This file is part of GNU Emacs. |
;; This file is part of GNU Emacs. |
11 |
;; |
;; |
80 |
;; |
;; |
81 |
;; Changes: |
;; Changes: |
82 |
;; ------- |
;; ------- |
83 |
|
;; Version 3.16 |
84 |
|
;; - In tables, directly after the field motion commands like TAB and RET, |
85 |
|
;; typing a character will blank the field. Can be turned off with |
86 |
|
;; variable `org-table-auto-blank-field'. |
87 |
|
;; - Inactive timestamps with `C-c !'. These do not trigger the agenda |
88 |
|
;; and are not linked to the calendar. |
89 |
|
;; - Additional key bindings to allow Org-mode to function on a tty emacs. |
90 |
|
;; - `C-c C-h' prefix key replaced by `C-c C-x', and `C-c C-x C-h' replaced |
91 |
|
;; by `C-c C-x b' (b=Browser). This was necessary to recover the |
92 |
|
;; standard meaning of C-h after a prefix key (show prefix bindings). |
93 |
|
;; |
94 |
;; Version 3.15 |
;; Version 3.15 |
95 |
;; - QUOTE keyword at the beginning of an entry causes fixed-width export |
;; - QUOTE keyword at the beginning of an entry causes fixed-width export |
96 |
;; of unmodified entry text. `C-c :' toggles this keyword. |
;; of unmodified entry text. `C-c :' toggles this keyword. |
210 |
|
|
211 |
;;; Customization variables |
;;; Customization variables |
212 |
|
|
213 |
(defvar org-version "3.15" |
(defvar org-version "3.16" |
214 |
"The version number of the file org.el.") |
"The version number of the file org.el.") |
215 |
(defun org-version () |
(defun org-version () |
216 |
(interactive) |
(interactive) |
854 |
:group 'org-structure |
:group 'org-structure |
855 |
:type 'hook) |
:type 'hook) |
856 |
|
|
857 |
|
(defcustom org-level-color-stars-only nil |
858 |
|
"Non-nil means fontify only the stars in each headline. |
859 |
|
When nil, the entire headline is fontified. |
860 |
|
After changin this, requires restart of Emacs to become effective." |
861 |
|
:group 'org-structure |
862 |
|
:type 'boolean) |
863 |
|
|
864 |
(defcustom org-adapt-indentation t |
(defcustom org-adapt-indentation t |
865 |
"Non-nil means, adapt indentation when promoting and demoting. |
"Non-nil means, adapt indentation when promoting and demoting. |
866 |
When this is set and the *entire* text in an entry is indented, the |
When this is set and the *entire* text in an entry is indented, the |
870 |
:group 'org-structure |
:group 'org-structure |
871 |
:type 'boolean) |
:type 'boolean) |
872 |
|
|
873 |
|
(defcustom org-enable-fixed-width-editor t |
874 |
|
"Non-nil means, lines starting with \":\" are treated as fixed-width. |
875 |
|
This currently only means, they are never auto-wrapped. |
876 |
|
When nil, such lines will be treated like ordinary lines. |
877 |
|
See also the QUOTE keyword." |
878 |
|
:group 'org-structure |
879 |
|
:type 'boolean) |
880 |
|
|
881 |
(defcustom org-cycle-emulate-tab t |
(defcustom org-cycle-emulate-tab t |
882 |
"Where should `org-cycle' emulate TAB. |
"Where should `org-cycle' emulate TAB. |
883 |
nil Never |
nil Never |
1181 |
field does not exceed the column width. |
field does not exceed the column width. |
1182 |
- Minimize the number of realigns. Normally, the table is aligned each time |
- Minimize the number of realigns. Normally, the table is aligned each time |
1183 |
TAB or RET are pressed to move to another field. With optimization this |
TAB or RET are pressed to move to another field. With optimization this |
1184 |
happens only if changes to a field might have changed the column width. |
happens only if changes to a field might have changed the column width. |
1185 |
Optimization requires replacing the functions `self-insert-command', |
Optimization requires replacing the functions `self-insert-command', |
1186 |
`delete-char', and `backward-delete-char' in Org-mode buffers, with a |
`delete-char', and `backward-delete-char' in Org-mode buffers, with a |
1187 |
slight (in fact: unnoticeable) speed impact for normal typing. Org-mode is |
slight (in fact: unnoticeable) speed impact for normal typing. Org-mode is |
1188 |
very good at guessing when a re-align will be necessary, but you can always |
very good at guessing when a re-align will be necessary, but you can always |
1189 |
force one with `C-c C-c'. |
force one with \\[org-ctrl-c-ctrl-c]. |
1190 |
|
|
1191 |
If you would like to use the optimized version in Org-mode, but the |
If you would like to use the optimized version in Org-mode, but the |
1192 |
un-optimized version in OrgTbl-mode, see the variable `orgtbl-optimized'. |
un-optimized version in OrgTbl-mode, see the variable `orgtbl-optimized'. |
1193 |
|
|
1194 |
This variable can be used to turn on and off the table editor during a session, |
This variable can be used to turn on and off the table editor during a session, |
1195 |
but in order to toggle optimization, a restart is required." |
but in order to toggle optimization, a restart is required. |
1196 |
|
|
1197 |
|
See also the variable `org-table-auto-blank-field'." |
1198 |
:group 'org-table |
:group 'org-table |
1199 |
:type '(choice |
:type '(choice |
1200 |
(const :tag "off" nil) |
(const :tag "off" nil) |
1201 |
(const :tag "on" t) |
(const :tag "on" t) |
1202 |
(const :tag "on, optimized" optimized))) |
(const :tag "on, optimized" optimized))) |
1203 |
|
|
1204 |
|
(defcustom org-table-auto-blank-field t |
1205 |
|
"Non-nil means, automatically blank table field when starting to type into it. |
1206 |
|
This only happens when typing immediately after a field motion |
1207 |
|
command (TAB, S-TAB or RET). |
1208 |
|
Only relevant when `org-enable-table-editor' is equal to `optimized'." |
1209 |
|
:group 'org-table |
1210 |
|
:type 'boolean) |
1211 |
|
|
1212 |
(defcustom org-table-default-size "5x2" |
(defcustom org-table-default-size "5x2" |
1213 |
"The default size for newly created tables, Columns x Rows." |
"The default size for newly created tables, Columns x Rows." |
1214 |
:group 'org-table |
:group 'org-table |
1284 |
:group 'org-table |
:group 'org-table |
1285 |
:type 'boolean) |
:type 'boolean) |
1286 |
|
|
|
;; FIXME: Should this one be in another group? Which one? |
|
|
(defcustom org-enable-fixed-width-editor t |
|
|
"Non-nil means, lines starting with \":\" are treated as fixed-width. |
|
|
This currently only means, they are never auto-wrapped. |
|
|
When nil, such lines will be treated like ordinary lines." |
|
|
:group 'org-table |
|
|
:type 'boolean) |
|
|
|
|
1287 |
(defgroup org-table-calculation nil |
(defgroup org-table-calculation nil |
1288 |
"Options concerning tables in Org-mode." |
"Options concerning tables in Org-mode." |
1289 |
:tag "Org Table Calculation" |
:tag "Org Table Calculation" |
2006 |
(append |
(append |
2007 |
(if org-noutline-p ; FIXME: I am not sure if eval will work |
(if org-noutline-p ; FIXME: I am not sure if eval will work |
2008 |
; on XEmacs if noutline is ever ported |
; on XEmacs if noutline is ever ported |
2009 |
'((eval . (list "^\\(\\*+\\).*" |
`((eval . (list "^\\(\\*+\\).*" |
2010 |
0 '(nth |
,(if org-level-color-stars-only 1 0) |
2011 |
|
'(nth ;; FIXME: 1<->0 ???? |
2012 |
(% (- (match-end 1) (match-beginning 1) 1) |
(% (- (match-end 1) (match-beginning 1) 1) |
2013 |
org-n-levels) |
org-n-levels) |
2014 |
org-level-faces) |
org-level-faces) |
2015 |
nil t))) |
nil t))) |
2016 |
'(("^\\(\\(\\*+\\)[^\r\n]*\\)[\n\r]" |
`(("^\\(\\(\\*+\\)[^\r\n]*\\)[\n\r]" |
2017 |
(1 (nth (% (- (match-end 2) (match-beginning 2) 1) |
(,(if org-level-color-stars-only 2 0) |
2018 |
org-n-levels) |
(nth (% (- (match-end 2) (match-beginning 2) 1) |
2019 |
org-level-faces) |
org-n-levels) |
2020 |
nil t)))) |
org-level-faces) |
2021 |
|
nil t)))) |
2022 |
org-font-lock-extra-keywords)) |
org-font-lock-extra-keywords)) |
2023 |
(set (make-local-variable 'font-lock-defaults) |
(set (make-local-variable 'font-lock-defaults) |
2024 |
'(org-font-lock-keywords t nil nil backward-paragraph)) |
'(org-font-lock-keywords t nil nil backward-paragraph)) |
2836 |
(insert " ")) |
(insert " ")) |
2837 |
(if (and (equal type :opt) (assoc completion table)) |
(if (and (equal type :opt) (assoc completion table)) |
2838 |
(message "%s" (substitute-command-keys |
(message "%s" (substitute-command-keys |
2839 |
"Press \\[org-complete] again to insert example settings")))) |
"Press \\[org-complete] again to insert example settings")))) |
2840 |
(t |
(t |
2841 |
(message "Making completion list...") |
(message "Making completion list...") |
2842 |
(let ((list (sort (all-completions pattern table) 'string<))) |
(let ((list (sort (all-completions pattern table) 'string<))) |
2943 |
(format-time-string (car org-time-stamp-formats) |
(format-time-string (car org-time-stamp-formats) |
2944 |
(org-read-date nil 'to-time))) |
(org-read-date nil 'to-time))) |
2945 |
(message "%s" (substitute-command-keys |
(message "%s" (substitute-command-keys |
2946 |
"Use \\[org-timestamp-up-day] and \\[org-timestamp-down-day] to change the date."))) |
"Use \\[org-timestamp-up-day] and \\[org-timestamp-down-day] to change the date."))) |
2947 |
|
|
2948 |
(defun org-schedule () |
(defun org-schedule () |
2949 |
"Insert the SCHEDULED: string to schedule a TODO item. |
"Insert the SCHEDULED: string to schedule a TODO item. |
2955 |
(format-time-string (car org-time-stamp-formats) |
(format-time-string (car org-time-stamp-formats) |
2956 |
(org-read-date nil 'to-time))) |
(org-read-date nil 'to-time))) |
2957 |
(message "%s" (substitute-command-keys |
(message "%s" (substitute-command-keys |
2958 |
"Use \\[org-timestamp-up-day] and \\[org-timestamp-down-day] to change the date."))) |
"Use \\[org-timestamp-up-day] and \\[org-timestamp-down-day] to change the date."))) |
2959 |
|
|
2960 |
|
|
2961 |
(defun org-occur (regexp &optional callback) |
(defun org-occur (regexp &optional callback) |
3107 |
(if org-time-was-given (setq fmt (cdr org-time-stamp-formats))) |
(if org-time-was-given (setq fmt (cdr org-time-stamp-formats))) |
3108 |
(insert (format-time-string fmt time)))))) |
(insert (format-time-string fmt time)))))) |
3109 |
|
|
3110 |
|
(defun org-time-stamp-inactive (&optional arg) |
3111 |
|
"Insert an inactive time stamp. |
3112 |
|
An inactive time stamp is enclosed in square brackets instead of angle |
3113 |
|
brackets. It is inactive in the sense that it does not trigger agenda entries, |
3114 |
|
does not link to the calendar and cannot be changed with the S-cursor keys." |
3115 |
|
(interactive "P") |
3116 |
|
(let ((fmt (if arg (cdr org-time-stamp-formats) |
3117 |
|
(car org-time-stamp-formats))) |
3118 |
|
(org-time-was-given nil) |
3119 |
|
time) |
3120 |
|
(setq time (org-read-date arg 'totime)) |
3121 |
|
(if org-time-was-given (setq fmt (cdr org-time-stamp-formats))) |
3122 |
|
(setq fmt (concat "[" (substring fmt 1 -1) "]")) |
3123 |
|
(insert (format-time-string fmt time)))) |
3124 |
|
|
3125 |
;;; FIXME: Make the function take "Fri" as "next friday" |
;;; FIXME: Make the function take "Fri" as "next friday" |
3126 |
(defun org-read-date (&optional with-time to-time) |
(defun org-read-date (&optional with-time to-time) |
3127 |
"Read a date and make things smooth for the user. |
"Read a date and make things smooth for the user. |
3584 |
(define-key org-agenda-mode-map "w" 'org-agenda-week-view) |
(define-key org-agenda-mode-map "w" 'org-agenda-week-view) |
3585 |
(define-key org-agenda-mode-map (org-key 'S-right) 'org-agenda-date-later) |
(define-key org-agenda-mode-map (org-key 'S-right) 'org-agenda-date-later) |
3586 |
(define-key org-agenda-mode-map (org-key 'S-left) 'org-agenda-date-earlier) |
(define-key org-agenda-mode-map (org-key 'S-left) 'org-agenda-date-earlier) |
3587 |
|
(define-key org-agenda-mode-map [?\C-c ?\C-x (right)] 'org-agenda-date-later) |
3588 |
|
(define-key org-agenda-mode-map [?\C-c ?\C-x (left)] 'org-agenda-date-earlier) |
3589 |
|
|
3590 |
(define-key org-agenda-mode-map ">" 'org-agenda-date-prompt) |
(define-key org-agenda-mode-map ">" 'org-agenda-date-prompt) |
3591 |
(let ((l '(1 2 3 4 5 6 7 8 9 0))) |
(let ((l '(1 2 3 4 5 6 7 8 9 0))) |
3621 |
(define-key org-agenda-mode-map "-" 'org-agenda-priority-down) |
(define-key org-agenda-mode-map "-" 'org-agenda-priority-down) |
3622 |
(define-key org-agenda-mode-map (org-key 'S-up) 'org-agenda-priority-up) |
(define-key org-agenda-mode-map (org-key 'S-up) 'org-agenda-priority-up) |
3623 |
(define-key org-agenda-mode-map (org-key 'S-down) 'org-agenda-priority-down) |
(define-key org-agenda-mode-map (org-key 'S-down) 'org-agenda-priority-down) |
3624 |
|
(define-key org-agenda-mode-map [?\C-c ?\C-x (up)] 'org-agenda-priority-up) |
3625 |
|
(define-key org-agenda-mode-map [?\C-c ?\C-x (down)] 'org-agenda-priority-down) |
3626 |
(define-key org-agenda-mode-map [(right)] 'org-agenda-later) |
(define-key org-agenda-mode-map [(right)] 'org-agenda-later) |
3627 |
(define-key org-agenda-mode-map [(left)] 'org-agenda-earlier) |
(define-key org-agenda-mode-map [(left)] 'org-agenda-earlier) |
3628 |
|
|
6370 |
|
|
6371 |
(defun org-table-check-inside-data-field () |
(defun org-table-check-inside-data-field () |
6372 |
"Is point inside a table data field? |
"Is point inside a table data field? |
6373 |
I.e. not on a hline or before the first or after the last column?" |
I.e. not on a hline or before the first or after the last column? |
6374 |
|
This actually throws an error, so it aborts the current command." |
6375 |
(if (or (not (org-at-table-p)) |
(if (or (not (org-at-table-p)) |
6376 |
(= (org-table-current-column) 0) |
(= (org-table-current-column) 0) |
6377 |
(org-at-table-hline-p) |
(org-at-table-hline-p) |
7064 |
(format "%d:%02d:%02d" h m s)))) |
(format "%d:%02d:%02d" h m s)))) |
7065 |
(kill-new sres) |
(kill-new sres) |
7066 |
(if (interactive-p) |
(if (interactive-p) |
7067 |
(message "%s" |
(message "s" |
7068 |
(concat |
(substitute-command-keys |
7069 |
(format "Sum of %d items: %-20s " (length numbers) sres) |
(format "Sum of %d items: %-20s (\\[yank] will insert result into buffer)" |
7070 |
(substitute-command-keys |
(length numbers) sres)))) |
|
"(\\[yank] will insert result into buffer)") |
|
|
)) |
|
|
) |
|
7071 |
sres)))) |
sres)))) |
7072 |
|
|
7073 |
(defun org-table-get-number-for-summing (s) |
(defun org-table-get-number-for-summing (s) |
7173 |
(stored-list (org-table-get-stored-formulas)) |
(stored-list (org-table-get-stored-formulas)) |
7174 |
(stored (cdr (assoc scol stored-list))) |
(stored (cdr (assoc scol stored-list))) |
7175 |
(eq (cond |
(eq (cond |
7176 |
((and stored equation (string-match "^ *= *$" equation)) |
((and stored equation (string-match "^ *=? *$" equation)) |
7177 |
stored) |
stored) |
7178 |
((stringp equation) |
((stringp equation) |
7179 |
equation) |
equation) |
7341 |
(when org-table-formula-evaluate-inline |
(when org-table-formula-evaluate-inline |
7342 |
(let* ((field (org-trim (or (org-table-get-field) ""))) |
(let* ((field (org-trim (or (org-table-get-field) ""))) |
7343 |
named eq) |
named eq) |
7344 |
(when (string-match "^:?=\\(.+\\)" field) |
(when (string-match "^:?=\\(.*\\)" field) |
7345 |
(setq named (equal (string-to-char field) ?:) |
(setq named (equal (string-to-char field) ?:) |
7346 |
eq (match-string 1 field)) |
eq (match-string 1 field)) |
7347 |
(if (fboundp 'calc-eval) |
(if (fboundp 'calc-eval) |
7963 |
'("\C-c\M-w" org-table-copy-region) |
'("\C-c\M-w" org-table-copy-region) |
7964 |
'("\C-c\C-y" org-table-paste-rectangle) |
'("\C-c\C-y" org-table-paste-rectangle) |
7965 |
'("\C-c-" org-table-insert-hline) |
'("\C-c-" org-table-insert-hline) |
7966 |
'([(shift tab)] org-table-previous-field) |
; '([(shift tab)] org-table-previous-field) |
|
'("\C-c\C-c" org-ctrl-c-ctrl-c) |
|
7967 |
'("\C-m" org-table-next-row) |
'("\C-m" org-table-next-row) |
7968 |
(list (org-key 'S-return) 'org-table-copy-down) |
(list (org-key 'S-return) 'org-table-copy-down) |
7969 |
'([(meta return)] org-table-wrap-region) |
'([(meta return)] org-table-wrap-region) |
7992 |
(orgtbl-make-binding 'orgtbl-tab 102 [(tab)] "\C-i")) |
(orgtbl-make-binding 'orgtbl-tab 102 [(tab)] "\C-i")) |
7993 |
(define-key orgtbl-mode-map "\C-i" |
(define-key orgtbl-mode-map "\C-i" |
7994 |
(orgtbl-make-binding 'orgtbl-tab 103 "\C-i" [(tab)]))) |
(orgtbl-make-binding 'orgtbl-tab 103 "\C-i" [(tab)]))) |
7995 |
|
(define-key orgtbl-mode-map "\C-i" |
7996 |
|
(orgtbl-make-binding 'orgtbl-tab 104 [(shift tab)])) |
7997 |
|
(define-key orgtbl-mode-map "\C-c\C-c" |
7998 |
|
(orgtbl-make-binding 'org-ctrl-c-ctrl-c 105 "\C-c\C-c")) |
7999 |
(when orgtbl-optimized |
(when orgtbl-optimized |
8000 |
;; If the user wants maximum table support, we need to hijack |
;; If the user wants maximum table support, we need to hijack |
8001 |
;; some standard editing functions |
;; some standard editing functions |
8002 |
(substitute-key-definition 'self-insert-command 'orgtbl-self-insert-command |
(org-remap orgtbl-mode-map |
8003 |
orgtbl-mode-map global-map) |
'self-insert-command 'orgtbl-self-insert-command |
8004 |
(substitute-key-definition 'delete-char 'orgtbl-delete-char |
'delete-char 'orgtbl-delete-char |
8005 |
orgtbl-mode-map global-map) |
'delete-backward-char 'orgtbl-delete-backward-char) |
8006 |
(substitute-key-definition 'delete-backward-char 'orgtbl-delete-backward-char |
(define-key orgtbl-mode-map "|" 'org-force-self-insert)) |
|
orgtbl-mode-map global-map) |
|
|
(define-key org-mode-map "|" 'self-insert-command)) |
|
8007 |
(easy-menu-define orgtbl-mode-menu orgtbl-mode-map "OrgTbl menu" |
(easy-menu-define orgtbl-mode-menu orgtbl-mode-map "OrgTbl menu" |
8008 |
'("OrgTbl" |
'("OrgTbl" |
8009 |
["Align" org-ctrl-c-ctrl-c :active (org-at-table-p) :keys "C-c C-c"] |
["Align" org-ctrl-c-ctrl-c :active (org-at-table-p) :keys "C-c C-c"] |
8028 |
"--" |
"--" |
8029 |
["Insert Hline" org-table-insert-hline :active (org-at-table-p) :keys "C-c -"]) |
["Insert Hline" org-table-insert-hline :active (org-at-table-p) :keys "C-c -"]) |
8030 |
("Rectangle" |
("Rectangle" |
8031 |
["Copy Rectangle" org-copy-special :active (org-at-table-p) :keys "C-c M-w"] |
["Copy Rectangle" org-copy-special :active (org-at-table-p) :keys "C-c C-x M-w"] |
8032 |
["Cut Rectangle" org-cut-special :active (org-at-table-p) :keys "C-c C-w"] |
["Cut Rectangle" org-cut-special :active (org-at-table-p) :keys "C-c C-x C-w"] |
8033 |
["Paste Rectangle" org-paste-special :active (org-at-table-p) :keys "C-c C-y"] |
["Paste Rectangle" org-paste-special :active (org-at-table-p) :keys "C-c C-x C-y"] |
8034 |
["Fill Rectangle" org-table-wrap-region :active (org-at-table-p) :keys "C-c C-q"]) |
["Fill Rectangle" org-table-wrap-region :active (org-at-table-p) :keys "C-c C-q"]) |
8035 |
"--" |
"--" |
8036 |
["Set Column Formula" org-table-eval-formula :active (org-at-table-p) :keys "C-c ="] |
["Set Column Formula" org-table-eval-formula :active (org-at-table-p) :keys "C-c ="] |
8066 |
overwritten, and the table is not marked as requiring realignment." |
overwritten, and the table is not marked as requiring realignment." |
8067 |
(interactive "p") |
(interactive "p") |
8068 |
(if (and (org-at-table-p) |
(if (and (org-at-table-p) |
8069 |
|
(or |
8070 |
|
(and org-table-auto-blank-field |
8071 |
|
(member last-command |
8072 |
|
'(orgtbl-hijacker-command-100 |
8073 |
|
orgtbl-hijacker-command-101 |
8074 |
|
orgtbl-hijacker-command-102 |
8075 |
|
orgtbl-hijacker-command-103 |
8076 |
|
orgtbl-hijacker-command-104 |
8077 |
|
orgtbl-hijacker-command-105)) |
8078 |
|
(org-table-blank-field)) |
8079 |
|
t) |
8080 |
(eq N 1) |
(eq N 1) |
8081 |
(looking-at "[^|\n]* +|")) |
(looking-at "[^|\n]* +|")) |
8082 |
(let (org-table-may-need-update) |
(let (org-table-may-need-update) |
8088 |
(let (orgtbl-mode) |
(let (orgtbl-mode) |
8089 |
(call-interactively (key-binding (vector last-input-event)))))) |
(call-interactively (key-binding (vector last-input-event)))))) |
8090 |
|
|
8091 |
|
(defun org-force-self-insert (N) |
8092 |
|
"Needed to enforce self-insert under remapping." |
8093 |
|
(interactive "p") |
8094 |
|
(self-insert-command N)) |
8095 |
|
|
8096 |
(defun orgtbl-delete-backward-char (N) |
(defun orgtbl-delete-backward-char (N) |
8097 |
"Like `delete-backward-char', insert whitespace at field end in tables. |
"Like `delete-backward-char', insert whitespace at field end in tables. |
8098 |
When deleting backwards, in tables this function will insert whitespace in |
When deleting backwards, in tables this function will insert whitespace in |
9408 |
;; i k @ expendable from outline-mode |
;; i k @ expendable from outline-mode |
9409 |
;; 0123456789 ! %^& ()_{} " `' free |
;; 0123456789 ! %^& ()_{} " `' free |
9410 |
|
|
9411 |
(define-key org-mode-map "\C-i" 'org-cycle) |
;; TAB key with modifiers |
9412 |
|
(define-key org-mode-map "\C-i" 'org-cycle) |
9413 |
(define-key org-mode-map [(meta tab)] 'org-complete) |
(define-key org-mode-map [(meta tab)] 'org-complete) |
9414 |
(define-key org-mode-map "\M-\C-i" 'org-complete) |
(define-key org-mode-map "\M-\C-i" 'org-complete) ; for tty emacs |
9415 |
(define-key org-mode-map [(meta shift left)] 'org-shiftmetaleft) |
;; The following line is necessary under Suse GNU/Linux |
9416 |
(define-key org-mode-map [(meta left)] 'org-metaleft) |
(unless org-xemacs-p |
9417 |
(define-key org-mode-map [(meta shift right)] 'org-shiftmetaright) |
(define-key org-mode-map [S-iso-lefttab] 'org-shifttab)) |
9418 |
(define-key org-mode-map [(meta shift up)] 'org-shiftmetaup) |
(define-key org-mode-map [(shift tab)] 'org-shifttab) |
9419 |
(define-key org-mode-map [(meta shift down)] 'org-shiftmetadown) |
|
9420 |
|
(define-key org-mode-map (org-key 'S-return) 'org-table-copy-down) |
9421 |
|
(define-key org-mode-map "\C-c\C-xc" 'org-table-copy-down) ; tty |
9422 |
|
(define-key org-mode-map [(meta shift return)] 'org-insert-todo-heading) |
9423 |
|
(define-key org-mode-map "\C-c\C-xM" 'org-insert-todo-heading) ; tty |
9424 |
|
(define-key org-mode-map [(meta return)] 'org-meta-return) |
9425 |
|
(define-key org-mode-map "\C-c\C-xm" 'org-meta-return) ; tty emacs |
9426 |
|
(define-key org-mode-map [?\e (return)] 'org-meta-return) ; tty emacs |
9427 |
|
|
9428 |
|
;; Cursor keys with modifiers |
9429 |
|
(define-key org-mode-map [(meta left)] 'org-metaleft) |
9430 |
|
(define-key org-mode-map [?\e (left)] 'org-metaleft) ; for tty emacs |
9431 |
|
(define-key org-mode-map "\C-c\C-xl" 'org-metaleft) ; for tty emacs |
9432 |
(define-key org-mode-map [(meta right)] 'org-metaright) |
(define-key org-mode-map [(meta right)] 'org-metaright) |
9433 |
(define-key org-mode-map [(meta up)] 'org-metaup) |
(define-key org-mode-map [?\e (right)] 'org-metaright) ; for tty emacs |
9434 |
(define-key org-mode-map [(meta down)] 'org-metadown) |
(define-key org-mode-map "\C-c\C-xr" 'org-metaright) ; for tty emacs |
9435 |
;(define-key org-mode-map "\C-c\C-h\C-w" 'org-cut-subtree) |
(define-key org-mode-map [(meta up)] 'org-metaup) |
9436 |
;(define-key org-mode-map "\C-c\C-h\M-w" 'org-copy-subtree) |
(define-key org-mode-map [?\e (up)] 'org-metaup) ; for tty emacs |
9437 |
;(define-key org-mode-map "\C-c\C-h\C-y" 'org-paste-subtree) |
(define-key org-mode-map "\C-c\C-xu" 'org-metaup) ; for tty emacs |
9438 |
(define-key org-mode-map "\C-c\C-h\C-w" 'org-cut-special) |
(define-key org-mode-map [(meta down)] 'org-metadown) |
9439 |
(define-key org-mode-map "\C-c\C-h\M-w" 'org-copy-special) |
(define-key org-mode-map [?\e (down)] 'org-metadown) ; for tty emacs |
9440 |
(define-key org-mode-map "\C-c\C-h\C-y" 'org-paste-special) |
(define-key org-mode-map "\C-c\C-xd" 'org-metadown) ; for tty emacs |
9441 |
|
|
9442 |
|
(define-key org-mode-map [(meta shift left)] 'org-shiftmetaleft) |
9443 |
|
(define-key org-mode-map "\C-c\C-xL" 'org-shiftmetaleft) ; tty |
9444 |
|
(define-key org-mode-map [(meta shift right)] 'org-shiftmetaright) |
9445 |
|
(define-key org-mode-map "\C-c\C-xR" 'org-shiftmetaright) ; tty |
9446 |
|
(define-key org-mode-map [(meta shift up)] 'org-shiftmetaup) |
9447 |
|
(define-key org-mode-map "\C-c\C-xU" 'org-shiftmetaup) ; tty |
9448 |
|
(define-key org-mode-map [(meta shift down)] 'org-shiftmetadown) |
9449 |
|
(define-key org-mode-map "\C-c\C-xD" 'org-shiftmetadown) ; tty |
9450 |
|
(define-key org-mode-map (org-key 'S-up) 'org-shiftup) |
9451 |
|
(define-key org-mode-map [?\C-c ?\C-x (up)] 'org-shiftup) |
9452 |
|
(define-key org-mode-map (org-key 'S-down) 'org-shiftdown) |
9453 |
|
(define-key org-mode-map [?\C-c ?\C-x (down)] 'org-shiftdown) |
9454 |
|
(define-key org-mode-map (org-key 'S-left) 'org-timestamp-down-day) |
9455 |
|
(define-key org-mode-map [?\C-c ?\C-x (left)] 'org-timestamp-down-day) |
9456 |
|
(define-key org-mode-map (org-key 'S-right) 'org-timestamp-up-day) |
9457 |
|
(define-key org-mode-map [?\C-c ?\C-x (right)] 'org-timestamp-up-day) |
9458 |
|
|
9459 |
|
;; All the other keys |
9460 |
(define-key org-mode-map "\C-c$" 'org-archive-subtree) |
(define-key org-mode-map "\C-c$" 'org-archive-subtree) |
9461 |
(define-key org-mode-map "\C-c\C-j" 'org-goto) |
(define-key org-mode-map "\C-c\C-j" 'org-goto) |
9462 |
(define-key org-mode-map "\C-c\C-t" 'org-todo) |
(define-key org-mode-map "\C-c\C-t" 'org-todo) |
9468 |
(define-key org-mode-map "\C-c/" 'org-occur) ; Minor-mode reserved |
(define-key org-mode-map "\C-c/" 'org-occur) ; Minor-mode reserved |
9469 |
(define-key org-mode-map "\C-c\C-m" 'org-insert-heading) |
(define-key org-mode-map "\C-c\C-m" 'org-insert-heading) |
9470 |
(define-key org-mode-map "\M-\C-m" 'org-insert-heading) |
(define-key org-mode-map "\M-\C-m" 'org-insert-heading) |
|
(define-key org-mode-map [(meta shift return)] 'org-insert-todo-heading) |
|
9471 |
(define-key org-mode-map "\C-c\C-l" 'org-insert-link) |
(define-key org-mode-map "\C-c\C-l" 'org-insert-link) |
9472 |
(define-key org-mode-map "\C-c\C-o" 'org-open-at-point) |
(define-key org-mode-map "\C-c\C-o" 'org-open-at-point) |
9473 |
(define-key org-mode-map "\C-c\C-z" 'org-time-stamp) ; Alternative binding |
(define-key org-mode-map "\C-c\C-z" 'org-time-stamp) ; Alternative binding |
9474 |
(define-key org-mode-map "\C-c." 'org-time-stamp) ; Minor-mode reserved |
(define-key org-mode-map "\C-c." 'org-time-stamp) ; Minor-mode reserved |
9475 |
|
(define-key org-mode-map "\C-c!" 'org-time-stamp-inactive) ; Minor-mode r. |
9476 |
(define-key org-mode-map "\C-c," 'org-priority) ; Minor-mode reserved |
(define-key org-mode-map "\C-c," 'org-priority) ; Minor-mode reserved |
9477 |
(define-key org-mode-map "\C-c\C-y" 'org-evaluate-time-range) |
(define-key org-mode-map "\C-c\C-y" 'org-evaluate-time-range) |
9478 |
(define-key org-mode-map "\C-c>" 'org-goto-calendar) |
(define-key org-mode-map "\C-c>" 'org-goto-calendar) |
9480 |
(define-key org-mode-map "\C-c[" 'org-add-file) |
(define-key org-mode-map "\C-c[" 'org-add-file) |
9481 |
(define-key org-mode-map "\C-c]" 'org-remove-file) |
(define-key org-mode-map "\C-c]" 'org-remove-file) |
9482 |
(define-key org-mode-map "\C-c\C-r" 'org-timeline) |
(define-key org-mode-map "\C-c\C-r" 'org-timeline) |
|
(define-key org-mode-map (org-key 'S-up) 'org-shiftup) |
|
|
(define-key org-mode-map (org-key 'S-down) 'org-shiftdown) |
|
|
(define-key org-mode-map (org-key 'S-left) 'org-timestamp-down-day) |
|
|
(define-key org-mode-map (org-key 'S-right) 'org-timestamp-up-day) |
|
9483 |
(define-key org-mode-map "\C-c-" 'org-table-insert-hline) |
(define-key org-mode-map "\C-c-" 'org-table-insert-hline) |
|
;; The following line is necessary for German keyboards under Suse GNU/Linux |
|
|
(unless org-xemacs-p |
|
|
(define-key org-mode-map [S-iso-lefttab] 'org-shifttab)) |
|
|
(define-key org-mode-map [(shift tab)] 'org-shifttab) |
|
9484 |
(define-key org-mode-map "\C-c\C-c" 'org-ctrl-c-ctrl-c) |
(define-key org-mode-map "\C-c\C-c" 'org-ctrl-c-ctrl-c) |
9485 |
(define-key org-mode-map "\C-m" 'org-return) |
(define-key org-mode-map "\C-m" 'org-return) |
|
(define-key org-mode-map (org-key 'S-return) 'org-table-copy-down) |
|
|
(define-key org-mode-map [(meta return)] 'org-meta-return) |
|
9486 |
(define-key org-mode-map "\C-c?" 'org-table-current-column) |
(define-key org-mode-map "\C-c?" 'org-table-current-column) |
9487 |
(define-key org-mode-map "\C-c " 'org-table-blank-field) |
(define-key org-mode-map "\C-c " 'org-table-blank-field) |
9488 |
(define-key org-mode-map "\C-c+" 'org-table-sum) |
(define-key org-mode-map "\C-c+" 'org-table-sum) |
9497 |
(define-key org-mode-map "\C-c\C-x\C-a" 'org-export-as-ascii) |
(define-key org-mode-map "\C-c\C-x\C-a" 'org-export-as-ascii) |
9498 |
(define-key org-mode-map "\C-c\C-xv" 'org-export-copy-visible) |
(define-key org-mode-map "\C-c\C-xv" 'org-export-copy-visible) |
9499 |
(define-key org-mode-map "\C-c\C-x\C-v" 'org-export-copy-visible) |
(define-key org-mode-map "\C-c\C-x\C-v" 'org-export-copy-visible) |
9500 |
|
;; OPML support is only planned |
9501 |
;(define-key org-mode-map "\C-c\C-xo" 'org-export-as-opml) |
;(define-key org-mode-map "\C-c\C-xo" 'org-export-as-opml) |
9502 |
;(define-key org-mode-map "\C-c\C-x\C-o" 'org-export-as-opml) |
;(define-key org-mode-map "\C-c\C-x\C-o" 'org-export-as-opml) |
9503 |
(define-key org-mode-map "\C-c\C-xt" 'org-insert-export-options-template) |
(define-key org-mode-map "\C-c\C-xt" 'org-insert-export-options-template) |
9504 |
(define-key org-mode-map "\C-c:" 'org-toggle-fixed-width-section) |
(define-key org-mode-map "\C-c:" 'org-toggle-fixed-width-section) |
9505 |
(define-key org-mode-map "\C-c\C-xh" 'org-export-as-html) |
(define-key org-mode-map "\C-c\C-xh" 'org-export-as-html) |
9506 |
(define-key org-mode-map "\C-c\C-x\C-h" 'org-export-as-html-and-open) |
(define-key org-mode-map "\C-c\C-xb" 'org-export-as-html-and-open) |
9507 |
|
(define-key org-mode-map "\C-c\C-x\C-b" 'org-export-as-html-and-open) |
9508 |
|
|
9509 |
|
(define-key org-mode-map "\C-c\C-x\C-w" 'org-cut-special) |
9510 |
|
(define-key org-mode-map "\C-c\C-x\M-w" 'org-copy-special) |
9511 |
|
(define-key org-mode-map "\C-c\C-x\C-y" 'org-paste-special) |
9512 |
|
|
9513 |
(defsubst org-table-p () (org-at-table-p)) |
(defsubst org-table-p () (org-at-table-p)) |
9514 |
|
|
9518 |
overwritten, and the table is not marked as requiring realignment." |
overwritten, and the table is not marked as requiring realignment." |
9519 |
(interactive "p") |
(interactive "p") |
9520 |
(if (and (org-table-p) |
(if (and (org-table-p) |
9521 |
|
(or |
9522 |
|
(and org-table-auto-blank-field |
9523 |
|
(member last-command |
9524 |
|
'(org-cycle org-return org-shifttab org-ctrl-c-ctrl-c)) |
9525 |
|
(org-table-blank-field)) |
9526 |
|
t) |
9527 |
(eq N 1) |
(eq N 1) |
9528 |
(looking-at "[^|\n]* +|")) |
(looking-at "[^|\n]* +|")) |
9529 |
(let (org-table-may-need-update) |
(let (org-table-may-need-update) |
9578 |
;; How to do this: Measure non-white length of current string |
;; How to do this: Measure non-white length of current string |
9579 |
;; If equal to column width, we should realign. |
;; If equal to column width, we should realign. |
9580 |
|
|
9581 |
|
(defun org-remap (map &rest commands) |
9582 |
|
"In MAP, remap the functions given in COMMANDS. |
9583 |
|
COMMANDS is a list of alternating OLDDEF NEWDEF command names." |
9584 |
|
(let (new old) |
9585 |
|
(while commands |
9586 |
|
(setq old (pop commands) new (pop commands)) |
9587 |
|
(if (fboundp 'command-remapping) |
9588 |
|
(define-key map (vector 'remap old) new) |
9589 |
|
(substitute-key-definition old new map global-map))))) |
9590 |
|
|
9591 |
(when (eq org-enable-table-editor 'optimized) |
(when (eq org-enable-table-editor 'optimized) |
9592 |
;; If the user wants maximum table support, we need to hijack |
;; If the user wants maximum table support, we need to hijack |
9593 |
;; some standard editing functions |
;; some standard editing functions |
9594 |
(substitute-key-definition 'self-insert-command 'org-self-insert-command |
(org-remap org-mode-map |
9595 |
org-mode-map global-map) |
'self-insert-command 'org-self-insert-command |
9596 |
(substitute-key-definition 'delete-char 'org-delete-char |
'delete-char 'org-delete-char |
9597 |
org-mode-map global-map) |
'delete-backward-char 'org-delete-backward-char) |
9598 |
(substitute-key-definition 'delete-backward-char 'org-delete-backward-char |
(define-key org-mode-map "|" 'org-force-self-insert)) |
|
org-mode-map global-map) |
|
|
(define-key org-mode-map "|" 'self-insert-command)) |
|
9599 |
|
|
9600 |
(defun org-shiftcursor-error () |
(defun org-shiftcursor-error () |
9601 |
"Throw an error because Shift-Cursor command was applied in wrong context." |
"Throw an error because Shift-Cursor command was applied in wrong context." |
9602 |
(error "This command is only active in tables and on headlines")) |
(error "This command is only active in tables and on headlines")) |
9603 |
|
|
9604 |
(defun org-shifttab () |
(defun org-shifttab () |
9605 |
"Call `(org-cycle t)' or `org-table-previous-field'." |
"Global visibility cycling or move to previous table field. |
9606 |
|
Calls `(org-cycle t)' or `org-table-previous-field', depending on context. |
9607 |
|
See the individual commands for more information." |
9608 |
(interactive) |
(interactive) |
9609 |
(cond |
(cond |
9610 |
((org-at-table-p) (org-table-previous-field)) |
((org-at-table-p) (org-table-previous-field)) |
9611 |
(t (org-cycle '(4))))) |
(t (org-cycle '(4))))) |
9612 |
|
|
9613 |
(defun org-shiftmetaleft () |
(defun org-shiftmetaleft () |
9614 |
"Call `org-promote-subtree' or `org-table-delete-column'." |
"Promote subtree or delete table column. |
9615 |
|
Calls `org-promote-subtree' or `org-table-delete-column', depending on context. |
9616 |
|
See the individual commands for more information." |
9617 |
(interactive) |
(interactive) |
9618 |
(cond |
(cond |
9619 |
((org-at-table-p) (org-table-delete-column)) |
((org-at-table-p) (org-table-delete-column)) |
9621 |
(t (org-shiftcursor-error)))) |
(t (org-shiftcursor-error)))) |
9622 |
|
|
9623 |
(defun org-shiftmetaright () |
(defun org-shiftmetaright () |
9624 |
"Call `org-demote-subtree' or `org-table-insert-column'." |
"Demote subtree or insert table column. |
9625 |
|
Calls `org-demote-subtree' or `org-table-insert-column', depending on context. |
9626 |
|
See the individual commands for more information." |
9627 |
(interactive) |
(interactive) |
9628 |
(cond |
(cond |
9629 |
((org-at-table-p) (org-table-insert-column)) |
((org-at-table-p) (org-table-insert-column)) |
9631 |
(t (org-shiftcursor-error)))) |
(t (org-shiftcursor-error)))) |
9632 |
|
|
9633 |
(defun org-shiftmetaup (&optional arg) |
(defun org-shiftmetaup (&optional arg) |
9634 |
"Call `org-move-subtree-up' or `org-table-kill-row'." |
"Move subtree up or kill table row. |
9635 |
|
Calls `org-move-subtree-up' or `org-table-kill-row', depending on context. |
9636 |
|
See the individual commands for more information." |
9637 |
(interactive "P") |
(interactive "P") |
9638 |
(cond |
(cond |
9639 |
((org-at-table-p) (org-table-kill-row)) |
((org-at-table-p) (org-table-kill-row)) |
9640 |
((org-on-heading-p) (org-move-subtree-up arg)) |
((org-on-heading-p) (org-move-subtree-up arg)) |
9641 |
(t (org-shiftcursor-error)))) |
(t (org-shiftcursor-error)))) |
9642 |
(defun org-shiftmetadown (&optional arg) |
(defun org-shiftmetadown (&optional arg) |
9643 |
"Call `org-move-subtree-down' or `org-table-insert-row'." |
"Move subtree down or insert table row. |
9644 |
|
Calls `org-move-subtree-down' or `org-table-insert-row', depending on context. |
9645 |
|
See the individual commands for more information." |
9646 |
(interactive "P") |
(interactive "P") |
9647 |
(cond |
(cond |
9648 |
((org-at-table-p) (org-table-insert-row arg)) |
((org-at-table-p) (org-table-insert-row arg)) |
9650 |
(t (org-shiftcursor-error)))) |
(t (org-shiftcursor-error)))) |
9651 |
|
|
9652 |
(defun org-metaleft (&optional arg) |
(defun org-metaleft (&optional arg) |
9653 |
"Call `org-do-promote' or `org-table-move-column' to left." |
"Promote heading or move table column to left. |
9654 |
|
Calls `org-do-promote' or `org-table-move-column', depending on context. |
9655 |
|
See the individual commands for more information." |
9656 |
(interactive "P") |
(interactive "P") |
9657 |
(cond |
(cond |
9658 |
((org-at-table-p) (org-table-move-column 'left)) |
((org-at-table-p) (org-table-move-column 'left)) |
9660 |
(t (backward-word (prefix-numeric-value arg))))) |
(t (backward-word (prefix-numeric-value arg))))) |
9661 |
|
|
9662 |
(defun org-metaright (&optional arg) |
(defun org-metaright (&optional arg) |
9663 |
"Call `org-do-demote' or `org-table-move-column' to right." |
"Demote subtree or move table column to right. |
9664 |
|
Calls `org-do-demote' or `org-table-move-column', depending on context. |
9665 |
|
See the individual commands for more information." |
9666 |
(interactive "P") |
(interactive "P") |
9667 |
(cond |
(cond |
9668 |
((org-at-table-p) (org-table-move-column nil)) |
((org-at-table-p) (org-table-move-column nil)) |
9670 |
(t (forward-word (prefix-numeric-value arg))))) |
(t (forward-word (prefix-numeric-value arg))))) |
9671 |
|
|
9672 |
(defun org-metaup (&optional arg) |
(defun org-metaup (&optional arg) |
9673 |
"Call `org-move-subtree-up' or `org-table-move-row' up." |
"Move subtree up or move table row up. |
9674 |
|
Calls `org-move-subtree-up' or `org-table-move-row', depending on context. |
9675 |
|
See the individual commands for more information." |
9676 |
(interactive "P") |
(interactive "P") |
9677 |
(cond |
(cond |
9678 |
((org-at-table-p) (org-table-move-row 'up)) |
((org-at-table-p) (org-table-move-row 'up)) |
9680 |
(t (org-shiftcursor-error)))) |
(t (org-shiftcursor-error)))) |
9681 |
|
|
9682 |
(defun org-metadown (&optional arg) |
(defun org-metadown (&optional arg) |
9683 |
"Call `org-move-subtree-down' or `org-table-move-row' down." |
"Move subtree down or move table row down. |
9684 |
|
Calls `org-move-subtree-down' or `org-table-move-row', depending on context. |
9685 |
|
See the individual commands for more information." |
9686 |
(interactive "P") |
(interactive "P") |
9687 |
(cond |
(cond |
9688 |
((org-at-table-p) (org-table-move-row nil)) |
((org-at-table-p) (org-table-move-row nil)) |
9690 |
(t (org-shiftcursor-error)))) |
(t (org-shiftcursor-error)))) |
9691 |
|
|
9692 |
(defun org-shiftup (&optional arg) |
(defun org-shiftup (&optional arg) |
9693 |
"Call `org-timestamp-up' or `org-priority-up'." |
"Increase item in timestamp or increase priority of current item. |
9694 |
|
Calls `org-timestamp-up' or `org-priority-up', depending on context. |
9695 |
|
See the individual commands for more information." |
9696 |
(interactive "P") |
(interactive "P") |
9697 |
(cond |
(cond |
9698 |
((org-at-timestamp-p) (org-timestamp-up arg)) |
((org-at-timestamp-p) (org-timestamp-up arg)) |
9699 |
(t (org-priority-up)))) |
(t (org-priority-up)))) |
9700 |
|
|
9701 |
(defun org-shiftdown (&optional arg) |
(defun org-shiftdown (&optional arg) |
9702 |
"Call `org-timestamp-down' or `org-priority-down'." |
"Decrease item in timestamp or decrease priority of current item. |
9703 |
|
Calls `org-timestamp-down' or `org-priority-down', depending on context. |
9704 |
|
See the individual commands for more information." |
9705 |
(interactive "P") |
(interactive "P") |
9706 |
(cond |
(cond |
9707 |
((org-at-timestamp-p) (org-timestamp-down arg)) |
((org-at-timestamp-p) (org-timestamp-down arg)) |
9708 |
(t (org-priority-down)))) |
(t (org-priority-down)))) |
9709 |
|
|
9710 |
(defun org-copy-special () |
(defun org-copy-special () |
9711 |
"Call either `org-table-copy' or `org-copy-subtree'." |
"Copy region in table or copy current subtree. |
9712 |
|
Calls `org-table-copy' or `org-copy-subtree', depending on context. |
9713 |
|
See the individual commands for more information." |
9714 |
(interactive) |
(interactive) |
9715 |
(call-interactively |
(call-interactively |
9716 |
(if (org-at-table-p) 'org-table-copy-region 'org-copy-subtree))) |
(if (org-at-table-p) 'org-table-copy-region 'org-copy-subtree))) |
9717 |
|
|
9718 |
(defun org-cut-special () |
(defun org-cut-special () |
9719 |
"Call either `org-table-copy' or `org-cut-subtree'." |
"Cut region in table or cut current subtree. |
9720 |
|
Calls `org-table-copy' or `org-cut-subtree', depending on context. |
9721 |
|
See the individual commands for more information." |
9722 |
(interactive) |
(interactive) |
9723 |
(call-interactively |
(call-interactively |
9724 |
(if (org-at-table-p) 'org-table-cut-region 'org-cut-subtree))) |
(if (org-at-table-p) 'org-table-cut-region 'org-cut-subtree))) |
9725 |
|
|
9726 |
(defun org-paste-special (arg) |
(defun org-paste-special (arg) |
9727 |
"Call either `org-table-paste-rectangle' or `org-paste-subtree'." |
"Paste rectangular region into table, or past subtree relative to level. |
9728 |
|
Calls `org-table-paste-rectangle' or `org-paste-subtree', depending on context. |
9729 |
|
See the individual commands for more information." |
9730 |
(interactive "P") |
(interactive "P") |
9731 |
(if (org-at-table-p) |
(if (org-at-table-p) |
9732 |
(org-table-paste-rectangle) |
(org-table-paste-rectangle) |
9739 |
created with org.el, re-align that table. This command works even if |
created with org.el, re-align that table. This command works even if |
9740 |
the automatic table editor has been turned off. |
the automatic table editor has been turned off. |
9741 |
If the cursor is in one of the special #+KEYWORD lines, this triggers |
If the cursor is in one of the special #+KEYWORD lines, this triggers |
9742 |
scanning the buffer for these lines and updating the information." |
scanning the buffer for these lines and updating the information. |
9743 |
|
If the cursor is on a #+TBLFM line, re-apply the formulae to the table." |
9744 |
(interactive "P") |
(interactive "P") |
9745 |
(let ((org-enable-table-editor t)) |
(let ((org-enable-table-editor t)) |
9746 |
(cond |
(cond |
9764 |
(skip-chars-backward " \r\n\t") |
(skip-chars-backward " \r\n\t") |
9765 |
(if (org-at-table-p) (org-table-recalculate t)))) |
(if (org-at-table-p) (org-table-recalculate t)))) |
9766 |
(t |
(t |
9767 |
(let ((org-inhibit-startup t)) (org-mode))))) |
(org-mode-restart)))) |
9768 |
((org-region-active-p) |
((org-region-active-p) |
9769 |
(org-table-convert-region (region-beginning) (region-end) arg)) |
(org-table-convert-region (region-beginning) (region-end) arg)) |
9770 |
((and (region-beginning) (region-end)) |
((and (region-beginning) (region-end)) |
9773 |
(error "Abort"))) |
(error "Abort"))) |
9774 |
(t (error "No table at point, and no region to make one"))))) |
(t (error "No table at point, and no region to make one"))))) |
9775 |
|
|
9776 |
|
(defun org-mode-restart () |
9777 |
|
"Restart Org-mode, to scan again for special lines. |
9778 |
|
Also updates the keyword regular expressions." |
9779 |
|
(interactive) |
9780 |
|
(let ((org-inhibit-startup t)) (org-mode)) |
9781 |
|
(message "Org-mode restarted to refresh keyword and special line setup")) |
9782 |
|
|
9783 |
(defun org-return () |
(defun org-return () |
9784 |
"Call `org-table-next-row' or `newline'." |
"Goto next table row or insert a newline. |
9785 |
|
Calls `org-table-next-row' or `newline', depending on context. |
9786 |
|
See the individual commands for more information." |
9787 |
(interactive) |
(interactive) |
9788 |
(cond |
(cond |
9789 |
((org-at-table-p) |
((org-at-table-p) |
9792 |
(t (newline)))) |
(t (newline)))) |
9793 |
|
|
9794 |
(defun org-meta-return (&optional arg) |
(defun org-meta-return (&optional arg) |
9795 |
"Call `org-insert-heading' or `org-table-wrap-region'." |
"Insert a new heading or wrap a region in a table. |
9796 |
|
Calls `org-insert-heading' or `org-table-wrap-region', depending on context. |
9797 |
|
See the individual commands for more information." |
9798 |
(interactive "P") |
(interactive "P") |
9799 |
(cond |
(cond |
9800 |
((org-at-table-p) |
((org-at-table-p) |
9862 |
(easy-menu-define org-org-menu org-mode-map "Org menu" |
(easy-menu-define org-org-menu org-mode-map "Org menu" |
9863 |
'("Org" |
'("Org" |
9864 |
["Cycle Visibility" org-cycle (or (bobp) (outline-on-heading-p))] |
["Cycle Visibility" org-cycle (or (bobp) (outline-on-heading-p))] |
9865 |
|
["Cycle Global Visibility" org-shifttab (not (org-at-table-p))] |
9866 |
["Sparse Tree" org-occur t] |
["Sparse Tree" org-occur t] |
9867 |
["Show All" show-all t] |
["Show All" show-all t] |
9868 |
"--" |
"--" |
9899 |
["Priority Down" org-shiftdown t]) |
["Priority Down" org-shiftdown t]) |
9900 |
("Dates and Scheduling" |
("Dates and Scheduling" |
9901 |
["Timestamp" org-time-stamp t] |
["Timestamp" org-time-stamp t] |
9902 |
|
["Timestamp (inactive)" org-time-stamp-inactive t] |
9903 |
("Change Date" |
("Change Date" |
9904 |
["1 Day Later" org-timestamp-up-day t] |
["1 Day Later" org-timestamp-up-day t] |
9905 |
["1 Day Earlier" org-timestamp-down-day t] |
["1 Day Earlier" org-timestamp-down-day t] |
9943 |
"--" |
"--" |
9944 |
["Build Full Customize Menu" org-create-customize-menu |
["Build Full Customize Menu" org-create-customize-menu |
9945 |
(fboundp 'customize-menu-create)]) |
(fboundp 'customize-menu-create)]) |
9946 |
|
"--" |
9947 |
|
["Refresh setup" org-mode-restart t] |
9948 |
)) |
)) |
9949 |
|
|
9950 |
(defun org-info (&optional node) |
(defun org-info (&optional node) |