Discussion:
[AUCTeX] [Bug] No install target for latex-flymake
Vladimir Lomov
2018-02-19 04:58:59 UTC
Permalink
Hello,

commit d86e95e5c2c70cc1be5de85add8fc9698f08c396 introduced
'latex-flymake' file and condition in 'latex.el' but doesn't update
Makefile.in to byte compile and install that file. This of course breaks
AUCTeX. I attached small patch vs 'Makefile.in' to add
'latex-flymake.el' to list of byte compiling and installing files.

---
WBR, Vladimir Lomov
--
Stupidity is its own reward.
Vladimir Lomov
2018-02-20 02:53:17 UTC
Permalink
Post by Vladimir Lomov
Hello,
commit d86e95e5c2c70cc1be5de85add8fc9698f08c396 introduced
'latex-flymake' file and condition in 'latex.el' but doesn't update
Makefile.in to byte compile and install that file. This of course breaks
AUCTeX. I attached small patch vs 'Makefile.in' to add
'latex-flymake.el' to list of byte compiling and installing files.
Actually I think that commit must be reverted till it will be carefully
tested. Currently with this commit my AUCTeX configuration somehow
broken, some configurations don't work. Without that commit all
works fine.

Of course the cause of strange behavior of AUCTeX can be not the commit
and flymake support but my configuration, it can be fragile somehow so
the flymake support just shows that but I don't know how to check that,
so just suggesting to test the patch carefully.

[...]

---
WBR, Vladimir Lomov
--
If it heals good, say it.
Arash Esbati
2018-02-20 20:23:35 UTC
Permalink
Post by Vladimir Lomov
commit d86e95e5c2c70cc1be5de85add8fc9698f08c396 introduced
'latex-flymake' file and condition in 'latex.el' but doesn't update
Makefile.in to byte compile and install that file. This of course breaks
AUCTeX. I attached small patch vs 'Makefile.in' to add
'latex-flymake.el' to list of byte compiling and installing files.
Hi Vladimir,

thanks for the report. I've had asked the original author of
latex-flymake.el to add this as well, but I just did it myself. Can you
please update your AUCTeX and try it again?

Best, Arash
Vladimir Lomov
2018-02-22 01:14:51 UTC
Permalink
Hello,
Post by Arash Esbati
Post by Vladimir Lomov
commit d86e95e5c2c70cc1be5de85add8fc9698f08c396 introduced
'latex-flymake' file and condition in 'latex.el' but doesn't update
Makefile.in to byte compile and install that file. This of course breaks
AUCTeX. I attached small patch vs 'Makefile.in' to add
'latex-flymake.el' to list of byte compiling and installing files.
Hi Vladimir,
thanks for the report. I've had asked the original author of
latex-flymake.el to add this as well, but I just did it myself. Can you
please update your AUCTeX and try it again?
I think you missed my next message.
Post by Arash Esbati
Best, Arash
---
WBR, Vladimir Lomov
--
Old musicians never die, they just decompose.
Arash Esbati
2018-02-23 11:38:46 UTC
Permalink
Post by Vladimir Lomov
Post by Arash Esbati
thanks for the report. I've had asked the original author of
latex-flymake.el to add this as well, but I just did it myself. Can you
please update your AUCTeX and try it again?
I think you missed my next message.
No, I saw that. I wanted to get the first issue fixed before going
forward. I see you have a potential fix for the issue.

@Alex: Can you please have look at the patch provided by Vladimir
here[1] and advise how to proceed? Thanks.

I suggest we close this thread and reply to Vladimir's message in
auctex-devel.

Best, Arash

Footnotes:
[1] http://lists.gnu.org/archive/html/auctex-devel/2018-02/msg00001.html
Alex Branham
2018-02-23 15:26:33 UTC
Permalink
Post by Arash Esbati
@Alex: Can you please have look at the patch provided by Vladimir
here[1] and advise how to proceed? Thanks.
The documentation is correct, I think. All users need to do now is to do
M-x flymake-mode. This patch disables adding the backend that flymake
needs, so users would need to do (LaTeX-setup-flymake-backend) and then
(flymake-mode), in that order. That seems annoying to me.

Probably a better solution would be to see how this is breaking
Vladimir's config. What exactly breaks?
Post by Arash Esbati
I suggest we close this thread and reply to Vladimir's message in
auctex-devel.
Happy to do so if someone would cc me :-)
Post by Arash Esbati
Best, Arash
[1] http://lists.gnu.org/archive/html/auctex-devel/2018-02/msg00001.html
Vladimir Lomov
2018-02-25 12:52:02 UTC
Permalink
Hello,
Post by Alex Branham
Post by Arash Esbati
@Alex: Can you please have look at the patch provided by Vladimir
here[1] and advise how to proceed? Thanks.
The documentation is correct, I think. All users need to do now is to do
M-x flymake-mode. This patch disables adding the backend that flymake
needs, so users would need to do (LaTeX-setup-flymake-backend) and then
(flymake-mode), in that order. That seems annoying to me.
I wouldn't pretend that I understand the Emacs Lisp, esp. these two
lines in 'latex-flymake.el':

