[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [AUCTeX-devel] [PATCH] New function to align tables
From: |
Damien Cassou |
Subject: |
Re: [AUCTeX-devel] [PATCH] New function to align tables |
Date: |
Wed, 31 Aug 2011 11:12:07 +0200 |
On Tue, Aug 30, 2011 at 11:53 AM, Ivan Andrus <address@hidden> wrote:
> How does this differ from running `fill-paragraph' in the tabular
> environment? It should be set up by `LaTeX-indent-environment-list' to run
> `align' (unless I set that up in my .emacs, but I don't think so).
In my configuration, fill-paragraph doesn't do anything to my tables.
I don't even have this `LaTeX-indent-environment-list' variable. Could
you please check?
In the meantime, I updated my function so that it removes useless
spaces and aligns '\\' too:
(defun LaTeX-align-table ()
(interactive)
(save-excursion
(LaTeX-mark-environment)
(while (re-search-forward "& *" (region-end) t)
(replace-match "& " nil nil))
(LaTeX-mark-environment)
(align-regexp (region-beginning) (region-end)
"\\(\\s-*\\)\\(&\\|\\\\\\\\\\)" 1 1 t)))
if you have a function that automatically makes a tabular environment
clean by aligning all '&' and '\\' vertically then my function is
useless. But I haven't found any yet.
--
Damien Cassou
http://damiencassou.seasidehosting.st
"Lambdas are relegated to relative obscurity until Java makes them
popular by not having them." James Iry