[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [AUCTeX] [Bug] No install target for latex-flymake

From: Alex Branham
Subject: Re: [AUCTeX] [Bug] No install target for latex-flymake
Date: Mon, 26 Feb 2018 09:22:29 -0600
User-agent: mu4e 1.0; emacs 26.0.91

On Sun 25 Feb 2018 at 21:57, Vladimir Lomov <address@hidden> wrote:

> Hello,
> ** Alex Branham [2018-02-25 11:03:14 -0600]:
>> On Sun 25 Feb 2018 at 06:52, Vladimir Lomov <address@hidden> wrote:
>> 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.

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

> The other hook 'preview-mode-setup' is also appreared
> out of nowhere because I didn't request this hook, but that is another
> issue.


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

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

> 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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]