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

Previous Next

Package: emacs;

Reported by: Norman Ramsey <nr <at> cs.tufts.edu>

Date: Thu, 7 Jun 2012 16:26:01 UTC

Severity: minor

Found in version 23.2

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #10 received at 11646-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Norman Ramsey <nr <at> cs.tufts.edu>
Cc: 11646-done <at> debbugs.gnu.org
Subject: Re: bug#11646: 23.2;
	latex-close-block indenting \end{verbatim} incorrectly
Date: Wed, 13 Jun 2012 09:57:47 -0400
>     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





This bug report was last modified 13 years and 59 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.