emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Fix a regression in C-u TAB behavior with point in org table cell


From: Kaushal Modi
Subject: [O] Fix a regression in C-u TAB behavior with point in org table cell
Date: Mon, 21 Nov 2016 14:56:28 +0000

Hello,

I was going through the orgcard.tex and reviewing it for changes in the default bindings since org 8.2. The current orgcard says that it was created for org 8.2.

While going through it, I found a useful nugget that if the point is in a table and if the cell is truncated (because of something like <5> in the header row), doing "C-u TAB" reveals the full field temporarily. I though realized that that feature is broken in org 9.x.

Here is my patch against the master branch that fixes it. Can you please review it and merge it if OK:

From ee5c93c0a6d70539d086050f2a5a033ba7431abb Mon Sep 17 00:00:00 2001
From: Kaushal Modi <address@hidden>
Date: Mon, 21 Nov 2016 09:50:07 -0500
Subject: [PATCH] Fix the regression in org 9.x in "C-u TAB" revealing org
 table cell

* lisp/org.el (org-cycle): Do not execute `org-cycle-internal-global'
  when the point is inside a table and `org-cycle' is called with a
  prefix.  Instead restore the old behavior of displaying the full
  table cell on doing "C-u TAB".
---
 lisp/org.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 1a2bf7a..4cd608a 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -6956,7 +6956,9 @@ if the variable `org-cycle-global-at-bob' is t."
  (outline-show-all)
  (org-unlogged-message "Entire buffer visible, including drawers"))
 
-       ((equal arg '(4)) (org-cycle-internal-global))
+       ((and (not (org-at-table-p))
+             (equal arg '(4)))
+        (org-cycle-internal-global))
 
        ;; Try hiding block at point.
        ((org-hide-block-toggle-maybe))
@@ -6969,7 +6971,7 @@ if the variable `org-cycle-global-at-bob' is t."
  (if (org-at-table.el-p)
     (message "%s" (substitute-command-keys "\\<org-mode-map>\
 Use `\\[org-edit-special]' to edit table.el tables"))
-  (if arg (org-table-edit-field t)
+  (if arg (org-table-edit-field t) ; Make current field fully visible when `org-cycle' called with prefix
     (org-table-justify-field-maybe)
     (call-interactively 'org-table-next-field))))
 
-- 
2.10.0

--

Kaushal Modi


reply via email to

[Prev in Thread] Current Thread [Next in Thread]