(when (< 25 emacs-major-version)
(add-hook 'LaTeX-mode-hook #'LaTeX-setup-flymake-backend))

but I checked that when I run Emacs _with_ these lines in the file I see
that LaTeX-mode-hook (through Customize) contains

preview-mode-setup
LaTeX-setup-flymake-backend

and in modeline when I open my LaTeX document I see

LaTeX/PS

that's why I concluded that documentation is wrong because the hook is
always on.
Post by Alex Branham
Probably a better solution would be to see how this is breaking
Vladimir's config. What exactly breaks?
The first thing I noticed was that when I typed '$' then Emacs didn't
insert second '$'. It took time to figure out what is going on here (I
use may be very tricky configuration, this is my 'custom' file:
https://bitbucket.org/vp1981/scripts/src/22c5c79e07ef5b61e23cb910324d2a1de9e07108/config/emacs/custom-default.el?at=master&fileviewer=file-view-default
) and the only thing I discovered
was that if 'latex-flymake.el' _has_ the above lines then
'LaTeX-mode-hook' has only two hooks (as I described above) but if I
remove that lines then 'LaTeX-mode-hook' has these settings:

preview-mode-setup
(lambda nil (define-key TeX-mode-map "^C^T{" 'TeX-insert-braces))
(lambda nil (define-key LaTeX-mode-map (kbd "C-c C-a k") 'ebib-insert-bibtex-key))
(lambda nil (outline-minor-mode 1))
(lambda nil (TeX-fold-mode 1))
TeX-source-correlate-mode
turn-on-reftex
turn-on-auto-fill
LaTeX-math-mode
turn-on-cdlatex

and these, except the first one, correspond to settings in 'custom'
file. In modeline of buffer with LaTeX document I see

LaTeX/FMPS CDL Ref Outl Fill
Post by Alex Branham
Post by Arash Esbati
I suggest we close this thread and reply to Vladimir's message in
auctex-devel.
Happy to do so if someone would cc me :-)
I'm appologize to send this message to both auctex and auctex-devel ML
but do that just for reference of the problem mentioned on both ML.

[...]

---
WBR, Vladimir Lomov
--
You will be a winner today. Pick a fight with a four-year-old.
Alex Branham
2018-02-25 17:03:14 UTC
Permalink
Post by Vladimir Lomov
Hello,
I wouldn't pretend that I understand the Emacs Lisp, esp. these two
(when (< 25 emacs-major-version)
(add-hook 'LaTeX-mode-hook #'LaTeX-setup-flymake-backend))
but I checked that when I run Emacs _with_ these lines in the file I see
that LaTeX-mode-hook (through Customize) contains
preview-mode-setup
LaTeX-setup-flymake-backend
and in modeline when I open my LaTeX document I see
LaTeX/PS
that's why I concluded that documentation is wrong because the hook is
always on.
Flymake requires a backend function (or functions) so it can find
warnings/errors. That's all LaTeX-setup-flymake-backend does, it doesn't
actually turn on flymake-mode.
Post by Vladimir Lomov
Post by Alex Branham
Probably a better solution would be to see how this is breaking
Vladimir's config. What exactly breaks?
The first thing I noticed was that when I typed '$' then Emacs didn't
insert second '$'. It took time to figure out what is going on here (I
https://bitbucket.org/vp1981/scripts/src/22c5c79e07ef5b61e23cb910324d2a1de9e07108/config/emacs/custom-default.el?at=master&fileviewer=file-view-default
) and the only thing I discovered
was that if 'latex-flymake.el' _has_ the above lines then
'LaTeX-mode-hook' has only two hooks (as I described above) but if I
preview-mode-setup
(lambda nil (define-key TeX-mode-map "^C^T{" 'TeX-insert-braces))
(lambda nil (define-key LaTeX-mode-map (kbd "C-c C-a k") 'ebib-insert-bibtex-key))
(lambda nil (outline-minor-mode 1))
(lambda nil (TeX-fold-mode 1))
TeX-source-correlate-mode
turn-on-reftex
turn-on-auto-fill
LaTeX-math-mode
turn-on-cdlatex
and these, except the first one, correspond to settings in 'custom'
file. In modeline of buffer with LaTeX document I see
LaTeX/FMPS CDL Ref Outl Fill
I guess this is caused by latex-flymake.el getting required early on in the process. If you replace

(when (< 25 emacs-major-version)
(add-hook 'LaTeX-mode-hook #'LaTeX-setup-flymake-backend))

With:

(when (< 25 emacs-major-version)
(with-eval-after-load "latex"
(add-hook 'LaTeX-mode-hook #'LaTeX-setup-flymake-backend)))

Does that solve your problem?


Thanks,
Alex
Vladimir Lomov
2018-02-26 03:57:09 UTC
Permalink
Hello,
[...]
Post by Alex Branham
Post by Vladimir Lomov
I wouldn't pretend that I understand the Emacs Lisp, esp. these two
(when (< 25 emacs-major-version)
(add-hook 'LaTeX-mode-hook #'LaTeX-setup-flymake-backend))
but I checked that when I run Emacs _with_ these lines in the file I see
that LaTeX-mode-hook (through Customize) contains
preview-mode-setup
LaTeX-setup-flymake-backend
and in modeline when I open my LaTeX document I see
LaTeX/PS
that's why I concluded that documentation is wrong because the hook is
always on.
Flymake requires a backend function (or functions) so it can find
warnings/errors. That's all LaTeX-setup-flymake-backend does, it doesn't
actually turn on flymake-mode.
I tried to explain not that: commentary in 'latex-flymake.el' tells that
the way to _enable_ this feature is to add 'LaTeX-setup-flymake-backend'
to the 'LaTeX-mode-hook' (may be either to '.emacs' or using
'Customize') but the point is that this hook is _already_ there,
regardless of the user wish, that's why I asked question about
documentation.

In example above I shown that if I just open a LaTeX document then
'LaTeX-setup-flymake-backend' is already in list of 'LaTeX-mode-hook'
even if I didn't request it and added nothing into '.emacs'
('Customize'). The other hook 'preview-mode-setup' is also appreared
out of nowhere because I didn't request this hook, but that is another
issue.
Post by Alex Branham
Post by Vladimir Lomov
Post by Alex Branham
Probably a better solution would be to see how this is breaking
Vladimir's config. What exactly breaks?
The first thing I noticed was that when I typed '$' then Emacs didn't
insert second '$'. It took time to figure out what is going on here (I
https://bitbucket.org/vp1981/scripts/src/22c5c79e07ef5b61e23cb910324d2a1de9e07108/config/emacs/custom-default.el?at=master&fileviewer=file-view-default
) and the only thing I discovered
was that if 'latex-flymake.el' _has_ the above lines then
'LaTeX-mode-hook' has only two hooks (as I described above) but if I
preview-mode-setup
(lambda nil (define-key TeX-mode-map "^C^T{" 'TeX-insert-braces))
(lambda nil (define-key LaTeX-mode-map (kbd "C-c C-a k") 'ebib-insert-bibtex-key))
(lambda nil (outline-minor-mode 1))
(lambda nil (TeX-fold-mode 1))
TeX-source-correlate-mode
turn-on-reftex
turn-on-auto-fill
LaTeX-math-mode
turn-on-cdlatex
and these, except the first one, correspond to settings in 'custom'
file. In modeline of buffer with LaTeX document I see
LaTeX/FMPS CDL Ref Outl Fill
I guess this is caused by latex-flymake.el getting required early on in the process. If you replace
(when (< 25 emacs-major-version)
(add-hook 'LaTeX-mode-hook #'LaTeX-setup-flymake-backend))
(when (< 25 emacs-major-version)
(with-eval-after-load "latex"
(add-hook 'LaTeX-mode-hook #'LaTeX-setup-flymake-backend)))
Does that solve your problem?
Yes, now my other hooks are loaded too, but the problem with
'LaTeX-setup-flymake-backend' still exists: it is loaded regardless of
the user wish (that's how I interprete its appearence in the
'LaTeX-mode-hook' list). For me it is unexpected behaviour and must be
documented or somehow changed (for example, if 'flymake-mode' is On, as
you mentioned in some of your mails).

P.S. As for 'preview-mode-setup' hook then I assume it is loaded by
'preview-latex' which I load manually in my '.emacs'.

---
WBR, Vladimir Lomov
--
core error - bus dumped
Alex Branham
2018-02-26 15:22:29 UTC
Permalink
Post by Vladimir Lomov
Hello,
[...]
Post by Vladimir Lomov
Post by Alex Branham
Flymake requires a backend function (or functions) so it can find
warnings/errors. That's all LaTeX-setup-flymake-backend does, it doesn't
actually turn on flymake-mode.
I tried to explain not that: commentary in 'latex-flymake.el' tells that
the way to _enable_ this feature is to add 'LaTeX-setup-flymake-backend'
to the 'LaTeX-mode-hook' (may be either to '.emacs' or using
'Customize') but the point is that this hook is _already_ there,
regardless of the user wish, that's why I asked question about
documentation.
I'm not sure where you're seeing that. For me, the commentary reads:

;;; Commentary:

;; This file provides flymake integration for latex documents using
;; "chktex" as a backend. You must be running Emacs 26 or newer.
;; Enable it by adding the following to your init file:

;; (add-hook 'LaTeX-mode-hook #'flymake-mode)

Which is correct. It doesn't mention LaTeX-setup-flymake-backend at all.
Post by Vladimir Lomov
In example above I shown that if I just open a LaTeX document then
'LaTeX-setup-flymake-backend' is already in list of 'LaTeX-mode-hook'
even if I didn't request it and added nothing into '.emacs'
('Customize').
Yes, that's supposed to be the case so the user can just do M-x
flymake-mode rather than needing to setup the backend manually.
Post by Vladimir Lomov
The other hook 'preview-mode-setup' is also appreared
out of nowhere because I didn't request this hook, but that is another
issue.
[...]
Post by Vladimir Lomov
Post by Alex Branham
I guess this is caused by latex-flymake.el getting required early on in the process. If you replace
(when (< 25 emacs-major-version)
(add-hook 'LaTeX-mode-hook #'LaTeX-setup-flymake-backend))
(when (< 25 emacs-major-version)
(with-eval-after-load "latex"
(add-hook 'LaTeX-mode-hook #'LaTeX-setup-flymake-backend)))
Does that solve your problem?
Yes, now my other hooks are loaded too, but the problem with
'LaTeX-setup-flymake-backend' still exists: it is loaded regardless of
the user wish (that's how I interprete its appearence in the
'LaTeX-mode-hook' list). For me it is unexpected behaviour and must be
documented or somehow changed (for example, if 'flymake-mode' is On, as
you mentioned in some of your mails).
We could set it up in LaTeX-mode instead, adding the hook directly to
flymake-diagnostic-functions. That would leave LaTeX-mode-hook
unchanged. I'll try this and see if it works for me. If so, I'll submit
a patch.
Post by Vladimir Lomov
P.S. As for 'preview-mode-setup' hook then I assume it is loaded by
'preview-latex' which I load manually in my '.emacs'.
---
WBR, Vladimir Lomov
Vladimir Lomov
2018-02-28 09:10:21 UTC
Permalink
Hello,
Post by Alex Branham
Post by Vladimir Lomov
Hello,
[...]
Post by Vladimir Lomov
Post by Alex Branham
Flymake requires a backend function (or functions) so it can find
warnings/errors. That's all LaTeX-setup-flymake-backend does, it doesn't
actually turn on flymake-mode.
I tried to explain not that: commentary in 'latex-flymake.el' tells that
the way to _enable_ this feature is to add 'LaTeX-setup-flymake-backend'
to the 'LaTeX-mode-hook' (may be either to '.emacs' or using
'Customize') but the point is that this hook is _already_ there,
regardless of the user wish, that's why I asked question about
documentation.
;; This file provides flymake integration for latex documents using
;; "chktex" as a backend. You must be running Emacs 26 or newer.
;; (add-hook 'LaTeX-mode-hook #'flymake-mode)
Which is correct. It doesn't mention LaTeX-setup-flymake-backend at all.
I'm sorry, I was blinded of 'add-hook' and 'LaTeX-mode-hook'.

[...]
Post by Alex Branham
Post by Vladimir Lomov
Post by Alex Branham
I guess this is caused by latex-flymake.el getting required early on
in the process. If you replace
(when (< 25 emacs-major-version)
(add-hook 'LaTeX-mode-hook #'LaTeX-setup-flymake-backend))
(when (< 25 emacs-major-version)
(with-eval-after-load "latex"
(add-hook 'LaTeX-mode-hook #'LaTeX-setup-flymake-backend)))
Does that solve your problem?
Yes, now my other hooks are loaded too, but the problem with
'LaTeX-setup-flymake-backend' still exists: it is loaded regardless of
the user wish (that's how I interprete its appearence in the
'LaTeX-mode-hook' list). For me it is unexpected behaviour and must be
documented or somehow changed (for example, if 'flymake-mode' is On, as
you mentioned in some of your mails).
We could set it up in LaTeX-mode instead, adding the hook directly to
flymake-diagnostic-functions. That would leave LaTeX-mode-hook
unchanged. I'll try this and see if it works for me. If so, I'll submit
a patch.
I'll test it on weekend or earlier.

[...]

---
WBR, Vladimir Lomov
--
The duck hunter trained his retriever to walk on water. Eager to show off
this amazing accomplishment, he asked a friend to go along on his next
hunting trip. Saying nothing, he fired his first shot and, as the duck fell,
the dog walked on the surface of the water, retrieved the duck and returned
it to his master.
"Notice anything?" the owner asked eagerly.
"Yes," said his friend, "I see that fool dog of yours can't swim."
Loading...