[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [AUCTeX] Extraneous double quotes in command
From: |
Ralf Angeli |
Subject: |
Re: [AUCTeX] Extraneous double quotes in command |
Date: |
Fri, 23 Feb 2007 07:49:29 +0100 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.93 (gnu/linux) |
* Alan Ristow (2007-02-23) writes:
> I've defined my ps2pdf command like this in my .emacs file:
>
> --------------
> ;; Setup additional commands
> (setq alan-tex-commands-extra
> (list
> (list "ps2pdf" "ps2pdf %s.ps && start %s.pdf" 'TeX-run-command
> nil t :help "Generate PDF file")
> ))
>
> ;; Add the new commands to the command list
> (require 'tex); need this to define TeX-command-list
> (setq TeX-command-list (append TeX-command-list alan-tex-commands-extra))
> --------------
>
> The first question, I suppose, is whether the way I've done this is good
> practice. It generates a PDF file just fine, so I know it works, I just
> don't know if this is the best way to go about it.
It's better to do stuff like that with `eval-after-load' instead of
`require' because then tex.el(c) will only be loaded when you open a
LaTeX file and not right at the start of your Emacs session. Here is
what it could look like:
(eval-after-load "tex"
'(setq TeX-command-list
(append TeX-command-list
'(("ps2pdf" "ps2pdf %s.ps && start \"\" %s.pdf"
'TeX-run-command nil t :help "Generate PDF file")))))
> Second, while it generates a PDF file just fine, it fails to open it.
> It's easy to see why if you look at the actual command that AUCTeX
> generates when I convert a file called test.ps:
>
> ps2pdf "test".ps && start "test".pdf
>
> Ghostscript apparently can handle "test".ps as an input file name, but
> start cannot, presumably because it is not a legal filename in Windows.
Look at the output of `start /?'. It assumes that an argument in
double quotes is supposed to be used as title for the console window
to be opened.
> With the double quotes present, it simply doesn't find the file. Is
> there any way to write my .emacs file such that the double quotes will
> not appear?
Add a pair of double quotes in front of the file name (see above).
--
Ralf