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: Mon, 26 Sep 2022 15:33:22 -0700 Message-ID: <87r0zxlqa5.fsf@melete.silentflame.com> References: <87czbxub4b.fsf@melete.silentflame.com> <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> <87r100bbto.fsf@melete.silentflame.com> <86o7v3kj30.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="2168"; 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 Tue Sep 27 00:34:14 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 1ocwg0-0000Fv-Kt for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 27 Sep 2022 00:34:14 +0200 Original-Received: from localhost ([::1]:58296 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ocwfz-00049N-3B for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 26 Sep 2022 18:34:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44950) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ocwfr-00049B-1b for bug-gnu-emacs@gnu.org; Mon, 26 Sep 2022 18:34:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52906) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ocwfq-00054e-OS for bug-gnu-emacs@gnu.org; Mon, 26 Sep 2022 18:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ocwfq-0003lE-76 for bug-gnu-emacs@gnu.org; Mon, 26 Sep 2022 18:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Sean Whitton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 26 Sep 2022 22:34:02 +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.166423161814421 (code B ref 57807); Mon, 26 Sep 2022 22:34:02 +0000 Original-Received: (at 57807) by debbugs.gnu.org; 26 Sep 2022 22:33:38 +0000 Original-Received: from localhost ([127.0.0.1]:51984 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ocwfP-0003kV-Lj for submit@debbugs.gnu.org; Mon, 26 Sep 2022 18:33:38 -0400 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]:48863) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ocwfK-0003kC-2P for 57807@debbugs.gnu.org; Mon, 26 Sep 2022 18:33:34 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 213265C0053; Mon, 26 Sep 2022 18:33:24 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 26 Sep 2022 18:33:24 -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=1664231604; x=1664318004; bh=Rh Yr3iZP84rIkSTHWVB8iYTZHKouv4Ycsr65yEXUGsc=; b=uTI/LVjfsN6nvSEKxm 4hSzmPD96N8pS/5FQSNhNuyzFgjPI4XH9Kn8sYpOIsp2SPaNB8tBqQKcfdWhnxLm Gfy5qeFkOc8KXfpEvr2ep74kUXGUm2vvY4ynYSqkAf9hi2XFGsZ9lYU7jPN+4s1V /oRiqKSJRD1WsQ7DUnvzbx63tgn2kovkC7CmSAvg0H6CSzvbo5EI3f95pzmlUpCx nH8O6zqRRHWgGKPqWxsldswmPXiF/UW+7ilCp/m9qGkE7l9cj66E38Um15dUqgbN +XEMoPfVfmAZTRi34Isj3uGl399bWS2HswqqljhO1VLunroZpkYqOXgyvJ5rypXp aNJg== 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=1664231604; x=1664318004; bh=RhYr3iZP84rIkSTHWVB8iYTZHKou v4Ycsr65yEXUGsc=; b=y+p1CbulSezw+RHET5d6eHlLn1EaVi2nWqsbcqoMCP4o 0BjARnA31LsuqmjD585LjpgF9Ue8SdRqVdNdMh6eJR6UFV/cHUWSe1LcwYxTrGDb K/RG54Dc8Xih2VZFPoBBkfJTt77Xpdtu5W5Wb/IohNKMCCiDfV4Ifslu9aEKRcWZ VFyxLlzMGwZWJea1Q2B/QLnOmrTGujAvgcTzven5cbW+CVWm6Wnk2tCIvem6GsYk YEi90Iri7euXlP4rBUKkUejSIfQBbnHrDHi7ijZ7UUbx/mtX3cwNqTS9t3TVluid SHgdfHmyzp/R3EB+Fhu7jJJ7+5vW81rDqxeeJteV+w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeegfedguddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefujghffffkfgggtgesmhdttdertdertdenucfhrhhomhepufgvrghn ucghhhhithhtohhnuceoshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgvqe enucggtffrrghtthgvrhhnpeffveeuhfeludfhfeegjeefhefhfeeludejueehfeevtdfh hfettedtfeelleetudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvg X-ME-Proxy: Feedback-ID: i23c04076:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 26 Sep 2022 18:33:23 -0400 (EDT) Original-Received: by melete.silentflame.com (Postfix, from userid 1000) id 7AFDD7E032C; Mon, 26 Sep 2022 15:33:22 -0700 (MST) In-Reply-To: <86o7v3kj30.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 25 Sep 2022 10:29:39 +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:243680 Archived-At: --=-=-= Content-Type: text/plain Hello, On Sun 25 Sep 2022 at 10:29AM +03, Juri Linkov wrote: >>>> 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. > > Thanks, I'm going to try it out. It looks like I need to call (minibuffer-depth) like display-buffer-override-next-command does. Updated patch attached. >> I think it's considerably worse than C-u C-x v b l tbh. > > Undoubtedly, it's worse. But it solves the problem that > all vc commands can't use C-u. Just to be clear, the thing that I think is much worse is being prompted for multiple intermediate commands, not the longer key sequence. I realised that we could add an override inside vc-read-revision, and potentially other places, which makes it considerably less annoying. Done in the attached. -- Sean Whitton --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=v2-0001-WIP-Add-vc-edit-next-command.patch >From 7115ae59cf5f263dbc1b1a208fce974d790d8cae Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 24 Sep 2022 16:17:56 -0700 Subject: [PATCH v2] WIP Add vc-edit-next-command. --- lisp/vc/vc-hooks.el | 3 ++- lisp/vc/vc.el | 34 ++++++++++++++++++++++++++++++++-- 2 files changed, 34 insertions(+), 3 deletions(-) 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..76554d2340 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1918,8 +1918,11 @@ vc-read-revision (setq files (cadr vc-fileset)) (setq backend (car vc-fileset)))) ((null backend) (setq backend (vc-backend (car files))))) - (let ((completion-table - (vc-call-backend backend 'revision-completion-table files))) + ;; Override any `vc-filter-command-function' value, as user probably + ;; doesn't want to edit the command to get the completions. + (let* ((vc-filter-command-function #'list) + (completion-table + (vc-call-backend backend 'revision-completion-table files))) (if completion-table (completing-read prompt completion-table nil nil initial-input 'vc-revision-history default) @@ -3244,6 +3247,33 @@ 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 ((minibuffer-depth (minibuffer-depth)) + (command this-command) + (keys (key-description (this-command-keys))) + (old vc-filter-command-function) + (echofun (lambda () keys)) + (postfun + (lambda () + (unless (or (eq this-command command) + (> (minibuffer-depth) minibuffer-depth)) + (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 --=-=-=--