From 45d6d8f8a287f0e5cbf9877a8aefd2571281e9ae Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Fri, 5 Apr 2013 11:14:20 +0200 Subject: [PATCH] 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-' does) and open a line elsewhere. (org-mode-map): Bind the new command to `C-o'. --- lisp/org.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lisp/org.el b/lisp/org.el index 524c75a1e..73496982f 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -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.