Ralf Angeli | 1 Apr 2006 13:09
Face
Picon

Re: Problem with TeX-modes

* David Kastrup (2006-03-30) writes:

> if I use M-x customize-variable RET TeX-modes RET
>
> and uncheck "LaTeX", set for current session and then load a LaTeX
> file, this bombs out.

Did this work before?

> The reason is that AUCTeX's tex-mode checks for the kind of file,
> decides that this is a LaTeX file, then calls Emacs' latex-mode.
> latex-mode calls tex-mode as part of its operation.
>
> Lather, rinse, repeat, overflow everything and the kitchen sink.
>
> Does anybody have a good idea how to deal with that problem?  The same
> problem occurs with plain TeX files when just unchecking plain-TeX in
> TeX-modes.

We could introduce a buffer-local variable which is set the first time
`TeX-tex-mode' is being run and which prevents `TeX-tex-mode' from
calling the specific mode (like `latex-mode') when it is run a second
time.  One could force it to run the specific mode by calling it with
(tex-mode 1) or doing something similar with a new dedicated argument
we could introduce.  I am not sure, however, if this is a good idea.
It rather feels like brute force.

> I think that the combination of smart format detection from AUCTeX
> (keep tex-mode checked) and dull Emacs mode should be permitted.

(Continue reading)

David Kastrup | 2 Apr 2006 19:13
Picon
Picon

Re: Re: Problem with TeX-modes

Ralf Angeli <angeli <at> iwi.uni-sb.de> writes:

> * David Kastrup (2006-03-30) writes:
>
>> if I use M-x customize-variable RET TeX-modes RET
>>
>> and uncheck "LaTeX", set for current session and then load a LaTeX
>> file, this bombs out.
>
> Did this work before?

I suppose that something similar to it must have worked at some time.
I can't imagine implementing all that functionality and never testing
anything of it.

Even though there is evidence that this would not exactly have been
the first time.

But I do remember _fixing_ some stuff around that functionality.

> We could introduce a buffer-local variable which is set the first time
> `TeX-tex-mode' is being run and which prevents `TeX-tex-mode' from
> calling the specific mode (like `latex-mode') when it is run a second
> time.  One could force it to run the specific mode by calling it with
> (tex-mode 1) or doing something similar with a new dedicated argument
> we could introduce.  I am not sure, however, if this is a good idea.
> It rather feels like brute force.

No idea.  Maybe one needs to analyze what the default TeX modes are
trying to achieve here.
(Continue reading)

Konrad Podczeck | 6 Apr 2006 00:20
Picon
Picon
Favicon

Interactive mode is not really interactive

When, auctex's "Run interactive" is on, the window showing the 
tex-compiler output does not become active, i.e. does not get focus. So 
this window is not ready to receive keyboard input. This is counter to 
the very meaning of "interactive."

When Emacs is customized so that the tex-compiler output appears in its 
own frame and "Run interactive" is on, then the first tex run makes 
this frame active, but from the second run on, the frame showing the 
tex-compiler output does also not become active anymore.

However, with the customization of having the tex-compiler output 
appearing in its own frame, this misbehavior  is only since Emacs CVS 
from about middle of February; before the tex-compiler output frame 
always became active.

The following solution for the problem is due to David Reitter, 
maintainer of the Aquamacs Emacs distribution.

(defun TeX-run-interactive (name command file)
   "Run TeX interactively.
Run command in a buffer (in comint-shell-mode) so that it accepts user
interaction. If you return to the file buffer after the TeX run,
Error parsing on C-x ` should work with a bit of luck."
   (TeX-run-set-command name command)
   (require 'comint)
   (let ((default TeX-command-default)
	(buffer (TeX-process-buffer-name file))
	(process nil)
	(dir (TeX-master-directory))
	(command-buff (current-buffer))
(Continue reading)

Alun Pope | 6 Apr 2006 02:23
Picon
Favicon

11.82; flyspell-mode mouse-2 yanks as well

Here is a short example file, which also explains the problem.  This seems to have to do with the
beta-version of Emacs I got for using preview with auctex.  So it
seems to be about the auctex-emacs interaction which is why i have
sent it to the list.
 
%-------example
\documentclass{article}
\begin{document}
 
Turn flyspell-mode on.
 
Then delete some stuff.  Deleted text is SPURIOUS JUNK.  (Deleted by
mouse-highlighting and delete key.)
 
Now make a spelling mistake: false.
 

SPURIOUS JUNK
 

The sequence was false was spelled flase, mouse-2 to correct, select
correct text then left-click.  Then the correction is made but the extra
text SPURIOUS JUNK appears two lines further on, presumably because it
is being yanked by the mouse-2, in addition to the correct behaviour
(flyspell-mode's correct-at-point).  If there is text on the line
SPURIOUS JUNK is appended.
\end{document}
 

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:
%----end example
 
 
 
Emacs  : GNU Emacs 22.0.50.1 (i386-mingw-nt5.0.2195)
 of 2006-01-29 on NEUTRINO
Package: 11.82
 
current state:
==============
(setq
 AUCTeX-date "2005-12-17"
 window-system 'w32
 LaTeX-version "2e"
 TeX-style-path '("style" "auto" "c:/MyLatexDocs/BibFiles/style"
    "c:/MyLatexDocs/BibFiles/auto"
    "c:/emacs/Emacs/site-lisp/auctex/style" "../var/auctex")
 TeX-auto-save t
 TeX-parse-self t
 TeX-master "h:/SGI/SGI - Premium Principles/PremiumPricing80to85"
 TeX-command-list '(("View pdf" "acrord32.exe %s.pdf" TeX-run-command
 nil t)
      ("All pdf" "texify --pdf %s.tex" TeX-run-command
 nil t)
      ("Clean"
       "del %s.log *.aux %s.out %s.exa %s.ilg %s.idx
 %s.ind %s.lof %s.lot %s.toc %s.bbl %s.blg %s.dvi %s.ps %s.2.ps
 %s.pdf" TeX-run-command nil t)
      ("All" "texify --tex-opt=--src %s.tex"
 TeX-run-command nil
       t)
      ("SmallGhostview" "gsview32.exe %s-2.ps"
 TeX-run-command
       nil t)
      ("HalfSize" "psnup -2 %f %s-2.ps" TeX-run-command
 nil t)
      ("TeX" "%(PDF)%(tex) %S%(PDFout) \"%(mode)\\input
 %t\""
       TeX-run-TeX nil
       (plain-tex-mode ams-tex-mode texinfo-mode) :help
       "Run plain TeX")
      ("LaTeX" "%l \"%(mode)\\input{%t}\"" TeX-run-TeX
 nil
       (latex-mode doctex-mode) :help "Run LaTeX")
      ("Makeinfo" "makeinfo %t" TeX-run-compile nil
       (texinfo-mode) :help "Run Makeinfo with Info
 output")
      ("Makeinfo HTML" "makeinfo --html %t"
 TeX-run-compile nil
       (texinfo-mode) :help "Run Makeinfo with HTML
 output")
      ("AmSTeX" "%(PDF)amstex %S%(PDFout)
 \"%(mode)\\input %t\""
       TeX-run-TeX nil (ams-tex-mode) :help "Run
 AMSTeX")
      ("ConTeXt" "texexec --once --texutil
 %(execopts)%t"
       TeX-run-TeX nil (context-mode) :help "Run ConTeXt
 once")
      ("ConTeXt Full" "texexec %(execopts)%t"
 TeX-run-TeX nil
       (context-mode) :help "Run ConTeXt until
 completion")
      ("ConTeXt Clean" "texutil --purgeall"
 TeX-run-interactive
       nil (context-mode) :help "Clean temporary ConTeXt
 files")
      ("BibTeX" "bibtex %s" TeX-run-BibTeX nil t :help
       "Run BibTeX")
      ("View" "%V" TeX-run-discard t t :help "Run
 Viewer")
      ("Print" "%p" TeX-run-command t t :help "Print the
 file")
      ("Queue" "%q" TeX-run-background nil t :help
       "View the printer queue" :visible
 TeX-queue-command)
      ("File" "%(o?)dvips %d -o %f " TeX-run-command t t
 :help
       "Generate PostScript file")
      ("Index" "makeindex %s" TeX-run-command nil t
 :help
       "Create index file")
      ("Check" "lacheck %s" TeX-run-compile nil
 (latex-mode)
       :help "Check LaTeX file for correctness")
      ("Spell" "<ignored>" TeX-run-ispell-on-document
 nil t
       :help "Spell-check the document")
      ("Other" "" TeX-run-command t t :help
       "Run an arbitrary command")
      )
 )
 
---------------------
Dr Alun Pope
 
Group Credit
St.George Bank
Level 9
182 George St
Sydney NSW 2000
 
(T): 02 9236 1442
(F): 02 9236 1570

**********************************************************************

***** IMPORTANT INFORMATION *****

This document should be read only by those persons to whom it is

addressed and its content is not intended for use by any other

persons. If you have received this message in error, please notify

us immediately. Please also destroy and delete the message from

your computer. Any unauthorised form of reproduction of this message

is strictly prohibited.

 

St George Bank Limited AFSL 240997, Advance Asset Management Limited

AFSL 240902, St George Life Limited AFSL 240900, ASGARD Capital Management Limited

AFSL 240695 and Securitor Financial Group Limited AFSL 240687 is not liable for

the proper and complete transmission of the information contained in

this communication, nor for any delay in its receipt.

**********************************************************************

 

_______________________________________________
bug-auctex mailing list
bug-auctex <at> gnu.org
http://lists.gnu.org/mailman/listinfo/bug-auctex
David Kastrup | 6 Apr 2006 09:21
Picon
Picon

Re: Interactive mode is not really interactive

Konrad Podczeck <konrad.podczeck <at> univie.ac.at> writes:

> When, auctex's "Run interactive" is on, the window showing the
> tex-compiler output does not become active, i.e. does not get
> focus. So this window is not ready to receive keyboard input. This
> is counter to the very meaning of "interactive."

Uh, no it isn't.  It is TeX which is started interactively.  The
semantics of AUCTeX are not changed.

> When Emacs is customized so that the tex-compiler output appears in
> its own frame

How do you customize Emacs in that manner?  Are you sure you are not
describing an Aquamacs-only problem?

> and "Run interactive" is on, then the first tex run makes this frame
> active, but from the second run on, the frame showing the
> tex-compiler output does also not become active anymore.

The semantics are not making anything active at all.  You can press
C-c C-l to show the compiler output, but that would not change focus
usually.

> However, with the customization of having the tex-compiler output
> appearing in its own frame,

Again: what did you do for customizing this?

> this misbehavior is only since Emacs CVS from about middle of
> February; before the tex-compiler output frame always became active.
>
> The following solution for the problem is due to David Reitter,
> maintainer of the Aquamacs Emacs distribution.

Are you or are you not using Aquamacs?  Could you use

M-x TeX-submit-bug-report RET

for generating a bug report including some basics of your configuration?

How did you come by this solution?  Is it part of Aquamacs?  We can
only use code in AUCTeX which has had its copyright assigned to the
FSF.  David Reitter only has an assignment in place just for Emacs,
not AUCTeX.  I don't think he would mind signing the same for AUCTeX,
but of course that would only cover code he explicitly contributed
himself, not code which he talked about with someone else.

--

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
David Kastrup | 6 Apr 2006 09:32
Picon
Picon

Re: Interactive mode is not really interactive

David Kastrup <dak <at> gnu.org> writes:

> Konrad Podczeck <konrad.podczeck <at> univie.ac.at> writes:
>
>> When, auctex's "Run interactive" is on, the window showing the
>> tex-compiler output does not become active, i.e. does not get
>> focus. So this window is not ready to receive keyboard input. This
>> is counter to the very meaning of "interactive."
>
> Uh, no it isn't.  It is TeX which is started interactively.  The
> semantics of AUCTeX are not changed.

P.S.: which is not to say that one might think about such a change.
But it would not be isolated to configurations where a separate frame
is used for everything and the kitchen sink.

The problem with changing focus to an interactive session is that you
can no longer start AUCTeX commands without changing the focus back
again.  So it is probably advisable to only change focus at C-c C-l.
And even then, making the behavior different in interactive mode might
be surprising to some.

We could use C-u C-c C-l for popping up a separate window _and_
changing focus in general.  And a customization option that makes C-c
C-l change focus when in interactive mode might also be possible.
And/or one that will automatically "C-c C-l" when an interactive
compilation is started.

But at the moment it is not clear what configuration your Emacs has
that would mandate a different behavior from the common one.

--

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
David Reitter | 6 Apr 2006 11:51
Picon
Gravatar

Re: Interactive mode is not really interactive

On 6 Apr 2006, at 08:32, David Kastrup wrote:

>>> When, auctex's "Run interactive" is on, the window showing the
>>> tex-compiler output does not become active, i.e. does not get
>>> focus. So this window is not ready to receive keyboard input. This
>>> is counter to the very meaning of "interactive."
>>
>> Uh, no it isn't.  It is TeX which is started interactively.  The
>> semantics of AUCTeX are not changed.
>
> P.S.: which is not to say that one might think about such a change.
> But it would not be isolated to configurations where a separate frame
> is used for everything and the kitchen sink.

No. The problem Konrad described is not just related to the fact that  
he likes to have separate frames for things, which can be done with  
`special-display-buffer-names' and friends, or, as in his case, very  
thoroughly with `one-buffer-one-frame-mode'.

However, the same issue occurs when you don't use that mode, but  
display the output in a separate window. Even then, input focus is  
not changed. This is because you open the output buffer via `with- 
output-to-temp-buffer', which is defined not to select the target  
window.

In my patch, which is just 3 lines of code and shouldn't need a  
signature from me (even though you can have that if you want), I just  
ensure that the input focus is changed:

     (let ((w (get-buffer-window buffer 'visible)))
       (select-frame-set-input-focus (window-frame w)) ;; set input  
focus
       (select-window w))

Of course one can conceive of other ways to achieve the same result.

> The problem with changing focus to an interactive session is that you
> can no longer start AUCTeX commands without changing the focus back
> again.  So it is probably advisable to only change focus at C-c C-l.
> And even then, making the behavior different in interactive mode might
> be surprising to some.

Well, I mean if you say it's "interactive", then I'd expect that you  
can interact with LaTeX compiler. Having the cursor there is  
something I'd actually expect.

The major mode in this buffer is comint-mode, so I don't know if you  
would want to make C-c ... keys do something from latex-mode.
A compromise here might be to automatically remove the window (i.e.  
bury-buffer or so) as soon as the command that is run has finished.

> We could use C-u C-c C-l for popping up a separate window _and_
> changing focus in general.  And a customization option that makes C-c
> C-l change focus when in interactive mode might also be possible.
> And/or one that will automatically "C-c C-l" when an interactive
> compilation is started.

Is that really necessary?
What use cases are there for interactive mode in a window that hasn't  
input focus?
David Kastrup | 6 Apr 2006 22:39
Picon
Picon

Re: Interactive mode is not really interactive


Please don't address bug reports to me in person, always send them to
the list.  I am not the only person dealing with bug reports.

Copying this to the list.

Konrad Podczeck <konrad.podczeck <at> univie.ac.at> writes:

> What I reported appears under both regular Aquamacs and Aquamacs with
> the "Q" option, which is basically Carbon Emacs without any Aquamacs
> customizations; see below for the output of M-x TeX-submit-bug-report
> RET under both settings.
>
> To get the TeX-compiler output in its own frame I added .*output\\* to
> the customization variable "Special Display Regexps".
>
> Here the output of M-x TeX-submit-bug-report RET for Aquamacs with the
> "Q" option:
>
> Emacs : GNU Emacs 22.0.50.1 (powerpc-apple-darwin7.9.0)
>  of 2006-04-06 on rodrigues.inf.ed.ac.uk
> Package: 11.82
>
> current state:
> ==============
> (setq
>  AUCTeX-date "2005-12-17"
>  window-system 'mac
>  LaTeX-version "2e"
>  TeX-style-path '("style" "auto"
> 		  "/Users/konradpodczeck/Library/texmf/bibtex/bst/style"
> 		  "/Users/konradpodczeck/Library/texmf/tex/style"
> 		  "/Users/konradpodczeck/Library/texmf/bibtex/bst/auto"
> 		  "/Users/konradpodczeck/Library/texmf/tex/auto"
> 		  "/Users/konradpodczeck/Desktop/Aquamacs
> Emacs.app/Contents/Resources/site-lisp/edit-modes/auctex/style"
> "/Users/konradpodczeck/Desktop/Aquamacs
> Emacs.app/Contents/Resources/site-lisp/edit-modes/var/auctex")
>  TeX-auto-save nil
>  TeX-parse-self t
>  TeX-master t
>  TeX-command-list '(("TeX" "%(PDF)%(tex) %S%(PDFout) \"%(mode)\\input
> %t\""
> 		     TeX-run-TeX nil
> 		     (plain-tex-mode ams-tex-mode texinfo-mode) :help
> 		     "Run plain TeX")
> 		    ("LaTeX" "%l \"%(mode)\\input{%t}\"" TeX-run-TeX
> 		    nil
> 		     (latex-mode doctex-mode) :help "Run LaTeX")
> 		    ("Makeinfo" "makeinfo %t" TeX-run-compile nil
> 		     (texinfo-mode) :help "Run Makeinfo with Info
> 		     output")
> 		    ("Makeinfo HTML" "makeinfo --html %t"
> 		    TeX-run-compile nil
> 		     (texinfo-mode) :help "Run Makeinfo with HTML
> 		     output")
> 		    ("AmSTeX" "%(PDF)amstex %S%(PDFout)
> 		    \"%(mode)\\input %t\""
> 		     TeX-run-TeX nil (ams-tex-mode) :help "Run
> 		     AMSTeX")
> 		    ("ConTeXt" "texexec --once --texutil
> 		    %(execopts)%t"
> 		     TeX-run-TeX nil (context-mode) :help "Run ConTeXt
> 		     once")
> 		    ("ConTeXt Full" "texexec %(execopts)%t"
> 		    TeX-run-TeX nil
> 		     (context-mode) :help "Run ConTeXt until
> 		     completion")
> 		    ("ConTeXt Clean" "texutil --purgeall"
> 		    TeX-run-interactive
> 		     nil (context-mode) :help "Clean temporary ConTeXt
> 		     files")
> 		    ("BibTeX" "bibtex %s" TeX-run-BibTeX nil t :help
> 		     "Run BibTeX")
> 		    ("View" "%V" TeX-run-discard t t :help "Run
> 		    Viewer")
> 		    ("Print" "%p" TeX-run-command t t :help "Print the
> 		    file")
> 		    ("Queue" "%q" TeX-run-background nil t :help
> 		     "View the printer queue" :visible
> 		     TeX-queue-command)
> 		    ("File" "%(o?)dvips %d -o %f " TeX-run-command t t
> 		    :help
> 		     "Generate PostScript file")
> 		    ("Index" "makeindex %s" TeX-run-command nil t
> 		    :help
> 		     "Create index file")
> 		    ("Check" "lacheck %s" TeX-run-compile nil
> 		    (latex-mode)
> 		     :help "Check LaTeX file for correctness")
> 		    ("Spell" "<ignored>" TeX-run-ispell-on-document
> 		    nil t
> 		     :help "Spell-check the document")
> 		    ("Other" "" TeX-run-command t t :help
> 		     "Run an arbitrary command")
> 		    )
>  )
>
> And here the output of M-x TeX-submit-bug-report RET for regular
> Aquamacs:
>
>
> Emacs : GNU Emacs 22.0.50.1 (powerpc-apple-darwin7.9.0)
>  of 2006-04-06 on rodrigues.inf.ed.ac.uk - Aquamacs Distribution
>  0.9.9a
> Package: 11.82
>
> current state:
> ==============
> (setq
>  AUCTeX-date "2005-12-17"
>  window-system 'mac
>  LaTeX-version "2e"
>  TeX-style-path '("style" "auto"
> 		  "/Users/konradpodczeck/Library/texmf/bibtex/bst/style"
> "/Users/konradpodczeck/Library/texmf/tex/style"
> "/Users/konradpodczeck/Library/texmf/bibtex/bst/auto"
> "/Users/konradpodczeck/Library/texmf/tex/auto"
> "/Users/konradpodczeck/Desktop/Aquamacs
> Emacs.app/Contents/Resources/site-lisp/edit-modes/auctex/style"
> "/Users/konradpodczeck/Desktop/Aquamacs
> Emacs.app/Contents/Resources/site-lisp/edit-modes/var/auctex")
>  TeX-auto-save nil
>  TeX-parse-self t
>  TeX-master t
>  TeX-command-list '(("TeX"
> 		     "%(PDF)%(tex) %S%(PDFout) \"%(mode)\\input %t\""
> 		     TeX-run-TeX nil
> 		     (plain-tex-mode texinfo-mode ams-tex-mode) :help
> 		     "Run plain TeX")
> 		    ("LaTeX" "%l \"%(mode)\\input{%t}\"" TeX-run-TeX
> 		     nil (latex-mode doctex-mode) :help "Run LaTeX")
> 		    ("Makeinfo" "makeinfo %t" TeX-run-compile nil
> 		     (texinfo-mode) :help
> 		     "Run Makeinfo with Info output")
> 		    ("Makeinfo HTML" "makeinfo --html %t"
> 		     TeX-run-compile nil (texinfo-mode) :help
> 		     "Run Makeinfo with HTML output")
> 		    ("AmSTeX"
> 		     "%(PDF)amstex %S%(PDFout) \"%(mode)\\input %t\""
> 		     TeX-run-TeX nil (ams-tex-mode) :help "Run
> 		     AMSTeX")
> 		    ("ConTeXt"
> 		     "texexec --once --texutil %(execopts)%t"
> 		     TeX-run-TeX nil (context-mode) :help
> 		     "Run ConTeXt once")
> 		    ("ConTeXt Full" "texexec %(execopts)%t"
> 		     TeX-run-TeX nil (context-mode) :help
> 		     "Run ConTeXt until completion")
> 		    ("ConTeXt Clean" "texutil --purgeall"
> 		     TeX-run-interactive nil (context-mode) :help
> 		     "Clean temporary ConTeXt files")
> 		    ("BibTeX" "bibtex %s" TeX-run-BibTeX nil t :help
> 		     "Run BibTeX")
> 		    ("View" "%V" TeX-run-discard t t :help
> 		     "Run Viewer")
> 		    ("Print" "%p" TeX-run-command t t :help
> 		     "Print the file")
> 		    ("Queue" "%q" TeX-run-background nil t :help
> 		     "View the printer queue" :visible
> 		     TeX-queue-command)
> 		    ("File" "%(o?)dvips %d -o %f " TeX-run-command t t
> 		     :help "Generate PostScript file")
> 		    ("Index" "makeindex %s" TeX-run-command nil t
> 		     :help "Create index file")
> 		    ("Check" "lacheck %s" TeX-run-compile nil
> 		     (latex-mode) :help
> 		     "Check LaTeX file for correctness")
> 		    ("Spell" "<ignored>" TeX-run-ispell-on-document
> 		     nil t :help "Spell-check the document")
> 		    ("MyLaTex" "mylatex %t" TeX-run-interactive nil t)
> 		    ("MyPDFLaTeX" "mypdflatex %t" TeX-run-interactive
> 		     nil t)
> 		    ("Excalibur" "open -a Excalibur %t"
> 		     TeX-run-command nil t)
> 		    ("Other" "" TeX-run-command t t :help
> 		     "Run an arbitrary command")
> 		    )
>  )
>
>
> Konrad Podczeck

--

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Ralf Angeli | 8 Apr 2006 14:56
Picon

Re: 11.82; flyspell-mode mouse-2 yanks as well

* Eli Zaretskii (2006-04-08) writes:

>> From: Ralf Angeli <angeli <at> iwi.uni-sb.de>
>> 
>> I can sort of reproduce this with a Windows build of 2006-03-09
[...]
> This bug, which was indeed specific to MS-Windows, was fixed on
> 2006-03-11

Argh, sooo close. (c:

--

-- 
Ralf

Gmane