Ralf Angeli <[EMAIL PROTECTED]> writes: > * Patrick Drechsler (2006-12-20) writes: > >>> (defvar pd-folding-done-p nil) >>> (make-variable-buffer-local 'pd-folding-done-p) >>> (add-hook 'LaTeX-mode-hook (lambda () >>> (unless pd-folding-done-p >>> (TeX-fold-mode 1) >>> (TeX-fold-buffer) >>> (setq pd-folding-done-p t)))) >> >> Thanks for taking the time Ralf! >> >> I have tried your code both using the Emacs version mentioned in the OP >> as well as with Emacs 23[1]. I do not see any difference in behaviour. > > Ugh, I should probably test the code before I post it. But I'm quite > baffled now because I thought this was a sure shot. > > The code does not work because in the hook the global value of > `pd-folding-done-p' is checked. When setting a breakpoint on > `TeX-fold-buffer' I get the following backtrace: > > Debugger entered--entering a function: > * TeX-fold-buffer() > (if pd-folding-done-p nil (TeX-fold-mode 1) (TeX-fold-buffer) (setq > pd-folding-done-p t)) > (unless pd-folding-done-p (TeX-fold-mode 1) (TeX-fold-buffer) (setq > pd-folding-done-p t)) > (lambda nil (unless pd-folding-done-p (TeX-fold-mode 1) (TeX-fold-buffer) > (setq pd-folding-done-p t)))() > run-hooks(text-mode-hook TeX-mode-hook LaTeX-mode-hook) > apply(run-hooks (text-mode-hook TeX-mode-hook LaTeX-mode-hook)) > TeX-run-mode-hooks(text-mode-hook TeX-mode-hook LaTeX-mode-hook) > latex-mode() > noweb-select-mode() > noweb-post-command-function() > run-hooks(post-command-hook) > > Now when I check `pd-folding-done-p' with `C-h v', the local value I > can see when using `C-h v' in the LaTeX buffer is not there. Does > anybody have an idea why?
(defun VirTeX-common-initialization () "Perform basic initialization." (kill-all-local-variables) [...] -- David Kastrup, Kriemhildstr. 15, 44793 Bochum _______________________________________________ bug-auctex mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-auctex
