emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Shrinking columns after formula recalculation
@ 2019-04-10 18:53 Nick Dokos
  2019-04-13  7:48 ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Nick Dokos @ 2019-04-10 18:53 UTC (permalink / raw)
  To: emacs-orgmode

I have a table with column width cookies. I shrink the columns with
C-u C-c TAB and then I recalculate with C-c C-c on the #TBLFM
line. The columns then get expanded and I have to do the C-u C-c TAB
again after every recalculation. Is there a way to have the columns
stay shrunk?

Example: An unsolved problem in number theory: for what values of n
is n! - 1 a prime?

|  n |                                     n! -1 | prime? |
|----+-------------------------------------------+--------|
|  / |                                      <10> |        |
| 30 |         265252859812191058636308479999999 |      1 |
| 31 |        8222838654177922817725562879999999 |      0 |
| 32 |      263130836933693530167218012159999999 |      1 |
| 33 |     8683317618811886495518194401279999999 |      1 |
| 34 |   295232799039604140847618609643519999999 |      0 |
| 35 | 10333147966386144929666651337523199999999 |      0 |
#+TBLFM: @3$2..@>$2 = fact($1) -1 :: @3$3..@>$3 = prime($2, 10)

Thanks!
-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Shrinking columns after formula recalculation
  2019-04-10 18:53 Shrinking columns after formula recalculation Nick Dokos
@ 2019-04-13  7:48 ` Nicolas Goaziou
  2019-04-15  2:50   ` Nick Dokos
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2019-04-13  7:48 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode

Hello,

Nick Dokos <ndokos@gmail.com> writes:

> I have a table with column width cookies. I shrink the columns with
> C-u C-c TAB and then I recalculate with C-c C-c on the #TBLFM
> line. The columns then get expanded and I have to do the C-u C-c TAB
> again after every recalculation. Is there a way to have the columns
> stay shrunk?
>
> Example: An unsolved problem in number theory: for what values of n
> is n! - 1 a prime?
>
> |  n |                                     n! -1 | prime? |
> |----+-------------------------------------------+--------|
> |  / |                                      <10> |        |
> | 30 |         265252859812191058636308479999999 |      1 |
> | 31 |        8222838654177922817725562879999999 |      0 |
> | 32 |      263130836933693530167218012159999999 |      1 |
> | 33 |     8683317618811886495518194401279999999 |      1 |
> | 34 |   295232799039604140847618609643519999999 |      0 |
> | 35 | 10333147966386144929666651337523199999999 |      0 |
>
> #+TBLFM: @3$2..@>$2 = fact($1) -1 :: @3$3..@>$3 = prime($2, 10)

Fixed. Thank you.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Shrinking columns after formula recalculation
  2019-04-13  7:48 ` Nicolas Goaziou
@ 2019-04-15  2:50   ` Nick Dokos
  2019-04-15 10:24     ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Nick Dokos @ 2019-04-15  2:50 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> Nick Dokos <ndokos@gmail.com> writes:
>
>> I have a table with column width cookies. I shrink the columns with
>> C-u C-c TAB and then I recalculate with C-c C-c on the #TBLFM
>> line. The columns then get expanded and I have to do the C-u C-c TAB
>> again after every recalculation. Is there a way to have the columns
>> stay shrunk?
>>
>> Example: An unsolved problem in number theory: for what values of n
>> is n! - 1 a prime?
>>
>> |  n |                                     n! -1 | prime? |
>> |----+-------------------------------------------+--------|
>> |  / |                                      <10> |        |
>> | 30 |         265252859812191058636308479999999 |      1 |
>> | 31 |        8222838654177922817725562879999999 |      0 |
>> | 32 |      263130836933693530167218012159999999 |      1 |
>> | 33 |     8683317618811886495518194401279999999 |      1 |
>> | 34 |   295232799039604140847618609643519999999 |      0 |
>> | 35 | 10333147966386144929666651337523199999999 |      0 |
>>
>> #+TBLFM: @3$2..@>$2 = fact($1) -1 :: @3$3..@>$3 = prime($2, 10)
>
> Fixed. Thank you.
>

Indeed - thank you!

But since no good deed shall go unpunished, here's another related
problem I ran into: with shrunk columns, I add a few more rows to the
table with S-RET on the first column, recalculate to populate the
added rows and then do an undo. That undoes the results of the
recalculation but it also unshrinks the column.

Thanks again!
-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Shrinking columns after formula recalculation
  2019-04-15  2:50   ` Nick Dokos
@ 2019-04-15 10:24     ` Nicolas Goaziou
  2019-04-15 12:47       ` Nick Dokos
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2019-04-15 10:24 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode

Hello,

Nick Dokos <ndokos@gmail.com> writes:

> But since no good deed shall go unpunished, here's another related
> problem I ran into: with shrunk columns, I add a few more rows to the
> table with S-RET on the first column, recalculate to populate the
> added rows and then do an undo. That undoes the results of the
> recalculation but it also unshrinks the column.

Yes, undo unshrinks. This is a good thing as one might not notice undone
changes within a shrunk column.

Also, AFAIK, there is no elegant way (i.e., not writing `org-undo') to
circumvent the issue, if it is considered as such.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Shrinking columns after formula recalculation
  2019-04-15 10:24     ` Nicolas Goaziou
@ 2019-04-15 12:47       ` Nick Dokos
  0 siblings, 0 replies; 5+ messages in thread
From: Nick Dokos @ 2019-04-15 12:47 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> Nick Dokos <ndokos@gmail.com> writes:
>
>> But since no good deed shall go unpunished, here's another related
>> problem I ran into: with shrunk columns, I add a few more rows to the
>> table with S-RET on the first column, recalculate to populate the
>> added rows and then do an undo. That undoes the results of the
>> recalculation but it also unshrinks the column.
>
> Yes, undo unshrinks. This is a good thing as one might not notice undone
> changes within a shrunk column.
>
> Also, AFAIK, there is no elegant way (i.e., not writing `org-undo') to
> circumvent the issue, if it is considered as such.
>

OK - thanks!
-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-04-15 12:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-10 18:53 Shrinking columns after formula recalculation Nick Dokos
2019-04-13  7:48 ` Nicolas Goaziou
2019-04-15  2:50   ` Nick Dokos
2019-04-15 10:24     ` Nicolas Goaziou
2019-04-15 12:47       ` Nick Dokos

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).