bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#11646: 23.2; latex-close-block indenting \end{verbatim} incorrectly


From: Stefan Monnier
Subject: bug#11646: 23.2; latex-close-block indenting \end{verbatim} incorrectly
Date: Wed, 13 Jun 2012 09:57:47 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

>     C-x C-f /tmp/foo.text

I presume you meant "foo.tex" ;-)

> Enter
>     \begin{verbatim} RET SPC SPC SPC hello RET C-c C-e
> and the resulting \end{verbatim} is indented three spaces instead of in
> column 0 as it should be.
> The problem does not manifest with \begin{quote}.

Yes, verbatim is special in LaTeX, and hence so it is in latex-mode.
The bug actually seems to require you be at EOB when hitting C-c C-e.
I've installed the patch below which seems to fix the root cause.


        Stefan


=== modified file 'lisp/textmodes/tex-mode.el'
--- lisp/textmodes/tex-mode.el  2012-04-16 23:57:09 +0000
+++ lisp/textmodes/tex-mode.el  2012-06-13 13:55:17 +0000
@@ -2686,7 +2686,9 @@
   "Syntax table used while computing indentation.")
 
 (defun latex-indent (&optional arg)
-  (if (and (eq (get-text-property (line-beginning-position) 'face)
+  (if (and (eq (get-text-property (if (and (eobp) (bolp))
+                                      (max (point-min) (1- (point)))
+                                    (line-beginning-position)) 'face)
               'tex-verbatim))
       'noindent
     (with-syntax-table tex-latex-indent-syntax-table






reply via email to

[Prev in Thread] Current Thread [Next in Thread]