From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "=?UTF-8?Q?J=C3=A9r=C3=B4me?= M. Berger" Newsgroups: gmane.emacs.bugs 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 Message-ID: <517B9566.4080302@free.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig9F8CF63C703C24381E7EB995" X-Trace: ger.gmane.org 1367056078 8414 80.91.229.3 (27 Apr 2013 09:47:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 27 Apr 2013 09:47:58 +0000 (UTC) To: 14286@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 27 11:48:03 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UW1je-0008O8-Sr for geb-bug-gnu-emacs@m.gmane.org; Sat, 27 Apr 2013 11:48:03 +0200 Original-Received: from localhost ([::1]:60120 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UW1je-0007Ct-Iv for geb-bug-gnu-emacs@m.gmane.org; Sat, 27 Apr 2013 05:48:02 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38109) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UW1ja-0007A8-Al for bug-gnu-emacs@gnu.org; Sat, 27 Apr 2013 05:48:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UW1jZ-00017U-Aw for bug-gnu-emacs@gnu.org; Sat, 27 Apr 2013 05:47:58 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41962) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UW1jZ-00017O-7N for bug-gnu-emacs@gnu.org; Sat, 27 Apr 2013 05:47:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UW1je-0005YT-8v for bug-gnu-emacs@gnu.org; Sat, 27 Apr 2013 05:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "=?UTF-8?Q?J=C3=A9r=C3=B4me?= M. Berger" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 Apr 2013 09:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 14286 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.136705605021301 (code B ref -1); Sat, 27 Apr 2013 09:48:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 27 Apr 2013 09:47:30 +0000 Original-Received: from localhost ([127.0.0.1]:46068 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UW1j7-0005XV-Tz for submit@debbugs.gnu.org; Sat, 27 Apr 2013 05:47:30 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54866) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UW1j5-0005XO-Sw for submit@debbugs.gnu.org; Sat, 27 Apr 2013 05:47:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UW1iz-0000xi-6b for submit@debbugs.gnu.org; Sat, 27 Apr 2013 05:47:22 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:41462) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UW1iz-0000xe-3n for submit@debbugs.gnu.org; Sat, 27 Apr 2013 05:47:21 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37986) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UW1ix-000769-LX for bug-gnu-emacs@gnu.org; Sat, 27 Apr 2013 05:47:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UW1iv-0000wH-SQ for bug-gnu-emacs@gnu.org; Sat, 27 Apr 2013 05:47:19 -0400 Original-Received: from def92-4-82-224-197-72.fbx.proxad.net ([82.224.197.72]:50911 helo=wraith.localdomain) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UW1iv-0000vw-KF for bug-gnu-emacs@gnu.org; Sat, 27 Apr 2013 05:47:17 -0400 Original-Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by wraith.localdomain (Postfix) with ESMTP id 3D4A1EE4E for ; Sat, 27 Apr 2013 11:07:50 +0200 (CEST) User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.24) Gecko/20120206 Thunderbird/2.0.0.24 Mnenhy/0.7.6.666 X-Enigmail-Version: 0.96.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:73767 Archived-At: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig9F8CF63C703C24381E7EB995 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D8<-----------= --------- (defun jb-tex-unquote (str) (mapconcat (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-newer-than-file-p 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)))))))) -------------------->8=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D Jerome --=20 mailto:jeberger@free.fr http://jeberger.free.fr Jabber: jeberger@jabber.fr --------------enig9F8CF63C703C24381E7EB995 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iEYEARECAAYFAlF7lWYACgkQd0kWM4JG3k+CRgCeJjscenHSRrnQEhjTt9QSPs+w QakAmgMH2ajqEdoEy+GkKOoCLBE29MGn =FARW -----END PGP SIGNATURE----- --------------enig9F8CF63C703C24381E7EB995--