From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ergus Newsgroups: gmane.emacs.devel Subject: Re: Fwd: idle exit hook Date: Thu, 23 Jul 2020 00:00:24 +0200 Message-ID: <20200722220024.qwwqfrueqql7t3wa@ergus> References: <20200722113242.577d4nfx4wbbbxxs.ref@ergus> <20200722113242.577d4nfx4wbbbxxs@ergus> <83o8o7fy6b.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4472"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: NeoMutt/20180716 Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jul 23 00:01:37 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 1jyMnx-00013Q-K6 for ged-emacs-devel@m.gmane-mx.org; Thu, 23 Jul 2020 00:01:37 +0200 Original-Received: from localhost ([::1]:54028 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jyMnw-0004u0-F6 for ged-emacs-devel@m.gmane-mx.org; Wed, 22 Jul 2020 18:01:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58926) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jyMmy-0004JQ-HL for emacs-devel@gnu.org; Wed, 22 Jul 2020 18:00:36 -0400 Original-Received: from sonic303-3.consmr.mail.bf2.yahoo.com ([74.6.131.42]:39087) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jyMmv-0001KE-Dw for emacs-devel@gnu.org; Wed, 22 Jul 2020 18:00:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1595455230; bh=GL4bk5P3ogaspayonM2pwywEb/igAFRrzbsuW0QR4Z4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=gyDdv1J4xmm3GslwpfL+k7+iLLxTuFqoTKlhV1Y03hxvFBDhI3GA75X3AE377DAw+gXhOQz7qx2VxFCW4evJ8twsMi7poknYCov0kzC5JPsGJI2ivW6KF9+Yo0a+BIXGx1fra0ojmORuDVabI0LetV9lhcK0hrRt8HZ7b/b5gPTgtAYrHOR2CKPD1D1avSpCF9AXgRN6gWfK641fxsQrcG7eZv0xiU4Cn4hJOM/53Iql1EIJ0QyP59ElNYokx/AbnkORIKcXqFZnqcKMj6lhj+4A7uoeOMWcdBO7TlS6U7ALDUT2tzuGjFs5HP51hc16mMeLwRV/9++TXsLWudHgGw== X-YMail-OSG: s99sjKkVM1kLOir7Uya6U7jDT12cPg562voI4fdtqpQdwFqNOTTg1Nr8xt39ljw xxL2yt.EjdTVRa6Y1CF5E5SOR_FGiL_iezxmo5dUFteetdSUa8KXTtXgfQAXE6OnqWozbjEeH9U. o_kcqOts3mdb67jHLYL9_HgBwKwZ3ueDkcmtwFyz55LqQrJNGOZQbDiWD_XZwd6l_HV5MhrIqVIt .rZNENTpaXTY46ikjTnbQiyPML1AWOrHhQxmnZkuVVpW0Zc0vNwymo14b2fTTUEops.uUz7xW.YX 8IG_arqSqHCMegshBelndjF3IV9jMfsSNjxJqkbDfVwrFC_4wmk3_pi0egpHXA3gaN1egZm2cPHs XmQ5T64SWKflMo43qYYkHfrcoLgeG4ZZvYKQmiZdzRf3t_LJ6n60Aun.UAqAVUf50A5R5FtMhfMx ec_PJJN0i5lu8DyHUCX5_h12o3uAovRfDJurFFwsZC6Qrh4jX9VJJ444j5c96VA1xoSzeHAcFMA. 2_yACfngLDzV9.XXSXA.exR3DbvHxNpF3tvobcONhT.27TZ64OoCV4uhVyk02cdIx.ZO6Ko3qTDW 0_Tn9gYcdJP2yTDKpXM1dYMgQt_Cxh6OkZILmdOX_xnmqo5wnHh0tqHXJsrrHZvNinTTn5ngegg. EOVrGEYyhEuCzgrYGkSrQbO1ftkYeJC5nu1m6k1kPFBBBf.5cectFJP44glgtuXiI4ckVhbZKux. anJjO4TSC3n_jJmR6ULb38XbkA.99U7dTh_TnqDxKT03GAAPRFzuLmsU4Kut79PEa2fjyJSxJ718 KqT_cICPSnjXuzLCGUDmMDX6Uyha90R8Gcd58nENP. Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.bf2.yahoo.com with HTTP; Wed, 22 Jul 2020 22:00:30 +0000 Original-Received: by smtp424.mail.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID c665bb2ffdf53e07f165505dcc1924de; Wed, 22 Jul 2020 22:00:25 +0000 (UTC) Content-Disposition: inline In-Reply-To: <83o8o7fy6b.fsf@gnu.org> X-Mailer: WebService/1.1.16271 hermes_aol Apache-HttpAsyncClient/4.1.4 (Java/11.0.7) Received-SPF: pass client-ip=74.6.131.42; envelope-from=spacibba@aol.com; helo=sonic303-3.consmr.mail.bf2.yahoo.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/22 18:00:30 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1, 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:253166 Archived-At: On Wed, Jul 22, 2020 at 04:59:24PM +0300, Eli Zaretskii wrote: >> Date: Wed, 22 Jul 2020 13:32:42 +0200 >> From: Ergus >> >> Is there an idle-time-exit-hook? or, what's the canonical method to call >> a function after breaking an idle? something like on-idle-exit? > >How do you define "breaking the idle"? IOW, what events or activities >will potentially be considered as "breaking the idle"? > Hi Eli: When I say "breaking the idle" I mean any event that potentially could be considered as not in idle anymore... or anything that resets the idle counter. >> The idea came to me when trying to implement my own version of >> idle-highlight-mode to propose to add it to vanilla. I would like to >> provide a different behaviour. > >Not sure why you need a new hook for implementing that behavior. >maybe tell more details about what you intend to implement. > The idea is extremely simple (that's why I thing it could be in vanilla). When in idle for some seconds a run-with-idle-timer calls a function to set a highlight for thing-at-point. (useful when programming for example) https://github.com/nonsequitur/idle-highlight-mode/blob/master/idle-highlight-mode.el The problem with the original implementation (apart from being abandon and re-implemented by many packages and configuration) is that the unhighlight function is called only when the idled function is executed again. A more common behavior (as in vs-code, atom and so on) is that when we press any key o perform any action to exit the "highlighted thing"; the highlight disappears immediately. This could be performed using a different hook, (post-command-hook) but it will require add and remove the hook constantly... WDYT? Best Ergus