From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.devel Subject: Re: How to test whether any code runs after same command invocation? Date: Fri, 14 Feb 2014 16:08:06 +0100 Message-ID: <87d2ip91gp.fsf@web.de> References: <87eh36kl1f.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1392390504 3645 80.91.229.3 (14 Feb 2014 15:08:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 14 Feb 2014 15:08:24 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 14 16:08:32 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WEKNS-0006px-Js for ged-emacs-devel@m.gmane.org; Fri, 14 Feb 2014 16:08:30 +0100 Original-Received: from localhost ([::1]:52239 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEKNR-0004TT-Sg for ged-emacs-devel@m.gmane.org; Fri, 14 Feb 2014 10:08:29 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEKNJ-0004Sj-CZ for emacs-devel@gnu.org; Fri, 14 Feb 2014 10:08:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WEKND-0008GW-Hp for emacs-devel@gnu.org; Fri, 14 Feb 2014 10:08:21 -0500 Original-Received: from mout.web.de ([212.227.17.12]:55125) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEKND-0008GP-87 for emacs-devel@gnu.org; Fri, 14 Feb 2014 10:08:15 -0500 Original-Received: from drachen.dragon ([90.186.97.10]) by smtp.web.de (mrweb102) with ESMTPSA (Nemesis) id 0MMmx9-1W6LkS3eAh-008bwp for ; Fri, 14 Feb 2014 16:08:13 +0100 In-Reply-To: (Stefan Monnier's message of "Fri, 14 Feb 2014 09:27:30 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-Provags-ID: V03:K0:G92ABod1hY2PEtzlzk4ndgPS2PQZ0sPLZyLgd7kAJiaUspNjdia aRCLeIpz2nlZ/NgDKzPsBmikVyHUwKiM7B2mjyxT0TRVWReLroDvLqCvwoORbB9EG5ruoZp ajoHHlboUvxWAx06KVChM1sU+VEPwLV7nHU7m/B/4S+CS9bYl6N71Kt6ZndRM1URcNOf+ZQ cfIOJWHXLcW4kXnHdHkNw== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 212.227.17.12 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:169612 Archived-At: Stefan Monnier writes: > > Example: I use some code that propertizes any dired buffer in a way that > > the mouse tooltip over any directory shows the directory contents. > > Since that can take a long time for huge directory hierarchies, I want > > to use a timeout. But if you have marked files you operate on, the code > > is run multiple times when refreshing the files' lines, so the timeout > > Not sure I understand. Do you use after-change-functions, by any > chance? I after-advice dired-insert-set-properties. > Could you use jit-lock instead? I didn't want to cope with that. Also, this was just an example, I have other, quite different use cases of the raised issue. > > Is there a cleverer way? > > In general, not that I know. > You can also use wall-time instead of a counter incremented in > post-command-hook. What's that? Don't find it anywhere. Is it a C variable? In that case I can't use it. Thanks, Michael.