GNU bug report logs - #55511
13.1.3; TeX-auto-store issues with complex paths

Previous Next

Package: auctex;

Reported by: Cyril Arnould <cyril.arnould <at> outlook.com>

Date: Wed, 18 May 2022 21:51:01 UTC

Severity: normal

Found in version 13.1.3

Done: Ikumi Keita <ikumi <at> ikumi.que.jp>

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 55511 in the body.
You can then email your comments to 55511 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-auctex <at> gnu.org:
bug#55511; Package auctex. (Wed, 18 May 2022 21:51:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Cyril Arnould <cyril.arnould <at> outlook.com>:
New bug report received and forwarded. Copy sent to bug-auctex <at> gnu.org. (Wed, 18 May 2022 21:51:02 GMT) Full text and rfc822 format available.

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

From: Cyril Arnould <cyril.arnould <at> outlook.com>
To: "bug-auctex <at> gnu.org" <bug-auctex <at> gnu.org>
Subject: 13.1.3; TeX-auto-store issues with complex paths
Date: Wed, 18 May 2022 21:44:52 +0000
[Message part 1 (text/plain, inline)]
As far as I've gathered, TeX-auto-store can be used to automatically
detect any \newcommand{} in files and create an .el file in the auto
directory which adds the commands to the TeX-symbol-list. From there
they can be used for things like auto-completion. I've also seen that if
the command is declared in a separate file but the TeX-master is set, it
will create the .el file in the auto folder of the TeX-master.

When the TeX-master file is parsed on the other hand, any .tex files
added via \input{} or \include{} seem to be added to the list of style
hooks to run. As far as I've seen, this has the effect that the
auto-completion for the \newcommand{} declared in a separate file is
also available in the TeX-master.

The problems start when the \input{} and \include{} commands are more
complex. In the following examples, preamble2.el to preamble5.el are not
run because the files are not found at the paths specified in the
master.el file.:

\input{preamble0}         % This works fine
\input{prea mble1}        % This works fine
\input{../../preamble2}   % This is not added to the TeX-run-style-hooks
                          % list at all
\input{"preamble3"}       % This gets added with quotes escaped,
                          % i.e. "\"preamble2\""
\input{folder/preamble4}  % This gets added as "folder/preamble3"
\input{../preamble5}      % This gets added as "../preamble4"

Another issue is that if several files are included that have the same
name but are in different subfolders, the generated .el files will end
up overwriting each other, so the symbol list of only one of the .tex
files will be available. Granted, this is probably quite the edge case
but it would be nice to solve nonetheless.

Somewhat related to this topic but not really a bug, more of a feature
request: it would be nice if files added via \import{}{} and
\subimport{}{} commands from the import package were added as well when parsing.

Emacs  : GNU Emacs 28.1 (build 2, x86_64-w64-mingw32)
of 2022-04-09
Package: 13.1.3

current state:
==============
(setq
AUCTeX-date "2022-04-16"
window-system 'w32
LaTeX-version "2e"
TeX-style-path '("~/.emacs.d/auctex" "c:/Users/Cyril/AppData/Roaming/.emacs.d/elpa/auctex-13.1.3/style"
                  "c:/Users/Cyril/AppData/Roaming/.emacs.d/auctex/auto" "c:/Users/Cyril/AppData/Roaming/.emacs.d/auctex/style" "auto" "style")
