From de72cd384d9cdbb7a67bf7a20ca4683d8a96d531 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Fri, 13 Sep 2013 21:09:17 +0200 Subject: [PATCH] Allow to turn of special behavior of `C-o' in tables * lisp/org.el (org-special-ctrl-o): New option. (org-open-line): Don't do anything special unless `org-special-ctrl-o' is non-nil. --- lisp/org.el | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 59a22a244..3b0d12534 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -1291,6 +1291,11 @@ OK to kill that hidden subtree. When nil, kill without remorse." (const :tag "Protect hidden subtrees with a security query" t) (const :tag "Never kill a hidden subtree with C-k" error))) +(defcustom org-special-ctrl-o t + "Non-nil means, make `C-o' insert a row in tables." + :group 'org-edit-structure + :type 'boolean) + (defcustom org-catch-invisible-edits nil "Check if in invisible region before inserting or deleting a character. Valid values are: @@ -20369,11 +20374,16 @@ Also updates the keyword regular expressions." (funcall org-finish-function)))) (defun org-open-line (n) - "Insert a new row in tables, call `open-line' elsewhere." + "Insert a new row in tables, call `open-line' elsewhere. +If `org-special-ctrl-o' is nil, just call `open-line' everywhere." (interactive "*p") - (if (org-at-table-p) - (org-table-insert-row) - (open-line n))) + (cond + ((not org-special-ctrl-o) + (open-line n)) + ((org-at-table-p) + (org-table-insert-row)) + (t + (open-line n)))) (defun org-return (&optional indent) "Goto next table row or insert a newline.