From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: Fix a regression in C-u TAB behavior with point in org table cell Date: Mon, 21 Nov 2016 14:56:28 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f403045dd8f4fab3bb0541d0dce1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c8q1S-0005p0-Gl for emacs-orgmode@gnu.org; Mon, 21 Nov 2016 09:56:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c8q1R-0000B8-D2 for emacs-orgmode@gnu.org; Mon, 21 Nov 2016 09:56:42 -0500 Received: from mail-ua0-x22f.google.com ([2607:f8b0:400c:c08::22f]:33032) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c8q1R-0000Ax-6M for emacs-orgmode@gnu.org; Mon, 21 Nov 2016 09:56:41 -0500 Received: by mail-ua0-x22f.google.com with SMTP id 20so228193999uak.0 for ; Mon, 21 Nov 2016 06:56:40 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-org list --f403045dd8f4fab3bb0541d0dce1 Content-Type: text/plain; charset=UTF-8 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 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 "\\\ 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 --f403045dd8f4fab3bb0541d0dce1 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
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 i= n 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 tempo= rarily. I though realized that that feature is broken in org 9.x.

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

F= rom ee5c93c0a6d70539d086050f2a5a033ba7431abb Mon Sep 17 00:00:00 2001
=
From: Kaushal Modi <kaush= al.modi@gmail.com>
Date: Mon, 21 Nov 2016 09:50:07 -0500
Subject: [PATCH] Fix the regression in org 9.x in "C-u TAB&qu= ot; revealing org
=C2=A0table cell

* lis= p/org.el (org-cycle): Do not execute `org-cycle-internal-global'
<= div>=C2=A0 when the point is inside a table and `org-cycle' is called w= ith a
=C2=A0 prefix.=C2=A0 Instead restore the old behavior of di= splaying the full
=C2=A0 table cell on doing "C-u TAB".=
---
=C2=A0lisp/org.el | 6 ++++--
=C2=A01 fil= e 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."
=C2=A0 (= outline-show-all)
=C2=A0 (org-unlogged-message "Entire buffer visible, = including drawers"))
=C2=A0
- =C2=A0 =C2=A0 =C2=A0= ((equal arg '(4)) (org-cycle-internal-global))
+ =C2=A0 =C2= =A0 =C2=A0 ((and (not (org-at-table-p))
+ =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 (equal arg '(4)))
+ =C2=A0 =C2=A0 =C2=A0= =C2=A0(org-cycle-internal-global))
=C2=A0
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 ;; Try hiding block at point.
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 ((org-hide-block-toggle-maybe))
@@ -6969,7 +6971,7 @@ = if the variable `org-cycle-global-at-bob' is t."
=C2=A0<= span class=3D"Apple-tab-span" style=3D"white-space:pre"> (if (org-at= -table.el-p)
=C2=A0 =C2=A0 =C2=A0(message "%s" (substitute-comman= d-keys "\\<org-mode-map>\
=C2=A0Use `\\[org-edit-speci= al]' to edit table.el tables"))
- =C2=A0(if arg (org-table-edit-fi= eld t)
+= =C2=A0(if arg (org-table-edit-field t) ; Make current field fully = visible when `org-cycle' called with prefix
=C2=A0 =C2=A0 =C2=A0(org-ta= ble-justify-field-maybe)
=C2=A0 =C2=A0 =C2=A0(call-interactively 'org-t= able-next-field))))
=C2=A0
--=C2=A0
2.10.0

--

Kaushal Modi

--f403045dd8f4fab3bb0541d0dce1--