unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#11646: 23.2; latex-close-block indenting \end{verbatim} incorrectly
@ 2012-06-07 12:14 Norman Ramsey
  2012-06-13 13:57 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Norman Ramsey @ 2012-06-07 12:14 UTC (permalink / raw)
  To: 11646

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

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}.


In GNU Emacs 23.2.1 (x86_64-pc-linux-gnu, GTK+ Version 2.20.1)
 of 2010-12-11 on brahms, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.10707000
configured using `configure  '--build' 'x86_64-linux-gnu' '--build' 'x86_64-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.2/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.2/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS=''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: nil
  value of $XMODIFIERS: nil
  locale-coding-system: nil
  default enable-multibyte-characters: t

Major mode: TeX

Minor modes in effect:
  flyspell-mode: t
  shell-dirtrack-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t

Recent input:
C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p 
C-p C-p C-p C-p C-o b n { a r r y <backspace> a y } 
{ c } C-a C-x C-s C-n C-x 4 b i n t e r p s . t e <tab> 
C-g C-x 4 f <M-backspace> <M-backspace> <M-backspace> 
p a p <tab> h o i <tab> <backspace> t <tab> u l u <tab> 
p <tab> i n t <tab> t e <tab> <return> C-s \ c a p 
t i o n C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-a 
<prior> C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-l 
C-p C-p C-SPC C-n M-w C-x o C-n C-n C-o C-o <return> 
C-p C-p C-e \ \ <return> C-y C-p M-f M-f _ 2 C-f C-f 
v _ 1 SPC \ o p l k <backspace> u s M-d SPC C-a \ t 
r a n s i t i o n SPC { C-e M-b M-b M-b M-f C-a M-f 
M-f C-f C-f <M-backspace> <backspace> M-f M-f M-f M-e 
C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-e <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <return> 
SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC { v 
, SPC \ s t a c k , SPC r h o <backspace> <backspace> 
<backspace> \ r h o \ SPC <backspace> <backspace> , 
SPC \ s i g m a } \ \ <return> C-c C-e C-a C-c C-e 
C-p C-p C-p <backspace> <backspace> <backspace> C-a 
C-n C-c C-e C-p C-p C-p SPC SPC SPC C-a C-n <return> 
C-c C-e C-h k C-c C-e M-x r e p o <tab> r <tab> <r
eturn>

Recent messages:
Starting new Ispell process [american] ...
Mark saved where search started
Mark set
Ispell process killed
Starting new Ispell process [american] ...
Mark set
Auto-saving...done
Auto-saving...done
Type C-x 4 C-o RET to restore the other window.
Making completion list...

Load-path shadows:
/usr/share/emacs/site-lisp/haskell-mode/haskell-font-lock hides /usr/share/emacs/23.2/site-lisp/haskell-mode/haskell-font-lock
/usr/share/emacs/site-lisp/haskell-mode/haskell-indentation hides /usr/share/emacs/23.2/site-lisp/haskell-mode/haskell-indentation
/usr/share/emacs/site-lisp/haskell-mode/inf-haskell hides /usr/share/emacs/23.2/site-lisp/haskell-mode/inf-haskell
/usr/share/emacs/site-lisp/haskell-mode/haskell-mode hides /usr/share/emacs/23.2/site-lisp/haskell-mode/haskell-mode
/usr/share/emacs/site-lisp/haskell-mode/haskell-hugs hides /usr/share/emacs/23.2/site-lisp/haskell-mode/haskell-hugs
/usr/share/emacs/site-lisp/haskell-mode/haskell-site-file hides /usr/share/emacs/23.2/site-lisp/haskell-mode/haskell-site-file
/usr/share/emacs/site-lisp/haskell-mode/haskell-cabal hides /usr/share/emacs/23.2/site-lisp/haskell-mode/haskell-cabal
/usr/share/emacs/site-lisp/haskell-mode/ghc-core hides /usr/share/emacs/23.2/site-lisp/haskell-mode/ghc-core
/usr/share/emacs/site-lisp/haskell-mode/haskell-decl-scan hides /usr/share/emacs/23.2/site-lisp/haskell-mode/haskell-decl-scan
/usr/share/emacs/site-lisp/haskell-mode/haskell-doc hides /usr/share/emacs/23.2/site-lisp/haskell-mode/haskell-doc
/usr/share/emacs/site-lisp/haskell-mode/haskell-c hides /usr/share/emacs/23.2/site-lisp/haskell-mode/haskell-c
/usr/share/emacs/site-lisp/haskell-mode/haskell-indent hides /usr/share/emacs/23.2/site-lisp/haskell-mode/haskell-indent
/usr/share/emacs/site-lisp/haskell-mode/haskell-ghci hides /usr/share/emacs/23.2/site-lisp/haskell-mode/haskell-ghci
/usr/share/emacs/site-lisp/haskell-mode/haskell-simple-indent hides /usr/share/emacs/23.2/site-lisp/haskell-mode/haskell-simple-indent
/usr/share/emacs/23.2/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup
~nr/emacs/noweb-mode hides /usr/share/emacs/site-lisp/noweb-mode
~nr/emacs/longlines hides /usr/share/emacs/23.2/lisp/longlines
~nr/emacs/mwheel hides /usr/share/emacs/23.2/lisp/mwheel
/usr/share/emacs23/site-lisp/dictionaries-common/flyspell hides /usr/share/emacs/23.2/lisp/textmodes/flyspell
/usr/share/emacs23/site-lisp/dictionaries-common/ispell hides /usr/share/emacs/23.2/lisp/textmodes/ispell

Features:
(shadow sort mail-extr message sendmail ecomplete rfc822 mml mml-sec
password-cache mm-decode mm-bodies mm-encode mailcap mail-parse rfc2231
rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader gnus-util netrc
time-date mm-util mail-prsvr gmm-utils wid-edit mailheader canlock sha1
hex-util hashcash mail-utils emacsbug latexenc debug help-mode view
skeleton multi-isearch sml-menus sml-mode cc-mode cc-fonts cc-menus
cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs haskell-font-lock
haskell-decl-scan haskell-doc haskell-indentation haskell-indent
haskell-mode byte-opt bytecomp byte-compile pp haskell-cabal dired
sh-script executable caml vc-git vc-hg flyspell ispell tex-mode
regexp-opt shell desktop darcsum easymenu add-log rect assoc
scroll-in-place noweb derived easy-mmode cl cl-19 multi-mode advice
help-fns advice-preload imenu compile comint ring edmacro kmacro tooltip
ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd font-setting
tool-bar dnd fontset image fringe lisp-mode register page menu-bar
rfn-eshadow timer select scroll-bar mldrag mouse jit-lock font-lock
syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button
minibuffer faces cus-face files text-properties overlay md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process dbusbind system-font-setting
font-render-setting gtk x-toolkit x multi-tty emacs)





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#11646: 23.2; latex-close-block indenting \end{verbatim} incorrectly
  2012-06-07 12:14 bug#11646: 23.2; latex-close-block indenting \end{verbatim} incorrectly Norman Ramsey
@ 2012-06-13 13:57 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2012-06-13 13:57 UTC (permalink / raw)
  To: Norman Ramsey; +Cc: 11646-done

>     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






^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-06-13 13:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-07 12:14 bug#11646: 23.2; latex-close-block indenting \end{verbatim} incorrectly Norman Ramsey
2012-06-13 13:57 ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).