From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sean Whitton Newsgroups: gmane.emacs.bugs Subject: bug#57807: 29.0.50; Make vc-print-branch-log able to log multiple branches Date: Sat, 24 Sep 2022 16:18:59 -0700 Message-ID: <87r100bbto.fsf@melete.silentflame.com> References: <87czbxub4b.fsf@melete.silentflame.com> <86v8ppn5b2.fsf@mail.linkov.net> <87h719shi6.fsf@melete.silentflame.com> <861qsdktqo.fsf@mail.linkov.net> <87fsgs396r.fsf@melete.silentflame.com> <8635cs8s59.fsf@mail.linkov.net> <87leqk1day.fsf@melete.silentflame.com> <86o7vfpzya.fsf@mail.linkov.net> <87sfkos6as.fsf@melete.silentflame.com> <86bkrb7qt8.fsf@mail.linkov.net> <8735clu05s.fsf@melete.silentflame.com> <864jx0o903.fsf@mail.linkov.net> <87o7v8ple4.fsf@melete.silentflame.com> <86illgc542.fsf@mail.linkov.net> <875yhfo0en.fsf@melete.silentflame.com> <86h70zp8br.fsf@mail.linkov.net> <87wn9vjecm.fsf@melete.silentflame.com> <86y1uad298.fsf@mail.linkov.net> <87fsggd1f1.fsf@melete.silentflame.com> <86v8pc5yff.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30347"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 57807@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 25 01:20:21 2022 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 1ocERX-0007fs-OS for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 25 Sep 2022 01:20:21 +0200 Original-Received: from localhost ([::1]:38792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ocERV-0004D2-2Y for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 24 Sep 2022 19:20:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34034) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ocERG-0004Cu-Et for bug-gnu-emacs@gnu.org; Sat, 24 Sep 2022 19:20:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46360) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ocERG-0000Lj-37 for bug-gnu-emacs@gnu.org; Sat, 24 Sep 2022 19:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ocERF-0003k5-QS for bug-gnu-emacs@gnu.org; Sat, 24 Sep 2022 19:20:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Sean Whitton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Sep 2022 23:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57807 X-GNU-PR-Package: emacs Original-Received: via spool by 57807-submit@debbugs.gnu.org id=B57807.166406155314325 (code B ref 57807); Sat, 24 Sep 2022 23:20:01 +0000 Original-Received: (at 57807) by debbugs.gnu.org; 24 Sep 2022 23:19:13 +0000 Original-Received: from localhost ([127.0.0.1]:45438 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ocEQS-0003iz-MV for submit@debbugs.gnu.org; Sat, 24 Sep 2022 19:19:13 -0400 Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]:37267) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ocEQO-0003ik-CN for 57807@debbugs.gnu.org; Sat, 24 Sep 2022 19:19:11 -0400 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id D46DA5C007F; Sat, 24 Sep 2022 19:19:00 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sat, 24 Sep 2022 19:19:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=cc:cc:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1664061540; x=1664147940; bh=1q NlNDOdqBSn/R66j5Bh9eTc7qzVvyC6YdtWInhgb7Q=; b=2n+OTHmOAV9KpWN8zv zh6LAry6cKoN27ziYptu5LEA/pEj4IBz1TxDJHAFW2HKOcvwIkueWNjnGqlGwTzc cZjpSRFncFYJJCgx42ETjdGvRMO6bBtnTEV8BpG+VCoBUIhSy2znVx5/2NOb/A/p d0lI3uV2QseLMwqBRC/EjWAxwK9NGx48aEStZ1dC0+1f+ABUR/FjJmUIOnywwcHE YeWUFBX3bJ/AoJCD5DLJUuv51nr2Xtk6mdfafPsM8fgE9ZLjrV3Se0qJ2M3Ygupi 21JbjrFy4fM2pQTv0R8Bj9XYr6nrOcqA2FDzbOqbDvUQEta2jqr1dMOVkz9m6UAW T3Ug== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1664061540; x=1664147940; bh=1qNlNDOdqBSn/R66j5Bh9eTc7qzV vyC6YdtWInhgb7Q=; b=jpw16lez5MKTIvrFw17TFT+ASYBhFa3vQ1B+KnabCqh+ OM6IHMQTgasLwCK/o75ILDOdf8T3QnLmOyYFDTaHC3Ik7hdwJy2pz4wXYNI8M5Ho +4Jwa93Sd60AnuUbNl2lKz4m1S8pY6B+87FF8buQjLCZEHAGIe51Oax07O3JtjYC ZtQ3IaTbbVFI2Daz9V39eWRMPBus3q2pF3w1pCzwZJgkaAmymK3znLxYJkK7+2D6 J/jmBjlye70LxUjw/9kUGpk5/FxfNBJLEN5pyh2A2cLmgOD/G8HA3jFzpD6IvZdz 4DR6NLDW6DDmxpnpysPkwbBCVNHY/K64GN/hbeLq1Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeefledgudelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefujghffffkfgggtgesmhdttdertdertdenucfhrhhomhepufgvrghn ucghhhhithhtohhnuceoshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgvqe enucggtffrrghtthgvrhhnpeffveeuhfeludfhfeegjeefhefhfeeludejueehfeevtdfh hfettedtfeelleetudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvg X-ME-Proxy: Feedback-ID: i23c04076:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 24 Sep 2022 19:19:00 -0400 (EDT) Original-Received: by melete.silentflame.com (Postfix, from userid 1000) id A68837F2CDC; Sat, 24 Sep 2022 16:18:59 -0700 (MST) In-Reply-To: <86v8pc5yff.fsf@mail.linkov.net> (Juri Linkov's message of "Sat, 24 Sep 2022 22:57:16 +0300") 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:243562 Archived-At: --=-=-= Content-Type: text/plain Hello, On Sat 24 Sep 2022 at 10:57PM +03, Juri Linkov wrote: >>> But 'M-!' has a clear connection with editing a shell command. So >>> 'C-x v !' looks like the best candidate among all considered so far. >> >> I'm running into the problem that you pointed out in another thread. >> How do we apply vc-filter-command-function to the final VC command >> that's to be run without also applying it to intermediate VC commands, >> e.g. in vc-read-revision? > > Maybe there is no problem to apply the editing filter to all commands, > I don't know. First need to try to see how it really works. Here's the WIP patch, hopefully it works well enough for testing. I think it's considerably worse than C-u C-x v b l tbh. -- Sean Whitton --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-WIP-Add-vc-edit-next-command.patch >From 8521996056c980d096f1ec935c34345f265d3665 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 24 Sep 2022 16:17:56 -0700 Subject: [PATCH] WIP Add vc-edit-next-command. --- lisp/vc/vc-hooks.el | 3 ++- lisp/vc/vc.el | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index 7f0d9e4d86..6ad26cfe67 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -882,7 +882,8 @@ vc-prefix-map "=" #'vc-diff "D" #'vc-root-diff "~" #'vc-revision-other-window - "x" #'vc-delete-file) + "x" #'vc-delete-file + "!" #'vc-edit-next-command) (fset 'vc-prefix-map vc-prefix-map) (define-key ctl-x-map "v" 'vc-prefix-map) diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 4950a1a32d..595288d30f 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -3244,6 +3244,31 @@ vc-update-change-log (vc-call-backend (vc-responsible-backend default-directory) 'update-changelog args)) +(defvar vc-filter-command-function) + +;;;###autoload +(defun vc-edit-next-command () + "Request editing the next VC shell command before execution. +This is a prefix command. It affects only a VC command executed +immediately after this one." + (interactive) + (letrec ((command this-command) + (keys (key-description (this-command-keys))) + (old vc-filter-command-function) + (echofun (lambda () keys)) + (postfun + (lambda () + (unless (eq this-command command) + (remove-hook 'post-command-hook postfun) + (remove-hook 'prefix-command-echo-keystrokes-functions + echofun) + (setq vc-filter-command-function old))))) + (add-hook 'post-command-hook postfun) + (add-hook 'prefix-command-echo-keystrokes-functions echofun) + (setq vc-filter-command-function + (lambda (&rest args) + (apply #'vc-user-edit-command (apply old args)))))) + (defun vc-default-responsible-p (_backend _file) "Indicate whether BACKEND is responsible for FILE. The default is to return nil always." -- 2.30.2 --=-=-=--