From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Randby Subject: Re: Table Columns Date: Thu, 24 Jan 2019 16:45:41 -0500 Message-ID: <158db4a6-ef20-c815-9e59-faafde175e2a@gmail.com> References: <0b0033a4-e932-832b-3ca5-5ed7e83c05c4@gmail.com> <87k1itztbk.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([209.51.188.92]:43843) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gmn3Y-0004Rm-Kr for emacs-orgmode@gnu.org; Thu, 24 Jan 2019 17:01:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gmmok-0001eb-1v for emacs-orgmode@gnu.org; Thu, 24 Jan 2019 16:45:46 -0500 Received: from mail-io1-xd33.google.com ([2607:f8b0:4864:20::d33]:36028) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gmmoj-0001e6-Q5 for emacs-orgmode@gnu.org; Thu, 24 Jan 2019 16:45:45 -0500 Received: by mail-io1-xd33.google.com with SMTP id m19so6088174ioh.3 for ; Thu, 24 Jan 2019 13:45:44 -0800 (PST) Received: from ?IPv6:2605:a000:121e:94:490f:e07d:7da5:9b87? ([2605:a000:121e:94:490f:e07d:7da5:9b87]) by smtp.gmail.com with ESMTPSA id x128sm12118040itb.8.2019.01.24.13.45.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Jan 2019 13:45:43 -0800 (PST) In-Reply-To: <87k1itztbk.fsf@nicolasgoaziou.fr> Content-Language: en-US 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 On 1/24/19 3:36 PM, Nicolas Goaziou wrote: > Scott Randby 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