TeX-auto-save t
TeX-parse-self t
TeX-master t
TeX-command-list '(("TeX" "%(PDF)%(tex) %(file-line-error) %`%(extraopts) %S%(PDFout)%(mode)%' %(output-dir) %t" TeX-run-TeX nil
                     (plain-tex-mode ams-tex-mode texinfo-mode) :help "Run plain TeX")
                    ("LaTeX" "%`%l%(mode)%' %T" TeX-run-TeX nil (latex-mode doctex-mode) :help "Run LaTeX")
                    ("Makeinfo" "makeinfo %(extraopts) %(o-dir) %t" TeX-run-compile nil (texinfo-mode) :help "Run Makeinfo with Info output")
                    ("Makeinfo HTML" "makeinfo %(extraopts) %(o-dir) --html %t" TeX-run-compile nil (texinfo-mode) :help "Run Makeinfo with HTML output")
                    ("AmSTeX" "amstex %(PDFout) %`%(extraopts) %S%(mode)%' %(output-dir) %t" TeX-run-TeX nil (ams-tex-mode) :help "Run AMSTeX")
                    ("ConTeXt" "%(cntxcom) --once --texutil %(extraopts) %(execopts)%t" TeX-run-TeX nil (context-mode) :help "Run ConTeXt once")
                    ("ConTeXt Full" "%(cntxcom) %(extraopts) %(execopts)%t" TeX-run-TeX nil (context-mode) :help "Run ConTeXt until completion")
                    ("BibTeX" "bibtex %(O?aux)" TeX-run-BibTeX nil (plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode context-mode) :help
                     "Run BibTeX")
                    ("Biber" "biber %(output-dir) %s" TeX-run-Biber nil (plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode) :help
                     "Run Biber")
                    ("Texindex" "texindex %s.??" TeX-run-command nil (texinfo-mode) :help "Run Texindex")
                    ("Texi2dvi" "%(PDF)texi2dvi %t" TeX-run-command nil (texinfo-mode) :help "Run Texi2dvi or Texi2pdf")
                    ("View" "%V" TeX-run-discard-or-function t t :help "Run Viewer") ("Print" "%p" TeX-run-command t t :help "Print the file")
                    ("Queue" "%q" TeX-run-background nil t :help "View the printer queue" :visible TeX-queue-command)
                    ("File" "%(o?)dvips %d -o %f " TeX-run-dvips t (plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode) :help
                     "Generate PostScript file")
                    ("Dvips" "%(o?)dvips %d -o %f " TeX-run-dvips nil (plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode) :help
                     "Convert DVI file to PostScript")
                    ("Dvipdfmx" "dvipdfmx -o %(O?pdf) %d" TeX-run-dvipdfmx nil (plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode) :help
                     "Convert DVI file to PDF with dvipdfmx")
                    ("Ps2pdf" "ps2pdf %f %(O?pdf)" TeX-run-ps2pdf nil (plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode) :help
                     "Convert PostScript file to PDF")
                    ("Glossaries" "makeglossaries %(d-dir) %s" TeX-run-command nil (plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode)
                     :help "Run makeglossaries to create glossary file")
                    ("Index" "makeindex %(O?idx)" TeX-run-index nil (plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode) :help
                     "Run makeindex to create index file")
                    ("upMendex" "upmendex %(O?idx)" TeX-run-index t (plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode) :help
                     "Run upmendex to create index file")
                    ("Xindy" "texindy %s" TeX-run-command nil (plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode) :help
                     "Run xindy to create index file")
                    ("Check" "lacheck %s" TeX-run-compile nil (latex-mode) :help "Check LaTeX file for correctness")
                    ("ChkTeX" "chktex -v6 %s" TeX-run-compile nil (latex-mode) :help "Check LaTeX file for common mistakes")
                    ("Spell" "(TeX-ispell-document \"\")" TeX-run-function nil t :help "Spell-check the document")
                    ("Clean" "TeX-clean" TeX-run-function nil t :help "Delete generated intermediate files")
                    ("Clean All" "(TeX-clean t)" TeX-run-function nil t :help "Delete generated intermediate and output files")
                    ("Other" "" TeX-run-command t t :help "Run an arbitrary command"))
)
[Message part 2 (text/html, inline)]

Information forwarded to bug-auctex <at> gnu.org:
bug#55511; Package auctex. (Fri, 20 May 2022 12:45:01 GMT) Full text and rfc822 format available.

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

From: Ikumi Keita <ikumikeita <at> jcom.home.ne.jp>
To: Cyril Arnould <cyril.arnould <at> outlook.com>
Cc: 55511 <at> debbugs.gnu.org
Subject: Re: bug#55511: 13.1.3; TeX-auto-store issues with complex paths
Date: Fri, 20 May 2022 21:44:46 +0900
Hi Cyril,

