Emacs: unindented verbatim/listing blocks

master
Pierre Neidhardt 2014-03-13 14:26:27 +01:00
parent a3e3cd1d2f
commit a4e74b58ea
1 changed files with 6 additions and 11 deletions

View File

@ -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