From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [RFC] Shrink columns dynamically Date: Thu, 27 Jul 2017 12:11:57 +0200 Message-ID: <87d18mmbo2.fsf@nicolasgoaziou.fr> References: <87bmoswkvs.fsf@nicolasgoaziou.fr> <87d198uznu.fsf@mat.ucm.es> <87o9ss4aj4.fsf@nicolasgoaziou.fr> <87inj0m5v5.fsf@mat.ucm.es> <878tjwuhxe.fsf@nicolasgoaziou.fr> <87o9sr5vzl.fsf@mat.ucm.es> <874lujv26h.fsf@nicolasgoaziou.fr> <87o9srxtec.fsf@mat.ucm.es> <87r2xntd3k.fsf@nicolasgoaziou.fr> <87fue3xjsl.fsf@mat.ucm.es> <877ezftb39.fsf@nicolasgoaziou.fr> <87fue23i4l.fsf@nicolasgoaziou.fr> <87iniyrug0.fsf@yandex.com> <158a779e34564ef98104c442384dadd3@HE1PR01MB1898.eurprd01.prod.exchangelabs.com> <87mv89skje.fsf@delle7240.chemeng.ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38643) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dafm2-0002e2-GX for emacs-orgmode@gnu.org; Thu, 27 Jul 2017 06:12:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1daflx-0002Kf-OF for emacs-orgmode@gnu.org; Thu, 27 Jul 2017 06:12:06 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:42762) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1daflx-0002Jd-HN for emacs-orgmode@gnu.org; Thu, 27 Jul 2017 06:12:01 -0400 Received: from saiph.selenimh (000043010000000000000469.ipv6.commingeshautdebit.fr [IPv6:2a03:a0a0:0:4301::469]) (Authenticated sender: mail@nicolasgoaziou.fr) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 7334EA80C2 for ; Thu, 27 Jul 2017 12:11:58 +0200 (CEST) Received: from ngz by saiph.selenimh with local (Exim 4.89) (envelope-from ) id 1daflt-0006UG-Tu for emacs-orgmode@gnu.org; Thu, 27 Jul 2017 12:11:57 +0200 In-Reply-To: <87mv89skje.fsf@delle7240.chemeng.ucl.ac.uk> (Eric S. Fraga's message of "Wed, 12 Jul 2017 17:10:45 +0100") 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-orgmode@gnu.org Hello, Eric S Fraga writes: > I have two use cases which currently are managed with the width cookies > and I can see that they probably should be managed differently. The > cases are: > > 1. a table with wide columns that is used to collect information > (publications with authors, title, journal, etc. is an example) and > which I use mostly by looking at it. That is, I open the document > and scan down the table or page down or whatever. I want this table > displayed initially with columns (e.g. title) narrowed to a specified > width. > > 2. a table with many columns, too many of the screen width even if each > column may only be a few characters wide, but one which I intend to > be manipulating extensively. In this case, I may want to > shrink/narrow/hide columns to make it easier to edit and do > calculations. > > At present, I use width cookies for both. They work well for use case > 1; much less well for use case 2. For me, these use cases are > orthogonal. I would be happy with two different approaches or the same > approach so long as the latter would retain the ability to save the view > (for use case 1). I pushed another take on the problem in "hide-table-column" branch. Rebasing is required. There, two commands are defined - `org-table-toggle-column-width' Shrink or expand column at point. More specifically, if the column contains a width cookie, the column is shrunk according to it. Otherwise, it is shrunk to 1 character. Here is its docstring: Shrink or expand current column in an Org table. If a width cookie specifies a width W for the column, the first W visible characters are displayed. Otherwise, the column is shrunk to a single character. When optional argument ARG is a string, use it as white space separated list of column ranges. A column range can be one of the following patterns: N column N only N-M every column between N and M (both inclusive) N- every column between N (inclusive) and the last column -M every column between the first one and M (inclusive) - every column When called with `C-u]' prefix, ask for the range specification. When called with `C-u C-u' prefix, expand all columns. - `org-table-shrink' Shrink all columns with a width cookie. Other columns are expanded. This is morally equivalent to the current behaviour, although it is now decoupled from aligning. Moreover, I added two new STARTUP keywords: "shrink" and "noshrink", which allow to apply aforementioned `org-table-shrink' command on all tables upon opening a document. Not that "align" no longer toggle column width. Feedback welcome. Regards, -- Nicolas Goaziou