all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* TeX called improperly
@ 2002-04-15  6:06 Steve Throckmorton
  2002-04-16 20:17 ` Richard Stallman
  2002-04-22  9:37 ` Kai Großjohann
  0 siblings, 2 replies; 10+ messages in thread
From: Steve Throckmorton @ 2002-04-15  6:06 UTC (permalink / raw)


This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English, because the Emacs maintainers do not have
translators to read other languages for them.

Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list,
and to the gnu.emacs.bug news group.

In GNU Emacs 21.1.1 (i386-msvc-windows98.2222)
 of 2001-10-22 on buffy
configured using `configure --with-msvc (12.00)'
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: enu
  locale-coding-system: iso-latin-1
  default-enable-multibyte-characters: t

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

I have encountered two separate problems calling utilities from within
TeX mode.  I was able to fix/workaround each with a modification to
the file tex-mode.el .

One problem is that attempts to call a dvi viewer were failing because
emacs was appending an ampersand ('&') to the .dvi filename in a vain
attempt to make Win98 run the viewer in background.  I changed the
function tex-print to call tex-send-command with nil (instead of
t, of course) passed to the optional argument 'background'.

The other problem I had was that emacs was calling tex.exe with the
option string (tex-start-options-string), which I set within 
buffer with the Local Variables feature, in quotes ("").  This caused
the options to be ignored by TeX.  I discovered that the function
tex-start-tex was running tex-start-options-string through some
function called shell-quote-argument, which caused the quotes to
appear in the command line.  I deleted the call to
shell-quote-argument, and that seemed to fix things for me.

It seems obvious to me that the first problem is Windows-specific.  I
have no idea about the options-string-in-quotes problem, though.



Recent input:
C-g C-x k <return> M-x r e p o r t - e <tab> <retu
rn>

Recent messages:
(C:\PROGRAM FILES\EMACS\EMACS-21.1\BIN\EMACS.EXE)
Loading smtpmail...done
Loading rmail...done
Counting messages...done
POP password: 
rmail-get-pop-password: Quit
Loading emacsbug...done

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

* Re: TeX called improperly
  2002-04-15  6:06 Steve Throckmorton
@ 2002-04-16 20:17 ` Richard Stallman
  2002-04-18 23:33   ` Steve Throckmorton
  2002-04-22  9:37 ` Kai Großjohann
  1 sibling, 1 reply; 10+ messages in thread
From: Richard Stallman @ 2002-04-16 20:17 UTC (permalink / raw)
  Cc: bug-gnu-emacs

    The other problem I had was that emacs was calling tex.exe with the
    option string (tex-start-options-string), which I set within 
    buffer with the Local Variables feature, in quotes ("").  This caused
    the options to be ignored by TeX.

What value did you use?  What job was it meant to accomplish?

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

* Re: TeX called improperly
  2002-04-16 20:17 ` Richard Stallman
@ 2002-04-18 23:33   ` Steve Throckmorton
  2002-04-19 18:43     ` Richard Stallman
  0 siblings, 1 reply; 10+ messages in thread
From: Steve Throckmorton @ 2002-04-18 23:33 UTC (permalink / raw)
  Cc: steve, bug-gnu-emacs

   Date: Tue, 16 Apr 2002 14:17:58 -0600 (MDT)
   X-Authentication-Warning: aztec.santafe.edu: rms set sender to rms@aztec using -f
   From: Richard Stallman <rms@gnu.org>
   CC: bug-gnu-emacs@gnu.org
   Reply-to: rms@gnu.org
   X-RCPT-TO: <steve@doodlebeth.com>
   X-UIDL: 315135886

       The other problem I had was that emacs was calling tex.exe with the
       option string (tex-start-options-string), which I set within 
       buffer with the Local Variables feature, in quotes ("").  This caused
       the options to be ignored by TeX.

   What value did you use?  What job was it meant to accomplish?


Here is the entire Local Variables section I am using for this file:


%Local Variables:
%mode:tex
%mode:auto-fill
%tex-command:"c:\\texmf\\miktex\\bin\\tex "
%tex-start-options-string:"--output-directory=c:\\steve\\tex --interaction=nonstopmode"
%tex-dvi-view-command:"c:\\texmf\\miktex\\bin\\yap.exe -1"
%End:

The version of TeX I am using accepts optional arguments in format:
--option-name=optionsetting

It (gracefully, I must say) ignores the arguments if they are quoted,
which is how Emacs was delivering them on the command line.

Perhaps I'm not supposed to be including quotes when I specify the
string, but default values are quoted, so I did mine too.

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

* Re: TeX called improperly
  2002-04-18 23:33   ` Steve Throckmorton
