emacs-devel
[Top][All Lists]
Advanced

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

Re: Issue or feature?


From: Stefan Monnier
Subject: Re: Issue or feature?
Date: Wed, 23 Dec 2020 22:50:17 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> (add-hook 'prog-mode-hook (lambda ()
>                              (run-with-idle-timer 1 nil #'flycheck-mode 1)))

Timers are run in a rather unpredictable context, so you'll want to do
something like:

    (add-hook 'prog-mode-hook
              (lambda ()
                (run-with-idle-timer 1 nil
                  (lambda (buf) (with-current-buffer buf (flycheck-mode 1)))
                  (current-buffer))))

-- Stefan




reply via email to

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