From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Thorpe Newsgroups: gmane.emacs.help Subject: Re: Time of last command invoked Date: Sun, 28 Feb 2021 06:17:18 +0000 Message-ID: <87im6cu369.fsf@robertthorpeconsulting.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35325"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Stefan Monnier , Jean Louis Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 28 07:18:42 2021 Return-path: Envelope-to: geh-help-gnu-emacs@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 1lGFPd-00094h-TJ for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 28 Feb 2021 07:18:41 +0100 Original-Received: from localhost ([::1]:48156 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGFPc-0002lo-Ue for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 28 Feb 2021 01:18:40 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56286) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGFOx-0002jX-R6 for help-gnu-emacs@gnu.org; Sun, 28 Feb 2021 01:17:59 -0500 Original-Received: from outbound-smtp49.blacknight.com ([46.22.136.233]:57323) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGFOv-0006Hl-9G for help-gnu-emacs@gnu.org; Sun, 28 Feb 2021 01:17:58 -0500 Original-Received: from mail.blacknight.com (pemlinmail02.blacknight.ie [81.17.254.11]) by outbound-smtp49.blacknight.com (Postfix) with ESMTPS id 8B9B8FA908 for ; Sun, 28 Feb 2021 06:17:52 +0000 (GMT) Original-Received: (qmail 12283 invoked from network); 28 Feb 2021 06:17:52 -0000 Original-Received: from unknown (HELO rt-inspiron-3480) (rt@robertthorpeconsulting.com@[51.37.90.145]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 28 Feb 2021 06:17:52 -0000 In-Reply-To: (message from Stefan Monnier on Sat, 27 Feb 2021 10:31:48 -0500) Received-SPF: pass client-ip=46.22.136.233; envelope-from=rt@robertthorpeconsulting.com; helo=outbound-smtp49.blacknight.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:128305 Archived-At: Stefan Monnier writes: >>> Is there some internal log in Emacs that keeps the date and >>> time of last command invoked by a key or M-x? >> That would imply a huge overhead. > > Not really, no. > We already keep a log of the keys and commands (as used for `C-h l`), > so it's a small matter of adding timestamps in there. > > But given the way this is currently implemented, it would have to be > done in the C code, I think. I think this depends on what Jean Louis wants. There are different possible interpretations. For just M-x it wouldn't be so difficult. That would just mean replacing execute-extended-command with something that records the time somewhere. The problem is that other keys. If it means a function that's activated directly then it seems possible. Every key that doesn't do "self-insert-command" could be remapped to a different command. That command could record the key pressed before handing over to the usual command. That would be tricky though, and would break some Emacs features like C-h k. It would be a lot of work and I don't think it would be worth it. BR, Robert Thorpe