* Table Columns
@ 2019-01-24 14:33 Scott Randby
0 siblings, 0 replies; 5+ messages in thread
From: Scott Randby @ 2019-01-24 14:33 UTC (permalink / raw)
To: emacs-orgmode
Greetings,
I had to stop using the align and shrink startup options because at least one of them causes a considerable delay when opening an Org file that contains many tables (in my case, 25 or more tables). The delay makes sense, and it isn't a big deal to not use these options, but I wonder this: Is there a way to tell Org to align and shrink all the tables in an Org file after startup or does it have to be done on an individual basis?
Scott Randby
^ permalink raw reply [flat|nested] 5+ messages in thread
* Table Columns
@ 2019-01-24 18:15 Scott Randby
2019-01-24 20:36 ` Nicolas Goaziou
0 siblings, 1 reply; 5+ messages in thread
From: Scott Randby @ 2019-01-24 18:15 UTC (permalink / raw)
To: emacs-orgmode
Greetings,
Sorry for repeating the message, but I want to add a bit to it.
I had to stop using the align and shrink startup options because at least one of them causes a considerable delay when opening an Org file that contains many tables (in my case, 25 or more tables). The delay makes sense, and it isn't a big deal to not use these options, but I wonder this: Is there a way to tell Org to align and shrink all the tables in an Org file after startup or does it have to be done on an individual basis?
My use case is this: I have an Org file with many tables and I edit some of them which requires me to shrink those tables. Later, I run a macro which accesses and alters all of the tables. I need all of the tables to be in the same state so that the macro runs correctly. I guess the solution is to have the macro put a table in the proper state before it does anything to that table, but that is one more thing I have to remember to put in the macro. It would be easiest if I could just tell Org to unshrink (which is what I actually want) all tables in the file before I run the macro.
Scott Randby
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Table Columns
2019-01-24 18:15 Scott Randby
@ 2019-01-24 20:36 ` Nicolas Goaziou
2019-01-24 21:45 ` Scott Randby
0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2019-01-24 20:36 UTC (permalink / raw)
To: Scott Randby; +Cc: emacs-orgmode
Hello,
Scott Randby <srandby@gmail.com> writes:
> I wonder this: Is there a way to tell Org to align and shrink all the
> tables in an Org file after startup or does it have to be done on an
> individual basis?
It should be
#+startup: align shrink
> My use case is this: I have an Org file with many tables and I edit
> some of them which requires me to shrink those tables. Later, I run
> a macro which accesses and alters all of the tables. I need all of the
> tables to be in the same state so that the macro runs correctly.
> I guess the solution is to have the macro put a table in the proper
> state before it does anything to that table, but that is one more
> thing I have to remember to put in the macro. It would be easiest if
> I could just tell Org to unshrink (which is what I actually want) all
> tables in the file before I run the macro.
There is no function to expand all tables in the buffer, but it is
pretty straightforward, and fast:
(dolist (o (overlays-in (point-min) (point-max)))
(when (eq 'table-column-hide (overlay-get o 'org-overlay-type))
(delete-overlay o)))
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Table Columns
2019-01-24 20:36 ` Nicolas Goaziou
@ 2019-01-24 21:45 ` Scott Randby
2019-01-25 11:11 ` Nicolas Goaziou
0 siblings, 1 reply; 5+ messages in thread
From: Scott Randby @ 2019-01-24 21:45 UTC (permalink / raw)
To: emacs-orgmode
On 1/24/19 3:36 PM, Nicolas Goaziou wrote:
> Scott Randby <srandby@gmail.com> writes:
>
>> I wonder this: Is there a way to tell Org to align and shrink all the
>> tables in an Org file after startup or does it have to be done on an
>> individual basis?
>
> It should be
>
> #+startup: align shrink
This is what I had in my file originally, but when I opened the file, there would be a lengthy delay before it actually opened. When I removed the code from the file, it opened immediately. I don't know what is going on.
>
>> My use case is this: I have an Org file with many tables and I edit
>> some of them which requires me to shrink those tables. Later, I run
>> a macro which accesses and alters all of the tables. I need all of the
>> tables to be in the same state so that the macro runs correctly.
>> I guess the solution is to have the macro put a table in the proper
>> state before it does anything to that table, but that is one more
>> thing I have to remember to put in the macro. It would be easiest if
>> I could just tell Org to unshrink (which is what I actually want) all
>> tables in the file before I run the macro.
>
> There is no function to expand all tables in the buffer, but it is
> pretty straightforward, and fast:
>
> (dolist (o (overlays-in (point-min) (point-max)))
> (when (eq 'table-column-hide (overlay-get o 'org-overlay-type))
> (delete-overlay o)))
Thanks, this works well. And I learned how to take your code and turn it into a function which is something I should have learned a long time ago. One of these days, I'll get around to really learning elisp instead of borrowing code others wrote and playing around with it like an amateur. Again, thank you very much.
Scott
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Table Columns
2019-01-24 21:45 ` Scott Randby
@ 2019-01-25 11:11 ` Nicolas Goaziou
0 siblings, 0 replies; 5+ messages in thread
From: Nicolas Goaziou @ 2019-01-25 11:11 UTC (permalink / raw)
To: Scott Randby; +Cc: emacs-orgmode
Hello,
Scott Randby <srandby@gmail.com> writes:
> On 1/24/19 3:36 PM, Nicolas Goaziou wrote:
>> Scott Randby <srandby@gmail.com> writes:
>>
>>> I wonder this: Is there a way to tell Org to align and shrink all the
>>> tables in an Org file after startup or does it have to be done on an
>>> individual basis?
>>
>> It should be
>>
>> #+startup: align shrink
>
> This is what I had in my file originally, but when I opened the file,
> there would be a lengthy delay before it actually opened. When
> I removed the code from the file, it opened immediately. I don't know
> what is going on.
The code navigates to each table, align them, determine what columns
should be shrunk, and actually shrink them. This is long if you have
many tables. It is indeed better, in this case, to shrink them
individually.
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-01-25 11:11 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-24 14:33 Table Columns Scott Randby
-- strict thread matches above, loose matches on Subject: below --
2019-01-24 18:15 Scott Randby
2019-01-24 20:36 ` Nicolas Goaziou
2019-01-24 21:45 ` Scott Randby
2019-01-25 11:11 ` Nicolas Goaziou
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).