First, I'm not subscribed to this list, so please add me to Cc for any possible
response (sorry, I already have to much traffic on my inbox).

When inserting a section with `TeX-insert-macro', if `TeX-fold-auto' is
activated, the section is immediatly folded, yielding a folded section with an
empty title, whereas I expected the section to have the "folding overlay", but
stay open until I got out of it (like when you enter a folded overlay).

Refining the auto-folding, what I really want is for all foldable macros to be
folded just after typing the '}' character. As I've been unable to find such a
feature in Auctex, I've added this to my latex hook (please tell me if this
already exists):

    (local-set-key [(})] '(lambda () (interactive) (insert "}")
                            (save-excursion (backward-char) (TeX-fold-macro))))

The save excursion keeps me safe in case the '}' was not part of a macro.

The problem is that when adding a section, it is folded with the same appearance
of a `ref' macro; but if I enter the overlay and then exit it, the folded
overlay is now correctly shown.

Thus, as a workaround I had to change the binding to:

    (local-set-key [(})] '(lambda () (interactive) (insert "}")
                            (TeX-fold-buffer)))

which is an overkill solution, as this folds the entire buffer, including some
environments that I might have left intentionally open.


Thanks,
        Lluis


--
 "And it's much the same thing with knowledge, for whenever you learn
 something new, the whole world becomes that much richer."
 -- The Princess of Pure Reason, as told by Norton Juster in The Phantom
 Tollbooth

_______________________________________________
bug-auctex mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-auctex

Reply via email to