[Top][All Lists]

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

bug#14286: Tex-mode always picks the first command in tex-compile-comman

From: Jérôme M. Berger
Subject: bug#14286: Tex-mode always picks the first command in tex-compile-commands on Windows
Date: Sat, 27 Apr 2013 11:07:50 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20120206 Thunderbird/ Mnenhy/

        Tex-mode is supposed to pick the most appropriate command in
tex-compile-commands depending on the situation. However, on Windows
it always picks the first command (and probably on Linux if TeX is
installed in some non-standard locations).

        This is due to the fact that the executables are shell-quoted which
prevents the detection logic in tex-command-active-p from working.
It works on Linux because most of the time shell-quoting leaves the
string intact, whereas on Windows shell-quoting always adds double
quotes around the string.

        I have been able to work around the issue by adding the following
to my configuration:

(defun jb-tex-unquote (str)
   (lambda (str) str)
   (split-string-and-unquote str)

(defun tex-command-active-p (cmd fspec)
  "Return non-nil if the CMD spec might need to be run."
  (let ((in (nth 1 cmd))
        (out (nth 2 cmd)))
    (if (stringp in)
        (let ((file (jb-tex-unquote (format-spec in fspec))))
          (when (file-exists-p file)
            (or (not out)
                 file (jb-tex-unquote
                       (format-spec out fspec))))))
      (when (and (eq in t) (stringp out))
        (not (tex-uptodate-p (jb-tex-unquote
                              (format-spec out fspec))))))))

Jabber: address@hidden

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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