[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-AUCTeX] TeX-insert-macro section with TeX-fold-auto
From: |
Lluís |
Subject: |
[Bug-AUCTeX] TeX-insert-macro section with TeX-fold-auto |
Date: |
Tue, 11 May 2010 20:58:47 +0200 |
User-agent: |
Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.7 Emacs/24.0.50 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) |
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] TeX-insert-macro section with TeX-fold-auto,
Lluís <=