GNU bug report logs - #42624
emacs 26.3 : tex-mode.el : tex & latex compile failures

Previous Next

Package: emacs;

Reported by: RDS <rds1944 <at> gmail.com>

Date: Fri, 31 Jul 2020 00:26:02 UTC

Severity: normal

Tags: notabug

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 42624 in the body.
You can then email your comments to 42624 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#42624; Package emacs. (Fri, 31 Jul 2020 00:26:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to RDS <rds1944 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 31 Jul 2020 00:26:02 GMT) Full text and rfc822 format available.

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

From: RDS <rds1944 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: emacs 26.3 : tex-mode.el : tex & latex compile failures
Date: Thu, 30 Jul 2020 17:25:12 -0700
[Message part 1 (text/plain, inline)]
emacs /path/to/src.tex -> C-c C-f -> ok
  buffer *tex-shell* pwd -> /path/to

emacs /path/to -> C-x d -> src.tex -> C-c C-f -> src.tex not found
(many other variations lead to similar failure)
  buffer *tex-shell* pwd -> /tmp

Problem traced to function tex-send-tex-command(...).
It does *not* change directory to location of src.tex

Remove or comment out this conditional stanza

  (unless (or (equal dir (let ((buf (tex-shell-buf-no-error)))
                           (and buf (with-current-buffer buf
                                      default-directory))))
     (not dir))
    (let (shell-dirtrack-verbose)
      (tex-send-command tex-shell-cd-command dir)))

Replace with

  (let (shell-dirtrack-verbose) (tex-send-command tex-shell-cd-command dir))

solves this error. Proper solution requires unless... to be repaired.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42624; Package emacs. (Sun, 02 Aug 2020 02:28:01 GMT) Full text and rfc822 format available.

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

From: RDS <rds1944 <at> gmail.com>
To: 42624 <at> debbugs.gnu.org
Subject: Re: emacs 26.3 : tex-mode.el : tex & latex compile failures
Date: Sat, 1 Aug 2020 19:27:07 -0700
[Message part 1 (text/plain, inline)]
Alternative repair. In the troublesome lines

  (unless (or (equal dir (let ((buf (tex-shell-buf-no-error)))
                           (and buf (with-current-buffer buf
                                      default-directory))))
      (not dir))
    (let (shell-dirtrack-verbose)
      (tex-send-command tex-shell-cd-command dir)))

change

   equal dir -> equal "garbage" in the line with unless.

This will force the cd command to always execute.

Here's the patch I made

--- tex-mode.0.el 2020-07-31 16:22:30.380924724 -0700
+++ tex-mode.1.el 2020-07-31 14:00:36.344874591 -0700
@@ -2482,7 +2482,8 @@
     (tex-send-tex-command compile-command dir)))

 (defun tex-send-tex-command (cmd &optional dir)
-  (unless (or (equal dir (let ((buf (tex-shell-buf-no-error)))
+  (setq nodir "garbage") ;; dir -> nodir  force a cd  nodir!=dir
+  (unless (or (equal nodir (let ((buf (tex-shell-buf-no-error)))
                            (and buf (with-current-buffer buf
                                       default-directory))))
        (not dir))
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42624; Package emacs. (Mon, 03 Aug 2020 18:11:01 GMT) Full text and rfc822 format available.

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

From: RDS <rds1944 <at> gmail.com>
To: 42624 <at> debbugs.gnu.org
Subject: Additional solutions
Date: Mon, 3 Aug 2020 11:09:35 -0700
[Message part 1 (text/plain, inline)]
I have found two other code modifications that fix the problem.

(define-derived-mode tex-shell shell-mode "TeX-Shell" ;; line 2000
  (setq-local compilation-error-regexp-alist tex-error-regexp-alist)
  (setq-local default-directory "") ;; My addition; most anything(?) inside
quotes is ok
  (compilation-shell-minor-mode t))

or

(defun tex-send-tex-command (cmd &optional dir) ;; line 2484
  (unless (or (equal dir (let ((buf)) ;; removed (tex-shell-buf-no-error)
;; buf is nil
                           (and buf (with-current-buffer buf
                                      default-directory))))

Among all the proposals (& there are certainly more), I can *not* choose
because I do not understand all the conditions that must be satisfied for
proper functioning of the entire module. My choices work for my restricted
situations. That is probably not enough for more general cases.

RDS
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42624; Package emacs. (Mon, 03 Aug 2020 20:37:01 GMT) Full text and rfc822 format available.

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

From: RDS <rds1944 <at> gmail.com>
To: 42624 <at> debbugs.gnu.org
Subject: More info
Date: Mon, 3 Aug 2020 13:35:30 -0700
[Message part 1 (text/plain, inline)]
More info

The function tex-file() is ok. It yields the correct tex/latex command,
file name, & directory. The trouble is the routines that create the
tex-shell. Note that the function tex-set-buffer-directory(...) is *never*
called. If it is used thusly

(defun tex-send-tex-command (cmd &optional dir) ;; line 2484
  (setq default-directory (tex-set-buffer-directory "*tex-shell*" "/tmp"))
;; new statement here
  (unless (or (equal dir (let ((buf (tex-shell-buf-no-error)))
                           (and buf (with-current-buffer buf
                                      default-directory))))

it works; yet another solution. This new addition could certainly be placed
elsewhere as well.

RDS
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42624; Package emacs. (Fri, 07 Aug 2020 00:35:02 GMT) Full text and rfc822 format available.

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

From: RDS <rds1944 <at> gmail.com>
To: 42624 <at> debbugs.gnu.org, 42570 <at> debbugs.gnu.org
Subject: emacs - tex-mode.el - build failure - not a bug
Date: Thu, 6 Aug 2020 17:33:11 -0700
[Message part 1 (text/plain, inline)]
A test using a Fedora 32 Live image + emacs + texlive-collection-latex
could not replicate the build failure described on this reporter's machine.
The latter has some problem with configuration or missing packages. As
such, these postings should be removed; it is not a bug.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42624; Package emacs. (Fri, 07 Aug 2020 07:09:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: RDS <rds1944 <at> gmail.com>
Cc: 42624 <at> debbugs.gnu.org, 42570 <at> debbugs.gnu.org
Subject: Re: bug#42570: emacs - tex-mode.el - build failure - not a bug
Date: Fri, 07 Aug 2020 09:08:16 +0200
RDS <rds1944 <at> gmail.com> writes:

> A test using a Fedora 32 Live image + emacs + texlive-collection-latex
> could not replicate the build failure described on this reporter's
> machine. The latter has some problem with configuration or missing
> packages. As such, these postings should be removed; it is not a bug.

OK; closing the bug report.

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




Added tag(s) notabug. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 07 Aug 2020 07:09:03 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 42624 <at> debbugs.gnu.org and RDS <rds1944 <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 07 Aug 2020 07:09:03 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. (Fri, 04 Sep 2020 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 234 days ago.

Previous Next


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