auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[AUCTeX] Re: Extraneous double quotes in command


From: Alan Ristow
Subject: [AUCTeX] Re: Extraneous double quotes in command
Date: Fri, 23 Feb 2007 10:20:33 -0500
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061207 Thunderbird/1.5.0.9 Mnenhy/0.7.4.0

Ralf Angeli wrote:
* 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")))))

Thanks for the advice. This didn't quite for me as written -- Emacs told me TeX-command: Invalid function: (quote TeX-run-command) when I tried to use it. I modified it to the following and it seems to be working quite well now:

(eval-after-load "tex"
  '(setq TeX-command-list
         (append TeX-command-list
                 (list
                  (list "ps2pdf" "ps2pdf %s.ps && start \"\" %s.pdf"
                    'TeX-run-command nil t :help "Generate PDF file")
))))

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.

Aha! That makes sense. I must confess that I had looked at 'start /?', but did not make that connection....

Thanks for the help!

Alan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]