emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Re-align All Tables in a Region.
@ 2012-08-18  8:14 Ian Barton
  2012-08-18  8:40 ` Andrew Young
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Barton @ 2012-08-18  8:14 UTC (permalink / raw)
  To: emacs-orgmode

I have a file which contains lots of tables. The document is created by 
a shell script, so when it's opened none of the tables are aligned. Is 
there a command that will let me re-align all tables in a region? There 
are a lot of tables, so I don't want to do them one at a time.

As a workaround I have used #+STARTUP: align in the buffer, which aligns 
them if I C-c on the in buffer setting.

Ian.

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

* Re: Re-align All Tables in a Region.
  2012-08-18  8:14 Re-align All Tables in a Region Ian Barton
@ 2012-08-18  8:40 ` Andrew Young
  2012-08-18 15:09   ` Bastien
  2012-08-19 10:46   ` Ian Barton
  0 siblings, 2 replies; 4+ messages in thread
From: Andrew Young @ 2012-08-18  8:40 UTC (permalink / raw)
  To: ian; +Cc: emacs-orgmode

Hi Ian,

On Sat, Aug 18, 2012 at 4:14 AM, Ian Barton <lists@wilkesley.net> wrote:
> I have a file which contains lots of tables. The document is created by a
> shell script, so when it's opened none of the tables are aligned. Is there a
> command that will let me re-align all tables in a region? There are a lot of
> tables, so I don't want to do them one at a time.
>
> As a workaround I have used #+STARTUP: align in the buffer, which aligns
> them if I C-c on the in buffer setting.
>
> Ian.
>

Not sure if there is a built-in, but this seems to work for me:

#+begin_src emacs-lisp
  (defun my-align-all-tables ()
    (interactive)
    (org-table-map-tables 'org-table-align 'quietly))
#+end_src

Hope this helps.

Sincerely,
Andrew

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

* Re: Re-align All Tables in a Region.
  2012-08-18  8:40 ` Andrew Young
@ 2012-08-18 15:09   ` Bastien
  2012-08-19 10:46   ` Ian Barton
  1 sibling, 0 replies; 4+ messages in thread
From: Bastien @ 2012-08-18 15:09 UTC (permalink / raw)
  To: Andrew Young; +Cc: ian, emacs-orgmode

Hi Andrew,

Andrew Young <youngar17@gmail.com> writes:

> Not sure if there is a built-in, but this seems to work for me:
>
> #+begin_src emacs-lisp
>   (defun my-align-all-tables ()
>     (interactive)
>     (org-table-map-tables 'org-table-align 'quietly))
> #+end_src

Neat.  I added an entry for this in the worg/org-hacks.org file.

Thanks,

-- 
 Bastien

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

* Re: Re-align All Tables in a Region.
  2012-08-18  8:40 ` Andrew Young
  2012-08-18 15:09   ` Bastien
@ 2012-08-19 10:46   ` Ian Barton
  1 sibling, 0 replies; 4+ messages in thread
From: Ian Barton @ 2012-08-19 10:46 UTC (permalink / raw)
  To: emacs-orgmode

On 18/08/12 09:40, Andrew Young wrote:
Sat, Aug 18, 2012 at 4:14 AM, Ian Barton <lists@wilkesley.net> wrote:
>> I have a file which contains lots of tables. The document is created by a
>> shell script, so when it's opened none of the tables are aligned. Is there a
>> command that will let me re-align all tables in a region? There are a lot of
>> tables, so I don't want to do them one at a time.
>>
>> As a workaround I have used #+STARTUP: align in the buffer, which aligns
>> them if I C-c on the in buffer setting.
>>
>> Ian.
>>
>
> Not sure if there is a built-in, but this seems to work for me:
>
> #+begin_src emacs-lisp
>    (defun my-align-all-tables ()
>      (interactive)
>      (org-table-map-tables 'org-table-align 'quietly))
> #+end_src
>
> Hope this helps.
>
> Sincerely,
> Andrew
>
Thanks Andrew, that works perfectly.

Ian.

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

end of thread, other threads:[~2012-08-19 10:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-18  8:14 Re-align All Tables in a Region Ian Barton
2012-08-18  8:40 ` Andrew Young
2012-08-18 15:09   ` Bastien
2012-08-19 10:46   ` Ian Barton

Code repositories for project(s) associated with this 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).