auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [AUCTeX] How to fold #+ORGTBL: lines


From: Joost Kremers
Subject: Re: [AUCTeX] How to fold #+ORGTBL: lines
Date: Thu, 27 Feb 2014 18:47:23 +0100
User-agent: mu4e 0.9.9.6pre2; emacs 24.3.1

On Thu, Feb 27 2014, Tassilo Horn <address@hidden> wrote:
> first of all, I don't use folding so I'm no expert there.

Why not? It's great.

>> I'm working a lot with orgtbl's in my latex documents. 
>> I would like to know if it's possible make some folding rules for
>> lines like this to beautify my code and make it more readable..
>>
>> The lines look like this
>>
>> #+ORGTBL: SEND sec-6 orgtbl-to-latex :skip 3 :splice t :lend
>> "\\\\\\cmidrule(lr){4-4}\\\cmidrule(lr){5-5}\\\cmidrule(lr){6-6}\\\cmidrule(lr){7-7}"
>>   :hline
>> "%%"
>
> Are those lines in comments or something?
>
>> Does anyone have an idea?
>
> A quick look seemed to indicate that folding works only for math,
> macros, and environments.  How about defining your own orgtbl
> environment and then wrapping those orgtbl lines with it.  Then you can
> define folding for your orgtbl environment in `TeX-fold-env-spec-list'
> or `LaTeX-fold-env-spec-list'.

Yeah, this is exactly what I do. I use the comment package to define a
comment environment called "orgtbl", which I then fold in
TeX-fold-env-spec-list (I guess LaTeX-fold-env-spec-list would be more
appropriate, but it works either way.)

There is one (small) disadvantage to this, so while we're on the
subject, I might as well make a feature request regarding TeX-fold-mode:
the problem is that although you can disable folding in comments that
start with %, it's not possible to disable folding inside comment
environments (either \begin{comment}...\end{comment} or user-defined
comment environments). Would it be possible to add that option? Also,
it'd be nice to have the option to disable folding in the preamble (or
even make that the default).

The reason for this request is that commands that are folded may occur
in the preamble and in #+ORGTBL lines without any argument. (In the
preamble in \newcommand definitions, for example), which leads to those
big ugly [Error: No content or function found] messages...

Anyway, just a nitpick, I know, but still... :-)

Joost


-- 
Joost Kremers
Life has its moments




reply via email to

[Prev in Thread] Current Thread [Next in Thread]