emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: emacs-orgmode@gnu.org
Subject: Re: [RFC] Shrink columns dynamically
Date: Thu, 27 Jul 2017 12:11:57 +0200	[thread overview]
Message-ID: <87d18mmbo2.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <87mv89skje.fsf@delle7240.chemeng.ucl.ac.uk> (Eric S. Fraga's message of "Wed, 12 Jul 2017 17:10:45 +0100")

Hello,

Eric S Fraga <e.fraga@ucl.ac.uk> 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

  parent reply	other threads:[~2017-07-27 10:12 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-10 12:12 [RFC] Shrink columns dynamically Nicolas Goaziou
2017-07-10 14:36 ` Uwe Brauer
2017-07-10 14:43   ` Nicolas Goaziou
2017-07-10 19:47     ` Uwe Brauer
2017-07-10 20:14       ` Nick Dokos
2017-07-10 20:59       ` Nicolas Goaziou
2017-07-11  6:27         ` Uwe Brauer
2017-07-11  7:54           ` Nicolas Goaziou
2017-07-11  8:35             ` Uwe Brauer
2017-07-11 11:41               ` Nicolas Goaziou
2017-07-11 12:03                 ` Uwe Brauer
2017-07-11 12:24                   ` Nicolas Goaziou
2017-07-11 17:56                     ` Kaushal Modi
2017-07-11 19:09                       ` Nicolas Goaziou
2017-07-11 19:23                         ` Kaushal Modi
2017-07-12  7:22                           ` Colin Baxter
2017-07-12 10:17                             ` Nicolas Goaziou
2017-07-12 16:06                               ` Colin Baxter
2017-07-12 19:14                               ` Rick Frankel
2017-07-27 11:47                                 ` Nicolas Goaziou
     [not found]                             ` <158a779e34564ef98104c442384dadd3@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2017-07-12 16:10                               ` Eric S Fraga
2017-07-16 10:54                                 ` B.V. Raghav
2017-07-27 10:14                                   ` Nicolas Goaziou
2017-07-27 10:11                                 ` Nicolas Goaziou [this message]
2017-07-31 22:29                                   ` Adam Porter
2017-08-05 22:56                                     ` Nicolas Goaziou
     [not found]                                 ` <e59b6e794bff46c29380611204d00402@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2017-07-27 10:49                                   ` Eric S Fraga
2017-08-05 22:54                                     ` Nicolas Goaziou
2017-08-19 16:54                                       ` Nicolas Goaziou
2017-09-06 13:29                                         ` Nicolas Goaziou
2017-07-11 20:21                         ` Uwe Brauer
2017-07-11  9:32             ` Uwe Brauer
2017-07-10 22:11     ` Kaushal Modi
2017-07-11  6:16       ` Michael Brand
2017-07-11 11:18         ` Deleting org table columns during export (Was: [RFC] Shrink columns dynamically) Kaushal Modi
2017-07-11 16:43           ` Michael Brand
2017-07-11 11:47         ` [RFC] Shrink columns dynamically Nicolas Goaziou
2017-07-11 16:40           ` Michael Brand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d18mmbo2.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).