>>>>> Cyril Arnould <cyril.arnould <at> outlook.com> writes:
> The problems start when the \input{} and \include{} commands are more
> complex. In the following examples, preamble2.el to preamble5.el are not
> run because the files are not found at the paths specified in the
> master.el file.:

Thanks for your report. I think the issue should be fixed on AUCTeX
side. I began to work on this, but haven't managed to address it yet due
to some gotcha, the reason of which I haven't figured out yet. Please be
patient.

> Another issue is that if several files are included that have the same
> name but are in different subfolders, the generated .el files will end
> up overwriting each other, so the symbol list of only one of the .tex
> files will be available. Granted, this is probably quite the edge case
> but it would be nice to solve nonetheless.

I'm not sure whether there is smart solution for this matter.

> Somewhat related to this topic but not really a bug, more of a feature
> request: it would be nice if files added via \import{}{} and
> \subimport{}{} commands from the import package were added as well
> when parsing.

I expect this would be addressed once the main bug is resolved.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine




Information forwarded to bug-auctex <at> gnu.org:
bug#55511; Package auctex. (Sat, 21 May 2022 10:44:02 GMT) Full text and rfc822 format available.

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

From: Cyril Arnould <cyril.arnould <at> outlook.com>
To: Ikumi Keita <ikumikeita <at> jcom.home.ne.jp>
Cc: "55511 <at> debbugs.gnu.org" <55511 <at> debbugs.gnu.org>
Subject: AW: bug#55511: 13.1.3; TeX-auto-store issues with complex paths
Date: Sat, 21 May 2022 10:43:46 +0000
[Message part 1 (text/plain, inline)]
>I'm not sure whether there is smart solution for this matter.

Maybe there should be an "auto" folder at every .tex file location instead
of only in the master location, I imagine this could solve a few of the
issues. The path to the .el file would have to be constructed using
"../", then the path to the included file, then "auto/" and finally the
filename. In my example, the paths to the .el files in the master's .el
file would end up as follows:

"../auto/preamble0",
"../auto/prea mble1"
"../../../auto/preamble2"
"../auto/preamble3"
"../folder/auto/preamble4"
"../../auto/preamble5"

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

Information forwarded to bug-auctex <at> gnu.org:
bug#55511; Package auctex. (Sun, 22 May 2022 09:10:02 GMT) Full text and rfc822 format available.

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

From: Ikumi Keita <ikumi <at> ikumi.que.jp>
To: Cyril Arnould <cyril.arnould <at> outlook.com>
Cc: "55511 <at> debbugs.gnu.org" <55511 <at> debbugs.gnu.org>
Subject: Re: bug#55511: 13.1.3; TeX-auto-store issues with complex paths
Date: Sun, 22 May 2022 18:09:07 +0900
[Message part 1 (text/plain, inline)]
Hi Cyril,

>>>>> Cyril Arnould <cyril.arnould <at> outlook.com> writes:
>> I'm not sure whether there is smart solution for this matter.
> Maybe there should be an "auto" folder at every .tex file location instead
> of only in the master location, I imagine this could solve a few of the
> issues.

Ah, yes, you are right. I was confusing with the case generating support
files for such as 'example.dtx', 'example.sty', 'example.drv' and
'example.bib', all in the same directory.

> The path to the .el file would have to be constructed using
> "../", then the path to the included file, then "auto/" and finally the
> filename.

Yes, and that's already implemented. AUCTeX searches support files under
each those "auto/" (and "stlye/") subdirectories and load them if found.

With respect to the main issue of this bug#55511, I think the attached
patch would solve the problem. Could you test it if possible?

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine

[patch (text/x-diff, attachment)]

Information forwarded to bug-auctex <at> gnu.org:
bug#55511; Package auctex. (Sun, 22 May 2022 16:29:02 GMT) Full text and rfc822 format available.

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

From: Cyril Arnould <cyril.arnould <at> outlook.com>
To: Ikumi Keita <ikumi <at> ikumi.que.jp>
Cc: "55511 <at> debbugs.gnu.org" <55511 <at> debbugs.gnu.org>
Subject: AW: bug#55511: 13.1.3; TeX-auto-store issues with complex paths
Date: Sun, 22 May 2022 16:28:22 +0000
[Message part 1 (text/plain, inline)]
Thanks, the patch seems to work! To be clear, all the .el files are
still placed  in the TeX-master's auto directory, so .tex files with the
same name in different folders still end up overwriting each other's .el
file. I'm guessing that was also your intention. For my workflow that's
not an issue though.

