From a4e74b58eaca4c17b80f9fd2d42d901b3b65ed42 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Thu, 13 Mar 2014 14:26:27 +0100 Subject: [PATCH] Emacs: unindented verbatim/listing blocks --- .emacs.d/mode-latex.el | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/.emacs.d/mode-latex.el b/.emacs.d/mode-latex.el index 41d8dd27..f0e7c466 100644 --- a/.emacs.d/mode-latex.el +++ b/.emacs.d/mode-latex.el @@ -40,7 +40,12 @@ ;; LaTeX setup (setq latex-block-default "itemize") -(setq latex-block-names '("description" "listing" "quote" "verbatim")) +(setq latex-block-names '("listing")) + +(mapcar + (lambda (latex-block) + (add-to-list 'latex-block-body-alist `(,latex-block nil '(delete-horizontal-space t) _))) + '("listing" "verbatim" "verbatim*")) (add-hook-and-eval 'latex-mode-hook @@ -81,16 +86,6 @@ (define-skeleton latex-subsection "Insert section command." nil "\\subsection{" @ _ "}" \n) (define-skeleton latex-subsubsection "Insert section command." nil "\\subsubsection{" @ _ "}" \n) -;; TODO: use block option to tell `latex-insert-block not to indent. -(define-skeleton latex-listing - "Insert listing. -This skel is different from `latex-insert-block' in the way that - the content is not indented." - nil - "\\begin{lstlisting}\n" - @ _ \n - "\\end{lstlisting}" > \n @) - ;; TODO: If tabular, center. ;; TODO: complete with '(tabular, align, "pmatrix" "bmatrix" "Bmatrix" "vmatrix" "Vmatrix" "smallmatrix"))}} (define-skeleton latex-matrix