auctex-devel
[Top][All Lists]
Advanced

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

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


From: Vladimir Lomov
Subject: Re: [AUCTeX-devel] [Bug] No install target for latex-flymake
Date: Mon, 26 Feb 2018 11:57:09 +0800
User-agent: Mutt/1.9.3 (2018-01-21)

Hello,
** Alex Branham [2018-02-25 11:03:14 -0600]:

> 
> On Sun 25 Feb 2018 at 06:52, Vladimir Lomov <address@hidden> wrote:
> 
[...]
>>
>> 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.
> 
> 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.

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

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



reply via email to

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