From: "Jérôme M. Berger" <jeberger@free.fr>
To: 14286@debbugs.gnu.org
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 [thread overview]
Message-ID: <517B9566.4080302@free.fr> (raw)
[-- Attachment #1: Type: text/plain, Size: 1527 bytes --]
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@free.fr
http://jeberger.free.fr
Jabber: jeberger@jabber.fr
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next reply other threads:[~2013-04-27 9:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-27 9:07 Jérôme M. Berger [this message]
2020-12-06 18:26 ` bug#14286: Tex-mode always picks the first command in tex-compile-commands on Windows Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=517B9566.4080302@free.fr \
--to=jeberger@free.fr \
--cc=14286@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).