GNU bug report logs - #14286
Tex-mode always picks the first command in tex-compile-commands on Windows

Previous Next

Package: emacs;

Reported by: "Jérôme M. Berger" <jeberger <at> free.fr>

Date: Sat, 27 Apr 2013 09:48:02 UTC

Severity: normal

Tags: fixed

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 14286 in the body.
You can then email your comments to 14286 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#14286; Package emacs. (Sat, 27 Apr 2013 09:48:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Jérôme M. Berger" <jeberger <at> free.fr>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 27 Apr 2013 09:48:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Jérôme M. Berger" <jeberger <at> free.fr>
To: bug-gnu-emacs <at> gnu.org
Subject: Tex-mode always picks the first command in tex-compile-commands on
	Windows
Date: Sat, 27 Apr 2013 11:07:50 +0200
[Message part 1 (text/plain, inline)]
	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:

====================8<--------------------
(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====================

		Jerome
-- 
mailto:jeberger <at> free.fr
http://jeberger.free.fr
Jabber: jeberger <at> jabber.fr

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14286; Package emacs. (Sun, 06 Dec 2020 18:27:02 GMT) Full text and rfc822 format available.

Message #8 received at 14286 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Jérôme M. Berger <jeberger <at> free.fr>
Cc: 14286 <at> debbugs.gnu.org
Subject: Re: bug#14286: Tex-mode always picks the first command in
 tex-compile-commands on Windows
Date: Sun, 06 Dec 2020 19:26:31 +0100
"Jérôme M. Berger" <jeberger <at> free.fr> writes:

> 	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.

[...]

> (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))))))))

(This bug report unfortunately got no response at the time.)

Thanks -- I think it would be better to just avoid quoting the file
names altogether -- until we need to when actually issuing commands on
the files.  I've done this in Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 06 Dec 2020 18:27:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 14286 <at> debbugs.gnu.org and "Jérôme M. Berger" <jeberger <at> free.fr> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 06 Dec 2020 18:27:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 04 Jan 2021 12:24:14 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 167 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.