@ 2002-04-19 18:43     ` Richard Stallman
  0 siblings, 0 replies; 10+ messages in thread
From: Richard Stallman @ 2002-04-19 18:43 UTC (permalink / raw)
  Cc: steve, emacs-devel, karl

It looks like the normal value of tex-start-options-string
consists of TeX commands that start with backslashes: \nonstopmode\input.
You are using it with a value that has the syntax of
typical Unix command line options.  I would have thought that was
the wrong way to use this variable, but since you expected it to
work, maybe you know something I don't.  Perhaps I dont
fully understand the command syntax TeX accepts.

Karl, can you give advice?


From: Steve Throckmorton <steve@doodlebeth.com>
To: rms@gnu.org
CC: steve@doodlebeth.com, bug-gnu-emacs@gnu.org
In-reply-to: <200204162017.g3GKHwc24346@aztec.santafe.edu> (message from
	Richard Stallman on Tue, 16 Apr 2002 14:17:58 -0600 (MDT))
Subject: Re: TeX called improperly
Sender: bug-gnu-emacs-admin@gnu.org
Date: Thu, 18 Apr 2002 19:33:38 -0400

   Date: Tue, 16 Apr 2002 14:17:58 -0600 (MDT)
   X-Authentication-Warning: aztec.santafe.edu: rms set sender to rms@aztec using -f
   From: Richard Stallman <rms@gnu.org>
   CC: bug-gnu-emacs@gnu.org
   Reply-to: rms@gnu.org
   X-RCPT-TO: <steve@doodlebeth.com>
   X-UIDL: 315135886

       The other problem I had was that emacs was calling tex.exe with the
       option string (tex-start-options-string), which I set within 
       buffer with the Local Variables feature, in quotes ("").  This caused
       the options to be ignored by TeX.

   What value did you use?  What job was it meant to accomplish?


Here is the entire Local Variables section I am using for this file:


%Local Variables:
%mode:tex
%mode:auto-fill
%tex-command:"c:\\texmf\\miktex\\bin\\tex "
%tex-start-options-string:"--output-directory=c:\\steve\\tex --interaction=nonstopmode"
%tex-dvi-view-command:"c:\\texmf\\miktex\\bin\\yap.exe -1"
%End:

The version of TeX I am using accepts optional arguments in format:
--option-name=optionsetting

It (gracefully, I must say) ignores the arguments if they are quoted,
which is how Emacs was delivering them on the command line.

Perhaps I'm not supposed to be including quotes when I specify the
string, but default values are quoted, so I did mine too.


_______________________________________________
Bug-gnu-emacs mailing list
Bug-gnu-emacs@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-gnu-emacs

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

* Re: TeX called improperly
@ 2002-04-19 20:01 Karl Berry
  2002-04-20 17:27 ` Richard Stallman
  0 siblings, 1 reply; 10+ messages in thread
From: Karl Berry @ 2002-04-19 20:01 UTC (permalink / raw)
  Cc: steve, emacs-devel

    the command syntax TeX accepts.

The standard Web2c tex and other binaries have accepted a number of
command line options for a while; --help, --version, and others.

Although I've never used miktex, I'm not surprised that it accepts such
options also.

So, the command line to tex can include both regular Unix-style options
and TeX-style stuff such as \nonstopmode.

    It (gracefully, I must say) ignores the arguments if they are quoted,
    which is how Emacs was delivering them on the command line.

I'm surprised that a quoted argument would be ignored completely.  Seems
like it would either be one (very strange) option, or even stranger
filename.  But if that's what miktex does, it presumably knows what it's
doing :).

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

* Re: TeX called improperly
  2002-04-19 20:01 Karl Berry
