org.el: Let `C-o' insert a new row in tables and open a line elsewhere

* org.el (org-ctrl-o): New command to insert a new row in
tables (like `M-S-<down>' does) and open a line elsewhere.
(org-mode-map): Bind the new command to `C-o'.
This commit is contained in:
Bastien Guerry 2013-04-05 11:14:20 +02:00
parent d307657b9d
commit 45d6d8f8a2
1 changed files with 8 additions and 0 deletions

View File

@ -18979,6 +18979,7 @@ BEG and END default to the buffer boundaries."
(org-defkey org-mode-map "\C-c\C-c" 'org-ctrl-c-ctrl-c)
(org-defkey org-mode-map "\C-c\C-k" 'org-kill-note-or-show-branches)
(org-defkey org-mode-map "\C-c#" 'org-update-statistics-cookies)
(org-defkey org-mode-map "\C-o" 'org-ctrl-o)
(org-defkey org-mode-map "\C-m" 'org-return)
(org-defkey org-mode-map "\C-j" 'org-return-indent)
(org-defkey org-mode-map "\C-c?" 'org-table-field-info)
@ -20237,6 +20238,13 @@ Also updates the keyword regular expressions."
(let ((org-note-abort t))
(funcall org-finish-function))))
(defun org-ctrl-o (n)
"Insert a new row in tables, call `open-line' elsewhere."
(interactive "*p")
(if (org-at-table-p)
(org-table-insert-row)
(open-line n)))
(defun org-return (&optional indent)
"Goto next table row or insert a newline.
Calls `org-table-next-row' or `newline', depending on context.