From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Issue or feature? Date: Wed, 23 Dec 2020 22:50:17 -0500 Message-ID: References: <20201224030549.qtmvcjmi4zw4pcgw.ref@Ergus> <20201224030549.qtmvcjmi4zw4pcgw@Ergus> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8619"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Ergus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Dec 24 04:51:06 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ksHec-0002AX-ST for ged-emacs-devel@m.gmane-mx.org; Thu, 24 Dec 2020 04:51:06 +0100 Original-Received: from localhost ([::1]:45696 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ksHeb-0007zY-SM for ged-emacs-devel@m.gmane-mx.org; Wed, 23 Dec 2020 22:51:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48264) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ksHe0-0007XO-LN for emacs-devel@gnu.org; Wed, 23 Dec 2020 22:50:28 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:9991) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ksHdx-00075d-SI for emacs-devel@gnu.org; Wed, 23 Dec 2020 22:50:27 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 61EBB8063C; Wed, 23 Dec 2020 22:50:24 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id A571480784; Wed, 23 Dec 2020 22:50:18 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1608781818; bh=ST7YGav4zHeixMH1GMI44u3qfPN/OaTUWiXm/542FsU=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Yh8Go+7UVBzpnZkmHujm38VBXA1wH/XKpfe9DcABQO5u/AdVudEn7hbX9e6MedsuJ Vgux9ZfbULZxjO1TZttx4p2EzRFDpvFll2DaBSWSfq3q1+OHIZQXBPZi+uD2H/Xm8A Il9SwELArYqdjI/Y2mVar3UrxA4l5gx1rr/6ZEN3xiqdkAuILLgEST5YS9psemDUEG 03yEpauEMI9bJisMLzJay7Vx1WR7n6xSpGOcEDfq02XmfZr/irOauMCS0ugPX6cHqO VFKR8Td9Z//RZjtAGv00T1a+a4R+3op/5fNRuPB1X8KPnnszUUCOCT0j9FNfCfo9ef AFIlfTPwuDoGg== Original-Received: from alfajor (unknown [104.247.243.191]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 6C7A212053B; Wed, 23 Dec 2020 22:50:18 -0500 (EST) In-Reply-To: <20201224030549.qtmvcjmi4zw4pcgw@Ergus> (Ergus's message of "Thu, 24 Dec 2020 04:05:49 +0100") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:261652 Archived-At: > (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