@ 2002-04-20 17:27 ` Richard Stallman
  0 siblings, 0 replies; 10+ messages in thread
From: Richard Stallman @ 2002-04-20 17:27 UTC (permalink / raw)
  Cc: steve, emacs-devel

What do you think is the right solution, the right way to handle
tex-start-options-string?

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

* Re: TeX called improperly
@ 2002-04-20 17:34 Karl Berry
  2002-04-22  7:46 ` Richard Stallman
  0 siblings, 1 reply; 10+ messages in thread
From: Karl Berry @ 2002-04-20 17:34 UTC (permalink / raw)
  Cc: steve, emacs-devel

    What do you think is the right solution, the right way to handle
    tex-start-options-string?

Just pass whatever is in the variable to tex?

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

* Re: TeX called improperly
@ 2002-04-20 17:42 Karl Berry
  0 siblings, 0 replies; 10+ messages in thread
From: Karl Berry @ 2002-04-20 17:42 UTC (permalink / raw)
  Cc: steve, emacs-devel

    What do you think is the right solution, the right way to handle
    tex-start-options-string?

To expand a little ...

Looking at the original bug report again, I see the problem was the
quotes, right?  So Emacs should strip off the quotes before sending it
to tex, so the multiple options come through as multiple options.

I'm surprised that this does not happen at a lower level actually, since
I thought all those quotes mean is that the Local Variables: value is a
string constant.

Perhaps Emacs is adding its own quotes back to the command, so that the
local var could be set to a value like "\\nonstopmode\\input foo" and
this would get passed on the command line as '\nonstopmode\input foo'.

Unfortunately that won't work in the presence of multiple options, so
all I can suggest is for Emacs not to be so smart, and just pass the
value it is given.  It'll have to be up to the user to put in the right
number of backslashes (four, I guess).

Or if there is too problematic for compatibility, I guess another
variable could be introduced.  (tex-start-options-no-implicit-quoting)

Hope this helps,
k

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

* Re: TeX called improperly
  2002-04-20 17:34 TeX called improperly Karl Berry
@ 2002-04-22  7:46 ` Richard Stallman
  0 siblings, 0 replies; 10+ messages in thread
From: Richard Stallman @ 2002-04-22  7:46 UTC (permalink / raw)
  Cc: steve, emacs-devel

	What do you think is the right solution, the right way to handle
	tex-start-options-string?

    Just pass whatever is in the variable to tex?

That won't work.

    Perhaps Emacs is adding its own quotes back to the command, so that the
    local var could be set to a value like "\\nonstopmode\\input foo" and
    this would get passed on the command line as '\nonstopmode\input foo'.

Yes, that is the reason.  That is the default case; if it does not
work, that is a worse problem than we have now.

Maybe we could have two variables, tex-start-options-string
and tex-start-commands, and use the latter for TeX commands
like \nonstopmode.

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

* Re: TeX called improperly
  2002-04-15  6:06 Steve Throckmorton
  2002-04-16 20:17 ` Richard Stallman
@ 2002-04-22  9:37 ` Kai Großjohann
  1 sibling, 0 replies; 10+ messages in thread
From: Kai Großjohann @ 2002-04-22  9:37 UTC (permalink / raw)


steve@doodlebeth.com (Steve Throckmorton) writes:

> The other problem I had was that emacs was calling tex.exe with the
> option string (tex-start-options-string), which I set within 
> buffer with the Local Variables feature, in quotes ("").  This caused
> the options to be ignored by TeX.  I discovered that the function
> tex-start-tex was running tex-start-options-string through some
> function called shell-quote-argument, which caused the quotes to
> appear in the command line.  I deleted the call to
> shell-quote-argument, and that seemed to fix things for me.

Maybe it would be useful to have a variable tex-start-options-list or
similar which contained a list of strings.  Then you could have put
your various options in there.

Thoughts?

kai
-- 
Silence is foo!

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

end of thread, other threads:[~2002-04-22  9:37 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-04-20 17:34 TeX called improperly Karl Berry
2002-04-22  7:46 ` Richard Stallman
  -- strict thread matches above, loose matches on Subject: below --
2002-04-20 17:42 Karl Berry
2002-04-19 20:01 Karl Berry
2002-04-20 17:27 ` Richard Stallman
2002-04-15  6:06 Steve Throckmorton
2002-04-16 20:17 ` Richard Stallman
2002-04-18 23:33   ` Steve Throckmorton
2002-04-19 18:43     ` Richard Stallman
2002-04-22  9:37 ` Kai Großjohann

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.