From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Berman via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#73854: 29.4; tex-mode: unexpected and inconsistent behaviour of `tex-compile`, `tex-file`, and `tex-view` Date: Sat, 19 Oct 2024 13:31:05 +0200 Message-ID: <87ldykxrba.fsf@gmx.net> References: <86ed4cl8no.fsf@gnu.org> Reply-To: Stephen Berman Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32432"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Thalis Charakas , 73854@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 19 13:35:00 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1t27jX-0008IF-Oo for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 19 Oct 2024 13:35:00 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t27jE-00060I-Re; Sat, 19 Oct 2024 07:34:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t27jC-0005z8-P7 for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2024 07:34:38 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t27jC-0001Vh-Ga for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2024 07:34:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=ISyLYH3OyLD/RZJe//Y6jeDAKSEXFvZv2ydrfcZf4v8=; b=JttO1/WDvYwnRcNGy8gSYyOv47dImngJAskh6ubJ//8z7X6elXwJ/yOCZKNWEzp1S1cSf96csl2hHBHtqvdoY9x3bWErWU/Cpvn8t/6ByN/QNIQULKsH/nO+uTYz20rr9BVqVmrrjDGbdvt7f9sGQbnsuz4pXjWjvoQ7EAmidXL8n72ajxBn1UuKm0v1rinA9Y+UUhD7k/phXOVDnmkzUtF+loAHAl3tCoaVEL0DMCtrB0spj2Lg5kkwS2Oc39GNi/Ayu6m3V3F0z07jjnL/u7SLA5yVoPcGgwlFgwU/IXARRwywPyNb+H+gnkH6Lq0CEyif/pe3ffMnnfMt3R7c/g==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t27jZ-0002vk-PX for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2024 07:35:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Oct 2024 11:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73854 X-GNU-PR-Package: emacs Original-Received: via spool by 73854-submit@debbugs.gnu.org id=B73854.172933765711202 (code B ref 73854); Sat, 19 Oct 2024 11:35:01 +0000 Original-Received: (at 73854) by debbugs.gnu.org; 19 Oct 2024 11:34:17 +0000 Original-Received: from localhost ([127.0.0.1]:41681 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t27iq-0002uc-Mg for submit@debbugs.gnu.org; Sat, 19 Oct 2024 07:34:17 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:34501) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t27im-0002uK-Kr for 73854@debbugs.gnu.org; Sat, 19 Oct 2024 07:34:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1729337467; x=1729942267; i=stephen.berman@gmx.net; bh=ISyLYH3OyLD/RZJe//Y6jeDAKSEXFvZv2ydrfcZf4v8=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=nyvEy5y/lWmQIklcLrw9QZguOME5AdfijbNvAhH1IwYwT2zpSihXnRJFML2R62VQ ESCi4LGs7+0F9OwmJQ+PaL2GAccg8psH/SEom4TJWSTbKN4xwrqL34W/+jvQXuC36 i6yNgg/1W6fXsDoeByNz6H+WwxInCnrpUqSz6NDkLAUIabTnqisHJzipEmeWWDrm5 a4JqkWZ10XO05MnnqRMRiAAO/Hq37g5w4W8jOPj+bNmNezu/ioBVev4HDGkaOkIeI jZZqrVk/PSFq4IsLj8A9+wA9qgADHTSFmCSYPnwg4T31frkiM/iW3gn4ffVYI301J 3R9uvKE+VR+HPSkn2A== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from strobelfssd ([94.134.95.160]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MhU9j-1tVwds2krL-00eZjY; Sat, 19 Oct 2024 13:31:07 +0200 In-Reply-To: <86ed4cl8no.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 19 Oct 2024 12:54:51 +0300") X-Provags-ID: V03:K1:tV4YNfQMoNo3Pmyewz/YXfV7i/Jr72VAnrXKMHguWH27C/pn9Ew hCDB/ptmf4Z8N0/c9wOkslkQHne/YgJQytDNj1gXnsnyOA6kP2Ys/mS2OQ9fVEEMzk6pGkI wDz40qAqCI2rWwmaEuMEvKzFRWykAJTxjf8RPLtTsgWxjj9NPYnxhJFhRBzZKH71uUd/9ze eBvS68M6i97JD26tJIyhQ== UI-OutboundReport: notjunk:1;M01:P0:vodcWgjolGE=;Iwud6luHxFUdmoADRpUHVi5/6Fc ZQQrhRV29osgOuRkiyuRHeKKJ9Y/P3zJJdwfZ6J8Gwbd7YNT79DP85lFB8sALEzpa6xBx4VlO 5/7AjJv5v4voHiUNYHc6MQDTT2RL7Jvf1QeQi7tuBMuEQvTOcB01ztc9RvKZe6Xeh7I15MLml arpZxl8KqMnJe4fQByGwv33/YGxYbAlsgGXRnqGN0n5gKBPrXeEkYVnu+aRhBVAGWwgqT3bXM UTkzD3JKDziGMQz1+3Ci2tdkNLUBkJM6sClpjK/et3CMk1GcnD22/bRCLg0f95v7ch81wnnG7 p6BRah410Ed2+dZXKe28ngsIDhKHDZpyFX4+QHqPWhp0k2ADGk33CnzamWXeU/3qdSoOfPIzi rtwVNUcqNpmbO7j7bFl86kWLBbRPk5ki+lVPyvdyz1e/5Wycb8CovamP0POnI7ttZRgrLT2HA vzGNhdAn6Wspg7t9RIblRaM+/Pbi5n6ad6c/dKZc1qrtnEvvlh6KQBY7I1UJangIh/AHTDLzV IEY0QgNcYfpMHTcc+U7qAG/pawCRYBM+D1yD8s45cYKYql5fXfgAdq3AiouKoiR/WHGvIkrP2 avg7yN/tVmYKgwHxLsSP0MRx0O7SkOiEV37gZ1+OQXW4kswZaNfjr6w1ti0rWjHdZoKwJgrFj aMOXzfdngRMB/o3j2Glbf93klUFAdqO5+zpp7wEKABlAjPJzzTTCUQKmyefjIegi6106S0Adh I317G/eOnmVARtrSLTaNjgNO5tO8YZgvSyql/RKl84Lpa/ITZHRHjDSt3QsjajNTycm8HxVn X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:293874 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Sat, 19 Oct 2024 12:54:51 +0300 Eli Zaretskii wrote: >> Date: Thu, 17 Oct 2024 18:36:19 +0000 >> From: Thalis Charakas via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >>=20 >> Basically, `tex-view` works, opening Evince, on a compiled .pdf only >> after a .dvi is created. >>=20 >> Running 'emacs -Q' I evaluate the following in the scratch buffer, to >> make it so that latex is compiled to pdf: >> ``` >> (setq tex-print-file-extension ".pdf" >> tex-dvi-view-command "evince" >> tex-dvi-print-command "lpr") >> ``` >> the last two lines are following the instructions on the description of >> `tex-print-file-extension`. >>=20 >> I navigate to a simple .tex in an empty directory and press `C-c C-c` >> which is bound by default to `tex-compile`, I press enter, as the >> default is `pdflatex`, and the file compiles, creating a .pdf in the >> directory. After that I press `C-c C-v`, which is bound to `tex-view` >> but Evince does not open, instead I get the message "tex-print: No >> appropriate =E2=80=98.dvi=E2=80=99 file could be found. If I press `C-c = C-f` >> (`tex-file`) after that, a .dvi file is created, and now `tex-view` >> works, meaning it opens the .pdf with Evince. >>=20 >> The fact that `tex-view` works on the .pdf only when a .dvi is first >> created seems like a bug. > > Thanks. Can you step with Edebug through tex-print in your case and > try to figure out what happens there that causes the error message? > There's some logic there which is supposed to verify that the current > buffer's print file is up-to-date: > > (if (and (not (equal (current-buffer) tex-last-buffer-texed)) > (buffer-file-name) > ;; Check that this buffer's printed file is up to date. > (file-newer-than-file-p > (setq test-name (tex-append (buffer-file-name) > tex-print-file-extension)) > (buffer-file-name))) > (setq print-file-name-dvi test-name)) > > Maybe something goes wrong there in your case? I debugged this and the problem is that tex-print expects the variable tex-print-file to be set, but (as its doc string says) it is set by tex-region, tex-buffer and tex-file, which are all not commands run by tex-compile, which is meant to run external programs (listed by tex-compile-commands). A simple fix is the following patch: --=-=-= Content-Type: text/x-patch Content-Disposition: inline Content-Description: tex-compile patch Content-Transfer-Encoding: quoted-printable diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 6fc49800018..acb5bb4b860 100644 =2D-- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -2530,6 +2530,7 @@ tex-compile (if (tex-shell-running) (tex-kill-job) (tex-start-shell)) + (setq tex-print-file (expand-file-name (tex-main-file))) (tex-send-tex-command cmd dir)))) (defun tex-start-tex (command file &optional dir) --=-=-= Content-Type: text/plain But I'm not familiar with the tex-mode.el code and don't know if this change might have unwanted consequences (though it seems prima facie safe). Steve Berman --=-=-=--