I didn't really manage to install AUCTeX from the git repo though. My
emacs installation comes from MSYS2
(https://packages.msys2.org/package/mingw-w64-x86_64-emacs) and when I
tried to run the ./configure script in the MINGW64 environment, it
failed because of some sed error. Running it from the MSYS environment
instead seemed to have worked, it installed the package to
C:\msys64\mingw64\share\emacs\site-lisp. So I removed my old AUCTeX
package from the .emacs.d folder, but for some reason my .emacs file
kept reinstalling it from ELPA even though the site-lisp folder is part
of the load-path... I load it via use-package:

;; AUCTeX
(use-package latex
  :ensure auctex)

Anyway, long story short, I applied the patch to my working copy, then
simply overwrote the tex.el and latex.el in my .emacs.d/elpa
folder. That means the rest of the AUCTeX files were not up to date with
the master branch but it worked nonetheless.
[Message part 2 (text/html, inline)]

Information forwarded to bug-auctex <at> gnu.org:
bug#55511; Package auctex. (Sun, 22 May 2022 18:18:01 GMT) Full text and rfc822 format available.

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

From: Arash Esbati <arash <at> gnu.org>
To: Cyril Arnould <cyril.arnould <at> outlook.com>
Cc: Ikumi Keita <ikumi <at> ikumi.que.jp>,
 "55511 <at> debbugs.gnu.org" <55511 <at> debbugs.gnu.org>
Subject: Re: bug#55511: 13.1.3; TeX-auto-store issues with complex paths
Date: Sun, 22 May 2022 20:16:43 +0200
Cyril Arnould <cyril.arnould <at> outlook.com> writes:

> I didn't really manage to install AUCTeX from the git repo though. My
> emacs installation comes from MSYS2
> (https://packages.msys2.org/package/mingw-w64-x86_64-emacs) and when I
> tried to run the ./configure script in the MINGW64 environment, it
> failed because of some sed error.

Did you run ./autogen.sh before ./configure?

We have instructions for using AUCTeX from a local Git repo described
here[1].  Maybe that is easier for testing purposes.

> Running it from the MSYS environment instead seemed to have worked, it
> installed the package to C:\msys64\mingw64\share\emacs\site-lisp. So I
> removed my old AUCTeX
> package from the .emacs.d folder, but for some reason my .emacs file
> kept reinstalling it from ELPA even though the site-lisp folder is part
> of the load-path... I load it via use-package:

> ;; AUCTeX
>
> (use-package latex
>   :ensure auctex)

I'd say this is the expected behavior[2]:

  The :ensure keyword causes the package(s) to be installed automatically
  if not already present on your system:

  (use-package magit
    :ensure t)

  If you need to install a different package from the one named by
  use-package, you can specify it like this:

  (use-package tex
    :ensure auctex)

I don't use use-package, but I think you need to use-package tex and not latex.

Best, Arash

Footnotes:
[1]  https://www.gnu.org/software/auctex/manual/auctex.html#Using-AUCTeX-from-local-Git-repo

[2]  https://github.com/jwiegley/use-package#package-installation




Information forwarded to bug-auctex <at> gnu.org:
bug#55511; Package auctex. (Sun, 22 May 2022 22:55:02 GMT) Full text and rfc822 format available.

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

From: Cyril Arnould <cyril.arnould <at> outlook.com>
To: Arash Esbati <arash <at> gnu.org>
Cc: Ikumi Keita <ikumi <at> ikumi.que.jp>,
 "55511 <at> debbugs.gnu.org" <55511 <at> debbugs.gnu.org>
Subject: AW: bug#55511: 13.1.3; TeX-auto-store issues with complex paths
Date: Sun, 22 May 2022 22:54:47 +0000
[Message part 1 (text/plain, inline)]
>Did you run ./autogen.sh before ./configure?

I did, yes, I attached the output in case you're interested. It seems
like it starts failing after the following line:

checking for install-info... /usr/bin/install-info

The problem is I end up with an empty Makefile, so make fails
afterwards.

>We have instructions for using AUCTeX from a local Git repo described
>here[1].

I think what was missing were the following lines from the
AUCTeX-documentation:

(load "auctex.el" nil t t)
(load "preview-latex.el" nil t t)

When I added those, it worked. I guess these lines are not necessary
when installing via ELPA?

>I don't use use-package, but I think you need to use-package tex and
>not latex.

I think I've changed this based off of this post:

https://emacs.stackexchange.com/questions/41321/when-to-specify-a-package-name-in-use-packages-ensure-tag/41324#41324

I wanted to load LaTeX-mode, not TeX-mode, which is in latex.el. I also
load reftex using the following snippet:

(use-package reftex-mode
  :ensure auctex
  :hook LaTeX-mode)

Anyway, the patch was still working with the properly installed auctex.
[Message part 2 (text/html, inline)]
[mingw-output (application/octet-stream, attachment)]

Information forwarded to bug-auctex <at> gnu.org:
bug#55511; Package auctex. (Mon, 23 May 2022 08:22:01 GMT) Full text and rfc822 format available.

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

From: Ikumi Keita <ikumi <at> ikumi.que.jp>
To: Cyril Arnould <cyril.arnould <at> outlook.com>
Cc: "55511 <at> debbugs.gnu.org" <55511 <at> debbugs.gnu.org>
Subject: Re: bug#55511: 13.1.3; TeX-auto-store issues with complex paths
Date: Mon, 23 May 2022 17:21:12 +0900
Hi Cyril,

>>>>> Cyril Arnould <cyril.arnould <at> outlook.com> writes:
> Thanks, the patch seems to work!

Thanks for checking. I committed the change into the git repo.

> To be clear, all the .el files are still placed in the TeX-master's
> auto directory, so .tex files with the same name in different folders
> still end up overwriting each other's .el file.

Ah, I see your points. Looking at the code `TeX-auto-write', it is
hard-coded that it saves support .el files in TeX-master's auto
subdirectory actually. I think that AUCTeX can introduce a new user
option to decide whether to aggregate them in one auto directory or save
into each auto subdirectory separately.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine




Information forwarded to bug-auctex <at> gnu.org:
bug#55511; Package auctex. (Mon, 23 May 2022 12:26:02 GMT) Full text and rfc822 format available.

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

From: Arash Esbati <arash <at> gnu.org>
To: Cyril Arnould <cyril.arnould <at> outlook.com>
Cc: Ikumi Keita <ikumi <at> ikumi.que.jp>,
 "55511 <at> debbugs.gnu.org" <55511 <at> debbugs.gnu.org>
Subject: Re: bug#55511: 13.1.3; TeX-auto-store issues with complex paths
Date: Mon, 23 May 2022 14:25:20 +0200
Cyril Arnould <cyril.arnould <at> outlook.com> writes:

>>Did you run ./autogen.sh before ./configure?
>
> I did, yes, I attached the output in case you're interested. It seems
> like it starts failing after the following line:
>
> checking for install-info... /usr/bin/install-info
>
> The problem is I end up with an empty Makefile, so make fails
> afterwards.

Hmm, can't tell what's going wrong.  I'm also using Msys2/Mingw64 on
Win10 and don't see this issue.  I do:

$ ./autogen.sh
$ ./configure --without-texmf-dir --with-lispdir=.
$ make

> I think what was missing were the following lines from the
> AUCTeX-documentation:
>
> (load "auctex.el" nil t t)
> (load "preview-latex.el" nil t t)
>
> When I added those, it worked.

When you install AUCTeX from anywhere else than ELPA, you need those
line, true.

> I guess these lines are not necessary when installing via ELPA?

True.  There were reports where the 2 lines above were even harmful when
installed from ELPA.

> I think I've changed this based off of this post:
>
> https://emacs.stackexchange.com/questions/41321/when-to-specify-a-package-name-in-use-packages-ensure-tag/41324#41324
>
> I wanted to load LaTeX-mode, not TeX-mode, which is in latex.el.

The reason I was asking it that active contributors don't use
use-package and we currently have this in the manual:

(use-package tex
  :ensure auctex)

If that's not right, we should change it (but it seems there is no
definitive answer to this ;-)

> Anyway, the patch was still working with the properly installed
> auctex.

Indeed, Keita has installed it, so the issue is now resolved and should
be available via ELPA also sometimes soon.

Best, Arash




Information forwarded to bug-auctex <at> gnu.org:
bug#55511; Package auctex. (Mon, 23 May 2022 22:18:02 GMT) Full text and rfc822 format available.

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

From: Cyril Arnould <cyril.arnould <at> outlook.com>
To: Arash Esbati <arash <at> gnu.org>
Cc: Ikumi Keita <ikumi <at> ikumi.que.jp>,
 "55511 <at> debbugs.gnu.org" <55511 <at> debbugs.gnu.org>
Subject: AW: bug#55511: 13.1.3; TeX-auto-store issues with complex paths
Date: Mon, 23 May 2022 22:16:57 +0000
[Message part 1 (text/plain, inline)]
To Keita:

Thanks!

>I think that AUCTeX can introduce a new user option to decide whether
>to aggregate them in one auto directory or save into each auto
>subdirectory separately.

Is it important for the user to have control over this? The only reason
I can think of for keeping support for one auto folder in the master
location would be backwards compatibility with old auto folders.

To Arash:

>Hmm, can't tell what's going wrong.  I'm also using Msys2/Mingw64 on
>Win10 and don't see this issue.  I do:

I think I've narrowed it down a bit, I have mingw-w64-x86_64-sed
installed. If I remove the package, it uses the /usr/bin/sed and
finishes with no issues. So the problem seems to either be with the
mingw-w64-x86_64-sed or incorrect handling of that variant of sed by the
configure script.

>The reason I was asking it that active contributors don't use
>use-package and we currently have this in the manual:
>
>(use-package tex
>  :ensure auctex)
>
>If that's not right, we should change it (but it seems there is no
>definitive answer to this ;-)

As far as I know, the simplest use-package definition would be to just
load a preinstalled package. The following two lines would be
equivalent if I'm not mistaken:

(use-package vlf)
(require 'vlf)

Since vlf (very large file mode) is not part of Emacs itself, I also
need to use the :ensure keyword in my .emacs file. If vlf is not found
in the load-path, this will use package.el to install it automatically:

(use-package vlf
  :ensure t)

The problem with AUCTeX is that there's no (provide 'auctex) feature, so
(use-package auctex) will fail because it can't (require 'auctex). If
I'm not mistaken, the reason there's no (provide 'auctex) is because
AUCTeX redefines already existing modes, i.e. plain-tex-mode and
latex-mode. Now, with the following lines however, use-package will make
sure the auctex package is installed and then (require 'tex):

(use-package tex
  :ensure auctex)

Now, to the question whether to use (use-package tex) vs. (use-package
latex): I think it doesn't matter precisely because the features AUCTeX
implements already exist. Having the .emacs.d/elpa/auctex-13.1.3 folder
in the load-path (which package.el will do automatically upon
installation) will make sure AUCTeX is used instead of the Emacs
TeX-mode, so neither (require 'tex) nor (require 'latex) seem to be
necessary at all.

I guess Emacs already loads all of the packages at some point after the
user init file? Not quite sure. If that's not it, then I guess
(use-package latex) also works because latex.el has (require 'tex) at
the top.

I've also remembered why I specifically wanted to work with (use-package
latex) rather than (use-package tex): I wanted to redefine keybindings
of the LaTeX-mode-map, for which I need to (require 'latex)
resp. (use-package latex) in the init file already:

(use-package latex
  :ensure auctex
  :bind
  (:map LaTeX-mode-map
        ("C-c b" . TeX-command-buffer)
        ("C-c C-b" . align-current)
        ("C-c c" . TeX-command-master)
        ("C-c C-c" . comment-or-uncomment-region))
  :init
  (add-hook 'TeX-after-compilation-finished-functions
            #'TeX-revert-document-buffer))

On a side note, I've also just noticed that I don't have to :ensure the
auctex package is installed in the (use-package reftex) definition since
reftex is part of Emacs. I thought it was part of AUCTeX as well.

So, long story short, (use-package tex) is fine as long as you don't
need to modify any of another provided package's definitions. If I'm not
mistaken though, use-package should work with any other of the provided
packages.
[Message part 2 (text/html, inline)]

Information forwarded to bug-auctex <at> gnu.org:
bug#55511; Package auctex. (Tue, 24 May 2022 08:43:01 GMT) Full text and rfc822 format available.

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

From: Ikumi Keita <ikumi <at> ikumi.que.jp>
To: Cyril Arnould <cyril.arnould <at> outlook.com>
Cc: Arash Esbati <arash <at> gnu.org>,
 "55511 <at> debbugs.gnu.org" <55511 <at> debbugs.gnu.org>
Subject: Re: bug#55511: 13.1.3; TeX-auto-store issues with complex paths
Date: Tue, 24 May 2022 17:42:35 +0900
Hi Cyril,

>>>>> Cyril Arnould <cyril.arnould <at> outlook.com> writes:
> To Keita:
> Thanks!

You're welcome.

> Is it important for the user to have control over this? The only reason
> I can think of for keeping support for one auto folder in the master
> location would be backwards compatibility with old auto folders.

We can't tell each user's preference. :-) So I think conservative
approach would be better.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine




Information forwarded to bug-auctex <at> gnu.org:
bug#55511; Package auctex. (Tue, 24 May 2022 11:46:01 GMT) Full text and rfc822 format available.

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

From: Tassilo Horn <tsdh <at> gnu.org>
To: Ikumi Keita <ikumi <at> ikumi.que.jp>
Cc: bug-auctex <at> gnu.org, Arash Esbati <arash <at> gnu.org>,
 "55511 <at> debbugs.gnu.org" <55511 <at> debbugs.gnu.org>,
 Cyril Arnould <cyril.arnould <at> outlook.com>
Subject: Re: bug#55511: 13.1.3; TeX-auto-store issues with complex paths
Date: Tue, 24 May 2022 13:35:31 +0200
Ikumi Keita <ikumi <at> ikumi.que.jp> writes:

>> Is it important for the user to have control over this? The only
>> reason I can think of for keeping support for one auto folder in the
>> master location would be backwards compatibility with old auto
>> folders.
>
> We can't tell each user's preference. :-) So I think conservative
> approach would be better.

I've lost track in this discussion but is the plan to have many auto/
directories in the directories where the included tex files reside or do
you want to resemble the path to included files below the single auto/
directory next to the master document?

If it's the former, there could be the possibility that the current user
has no write permissions everywhere.  It could also be annoying in cases
where the included files reside on a network share or a VCS checkout
which will become dirty due to AUCTeX writing there.

Bye,
Tassilo




Information forwarded to bug-auctex <at> gnu.org:
bug#55511; Package auctex. (Tue, 24 May 2022 11:46:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-auctex <at> gnu.org:
bug#55511; Package auctex. (Tue, 24 May 2022 13:46:01 GMT) Full text and rfc822 format available.

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

From: Ikumi Keita <ikumi <at> ikumi.que.jp>
To: Tassilo Horn <tsdh <at> gnu.org>
Cc: Arash Esbati <arash <at> gnu.org>,
 "55511 <at> debbugs.gnu.org" <55511 <at> debbugs.gnu.org>,
 Cyril Arnould <cyril.arnould <at> outlook.com>
Subject: Re: bug#55511: 13.1.3; TeX-auto-store issues with complex paths
Date: Tue, 24 May 2022 22:44:55 +0900
[Message part 1 (text/plain, inline)]
Hi Tassilo,

>>>>> Tassilo Horn <tsdh <at> gnu.org> writes:
> I've lost track in this discussion but is the plan to have many auto/
> directories in the directories where the included tex files reside or do
> you want to resemble the path to included files below the single auto/
> directory next to the master document?

My idea is to have a new user option to choose one from those two plans.
The attached patch implements this idea. The current behavior is the
latter one.

> If it's the former, there could be the possibility that the current user
> has no write permissions everywhere.  It could also be annoying in cases
> where the included files reside on a network share or a VCS checkout
> which will become dirty due to AUCTeX writing there.

Indeed.

Best,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine

[patch (text/x-diff, attachment)]

Information forwarded to bug-auctex <at> gnu.org:
bug#55511; Package auctex. (Fri, 27 May 2022 09:07:01 GMT) Full text and rfc822 format available.

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

From: Ikumi Keita <ikumi <at> ikumi.que.jp>
To: Cyril Arnould <cyril.arnould <at> outlook.com>, Tassilo Horn <tsdh <at> gnu.org>
Cc: Arash Esbati <arash <at> gnu.org>,
 "55511 <at> debbugs.gnu.org" <55511 <at> debbugs.gnu.org>
Subject: Re: bug#55511: 13.1.3; TeX-auto-store issues with complex paths
Date: Fri, 27 May 2022 18:06:50 +0900
>>>>> Ikumi Keita <ikumi <at> ikumi.que.jp> writes:
>>>>> Tassilo Horn <tsdh <at> gnu.org> writes:
>> I've lost track in this discussion but is the plan to have many auto/
>> directories in the directories where the included tex files reside or do
>> you want to resemble the path to included files below the single auto/
>> directory next to the master document?

> My idea is to have a new user option to choose one from those two plans.
> The attached patch implements this idea. The current behavior is the
> latter one.

I installed my proposal with updates in documentation. I'll close this
bug#55511. Remaining feature request of support for \import{}{} and
\subimport{}{} commands from the import package will be considered some
other day :-)

Best,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine




bug closed, send any further explanations to 55511 <at> debbugs.gnu.org and Cyril Arnould <cyril.arnould <at> outlook.com> Request was from Ikumi Keita <ikumi <at> ikumi.que.jp> to control <at> debbugs.gnu.org. (Fri, 27 May 2022 09:08:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-auctex <at> gnu.org:
bug#55511; Package auctex. (Fri, 27 May 2022 12:45:02 GMT) Full text and rfc822 format available.

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

From: Arash Esbati <arash <at> gnu.org>
To: Ikumi Keita <ikumi <at> ikumi.que.jp>
Cc: Tassilo Horn <tsdh <at> gnu.org>,
 "55511 <at> debbugs.gnu.org" <55511 <at> debbugs.gnu.org>,
 Cyril Arnould <cyril.arnould <at> outlook.com>
Subject: Re: bug#55511: 13.1.3; TeX-auto-store issues with complex paths
Date: Fri, 27 May 2022 14:43:55 +0200
Hi Keita,

Ikumi Keita <ikumi <at> ikumi.que.jp> writes:

> Remaining feature request of support for \import{}{} and
> \subimport{}{} commands from the import package will be considered
> some other day :-)

Life would be easier for AUCTeX and RefTeX if the author of import
package would change that package as suggested here:

  https://tex.stackexchange.com/a/538660/76063

As D.A. says,

  "the editor recognition of file names used for \subimport is hopeless,
  because the leading portion of the path is implicit."

Best, Arash




Information forwarded to bug-auctex <at> gnu.org:
bug#55511; Package auctex. (Fri, 27 May 2022 17:05:02 GMT) Full text and rfc822 format available.

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

From: Ikumi Keita <ikumi <at> ikumi.que.jp>
To: Arash Esbati <arash <at> gnu.org>
Cc: "55511 <at> debbugs.gnu.org" <55511 <at> debbugs.gnu.org>,
 Cyril Arnould <cyril.arnould <at> outlook.com>
Subject: Re: bug#55511: 13.1.3; TeX-auto-store issues with complex paths
Date: Sat, 28 May 2022 02:04:31 +0900
>>>>> Arash Esbati <arash <at> gnu.org> writes:
> Life would be easier for AUCTeX and RefTeX if the author of import
> package would change that package as suggested here:

>   https://tex.stackexchange.com/a/538660/76063

> As D.A. says,

>   "the editor recognition of file names used for \subimport is hopeless,
>   because the leading portion of the path is implicit."

OMG! 😵

Bye,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 25 Jun 2022 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 303 days ago.

Previous Next


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