From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#52023: 27.2; Enhancement: `this-command-invocation-(buffer|window)' Date: Sun, 21 Nov 2021 21:19:04 +0200 Organization: LINKOV.NET Message-ID: <867dd1mhn7.fsf@mail.linkov.net> 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="2401"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: 52023@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 21 20:38:53 2021 Return-path: Envelope-to: geb-bug-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 1mosft-0000Tr-Mp for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 21 Nov 2021 20:38:53 +0100 Original-Received: from localhost ([::1]:32838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mosfs-0005Bo-1W for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 21 Nov 2021 14:38:52 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:56876) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mosf4-0004uC-LZ for bug-gnu-emacs@gnu.org; Sun, 21 Nov 2021 14:38:07 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34516) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mosf4-0005u5-Ct for bug-gnu-emacs@gnu.org; Sun, 21 Nov 2021 14:38:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mosf4-0004qZ-4m for bug-gnu-emacs@gnu.org; Sun, 21 Nov 2021 14:38:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 Nov 2021 19:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52023 X-GNU-PR-Package: emacs Original-Received: via spool by 52023-submit@debbugs.gnu.org id=B52023.163752347818612 (code B ref 52023); Sun, 21 Nov 2021 19:38:02 +0000 Original-Received: (at 52023) by debbugs.gnu.org; 21 Nov 2021 19:37:58 +0000 Original-Received: from localhost ([127.0.0.1]:46060 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mosez-0004q6-Tr for submit@debbugs.gnu.org; Sun, 21 Nov 2021 14:37:58 -0500 Original-Received: from relay11.mail.gandi.net ([217.70.178.231]:36159) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mosey-0004ps-SR for 52023@debbugs.gnu.org; Sun, 21 Nov 2021 14:37:57 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 9C5ED100004; Sun, 21 Nov 2021 19:37:49 +0000 (UTC) In-Reply-To: (Drew Adams's message of "Sun, 21 Nov 2021 18:11:51 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:220586 Archived-At: > Enhancement request: please consider adding functions > `this-command-invocation-buffer' and `this-command-invocation-window'. > (Other names OK.) > > They would return, respectively, the buffer that was current, and the > window that was selected, when the command that's the value of > `this-command' was invoked. > > Currently, to get this information a workaround would be to use a > `pre-command-hook' function that sets variables, and then to test those > variables. Maybe these functions give what you need? (old-selected-window) (window-buffer (old-selected-window))