unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#42570: tex-mode compiles / builds only in /tmp
@ 2020-07-28  2:14 RDS
  2020-07-28 23:19 ` bug#42570: tex-mode compiles / builds only in /tmp - more info RDS
  2020-08-06  2:06 ` bug#42570: Lars suggested tests RDS
  0 siblings, 2 replies; 11+ messages in thread
From: RDS @ 2020-07-28  2:14 UTC (permalink / raw)
  To: 42570

[-- Attachment #1: Type: text/plain, Size: 787 bytes --]

emacs 26.3. 2 different builds. 2 distinct OSs.

One build is custom inside Slackware; another build is standard issue from
Fedora 32.

Results below are identical for both situations.

If the tex / latex source (or a symbolic link) resides in /tmp directory,
everything from the tex mode menu functions as expected.

If the source is anywhere else in the directory structure, the first step,
compilation (tex / latex), fails because it can *not* find the source file.
Yet, if I use my own custom elisp script or invoke the relevant commands
manually, there is *no* problem.

The builtin tex-mode.el script seems to expect all code to be only in /tmp
or nothing will occur.

Am I missing something? A variable setting? Some other configuration aspect?

Thanks for your attention.

Guido

[-- Attachment #2: Type: text/html, Size: 979 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#42570: tex-mode compiles / builds only in /tmp - more info
  2020-07-28  2:14 bug#42570: tex-mode compiles / builds only in /tmp RDS
@ 2020-07-28 23:19 ` RDS
  2020-08-04 10:25   ` Lars Ingebrigtsen
  2020-08-06  2:06 ` bug#42570: Lars suggested tests RDS
  1 sibling, 1 reply; 11+ messages in thread
From: RDS @ 2020-07-28 23:19 UTC (permalink / raw)
  To: 42570

[-- Attachment #1: Type: text/plain, Size: 309 bytes --]

Invoking
    emacs  /path/to/file.tex
followed by C-c C-f does work.

But doing
    emacs  /path/to
then opening file.tex from dired followed by C-c C-f does not work.

Apparently tex-mode.el is *not *sending the correct full path to pdftex; it
does *not* find the input file under many circumstances.

Guido

[-- Attachment #2: Type: text/html, Size: 442 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#42624: emacs 26.3 : tex-mode.el : tex & latex compile failures
@ 2020-07-31  0:25 RDS
  2020-08-02  2:27 ` RDS
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: RDS @ 2020-07-31  0:25 UTC (permalink / raw)
  To: 42624

[-- Attachment #1: Type: text/plain, Size: 832 bytes --]

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.

[-- Attachment #2: Type: text/html, Size: 1059 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#42624: emacs 26.3 : tex-mode.el : tex & latex compile failures
  2020-07-31  0:25 bug#42624: emacs 26.3 : tex-mode.el : tex & latex compile failures RDS
@ 2020-08-02  2:27 ` RDS
  2020-08-03 18:09 ` bug#42624: Additional solutions RDS
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: RDS @ 2020-08-02  2:27 UTC (permalink / raw)
  To: 42624

[-- Attachment #1: Type: text/plain, Size: 1044 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 3100 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#42624: Additional solutions
  2020-07-31  0:25 bug#42624: emacs 26.3 : tex-mode.el : tex & latex compile failures RDS
  2020-08-02  2:27 ` RDS
@ 2020-08-03 18:09 ` RDS
  2020-08-03 20:35 ` bug#42624: More info RDS
  2020-08-07  0:33 ` bug#42624: emacs - tex-mode.el - build failure - not a bug RDS
  3 siblings, 0 replies; 11+ messages in thread
From: RDS @ 2020-08-03 18:09 UTC (permalink / raw)
  To: 42624

[-- Attachment #1: Type: text/plain, Size: 893 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1261 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#42624: More info
  2020-07-31  0:25 bug#42624: emacs 26.3 : tex-mode.el : tex & latex compile failures RDS
  2020-08-02  2:27 ` RDS
  2020-08-03 18:09 ` bug#42624: Additional solutions RDS
@ 2020-08-03 20:35 ` RDS
  2020-08-07  0:33 ` bug#42624: emacs - tex-mode.el - build failure - not a bug RDS
  3 siblings, 0 replies; 11+ messages in thread
From: RDS @ 2020-08-03 20:35 UTC (permalink / raw)
  To: 42624

[-- Attachment #1: Type: text/plain, Size: 699 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 942 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#42570: tex-mode compiles / builds only in /tmp - more info
  2020-07-28 23:19 ` bug#42570: tex-mode compiles / builds only in /tmp - more info RDS
@ 2020-08-04 10:25   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 11+ messages in thread
From: Lars Ingebrigtsen @ 2020-08-04 10:25 UTC (permalink / raw)
  To: RDS; +Cc: 42570

RDS <rds1944@gmail.com> writes:

> Invoking
>     emacs  /path/to/file.tex
> followed by C-c C-f does work.
>
> But doing
>     emacs  /path/to
> then opening file.tex from dired followed by C-c C-f does not work.

I'm unable to reproduce this in Emacs 26.3.

Here's my test case:

emacs -nw ~/src/emacs/trunk/etc/refcards/refcard.tex
`C-c C-f' -> a dvi file is made

emacs -nw ~/src/emacs/trunk/etc/refcards/
open refcard.tex
`C-c C-f' -> a dvi file is made

Are you able to reproduce this if you start emacs with -Q?

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





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#42570: Lars suggested tests
  2020-07-28  2:14 bug#42570: tex-mode compiles / builds only in /tmp RDS
  2020-07-28 23:19 ` bug#42570: tex-mode compiles / builds only in /tmp - more info RDS
@ 2020-08-06  2:06 ` RDS
  2020-08-06  7:26   ` Lars Ingebrigtsen
  1 sibling, 1 reply; 11+ messages in thread
From: RDS @ 2020-08-06  2:06 UTC (permalink / raw)
  To: 42570

[-- Attachment #1: Type: text/plain, Size: 1152 bytes --]

I have tried the tests you suggest on refcard.tex (plus a few others in
that dir) with & without -Q cl switch; nearly all failed to produce a dvi.
Immediately tex fails since it can *not* find the source file as I
described previously. (Also review additional material in bug 42624.) The
results are identical on both a Slackware-current partition installation &
on a Fedora 32 partition installation.

The Texlive installations are current & direct compilation on any tex /
latex source files functions flawlessly. I also have a tiny piece of lisp
code that directly invokes, via start-process, the tex / latex compiler;
it, too, never has a problem.

Reiterating, the tex-shell created by tex-mode.el does *not* see a path to
the source unless modifications I suggest are made as in bug 42624.

Is this possibly a configuration issue? Could there be hidden environmental
variables that need to be set either in my bash shell or something I am
missing in the init.el? Official emacs documentation about tex-mode says
little about this matter. As an aside, inside tex-mode.el, there is a
getenv ESHELL command. Does ESHELL need some special attention?

[-- Attachment #2: Type: text/html, Size: 1326 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#42570: Lars suggested tests
  2020-08-06  2:06 ` bug#42570: Lars suggested tests RDS
@ 2020-08-06  7:26   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 11+ messages in thread
From: Lars Ingebrigtsen @ 2020-08-06  7:26 UTC (permalink / raw)
  To: RDS; +Cc: 42570

RDS <rds1944@gmail.com> writes:

> Is this possibly a configuration issue? Could there be hidden
> environmental variables that need to be set either in my bash shell or
> something I am missing in the init.el?

I don't know -- I've tried your recipe for the bug on two different
(Debian and Ubuntu) machines, and I'm unable to reproduce it with "emacs
-Q" on Emacs 26.3.

So I think it sounds like a configuration issue on your side somewhere,
but I haven't used tex otherwise in quite a few years.

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





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#42624: emacs - tex-mode.el - build failure - not a bug
  2020-07-31  0:25 bug#42624: emacs 26.3 : tex-mode.el : tex & latex compile failures RDS
                   ` (2 preceding siblings ...)
  2020-08-03 20:35 ` bug#42624: More info RDS
@ 2020-08-07  0:33 ` RDS
  2020-08-07  7:08   ` bug#42570: " Lars Ingebrigtsen
  3 siblings, 1 reply; 11+ messages in thread
From: RDS @ 2020-08-07  0:33 UTC (permalink / raw)
  To: 42624, 42570

[-- Attachment #1: Type: text/plain, Size: 275 bytes --]

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.

[-- Attachment #2: Type: text/html, Size: 360 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#42570: emacs - tex-mode.el - build failure - not a bug
  2020-08-07  0:33 ` bug#42624: emacs - tex-mode.el - build failure - not a bug RDS
@ 2020-08-07  7:08   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 11+ messages in thread
From: Lars Ingebrigtsen @ 2020-08-07  7:08 UTC (permalink / raw)
  To: RDS; +Cc: 42624, 42570

RDS <rds1944@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





^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-08-07  7:08 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-31  0:25 bug#42624: emacs 26.3 : tex-mode.el : tex & latex compile failures RDS
2020-08-02  2:27 ` RDS
2020-08-03 18:09 ` bug#42624: Additional solutions RDS
2020-08-03 20:35 ` bug#42624: More info RDS
2020-08-07  0:33 ` bug#42624: emacs - tex-mode.el - build failure - not a bug RDS
2020-08-07  7:08   ` bug#42570: " Lars Ingebrigtsen
  -- strict thread matches above, loose matches on Subject: below --
2020-07-28  2:14 bug#42570: tex-mode compiles / builds only in /tmp RDS
2020-07-28 23:19 ` bug#42570: tex-mode compiles / builds only in /tmp - more info RDS
2020-08-04 10:25   ` Lars Ingebrigtsen
2020-08-06  2:06 ` bug#42570: Lars suggested tests RDS
2020-08-06  7:26   ` Lars Ingebrigtsen

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