Bug in docTeX mode

David Kastrup <[email protected]> Wed, 09 Mar 2005 20:54:16 +0100
Newsgroups gmane.emacs.auc-tex
Message-ID <[email protected]>

Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.

If the bug (or problem) is triggered by a specific (La)TeX
file, you should try to produce a minimal sample file showing the
problem and include it in your report.

Your bug report will be posted to the AUCTeX mailing list.

Take the following document in docTeX mode with an active region (mark
a region and do C-u C-x C-x in CVS Emacs) between -.- and -#-

% -.-
woozle-#-

Press C-c C-e macrocode RET

You get something like
Debugger entered--Lisp error: (error "Can't locate beginning of current environment")
  signal(error ("Can't locate beginning of current environment"))
  error("Can't locate beginning of current environment")
  LaTeX-find-matching-begin()
  LaTeX-mark-environment()
  LaTeX-fill-environment(nil)
  LaTeX-insert-environment("macrocode")
  LaTeX-environment-menu("macrocode")
  byte-code("ÄÅÆ ..Ç.\f.ÈQÉ Ê.‰Ë&.Ì	G!.(.Æ .(.Í.‚6.Ì	G!.4..‚6.	.Î	É \"..E.Ï	C!..O.Ð	!.R.Ñ	!*." [LaTeX-default-environment environment entry arg completing-read "Environment type: (default " TeX-near-bobp "document" ") " LaTeX-environment-list nil LaTeX-environment-history zerop "document" assoc LaTeX-add-environments LaTeX-modify-environment LaTeX-environment-menu] 8)
  LaTeX-environment(nil)
  call-interactively(LaTeX-environment)

and the text changes into

% \begin{macrocode}
% 
woozle
\end{macrocode}

Emacs  : GNU Emacs 22.0.50.29 (i686-pc-linux-gnu, GTK+ Version 2.6.2)
 of 2005-03-03 on lola.goethe.zz
Package: AUCTeX CVS-5.485 (2005-02-12)

current state:
==============
(setq
 window-system 'x
 LaTeX-version "2e"
 TeX-style-path '("style/" "auto/" "/usr/local/emacs-21/share/emacs/site-lisp/auctex/style/"
		  "/usr/local/emacs-21/var/auctex/")
 TeX-auto-save t
 TeX-parse-self t
 TeX-master t
 )
-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum