From 9c900805937ebc21d468612d1c594381cca53cd2 Mon Sep 17 00:00:00 2001 From: Chris Kauffman Date: Fri, 28 Jul 2017 22:06:05 -0400 Subject: [PATCH 2/5] Added keybindings for org-table-move-single-cell-* functions: S-up, S-down, etc. Done via modifications to org-shiftup, org-shiftdown, etc. Dispatching at the end of available contexts between behavior for clock table and function hooks. --- lisp/org.el | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 44abc0dbe..fc740bdca 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -20477,8 +20477,10 @@ commands for more information." (defun org-shiftup (&optional arg) "Increase item in timestamp or increase priority of current headline. -Calls `org-timestamp-up' or `org-priority-up', or `org-previous-item', -depending on context. See the individual commands for more information." +Calls `org-timestamp-up' or `org-priority-up', or +`org-previous-item', or `org-table-move-single-cell-up', +depending on context. See the individual commands for more +information." (interactive "P") (cond ((run-hook-with-args-until-success 'org-shiftup-hook)) @@ -20494,6 +20496,7 @@ depending on context. See the individual commands for more information." ((and (not org-support-shift-select) (org-at-item-p)) (call-interactively 'org-previous-item)) ((org-clocktable-try-shift 'up arg)) + ((org-at-table-p) (org-table-move-single-cell-up)) ((run-hook-with-args-until-success 'org-shiftup-final-hook)) (org-support-shift-select (org-call-for-shift-select 'previous-line)) @@ -20501,8 +20504,9 @@ depending on context. See the individual commands for more information." (defun org-shiftdown (&optional arg) "Decrease item in timestamp or decrease priority of current headline. -Calls `org-timestamp-down' or `org-priority-down', or `org-next-item' -depending on context. See the individual commands for more information." +Calls `org-timestamp-down' or `org-priority-down', or +`org-next-item', or `org-table-move-single-cell-down', depending +on context. See the individual commands for more information." (interactive "P") (cond ((run-hook-with-args-until-success 'org-shiftdown-hook)) @@ -20518,6 +20522,7 @@ depending on context. See the individual commands for more information." ((and (not org-support-shift-select) (org-at-item-p)) (call-interactively 'org-next-item)) ((org-clocktable-try-shift 'down arg)) + ((org-at-table-p) (org-table-move-single-cell-down)) ((run-hook-with-args-until-success 'org-shiftdown-final-hook)) (org-support-shift-select (org-call-for-shift-select 'next-line)) @@ -20531,7 +20536,8 @@ Depending on context, this does one of the following: - on a headline, switch to the next TODO keyword. - on an item, switch entire list to the next bullet type - on a property line, switch to the next allowed value -- on a clocktable definition line, move time block into the future" +- on a clocktable definition line, move time block into the future +- on a normal table, move a single cell right" (interactive "P") (cond ((run-hook-with-args-until-success 'org-shiftright-hook)) @@ -20554,6 +20560,7 @@ Depending on context, this does one of the following: (org-at-property-p)) (call-interactively 'org-property-next-allowed-value)) ((org-clocktable-try-shift 'right arg)) + ((org-at-table-p) (org-table-move-single-cell-right)) ((run-hook-with-args-until-success 'org-shiftright-final-hook)) (org-support-shift-select (org-call-for-shift-select 'forward-char)) @@ -20567,7 +20574,8 @@ Depending on context, this does one of the following: - on a headline, switch to the previous TODO keyword. - on an item, switch entire list to the previous bullet type - on a property line, switch to the previous allowed value -- on a clocktable definition line, move time block into the past" +- on a clocktable definition line, move time block into the past +- on a normal table, move a single cell left" (interactive "P") (cond ((run-hook-with-args-until-success 'org-shiftleft-hook)) @@ -20590,6 +20598,7 @@ Depending on context, this does one of the following: (org-at-property-p)) (call-interactively 'org-property-previous-allowed-value)) ((org-clocktable-try-shift 'left arg)) + ((org-at-table-p) (org-table-move-single-cell-left)) ((run-hook-with-args-until-success 'org-shiftleft-final-hook)) (org-support-shift-select (org-call-for-shift-select 'backward-char)) -- 2.12.2