Post by Jean-Jacques Rétorré;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq LaTeX-verbatim-environments-local '("truc"
"machin"
"bidule"
))
(dolist (env LaTeX-verbatim-environments-local)
(add-to-list 'LaTeX-indent-environment-list (list env #'current-indentation))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;
Cette fois j'ai testé (je ne l'avais pas fait honte à moi ) car ça
m'avais paru trop facile, maintenant je comprends mieux ta demande.
Bon, finalement, ça marchait dans mon instance Emacs déjà ouverte, mais
le redémarrage plante. Si je commente la ligne `(dolist ...)` puis
redémarre, Emacs se lance normalement et un C-x C-e en fin de cette
ligne me donne :
┌────
│ Debugger entered--Lisp error: (void-variable LaTeX-indent-environment-list)
│ (member x LaTeX-indent-environment-list)
│ (if (member x LaTeX-indent-environment-list) LaTeX-indent-environment-list (setq LaTeX-indent-environment-list (cons x LaTeX-indent-environment-list)))
│ (let* ((x (list env (function current-indentation)))) (if (member x LaTeX-indent-environment-list) LaTeX-indent-environment-list (setq LaTeX-indent-environment-list (cons x LaTeX-indent-environment-list))))
│ (while --dolist-tail-- (setq env (car --dolist-tail--)) (let* ((x (list env (function current-indentation)))) (if (member x LaTeX-indent-environment-list) LaTeX-indent-environment-list (setq LaTeX-indent-environment-list (cons x LaTeX-indent-environment-list)))) (setq --dolist-tail-- (cdr --dolist-tail--)))
│ (let ((--dolist-tail-- LaTeX-verbatim-environments-local) env) (while --dolist-tail-- (setq env (car --dolist-tail--)) (let* ((x (list env (function current-indentation)))) (if (member x LaTeX-indent-environment-list) LaTeX-indent-environment-list (setq LaTeX-indent-environment-list (cons x LaTeX-indent-environment-list)))) (setq --dolist-tail-- (cdr --dolist-tail--))))
│ eval((let ((--dolist-tail-- LaTeX-verbatim-environments-local) env) (while --dolist-tail-- (setq env (car --dolist-tail--)) (let* ((x (list env (function current-indentation)))) (if (member x LaTeX-indent-environment-list) LaTeX-indent-environment-list (setq LaTeX-indent-environment-list (cons x LaTeX-indent-environment-list)))) (setq --dolist-tail-- (cdr --dolist-tail--)))) nil)
│ elisp--eval-last-sexp(nil)
│ eval-last-sexp(nil)
│ funcall-interactively(eval-last-sexp nil)
│ call-interactively(eval-last-sexp nil nil)
│ command-execute(eval-last-sexp)
└────
Pourtant, `C-h v RET LaTeX-indent-environment-list RET` donne :
┌────
│ LaTeX-indent-environment-list is a variable defined in ‘latex.el’.
│ Its value is shown below.
│
│ Documentation:
│ Alist of environments with special indentation.
│ The second element in each entry is the function to calculate the
│ indentation level in columns.
│
│ Environments present in this list are not filled by filling
│ functions, see ‘LaTeX-fill-region-as-paragraph’.
│
│ You can customize this variable.
│
│ Value:
│ (("sverbatim" current-indentation)
│ ("comment" current-indentation)
│ ("tikzpicture" current-indentation)
│ ("verbatim" current-indentation)
│ ("verbatim*" current-indentation)
│ ("filecontents" current-indentation)
│ ("filecontents*" current-indentation)
│ ("tabular" LaTeX-indent-tabular)
│ ("tabular*" LaTeX-indent-tabular)
│ ("align" LaTeX-indent-tabular)
│ ("align*" LaTeX-indent-tabular)
│ ("array" LaTeX-indent-tabular)
│ ("eqnarray" LaTeX-indent-tabular)
│ ("eqnarray*" LaTeX-indent-tabular)
│ ("displaymath")
│ ("equation")
│ ("equation*")
│ ("picture")
│ ("tabbing"))
│ Original value was
│ (("verbatim" current-indentation)
│ ("verbatim*" current-indentation)
│ ("filecontents" current-indentation)
│ ("filecontents*" current-indentation)
│ ("tabular" LaTeX-indent-tabular)
│ ("tabular*" LaTeX-indent-tabular)
│ ("align" LaTeX-indent-tabular)
│ ("align*" LaTeX-indent-tabular)
│ ("array" LaTeX-indent-tabular)
│ ("eqnarray" LaTeX-indent-tabular)
│ ("eqnarray*" LaTeX-indent-tabular)
│ ("displaymath")
│ ("equation")
│ ("equation*")
│ ("picture")
│ ("tabbing"))
└────
la différence entre les valeurs courantes et originales étant dues au
fait que `emacs-leuven` contient :
┌────
│ (add-to-list 'LaTeX-indent-environment-list '("tikzpicture" current-indentation))
│ (add-to-list 'LaTeX-indent-environment-list '("comment" current-indentation))
│ (add-to-list 'LaTeX-indent-environment-list '("sverbatim" current-indentation))
└────
--
Denis