Received: (at 64531) by debbugs.gnu.org; 12 Feb 2025 08:37:15 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Wed Feb 12 03:37:15 2025 Received: from localhost ([127.0.0.1]:60774 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ti8F9-0007Zh-4i for submit <at> debbugs.gnu.org; Wed, 12 Feb 2025 03:37:15 -0500 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]:49427) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>) id 1ti8F6-0007ZK-DD for 64531 <at> debbugs.gnu.org; Wed, 12 Feb 2025 03:37:13 -0500 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-5de5a853090so8871682a12.3 for <64531 <at> debbugs.gnu.org>; Wed, 12 Feb 2025 00:37:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739349426; x=1739954226; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=Ft6CKBumEZswOWUbF/ta/JuS+K1sXYR7IXCbvHumv50=; b=epLdsttczCWq4wlgT9Bzclwy+d8zUVlvqrKQghP9iX1HwpzzZ7wuwESkTFJkPSo7Eq wbdm+Zd7f/Aeyxhe1fjfskc4odmN5EL8yzDZpPU0sZPQQktSJIC0yyFjm20m0bclbV5B 4rwyFGBlugnFBPLutyBbViXSYeV7h2mfZIoW6KCi7Vfd9EJFoocHVglNmi3XJENiIaVy l+jPRpVshj2Cuxr/MeHJYYjNEiEO+fAKx9aqFmWAg3ERT/AaforhDx6hR5EMADifh/MI c5FBdNQk3pbfDZoH6kEAjvEvcLN4BNsZmH3tQ6ZubUBbtbK39q9owGWOMCdbUpA1rn6B 728A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739349426; x=1739954226; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ft6CKBumEZswOWUbF/ta/JuS+K1sXYR7IXCbvHumv50=; b=WPva3Kx9TCDUevFc4L1efyJ+I36wsASvHcapCODw2+nIqcZWr0HoQxVJOyFaBVfLgV 1uSOJOQRzfr5mMCrjD05elmj+EUY8v7cyhqd24/UsXLTBNxfPc75S7MfEeoVgZSxi+FY kNCZoA1HWzKXO1mzdcJtCtlE1kBy6cYCr71XRoPMgq3QdZSWAYPutlEtHWsuACZZjavp AdjAjPl8m4P2cKfm53qWzSZcSYQJvZlRjTRtPpIs1EcfpCZkPHL8PpacwFFypr+QXhXJ kq17og9rFAiN5v48Uma6p7i0aiR7WIoCxUiQzpDbAexGPagtLpuwBPpbgZBqseekQRdi rA0g== X-Forwarded-Encrypted: i=1; AJvYcCW7Sv4n01A5jf/mWGD92TfpopnLwOPJ1HaVshCfJCwruAeXSpuFKKijaNJpm4Pa+xn5zvt3Bw==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzCcTJBu9MBunEut9S7HUXFqPrws4SlJF0tkJog75uYkRH/uTNe 6FvKwvxaT6UYY481bFvURSzTy2+cvXHpRn4D3//nst3nt53kPZctQAWVfmlzSWSDbrj9nnxL+aF KEcNcOraGAYz6NHWUicwesKsyLxY= X-Gm-Gg: ASbGncuT4tGArpcwRNaPiL1iPvzuIz2lj01b5EhPZTz6ap/9Sf/SSHQaKwUlGsHJ9Tv 1dT5tllgVCnrHjdYrNA0dZwlX8DYl42cPPe47svDvkSn5MurMGMousFCMfD9RguosE7HAbclYAg == X-Google-Smtp-Source: AGHT+IHcSHn3AVFbY3lzw8HX4JjVGxFzd9kM38Y9Q2tFvJcNjvSmEhXnGQ+pDISEAZUF8rhAn+STjcrbFislYiHK0W8= X-Received: by 2002:a05:6402:34d2:b0:5d0:81af:4a43 with SMTP id 4fb4d7f45d1cf-5deadd04147mr2314093a12.0.1739349426164; Wed, 12 Feb 2025 00:37:06 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 12 Feb 2025 00:37:04 -0800 From: Stefan Kangas <stefankangas@HIDDEN> In-Reply-To: <83o7ig51ej.fsf@HIDDEN> References: <87a5u1em71.fsf@HIDDEN> <83o7ig51ej.fsf@HIDDEN> MIME-Version: 1.0 Date: Wed, 12 Feb 2025 00:37:04 -0800 X-Gm-Features: AWEUYZkvEvU01J0jV1TS4XNQAbJfOeJIf_z-IbnQjrSJEB05YkRdan1WZoWzCYA Message-ID: <CADwFkm=mxHu_P5m1eN8B7zFXsZPn_q=J30phBZo3t2ue0UERug@HIDDEN> Subject: Re: bug#64531: [PATCH v3] Add new commands for copying VC filenames To: Eli Zaretskii <eliz@HIDDEN> Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 64531 Cc: 64531 <at> debbugs.gnu.org, Ivan Sokolov <ivan-p-sokolov@HIDDEN>, dgutov@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Eli Zaretskii <eliz@HIDDEN> writes: >> From: Ivan Sokolov <ivan-p-sokolov@HIDDEN> >> Cc: Eli Zaretskii <eliz@HIDDEN>, Dmitry Gutov <dgutov@HIDDEN> >> Date: Mon, 04 Sep 2023 23:08:02 +0300 >> >> I tried to write documentation for the previous version of the command >> and came to the conclusion that I crammed too much functionality into >> it. So I divided the DWIM command into command for copying name at >> point (bound to w) and command for copying marked files (bound to * w). >> >> I also added new command for copying VC related filenames from >> everywhere. An appropriate binding would be C-x v w, but I am not sure >> if I should use a top-level binding for such an insignificant command. >> >> Quoting and prefix arguments now copy `dired-copy-filename-as-kill'. > > Thanks, a few minor comments about the documentation parts: > >> diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi >> index 2dad70d3d13..8e7e2365f0a 100644 >> --- a/doc/emacs/maintaining.texi >> +++ b/doc/emacs/maintaining.texi >> @@ -1388,6 +1388,13 @@ You can use this command to mark files that are in one of registered >> states, including edited, added or removed. >> (@code{vc-dir-mark-registered-files}). >> >> +@findex vc-dir-copy-marked-files-as-kill >> +@item * w >> +This command copy names of marked files into the kill ring. If prefix > ^^^^ > "copies" > >> +argument is 0 names are absolute, with other prefix arguments names >> +are relative to the VC root directory. Without prefix names are >> +relative to the VC buffer directory. > > Our style is to describe the "normal" case first. Like this: > > Normally, the copied file names are relative to the current buffer's > default directory, but you can control that with the prefix > argument. With prefix argument of zero, the file names are copied > in their absolute form; with any other value of prefix argument, the > file names are relative to the root directory of the VCS repository. > >> +@item w >> +Copy the name of the file at point into the kill ring. If prefix >> +argument is 0 name is absolute, with other prefix arguments name is >> +relative to the VC root directory. Without prefix name is relative to >> +the VC buffer directory. > > This basically repeats the same text as above. We usually first > describe the command in short, preferably in one sentence, and place > the detailed description further down. Please try to follow these > conventions. Ivan, could you please send an updated patch based on Eli's comments above? Thanks in advance.
bug-gnu-emacs@HIDDEN
:bug#64531
; Package emacs
.
Full text available.Received: (at 64531) by debbugs.gnu.org; 19 Oct 2023 23:40:11 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 19 19:40:11 2023 Received: from localhost ([127.0.0.1]:38193 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qtccc-00014e-TV for submit <at> debbugs.gnu.org; Thu, 19 Oct 2023 19:40:11 -0400 Received: from forward101b.mail.yandex.net ([2a02:6b8:c02:900:1:45:d181:d101]:48242) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <dgutov@HIDDEN>) id 1qtccY-000140-62 for 64531 <at> debbugs.gnu.org; Thu, 19 Oct 2023 19:40:09 -0400 Received: from mail-nwsmtp-smtp-production-main-29.myt.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-29.myt.yp-c.yandex.net [IPv6:2a02:6b8:c12:3b0d:0:640:a433:0]) by forward101b.mail.yandex.net (Yandex) with ESMTP id 2219E60A93; Fri, 20 Oct 2023 02:39:31 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-29.myt.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id Sdw5jZ4Wk0U0-MWwr2KkR; Fri, 20 Oct 2023 02:39:30 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1697758770; bh=AYE7QfQCVRJKygMbmHLYQCyB8hS7ew4JSbJoBeg3/Dw=; h=In-Reply-To:From:Subject:Message-ID:Cc:References:Date:To; b=OOwyemXgzItlyFGpzK2m/FJ/FReXjxnoTiS1Mg6v6Fjxkp48bwG2hf7BKUMVRKXLI ATlX8HNXcui1va3DtLG141RcuTAluS9jVpvaKQCo42aA2VRpRrLlG627Bj2eZBl+VY FjP6cHxM5S0k8C+fAu7sNNEgcC+NecXn3QncQrf4= Authentication-Results: mail-nwsmtp-smtp-production-main-29.myt.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailauth.nyi.internal (Postfix) with ESMTP id 7D84F27C0074; Thu, 19 Oct 2023 19:39:28 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Thu, 19 Oct 2023 19:39:28 -0400 X-ME-Sender: <xms:ML4xZR9TJLY30PdmX9AB4qJu7XTlT6HViTx0gTnx5UQYxjiPSRsanw> <xme:ML4xZVtar_orbD3hIWbSDJnQDbKBbIiidWyRyg8_Hmifb7TPtsPAVjUUIgtsWP2BE juFWPEb-bMKvBJfRYQ> X-ME-Received: <xmr:ML4xZfCSG3UEectIQOO74US1vfduI-f5VWqeOcDu5V0xDn9SnTGMsnsFueupDIY> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrjeejgddvgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughguhhtohhvseihrghnuggvgidrrhhuqeenucggtffrrghtth gvrhhnpedtffeggeekleetvedtkeeltefhfedtuddvgeektdekudejhfeftdevfedtffdu veenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegugh huthhovhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqudeffeefleelheeh vddqvdelgeejjeejjeeiqdgughhuthhovheppeihrghnuggvgidrrhhusehfrghsthhmrg hilhdrtghomh X-ME-Proxy: <xmx:ML4xZVec5Hx9uknyCICupVdZS5uAtpSKEsD9WXgdrmt6fM8CNGbcyA> <xmx:ML4xZWN_RGDAjxv4YUgU3Qgl9YfWIdjCbs4MaNLyafVGhdc9nmkeEA> <xmx:ML4xZXnLx1F67fnh4UmlfGH-aGnAw8j3WGActtMOWiwM-M7H-MwoFA> <xmx:ML4xZY07fNM_WvQAzM-6YwHvkHNCxTm9Nf6Jt9ApLFPU7dV7QBg8gQ> Feedback-ID: ib1d9465d:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Oct 2023 19:39:27 -0400 (EDT) Message-ID: <e66c7b3c-dab2-fffb-f0b7-8670ba9d467a@HIDDEN> Date: Fri, 20 Oct 2023 02:39:24 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#64531: [PATCH v3] Add new commands for copying VC filenames Content-Language: en-US To: Eli Zaretskii <eliz@HIDDEN>, Ivan Sokolov <ivan-p-sokolov@HIDDEN> References: <87a5u1em71.fsf@HIDDEN> <83o7ig51ej.fsf@HIDDEN> From: Dmitry Gutov <dgutov@HIDDEN> In-Reply-To: <83o7ig51ej.fsf@HIDDEN> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 64531 Cc: 64531 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.2 (---) On 05/09/2023 14:01, Eli Zaretskii wrote: >> From: Ivan Sokolov<ivan-p-sokolov@HIDDEN> >> Cc: Eli Zaretskii<eliz@HIDDEN>, Dmitry Gutov<dgutov@HIDDEN> >> Date: Mon, 04 Sep 2023 23:08:02 +0300 >> >> I tried to write documentation for the previous version of the command >> and came to the conclusion that I crammed too much functionality into >> it. So I divided the DWIM command into command for copying name at >> point (bound to w) and command for copying marked files (bound to * w). >> >> I also added new command for copying VC related filenames from >> everywhere. An appropriate binding would be C-x v w, but I am not sure >> if I should use a top-level binding for such an insignificant command. >> >> Quoting and prefix arguments now copy `dired-copy-filename-as-kill'. > Thanks, a few minor comments about the documentation parts: Thank for the doc changes review. The code looks good, FWIW.
bug-gnu-emacs@HIDDEN
:bug#64531
; Package emacs
.
Full text available.Received: (at 64531) by debbugs.gnu.org; 5 Sep 2023 11:02:31 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 05 07:02:31 2023 Received: from localhost ([127.0.0.1]:54297 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qdTpH-0008K9-2R for submit <at> debbugs.gnu.org; Tue, 05 Sep 2023 07:02:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47998) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1qdTpE-0008Jv-Fp for 64531 <at> debbugs.gnu.org; Tue, 05 Sep 2023 07:02:29 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1qdTp3-0000Ij-6i; Tue, 05 Sep 2023 07:02:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Ixr+Yvd78vOWz5XrtymT7ieHR0XzK1zIYw6MxcK+GYw=; b=oaPFvQ3+qd/+ mPNkLihq/tIzbtRSvg2UdS3b6RmiTVuOGlkcIoPUtFM7tc/u1Q0Zsq8EnG53uaeeI5/BQMrTCWrqk d1jdj7gU9xpG2sPZROE/ThE4rc4c2f8Ydk4/NSNHUoyzM91ZWVYTITKuS4V8kXwdfxrE2QkPA0EUZ 77JeN2oU+Tv9kHcsPdb4iPmoEYdwD1Mui3JFllLiWF9SEZuW/vsRHBRfDnU+wjKySKFCzLg17KnMz pnwN6CEEDshEVJGtZOBRblfeeogKzkVEXsq6ReavST75LqtEJ2pf4R2J+GuNrbIlmNpTtjq3dPyGK clo84nLHe5NA+3iX8fGfHg==; Date: Tue, 05 Sep 2023 14:01:56 +0300 Message-Id: <83o7ig51ej.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> To: Ivan Sokolov <ivan-p-sokolov@HIDDEN> In-Reply-To: <87a5u1em71.fsf@HIDDEN> (message from Ivan Sokolov on Mon, 04 Sep 2023 23:08:02 +0300) Subject: Re: [PATCH v3] Add new commands for copying VC filenames References: <87a5u1em71.fsf@HIDDEN> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64531 Cc: 64531 <at> debbugs.gnu.org, dgutov@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > From: Ivan Sokolov <ivan-p-sokolov@HIDDEN> > Cc: Eli Zaretskii <eliz@HIDDEN>, Dmitry Gutov <dgutov@HIDDEN> > Date: Mon, 04 Sep 2023 23:08:02 +0300 > > I tried to write documentation for the previous version of the command > and came to the conclusion that I crammed too much functionality into > it. So I divided the DWIM command into command for copying name at > point (bound to w) and command for copying marked files (bound to * w). > > I also added new command for copying VC related filenames from > everywhere. An appropriate binding would be C-x v w, but I am not sure > if I should use a top-level binding for such an insignificant command. > > Quoting and prefix arguments now copy `dired-copy-filename-as-kill'. Thanks, a few minor comments about the documentation parts: > diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi > index 2dad70d3d13..8e7e2365f0a 100644 > --- a/doc/emacs/maintaining.texi > +++ b/doc/emacs/maintaining.texi > @@ -1388,6 +1388,13 @@ You can use this command to mark files that are in one of registered > states, including edited, added or removed. > (@code{vc-dir-mark-registered-files}). > > +@findex vc-dir-copy-marked-files-as-kill > +@item * w > +This command copy names of marked files into the kill ring. If prefix ^^^^ "copies" > +argument is 0 names are absolute, with other prefix arguments names > +are relative to the VC root directory. Without prefix names are > +relative to the VC buffer directory. Our style is to describe the "normal" case first. Like this: Normally, the copied file names are relative to the current buffer's default directory, but you can control that with the prefix argument. With prefix argument of zero, the file names are copied in their absolute form; with any other value of prefix argument, the file names are relative to the root directory of the VCS repository. > +@item w > +Copy the name of the file at point into the kill ring. If prefix > +argument is 0 name is absolute, with other prefix arguments name is > +relative to the VC root directory. Without prefix name is relative to > +the VC buffer directory. This basically repeats the same text as above. We usually first describe the command in short, preferably in one sentence, and place the detailed description further down. Please try to follow these conventions.
bug-gnu-emacs@HIDDEN
:bug#64531
; Package emacs
.
Full text available.Received: (at 64531) by debbugs.gnu.org; 4 Sep 2023 20:08:43 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 04 16:08:43 2023 Received: from localhost ([127.0.0.1]:52695 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qdFsH-0001fC-Pi for submit <at> debbugs.gnu.org; Mon, 04 Sep 2023 16:08:43 -0400 Received: from forward100b.mail.yandex.net ([2a02:6b8:c02:900:1:45:d181:d100]:43242) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ivan-p-sokolov@HIDDEN>) id 1qdFsC-0001eu-T0 for 64531 <at> debbugs.gnu.org; Mon, 04 Sep 2023 16:08:41 -0400 Received: from mail-nwsmtp-smtp-production-main-46.myt.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-46.myt.yp-c.yandex.net [IPv6:2a02:6b8:c12:3b27:0:640:a9e4:0]) by forward100b.mail.yandex.net (Yandex) with ESMTP id 865E56007D; Mon, 4 Sep 2023 23:08:29 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-46.myt.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id S8dvaxFWwW20-9EP6nkQM; Mon, 04 Sep 2023 23:08:29 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ya.ru; s=mail; t=1693858109; bh=vnuHOzHV2vZsw19xhPRVvSx/6Iv7fOebly96PE2US/A=; h=Message-ID:Date:Cc:Subject:To:From; b=jKCFNSRUAWz+eA1shkFNPlgV9cbP+hjEV+6B/oiOZJru5jzQ8HDVPZNVjgi4eM7JO m1sz2fPknSV5bOGOroPNWzxwzny+BvPFd2dyrhrDtoZVRFZrI2eD32Ih79yNEBOlnS LbzZonpZMZGgYe8yfASuM0n8wicOB7hlFkM4QjTc= Authentication-Results: mail-nwsmtp-smtp-production-main-46.myt.yp-c.yandex.net; dkim=pass header.i=@ya.ru From: Ivan Sokolov <ivan-p-sokolov@HIDDEN> To: 64531 <at> debbugs.gnu.org Subject: [PATCH v3] Add new commands for copying VC filenames Date: Mon, 04 Sep 2023 23:08:02 +0300 Message-ID: <87a5u1em71.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 64531 Cc: Eli Zaretskii <eliz@HIDDEN>, Dmitry Gutov <dgutov@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain Hi, Eli and Dmitry! I tried to write documentation for the previous version of the command and came to the conclusion that I crammed too much functionality into it. So I divided the DWIM command into command for copying name at point (bound to w) and command for copying marked files (bound to * w). I also added new command for copying VC related filenames from everywhere. An appropriate binding would be C-x v w, but I am not sure if I should use a top-level binding for such an insignificant command. Quoting and prefix arguments now copy `dired-copy-filename-as-kill'. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-new-commands-for-copying-VC-filenames.patch Content-Description: [PATCH] Add new commands for copying VC filenames From 0baa37ff90fb58e43240586a401a6145da78b3f5 Mon Sep 17 00:00:00 2001 From: Ivan Sokolov <ivan-p-sokolov@HIDDEN> Date: Mon, 4 Sep 2023 22:33:32 +0300 Subject: [PATCH] Add new commands for copying VC filenames --- doc/emacs/maintaining.texi | 13 ++++++++++++ etc/NEWS | 7 +++++++ lisp/vc/vc-dir.el | 20 +++++++++++++++++- lisp/vc/vc.el | 43 +++++++++++++++++++++++++++++++------- 4 files changed, 75 insertions(+), 8 deletions(-) diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 2dad70d3d13..8e7e2365f0a 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -1388,6 +1388,13 @@ You can use this command to mark files that are in one of registered states, including edited, added or removed. (@code{vc-dir-mark-registered-files}). +@findex vc-dir-copy-marked-files-as-kill +@item * w +This command copy names of marked files into the kill ring. If prefix +argument is 0 names are absolute, with other prefix arguments names +are relative to the VC root directory. Without prefix names are +relative to the VC buffer directory. + @item G Add the file under point to the list of files that the VC should ignore (@code{vc-dir-ignore}). For instance, if the VC is Git, it @@ -1407,6 +1414,12 @@ point is on a directory entry, unmark all files in that directory tree (@code{vc-dir-unmark-all-files}). With a prefix argument, unmark all files and directories. +@item w +Copy the name of the file at point into the kill ring. If prefix +argument is 0 name is absolute, with other prefix arguments name is +relative to the VC root directory. Without prefix name is relative to +the VC buffer directory. + @item x Hide files with @samp{up-to-date} or @samp{ignored} status (@code{vc-dir-hide-up-to-date}). With a prefix argument, hide items diff --git a/etc/NEWS b/etc/NEWS index c97df11042d..77192b23cb7 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -262,6 +262,13 @@ This is a string or a list of strings that specifies the Git log switches for shortlogs, such as the one produced by 'C-x v L'. 'vc-git-log-switches' is no longer used for shortlogs. +*** New commands for copying names of Version Controlled files +Commands 'vc-dir-copy-filename-as-kill' and +'vc-dir-copy-marked-files-as-kill' work like +'dired-copy-filename-as-kill' but in VC-dir buffer. Command +'vc-copy-filename-as-kill' copies name of the interactively chosen +file. + ** Diff Mode +++ diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index 53d58870b32..3a4b8dbd18d 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -353,6 +353,7 @@ See `run-hooks'." (define-key map (kbd "M-s a C-s") #'vc-dir-isearch) (define-key map (kbd "M-s a M-C-s") #'vc-dir-isearch-regexp) (define-key map "G" #'vc-dir-ignore) + (define-key map "w" #'vc-dir-copy-filename-as-kill) (let ((branch-map (make-sparse-keymap))) (define-key map "b" branch-map) @@ -367,7 +368,8 @@ See `run-hooks'." (let ((mark-map (make-sparse-keymap))) (define-key map "*" mark-map) (define-key mark-map "%" #'vc-dir-mark-by-regexp) - (define-key mark-map "r" #'vc-dir-mark-registered-files)) + (define-key mark-map "r" #'vc-dir-mark-registered-files) + (define-key mark-map "w" #'vc-dir-copy-marked-files-as-kill)) ;; Hook up the menu. (define-key map [menu-bar vc-dir-mode] @@ -930,6 +932,22 @@ system." (interactive) (view-file (vc-dir-current-file))) +(defun vc-dir-copy-filename-as-kill () + "In VC-dir buffer copy name of the file at point into the kill ring. +With a zero prefix arg, use the absolute file name. +With \\[universal-argument], use the file name relative to `vc-root-dir'." + (interactive) + (vc--copy-filenames-as-kill (list (vc-dir-current-file)))) + +(defun vc-dir-copy-marked-files-as-kill () + "In VC-dir buffer copy names of the marked files into the kill ring. +With a zero prefix arg, use the absolute file names. +With \\[universal-argument], use the file names relative to `vc-root-dir'." + (interactive) + (if-let* ((files (vc-dir-marked-files))) + (vc--copy-filenames-as-kill files t) + (message "No marked files"))) + (defun vc-dir-isearch () "Search for a string through all marked buffers using Isearch." (interactive) diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index be7fa46c28e..9e352cfc467 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1205,6 +1205,13 @@ BEWARE: this function may change the current buffer." (completing-read prompt (mapcar #'symbol-name backends) nil 'require-match nil nil default)))) +(defun vc-read-file (prompt) + "Read file name, prompting with PROMPT. +Default is the current file if it is under version control." + (read-file-name prompt nil (when (vc-backend buffer-file-name) + buffer-file-name) + t)) + ;; Here's the major entry point. ;;;###autoload @@ -3261,10 +3268,7 @@ backend to NEW-BACKEND, and unregister FILE from the current backend. "Delete file and mark it as such in the version control system. If called interactively, read FILE, defaulting to the current buffer's file name if it's under version control." - (interactive (list (read-file-name "VC delete file: " nil - (when (vc-backend buffer-file-name) - buffer-file-name) - t))) + (interactive (list (vc-read-file "VC delete file: "))) (setq file (expand-file-name file)) (let ((buf (get-file-buffer file)) (backend (vc-backend file))) @@ -3305,9 +3309,7 @@ buffer's file name if it's under version control." "Rename file OLD to NEW in both work area and repository. If called interactively, read OLD and NEW, defaulting OLD to the current buffer's file name if it's under version control." - (interactive (list (read-file-name "VC rename file: " nil - (when (vc-backend buffer-file-name) - buffer-file-name) t) + (interactive (list (vc-read-file "VC rename file: ") (read-file-name "Rename to: "))) ;; in CL I would have said (setq new (merge-pathnames new old)) (let ((old-base (file-name-nondirectory old))) @@ -3340,6 +3342,33 @@ current buffer's file name if it's under version control." (vc-mode-line new (vc-backend new)) (set-buffer-modified-p nil))))) +(defun vc--copy-as-kill (str) + (if (eq last-command 'kill-region) + (kill-append str nil) + (kill-new str)) + (message "%s" str)) + +(defun vc--copy-filenames-as-kill (files &optional quote) + (vc--copy-as-kill + (mapconcat + (lambda (file) + (cond ((eq current-prefix-arg 0) + (setq file (expand-file-name file))) + ((consp current-prefix-arg) + (setq file (file-relative-name file (vc-root-dir))))) + (if (and quote (string-match-p "[\s\"']" file)) + (format "%S" file) + file)) + files " "))) + +;;;###autoload +(defun vc-copy-filename-as-kill (file) + "Copy name of the FILE into the kill ring. +With a zero prefix arg, use the absolute file name. +With \\[universal-argument], use the file name relative to `vc-root-dir'." + (interactive (list (vc-read-file "VC copy filename as kill: "))) + (vc--copy-filenames-as-kill (list file))) + ;;;###autoload (defun vc-update-change-log (&rest args) "Find change log file and add entries from recent version control logs. -- 2.41.0 --=-=-=--
bug-gnu-emacs@HIDDEN
:bug#64531
; Package emacs
.
Full text available.Stefan Kangas <stefankangas@HIDDEN>
to control <at> debbugs.gnu.org
.
Full text available.Received: (at 64531) by debbugs.gnu.org; 20 Aug 2023 10:26:20 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun Aug 20 06:26:20 2023 Received: from localhost ([127.0.0.1]:53148 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qXfdT-0007NM-Ry for submit <at> debbugs.gnu.org; Sun, 20 Aug 2023 06:26:20 -0400 Received: from forward103b.mail.yandex.net ([2a02:6b8:c02:900:1:45:d181:d103]:39906) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <dgutov@HIDDEN>) id 1qXfdR-0007N7-2Z for 64531 <at> debbugs.gnu.org; Sun, 20 Aug 2023 06:26:18 -0400 Received: from mail-nwsmtp-smtp-production-main-63.sas.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-63.sas.yp-c.yandex.net [IPv6:2a02:6b8:c14:6e01:0:640:627f:0]) by forward103b.mail.yandex.net (Yandex) with ESMTP id 3B31960042; Sun, 20 Aug 2023 13:26:09 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-63.sas.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id 6QhH8lTDamI0-pztMNeNM; Sun, 20 Aug 2023 13:26:08 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1692527168; bh=JRu64OZzocL+/o6a6dMgFnk98ITNI52EDMxJHbjJRlo=; h=In-Reply-To:From:Subject:Message-ID:Cc:References:Date:To; b=doF8qFIjNHpOPQvaj7THAPFxhkn1yNAe2wLcQvsiHez7thPVjDyvZrCxsMXwFT3Ab bPKbcBpYzZJOSDqjpKe5ih5gBVnXvyFstyl2Q2SvUMU34m/CGlwSJYHTZmuI5uEiRv zhU1t8pmIGRB62lGCfW8ulHWrhuwXu09wpE/cW4s= Authentication-Results: mail-nwsmtp-smtp-production-main-63.sas.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id BB2D027C0054; Sun, 20 Aug 2023 06:26:06 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sun, 20 Aug 2023 06:26:06 -0400 X-ME-Sender: <xms:PurhZH7X5NFVPyldlD2QLKZdCeoetCQX5__5YXIcUpdeHYqIHxkS-A> <xme:PurhZM4QKSyf6DD2z_BJ17S0BshrJA17yAszFJM1T2u0-5EmtsaNF0b51gWzQGn3Y HxvMdJj9xgil6NwUXo> X-ME-Received: <xmr:PurhZOeT3cvijvFaMSzU5UVAqRHfLa8GBYm50UBOkkF89etHjrpbjdKo0YtXQ6M> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedruddujedgfedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegughhuthhovheshigrnhguvgigrdhruheqnecuggftrfgrth htvghrnheptdffgeegkeelteevtdekleethfeftdduvdegkedtkedujefhfedtveeftdff udevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hguhhtohhvodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqddufeeffeelleeh hedvqddvleegjeejjeejiedqughguhhtohhvpeephigrnhguvgigrdhruhesfhgrshhtmh grihhlrdgtohhm X-ME-Proxy: <xmx:PurhZILvENCkd0LvxzLoy8UcSpANfVeGMq_MRANlfhx8TPrTUHXmIA> <xmx:PurhZLKKgJK0NlQb9azlT0ZuciTbk3ysvm7osRN5PJCxKVNY_m8Qeg> <xmx:PurhZByWVZbr1lP5xoBkXVn-ZfDvsBnPW5DtyM51_OoKHRNaHngbdQ> <xmx:PurhZBipEc7KQcu0XgjdrusW8ge6ni8wLF0VJ6VW_fcmBJh4z4mg1Q> Feedback-ID: ib1d9465d:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 20 Aug 2023 06:26:05 -0400 (EDT) Message-ID: <43944ccb-8c21-5158-4bb5-31020a10eec8@HIDDEN> Date: Sun, 20 Aug 2023 13:26:02 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#64531: [PATCH v2] Add new command vc-dir-copy-filename-as-kill Content-Language: en-US To: Eli Zaretskii <eliz@HIDDEN> References: <87bkgmq1ra.fsf@HIDDEN> <83jzvadabq.fsf@HIDDEN> <87bkfhy7fr.fsf_-_@HIDDEN> <83a5un1mn3.fsf@HIDDEN> <21b04273-e7e5-cbe5-cd95-9484a89a4b64@HIDDEN> <838ra6xm9n.fsf@HIDDEN> From: Dmitry Gutov <dgutov@HIDDEN> In-Reply-To: <838ra6xm9n.fsf@HIDDEN> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 1.8 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On 20/08/2023 09:26, Eli Zaretskii wrote: >> Date: Sun, 20 Aug 2023 02:33:59 +0300 >> Cc: 64531 <at> debbugs.gnu.org >> From: Dmitry Gutov >> >> The difference from dired-copy-filename-as-kill in handing [...] Content analysis details: (1.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [2a02:6b8:c02:900:1:45:d181:d103 listed in] [zen.spamhaus.org] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [2a02:6b8:c02:900:1:45:d181:d103 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (dgutov[at]yandex.ru) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -1.0 NICE_REPLY_A Looks like a legit reply (A) X-Debbugs-Envelope-To: 64531 Cc: ivan-p-sokolov@HIDDEN, 64531 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: 0.8 (/) On 20/08/2023 09:26, Eli Zaretskii wrote: >> Date: Sun, 20 Aug 2023 02:33:59 +0300 >> Cc: 64531 <at> debbugs.gnu.org >> From: Dmitry Gutov <dgutov@HIDDEN> >> >> The difference from dired-copy-filename-as-kill in handing of the prefix >> argument looks unfortunate (as a principle), but I'd rather leave it for >> you to judge. Perhaps changing the latter command's interface would be a >> better choice; I'm not sure why it works that way. > > What difference is that? I must be missing something, since it sounds > like both commands use the argument to select absolute or relative > file names? One of them mandates M-0 for that effect. >> Implementation difference: instead of going through (format "%S"), this >> one uses shell-quote-argument. Is that good enough for Windows systems? > > It depends on how the result will be used. But maybe we should do the > same as dired-copy-filename-as-kill, just for consistency of the UX? Maybe. I imagine it might be used in a shell, but indeed there are different options. >> And one more difference which we might want to see fixed: >> >> (When there's a single file, no quoting is done.) >> >> It seems like, at least, in some usage scenarios users would prefer to >> have copied filename not quoted. E.g. for subsequent use with find-file >> or... something similar. I don't really use this command all that much, >> so maybe I'm mistaken here, though. > > There will always be cases when quoting gets in the way, but hopefully > they are rare. The important thing, IMO, is that quoting is useful > for many/most uses of the file names in VC commands. Is it? When using 'M-!'? Maybe. I think consistency between 'w' commands is somewhat important, though.
bug-gnu-emacs@HIDDEN
:bug#64531
; Package emacs
.
Full text available.Received: (at 64531) by debbugs.gnu.org; 20 Aug 2023 06:26:08 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun Aug 20 02:26:08 2023 Received: from localhost ([127.0.0.1]:52781 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qXbt1-0000fI-SB for submit <at> debbugs.gnu.org; Sun, 20 Aug 2023 02:26:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60180) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1qXbsz-0000ej-Jt for 64531 <at> debbugs.gnu.org; Sun, 20 Aug 2023 02:26:06 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1qXbss-0004sa-SB; Sun, 20 Aug 2023 02:25:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=e17UqTMjl/xTmR4ds2KxkuZ6SqiKWwGXqulbXZotm4s=; b=H84EQ6/hffdk /O73Ots/U02Ble6fmV1+4xYegIf5OkU8F4v9Wq+PWhd9Iis1WDFVRghWgRfTqp9CTXjp4ESSoYgHE /k6V/uOHKHOQKWc+kK+IQSkbcgtDUwpJQN4JhHEnE71OJUVi86TSAVAIehGaknnUA6xIZgNPA4GFq aTZc/O7+lmP+atRu/4dxZlIN5A564kaca3cop3h2EF/9+QKGiDP1H7HjN5eZafCOANoHEOJhs41Lq ElVFoxSBdwXeafsOWUZOQt/5mZ2wy65i9ECDf8a15VuPcG4UkxJSCt0GW/zjFT5rQsJHyss9aUqWL rpZJtap9PV9iBXhZxFQ1kA==; Date: Sun, 20 Aug 2023 09:26:12 +0300 Message-Id: <838ra6xm9n.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> To: Dmitry Gutov <dgutov@HIDDEN> In-Reply-To: <21b04273-e7e5-cbe5-cd95-9484a89a4b64@HIDDEN> (message from Dmitry Gutov on Sun, 20 Aug 2023 02:33:59 +0300) Subject: Re: bug#64531: [PATCH v2] Add new command vc-dir-copy-filename-as-kill References: <87bkgmq1ra.fsf@HIDDEN> <83jzvadabq.fsf@HIDDEN> <87bkfhy7fr.fsf_-_@HIDDEN> <83a5un1mn3.fsf@HIDDEN> <21b04273-e7e5-cbe5-cd95-9484a89a4b64@HIDDEN> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64531 Cc: 64531 <at> debbugs.gnu.org, ivan-p-sokolov@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > Date: Sun, 20 Aug 2023 02:33:59 +0300 > Cc: 64531 <at> debbugs.gnu.org > From: Dmitry Gutov <dgutov@HIDDEN> > > The difference from dired-copy-filename-as-kill in handing of the prefix > argument looks unfortunate (as a principle), but I'd rather leave it for > you to judge. Perhaps changing the latter command's interface would be a > better choice; I'm not sure why it works that way. What difference is that? I must be missing something, since it sounds like both commands use the argument to select absolute or relative file names? > Implementation difference: instead of going through (format "%S"), this > one uses shell-quote-argument. Is that good enough for Windows systems? It depends on how the result will be used. But maybe we should do the same as dired-copy-filename-as-kill, just for consistency of the UX? > And one more difference which we might want to see fixed: > > (When there's a single file, no quoting is done.) > > It seems like, at least, in some usage scenarios users would prefer to > have copied filename not quoted. E.g. for subsequent use with find-file > or... something similar. I don't really use this command all that much, > so maybe I'm mistaken here, though. There will always be cases when quoting gets in the way, but hopefully they are rare. The important thing, IMO, is that quoting is useful for many/most uses of the file names in VC commands. Is it?
bug-gnu-emacs@HIDDEN
:bug#64531
; Package emacs
.
Full text available.Received: (at 64531) by debbugs.gnu.org; 20 Aug 2023 06:19:57 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun Aug 20 02:19:57 2023 Received: from localhost ([127.0.0.1]:52771 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qXbn2-0000Tg-Kz for submit <at> debbugs.gnu.org; Sun, 20 Aug 2023 02:19:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42202) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1qXbn0-0000TS-6q for 64531 <at> debbugs.gnu.org; Sun, 20 Aug 2023 02:19:54 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1qXbms-0003hR-IA; Sun, 20 Aug 2023 02:19:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=7vbldJsbH8yK0WH8F4G2LKnVZlIRXQqx4RI0zaveRwQ=; b=SoLGhDgoDz8d 6DeNx1zqiVqfx7QmmGKiIrJ6W/Rajj2wFufiZYS9cNWcG02IQyBVa3t0l4D66Ef6xiTLVaPBxplgL 2GJb51quQPv8Wqsib7tKUIYorh8pxQmG3LEaWs1CYod/0C+mlRpSmccQ+eXC1aSo+iaYjrQi9egXg fizSr49H21fkA5dfqR+mZUJuqHDf0hWYH7+YAHKmnuAA+9X3bmAx4z8ik+V9PcyEckZvudEcVvT4A 1s0unTLu2PE4DBJnd/TOkvWiWhcRoIstUkJBqrMKwRyRl3C1mjed1NpqAv8MT58Rq9Nxub6Qvz6vT ZfBKT5bhO0TheF39r1BRJA==; Date: Sun, 20 Aug 2023 09:20:01 +0300 Message-Id: <83bkf2xmjy.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> To: Ivan Sokolov <ivan-p-sokolov@HIDDEN> In-Reply-To: <87sf8eeie7.fsf@HIDDEN> (message from Ivan Sokolov on Sun, 20 Aug 2023 02:12:32 +0300) Subject: Re: bug#64531: [PATCH v2] Add new command vc-dir-copy-filename-as-kill References: <87bkgmq1ra.fsf@HIDDEN> <83jzvadabq.fsf@HIDDEN> <87bkfhy7fr.fsf_-_@HIDDEN> <83a5un1mn3.fsf@HIDDEN> <87sf8eeie7.fsf@HIDDEN> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64531 Cc: 64531 <at> debbugs.gnu.org, dgutov@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > From: Ivan Sokolov <ivan-p-sokolov@HIDDEN> > Cc: Dmitry Gutov <dgutov@HIDDEN>, 64531 <at> debbugs.gnu.org > Date: Sun, 20 Aug 2023 02:12:32 +0300 > > Eli Zaretskii <eliz@HIDDEN> writes: > > >> From: Ivan Sokolov <ivan-p-sokolov@HIDDEN> > >> Cc: 64531 <at> debbugs.gnu.org > >> Date: Tue, 08 Aug 2023 16:44:56 +0300 > >> > >> Eli Zaretskii <eliz@HIDDEN> writes: > >> > >> > However, new commands should be called out in NEWS, and commands that > >> > are important enough should also be mentioned in the user manual. > >> > >> Added entry in NEWS, but not in the user manual, there is no such for > >> vc-dir afaik. > >> > >> >> +(defun vc-dir-copy-filename-as-kill (&optional absolutep) > >> >> + "Copy names of marked files (or file under cursor) into the kill ring. > >> > > >> > This sentence is too general: it doesn't mention VC Dir, although > >> > AFAIU it is specific to vc-dir. > >> > >> Fixed. > > > > Dmitry, is this good to go in? > > > > I still think it should be mention in the Emacs user manual, where we > > document vc-dir. > > Hi, Eli! > > I am working on the 3rd version of the patch with all the necessary > documentation and changes to the command which I will explain in the > cover letter. Not sure when I'll finish it though. Good to hear, and TIA. There's no rush, so take your time. (I will ping again if it takes too long IMO ;-)
bug-gnu-emacs@HIDDEN
:bug#64531
; Package emacs
.
Full text available.Received: (at 64531) by debbugs.gnu.org; 19 Aug 2023 23:34:16 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 19 19:34:16 2023 Received: from localhost ([127.0.0.1]:52451 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qXVSS-0006Kz-Ax for submit <at> debbugs.gnu.org; Sat, 19 Aug 2023 19:34:16 -0400 Received: from forward102c.mail.yandex.net ([2a02:6b8:c03:500:1:45:d181:d102]:46304) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <dgutov@HIDDEN>) id 1qXVSQ-0006Km-Iv for 64531 <at> debbugs.gnu.org; Sat, 19 Aug 2023 19:34:15 -0400 Received: from mail-nwsmtp-smtp-production-main-81.myt.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-81.myt.yp-c.yandex.net [IPv6:2a02:6b8:c12:530c:0:640:7b0d:0]) by forward102c.mail.yandex.net (Yandex) with ESMTP id A720860014; Sun, 20 Aug 2023 02:34:06 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-81.myt.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id 4YtrXPPDeGk0-z7cdEueC; Sun, 20 Aug 2023 02:34:05 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1692488046; bh=HjztpwqWjDfPiCpqRlVFxkMPyeI0d/UbjQMpt5TFZU0=; h=In-Reply-To:From:Subject:Message-ID:Cc:References:Date:To; b=hjolQarVmfGCyiVqx38cj25ATE70BCr6GPN9DFaxz6AqPSy08sV91ZEQ8/kWO2vOa Bk0gHvPl3SVJYNdEnq8bzeyThqU4AO+NqkuCIdAqPnffMdxdMgdPkbJwoPGvCmbxrk SUsObQEKNtHgXModwCsD5fYqohgh+jry2rp6Oymc= Authentication-Results: mail-nwsmtp-smtp-production-main-81.myt.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailauth.nyi.internal (Postfix) with ESMTP id CD51227C0054; Sat, 19 Aug 2023 19:34:03 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sat, 19 Aug 2023 19:34:03 -0400 X-ME-Sender: <xms:alHhZIR_m5C0hZGc7kfxAH5yjJkpPtZlP8Desqt9zI6hBHCihGvt_A> <xme:alHhZFz_a5Sd0R82pV7UvfANwMOfHP8sezAYnbDgsCkUCw833UEHgsGhWeqtzgTKr T_js7vWCV262v-Es-c> X-ME-Received: <xmr:alHhZF26mGEBqC3BovGk8Iu0FXXA1iJu31o2kNLRzKh6d9EX-VnEjOm_KV5aMN8> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudduiedgvdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegughhuthhovheshigrnhguvgigrdhruheqnecuggftrfgrth htvghrnheptdffgeegkeelteevtdekleethfeftdduvdegkedtkedujefhfedtveeftdff udevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hguhhtohhvodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqddufeeffeelleeh hedvqddvleegjeejjeejiedqughguhhtohhvpeephigrnhguvgigrdhruhesfhgrshhtmh grihhlrdgtohhm X-ME-Proxy: <xmx:alHhZMBTFn5vnJVft1FyXJzT5-2Nhnpsg1vYabMnfNz94vrFj84hVw> <xmx:alHhZBjtA7CPytZ8ebExquGqFKjiBgfrdKSiv0i7l3OSnR6RMfs5Fg> <xmx:alHhZIoftltZPR0uPpDA__2qcNVjkSuyz2_c2PSE5kW5ai1nxXqhfA> <xmx:a1HhZBYX_JRgylwFyhIGrjEoC9c5fPoNDAIHcs_H4PUqeTJPv8az8w> Feedback-ID: ib1d9465d:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 19 Aug 2023 19:34:01 -0400 (EDT) Message-ID: <21b04273-e7e5-cbe5-cd95-9484a89a4b64@HIDDEN> Date: Sun, 20 Aug 2023 02:33:59 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#64531: [PATCH v2] Add new command vc-dir-copy-filename-as-kill Content-Language: en-US To: Eli Zaretskii <eliz@HIDDEN>, Ivan Sokolov <ivan-p-sokolov@HIDDEN> References: <87bkgmq1ra.fsf@HIDDEN> <83jzvadabq.fsf@HIDDEN> <87bkfhy7fr.fsf_-_@HIDDEN> <83a5un1mn3.fsf@HIDDEN> From: Dmitry Gutov <dgutov@HIDDEN> In-Reply-To: <83a5un1mn3.fsf@HIDDEN> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 1.8 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi Eli, On 19/08/2023 11:06, Eli Zaretskii wrote: > Dmitry, is this good to go in? I'm good with the binding and the general functionality. Content analysis details: (1.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [2a02:6b8:c03:500:1:45:d181:d102 listed in] [zen.spamhaus.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [2a02:6b8:c03:500:1:45:d181:d102 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (dgutov[at]yandex.ru) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -1.0 NICE_REPLY_A Looks like a legit reply (A) X-Debbugs-Envelope-To: 64531 Cc: 64531 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: 0.8 (/) Hi Eli, On 19/08/2023 11:06, Eli Zaretskii wrote: > Dmitry, is this good to go in? I'm good with the binding and the general functionality. The difference from dired-copy-filename-as-kill in handing of the prefix argument looks unfortunate (as a principle), but I'd rather leave it for you to judge. Perhaps changing the latter command's interface would be a better choice; I'm not sure why it works that way. Implementation difference: instead of going through (format "%S"), this one uses shell-quote-argument. Is that good enough for Windows systems? And one more difference which we might want to see fixed: (When there's a single file, no quoting is done.) It seems like, at least, in some usage scenarios users would prefer to have copied filename not quoted. E.g. for subsequent use with find-file or... something similar. I don't really use this command all that much, so maybe I'm mistaken here, though.
bug-gnu-emacs@HIDDEN
:bug#64531
; Package emacs
.
Full text available.Received: (at 64531) by debbugs.gnu.org; 19 Aug 2023 23:13:03 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 19 19:13:03 2023 Received: from localhost ([127.0.0.1]:52440 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qXV7u-0005pp-Pi for submit <at> debbugs.gnu.org; Sat, 19 Aug 2023 19:13:03 -0400 Received: from forward100b.mail.yandex.net ([178.154.239.147]:42086) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ivan-p-sokolov@HIDDEN>) id 1qXV7r-0005pM-6a for 64531 <at> debbugs.gnu.org; Sat, 19 Aug 2023 19:13:01 -0400 Received: from mail-nwsmtp-smtp-production-main-45.sas.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-45.sas.yp-c.yandex.net [IPv6:2a02:6b8:c14:c83:0:640:84f9:0]) by forward100b.mail.yandex.net (Yandex) with ESMTP id AC6DE60031; Sun, 20 Aug 2023 02:12:55 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-45.sas.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id sCtbGSPWnmI0-85Bl4iUl; Sun, 20 Aug 2023 02:12:55 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ya.ru; s=mail; t=1692486775; bh=8qn5yJDgVO4GIr2/x4v6Inuw6iKehAvGMUCQfGjHBb4=; h=Message-ID:Date:Cc:In-Reply-To:Subject:References:To:From; b=Lf5kmbKt73Rj+AT4L/nvR10HHjMQBF9ogn7MV+PpBpVvQq8ZOUEa4+PdvVdeQVkXm 9fHqYkn1VzhyFf3pRHQd97oBJHJH6r/uC+bnwXR9Nf62+2Z+0K7gEGdlg6yGSeZ8mZ +YNgdWYHgkouyRcaGKh+PVNqGeYxoQu7c5DIw3o4= Authentication-Results: mail-nwsmtp-smtp-production-main-45.sas.yp-c.yandex.net; dkim=pass header.i=@ya.ru From: Ivan Sokolov <ivan-p-sokolov@HIDDEN> To: Eli Zaretskii <eliz@HIDDEN> Subject: Re: bug#64531: [PATCH v2] Add new command vc-dir-copy-filename-as-kill In-Reply-To: <83a5un1mn3.fsf@HIDDEN> (Eli Zaretskii's message of "Sat, 19 Aug 2023 11:06:56 +0300") References: <87bkgmq1ra.fsf@HIDDEN> <83jzvadabq.fsf@HIDDEN> <87bkfhy7fr.fsf_-_@HIDDEN> <83a5un1mn3.fsf@HIDDEN> Date: Sun, 20 Aug 2023 02:12:32 +0300 Message-ID: <87sf8eeie7.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 64531 Cc: 64531 <at> debbugs.gnu.org, Dmitry Gutov <dgutov@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Eli Zaretskii <eliz@HIDDEN> writes: >> From: Ivan Sokolov <ivan-p-sokolov@HIDDEN> >> Cc: 64531 <at> debbugs.gnu.org >> Date: Tue, 08 Aug 2023 16:44:56 +0300 >> >> Eli Zaretskii <eliz@HIDDEN> writes: >> >> > However, new commands should be called out in NEWS, and commands that >> > are important enough should also be mentioned in the user manual. >> >> Added entry in NEWS, but not in the user manual, there is no such for >> vc-dir afaik. >> >> >> +(defun vc-dir-copy-filename-as-kill (&optional absolutep) >> >> + "Copy names of marked files (or file under cursor) into the kill ring. >> > >> > This sentence is too general: it doesn't mention VC Dir, although >> > AFAIU it is specific to vc-dir. >> >> Fixed. > > Dmitry, is this good to go in? > > I still think it should be mention in the Emacs user manual, where we > document vc-dir. Hi, Eli! I am working on the 3rd version of the patch with all the necessary documentation and changes to the command which I will explain in the cover letter. Not sure when I'll finish it though.
bug-gnu-emacs@HIDDEN
:bug#64531
; Package emacs
.
Full text available.Received: (at 64531) by debbugs.gnu.org; 19 Aug 2023 08:06:54 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 19 04:06:54 2023 Received: from localhost ([127.0.0.1]:49312 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qXGz0-00045v-Gx for submit <at> debbugs.gnu.org; Sat, 19 Aug 2023 04:06:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37192) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1qXGyz-00045g-2O for 64531 <at> debbugs.gnu.org; Sat, 19 Aug 2023 04:06:53 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1qXGyr-00025U-QC; Sat, 19 Aug 2023 04:06:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=qx+4YZ53VEf7gcXBgiZJKLibjWxE5kVZjtNjypvJXWA=; b=hpwHPdw6wFRI feGDLlMqZ7X//9blwWT08OQ8SGrfR58zHRqKU2uSgF70zVv1TDTBAueh2wuJ8N/QwOWXCiPML/x3+ wrH0vSwdDYtlul59KRsYmZhIk8y5eZn5sRsAYDr8aOTXyJjNU85GP5DrWqCFtp/VYvRUUZc1nIu8W 1XaEcq54q9lEJzQeDAAwWUv4fnY55/yticO5e2fZg0lYLs5vt4RpVJwSeLG0XaYnwWgjrfSvVerib Tg7AYF+gIWMQpTlDQLnQ7BefFuKdRemIEVT394nX8S9q4ejNGa+JVUDxLwTAE3gKFFOwoV/FOK4oP 6Gg8Sun0r6jy81I0JzhQkA==; Date: Sat, 19 Aug 2023 11:06:56 +0300 Message-Id: <83a5un1mn3.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> To: Ivan Sokolov <ivan-p-sokolov@HIDDEN>, Dmitry Gutov <dgutov@HIDDEN> In-Reply-To: <87bkfhy7fr.fsf_-_@HIDDEN> (message from Ivan Sokolov on Tue, 08 Aug 2023 16:44:56 +0300) Subject: Re: bug#64531: [PATCH v2] Add new command vc-dir-copy-filename-as-kill References: <87bkgmq1ra.fsf@HIDDEN> <83jzvadabq.fsf@HIDDEN> <87bkfhy7fr.fsf_-_@HIDDEN> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64531 Cc: 64531 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > From: Ivan Sokolov <ivan-p-sokolov@HIDDEN> > Cc: 64531 <at> debbugs.gnu.org > Date: Tue, 08 Aug 2023 16:44:56 +0300 > > Eli Zaretskii <eliz@HIDDEN> writes: > > > However, new commands should be called out in NEWS, and commands that > > are important enough should also be mentioned in the user manual. > > Added entry in NEWS, but not in the user manual, there is no such for > vc-dir afaik. > > >> +(defun vc-dir-copy-filename-as-kill (&optional absolutep) > >> + "Copy names of marked files (or file under cursor) into the kill ring. > > > > This sentence is too general: it doesn't mention VC Dir, although > > AFAIU it is specific to vc-dir. > > Fixed. Dmitry, is this good to go in? I still think it should be mention in the Emacs user manual, where we document vc-dir.
bug-gnu-emacs@HIDDEN
:bug#64531
; Package emacs
.
Full text available.Received: (at 64531) by debbugs.gnu.org; 8 Aug 2023 13:56:13 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Aug 08 09:56:13 2023 Received: from localhost ([127.0.0.1]:37396 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qTNC1-0004BX-4o for submit <at> debbugs.gnu.org; Tue, 08 Aug 2023 09:56:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46710) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1qTNBy-0004BP-B0 for 64531 <at> debbugs.gnu.org; Tue, 08 Aug 2023 09:56:11 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1qTNBs-0001PM-Ly; Tue, 08 Aug 2023 09:56:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=OxWByizXdTCO6r7OvZb41isJUvLH4oTUf5oh/gerP+4=; b=fkqVzREJvwl0 G68IvRDOZPNdVHn36iRtyfHvykHTIvdAxd1crSogFx4sZaq1GsYWu8KtRRjRuA17O2Ua9bRvX2Ect wvZrPOlEv4LKRr6092hi/9DaE59IcPE7+eyg0Wueja1Wz/FCrHMGcXt4jVvuZ72o77o8CcKxPiHqt XOSyTzeyDqwaK8Nc355obyTBlLs3xN0AQ8d9ScMt8YmVUppk1jQ9UBvdtQaURacil/wwFUtty3g3m RIeNgq4uYbvnlKVUmCqxuyRUK3Yao4FREOIe53xtHB24vRgCTClobaAkllNGuYEjOtuqB9LkM7k9S u9AFlt8U70ko98s1iEdJMg==; Date: Tue, 08 Aug 2023 16:56:26 +0300 Message-Id: <83r0odmyd1.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> To: Ivan Sokolov <ivan-p-sokolov@HIDDEN> In-Reply-To: <87bkfhy7fr.fsf_-_@HIDDEN> (message from Ivan Sokolov on Tue, 08 Aug 2023 16:44:56 +0300) Subject: Re: bug#64531: [PATCH v2] Add new command vc-dir-copy-filename-as-kill References: <87bkgmq1ra.fsf@HIDDEN> <83jzvadabq.fsf@HIDDEN> <87bkfhy7fr.fsf_-_@HIDDEN> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64531 Cc: 64531 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > From: Ivan Sokolov <ivan-p-sokolov@HIDDEN> > Cc: 64531 <at> debbugs.gnu.org > Date: Tue, 08 Aug 2023 16:44:56 +0300 > > Eli Zaretskii <eliz@HIDDEN> writes: > > > However, new commands should be called out in NEWS, and commands that > > are important enough should also be mentioned in the user manual. > > Added entry in NEWS, but not in the user manual, there is no such for > vc-dir afaik. vc-dir is described in the subsection "VC Directory Mode" and its sub-subsections. > +(defun vc-dir-copy-filename-as-kill (&optional absolutep) > + "Copy filenames from the `vc-dir' buffer into the kill ring. > +If there are marked files, copy their names, otherwise copy the > +file at point. Names will be separated by a space, each will be > +quoted using `shell-quote-argument'. If ABSOLUTEP use absolute ^ A comma is missing there.
bug-gnu-emacs@HIDDEN
:bug#64531
; Package emacs
.
Full text available.Received: (at 64531) by debbugs.gnu.org; 8 Aug 2023 13:45:23 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Aug 08 09:45:23 2023 Received: from localhost ([127.0.0.1]:35684 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qTN1W-0003Nw-SU for submit <at> debbugs.gnu.org; Tue, 08 Aug 2023 09:45:23 -0400 Received: from forward500b.mail.yandex.net ([178.154.239.144]:60254) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ivan-p-sokolov@HIDDEN>) id 1qTN1T-0003Nk-KP for 64531 <at> debbugs.gnu.org; Tue, 08 Aug 2023 09:45:21 -0400 Received: from mail-nwsmtp-smtp-production-main-17.iva.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-17.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:c20c:0:640:509d:0]) by forward500b.mail.yandex.net (Yandex) with ESMTP id 796735E5FD; Tue, 8 Aug 2023 16:45:17 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-17.iva.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id GjY0Cb3WsqM0-E2w7NDOO; Tue, 08 Aug 2023 16:45:17 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ya.ru; s=mail; t=1691502317; bh=uPOYi6PsbKwx4ghBnqhfBzSqtTUb+t+45Epp3bXVhRE=; h=Message-ID:Date:Cc:In-Reply-To:Subject:References:To:From; b=rEYqzsQNKJTqLhhh9Qm5hIrmF6x0LVRSu+7eLeY+LgidJijHGblLrWkQzwjvobPHe dlYPtW4gadD1Qvx7NXnnt4zXEUAC0r70FrNluubcc+cXXb8yl5iSYWqETFX22yhUGW fPeDM7LbFGh6Zt/Y2cicpT9rfqpGprkdn4lK/GnU= Authentication-Results: mail-nwsmtp-smtp-production-main-17.iva.yp-c.yandex.net; dkim=pass header.i=@ya.ru From: Ivan Sokolov <ivan-p-sokolov@HIDDEN> To: Eli Zaretskii <eliz@HIDDEN> Subject: bug#64531: [PATCH v2] Add new command vc-dir-copy-filename-as-kill In-Reply-To: <83jzvadabq.fsf@HIDDEN> (Eli Zaretskii's message of "Sat, 08 Jul 2023 12:25:13 +0300") References: <87bkgmq1ra.fsf@HIDDEN> <83jzvadabq.fsf@HIDDEN> Date: Tue, 08 Aug 2023 16:44:56 +0300 Message-ID: <87bkfhy7fr.fsf_-_@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 64531 Cc: 64531 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Eli Zaretskii <eliz@HIDDEN> writes: > However, new commands should be called out in NEWS, and commands that > are important enough should also be mentioned in the user manual. Added entry in NEWS, but not in the user manual, there is no such for vc-dir afaik. >> +(defun vc-dir-copy-filename-as-kill (&optional absolutep) >> + "Copy names of marked files (or file under cursor) into the kill ring. > > This sentence is too general: it doesn't mention VC Dir, although > AFAIU it is specific to vc-dir. Fixed. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=v2-0001-Add-new-command-vc-dir-copy-filename-as-kill.patch From 88cb2e3407adf0245bc15a88896e1cd611d559c8 Mon Sep 17 00:00:00 2001 From: Ivan Sokolov <ivan-p-sokolov@HIDDEN> Date: Tue, 11 Jul 2023 18:19:57 +0300 Subject: [PATCH v2] Add new command vc-dir-copy-filename-as-kill * lisp/vc/vc-dir.el (vc-dir-copy-filename-as-kill): New command. (vc-dir-mode-map): Bind vc-dir-copy-filename-as-kill to `w'. --- etc/NEWS | 3 +++ lisp/vc/vc-dir.el | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index 1a86c9e55e2..da3672e068b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -154,6 +154,9 @@ This is a string or a list of strings that specifies the Git log switches for shortlogs, such as the one produced by 'C-x v L'. 'vc-git-log-switches' is no longer used for shortlogs. +*** New command 'vc-dir-copy-filename-as-kill'. +This works like 'dired-copy-filename-as-kill' but in vc-dir buffers. + ** Diff Mode +++ diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index 53d58870b32..dc25467a3e9 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -353,6 +353,7 @@ See `run-hooks'." (define-key map (kbd "M-s a C-s") #'vc-dir-isearch) (define-key map (kbd "M-s a M-C-s") #'vc-dir-isearch-regexp) (define-key map "G" #'vc-dir-ignore) + (define-key map "w" #'vc-dir-copy-filename-as-kill) (let ((branch-map (make-sparse-keymap))) (define-key map "b" branch-map) @@ -930,6 +931,23 @@ system." (interactive) (view-file (vc-dir-current-file))) +(defun vc-dir-copy-filename-as-kill (&optional absolutep) + "Copy filenames from the `vc-dir' buffer into the kill ring. +If there are marked files, copy their names, otherwise copy the +file at point. Names will be separated by a space, each will be +quoted using `shell-quote-argument'. If ABSOLUTEP use absolute +names, otherwise names are relative to the `default-directory'." + (interactive "P") + (let ((files (or (vc-dir-marked-files) + (list (vc-dir-current-file))))) + (unless absolutep + (setq files (mapcar #'file-relative-name files))) + (let ((string (mapconcat #'shell-quote-argument files " "))) + (if (eq last-command 'kill-region) + (kill-append string nil) + (kill-new string)) + (message "%s" string)))) + (defun vc-dir-isearch () "Search for a string through all marked buffers using Isearch." (interactive) -- 2.41.0 --=-=-=--
bug-gnu-emacs@HIDDEN
:bug#64531
; Package emacs
.
Full text available.Received: (at 64531) by debbugs.gnu.org; 8 Jul 2023 09:25:26 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 08 05:25:26 2023 Received: from localhost ([127.0.0.1]:44290 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qI4By-0000bn-H1 for submit <at> debbugs.gnu.org; Sat, 08 Jul 2023 05:25:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57936) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1qI4Bv-0000bX-8u for 64531 <at> debbugs.gnu.org; Sat, 08 Jul 2023 05:25:25 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1qI4Bp-0000tb-Co; Sat, 08 Jul 2023 05:25:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=cdVPtK+l5baK0S7C3TiSqRA3OHv8Vic5hA7385tF7eQ=; b=EiVhkh3KYSp8 GMEMAuztPzSWr9Je3e6ZdUbD2Arlgc8iwDakHhSYQtspBScjii74f/bAWpyA1vEhrVbi7m8TbrUhr AJp3V5zT8VKAHmoub6UFQmgxCP0aKNf/3OLAqj2sD2jY51ieES0VHEBU0F+4doK06zn7n6icTpMWQ cA023YJC3j39jTmajgzXjYGbtnG6HaDmuhHyM7i+FWPK/apa7B3FIsjbeAjLVFOaT7mq1UnxAaTJu zM4TzLN7E9//aA2yN6WUrErnJW/ITSBUXiz8pGwt3tQ7J3ZNzb39649/o6x6faPGZHfhjJiVXl9Fe coAvIafkk+jqg3llMyd5oA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <eliz@HIDDEN>) id 1qI4Bi-0004el-Ht; Sat, 08 Jul 2023 05:25:11 -0400 Date: Sat, 08 Jul 2023 12:25:13 +0300 Message-Id: <83jzvadabq.fsf@HIDDEN> From: Eli Zaretskii <eliz@HIDDEN> To: Ivan Sokolov <ivan-p-sokolov@HIDDEN> In-Reply-To: <87bkgmq1ra.fsf@HIDDEN> (message from Ivan Sokolov on Sat, 08 Jul 2023 10:51:53 +0300) Subject: Re: bug#64531: [PATCH] Add new command vc-dir-copy-filename-as-kill References: <87bkgmq1ra.fsf@HIDDEN> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 64531 Cc: 64531 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) > From: Ivan Sokolov <ivan-p-sokolov@HIDDEN> > Date: Sat, 08 Jul 2023 10:51:53 +0300 > > This new command is inspired by `dired-copy-filename-as-kill', but has a > few differences, that can be easily reversed if there is such need. > > Changes: > 1. even single filename is quoted; > 2. filenames are relative by default, prefix makes them absolute; > 3. value of prefix argument does not matter, in dired it has to be 0. > > I bound it to the `w' key because `w' is currently unbound in > vc-dir-mode-map and it is what is used in dired. Thanks. However, new commands should be called out in NEWS, and commands that are important enough should also be mentioned in the user manual. > +(defun vc-dir-copy-filename-as-kill (&optional absolutep) > + "Copy names of marked files (or file under cursor) into the kill ring. This sentence is too general: it doesn't mention VC Dir, although AFAIU it is specific to vc-dir.
bug-gnu-emacs@HIDDEN
:bug#64531
; Package emacs
.
Full text available.Received: (at submit) by debbugs.gnu.org; 8 Jul 2023 07:52:31 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 08 03:52:31 2023 Received: from localhost ([127.0.0.1]:44239 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1qI2k3-0006iV-Ah for submit <at> debbugs.gnu.org; Sat, 08 Jul 2023 03:52:31 -0400 Received: from lists.gnu.org ([209.51.188.17]:42078) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ivan-p-sokolov@HIDDEN>) id 1qI2k0-0006iK-Sh for submit <at> debbugs.gnu.org; Sat, 08 Jul 2023 03:52:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ivan-p-sokolov@HIDDEN>) id 1qI2k0-0001kq-M3 for bug-gnu-emacs@HIDDEN; Sat, 08 Jul 2023 03:52:28 -0400 Received: from forward102b.mail.yandex.net ([2a02:6b8:c02:900:1:45:d181:d102]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ivan-p-sokolov@HIDDEN>) id 1qI2jw-0003Ze-U1 for bug-gnu-emacs@HIDDEN; Sat, 08 Jul 2023 03:52:28 -0400 Received: from mail-nwsmtp-smtp-production-main-29.myt.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-29.myt.yp-c.yandex.net [IPv6:2a02:6b8:c12:3faf:0:640:537b:0]) by forward102b.mail.yandex.net (Yandex) with ESMTP id 7038860043 for <bug-gnu-emacs@HIDDEN>; Sat, 8 Jul 2023 10:52:17 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-29.myt.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id 7qQkXH7DTiE0-V7tI57ST; Sat, 08 Jul 2023 10:52:15 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ya.ru; s=mail; t=1688802736; bh=4q4vo5pWJjU5Cwng/SH7W0NYIfQ9UIxmL1HbxrTWvp4=; h=Message-ID:Date:Subject:To:From; b=neR9XJEcC8bBRvmtpqInQCKZ4mUMBJDGEAEtZN+H+1d8IrqMKqrM41rk1AeRcOjjb XfSEqyeFvubm9OKbhBvim09ISWKrsNoycqW5xcM4tWtoHzNPBG1T7zHumVILRIenSz P+ecVO0JF8ZZiLzwRRPaC5NDeG6OaB4IHCzNn16Y= Authentication-Results: mail-nwsmtp-smtp-production-main-29.myt.yp-c.yandex.net; dkim=pass header.i=@ya.ru From: Ivan Sokolov <ivan-p-sokolov@HIDDEN> To: bug-gnu-emacs@HIDDEN Subject: [PATCH] Add new command vc-dir-copy-filename-as-kill Date: Sat, 08 Jul 2023 10:51:53 +0300 Message-ID: <87bkgmq1ra.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a02:6b8:c02:900:1:45:d181:d102; envelope-from=ivan-p-sokolov@HIDDEN; helo=forward102b.mail.yandex.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain Hi! This new command is inspired by `dired-copy-filename-as-kill', but has a few differences, that can be easily reversed if there is such need. Changes: 1. even single filename is quoted; 2. filenames are relative by default, prefix makes them absolute; 3. value of prefix argument does not matter, in dired it has to be 0. I bound it to the `w' key because `w' is currently unbound in vc-dir-mode-map and it is what is used in dired. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-new-command-vc-dir-copy-filename-as-kill.patch Content-Description: [PATCH] Add new command vc-dir-copy-filename-as-kill From d2edc8052d3f8a34b4f28f6721cb2b2ceca1d4a5 Mon Sep 17 00:00:00 2001 From: Ivan Sokolov <ivan-p-sokolov@HIDDEN> Date: Sat, 8 Jul 2023 10:34:18 +0300 Subject: [PATCH] Add new command vc-dir-copy-filename-as-kill --- lisp/vc/vc-dir.el | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index 53d58870b32..e348f1027ab 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -353,6 +353,7 @@ See `run-hooks'." (define-key map (kbd "M-s a C-s") #'vc-dir-isearch) (define-key map (kbd "M-s a M-C-s") #'vc-dir-isearch-regexp) (define-key map "G" #'vc-dir-ignore) + (define-key map "w" #'vc-dir-copy-filename-as-kill) (let ((branch-map (make-sparse-keymap))) (define-key map "b" branch-map) @@ -930,6 +931,24 @@ system." (interactive) (view-file (vc-dir-current-file))) +(defun vc-dir-copy-filename-as-kill (&optional absolutep) + "Copy names of marked files (or file under cursor) into the kill ring. +If there are severals names, they will be separated by a space. +Names are always quoted using `shell-quote-argument'. + +If ABSOLUTEP use the absolute names, otherwise names are relative +to the `default-directory'." + (interactive "P") + (let ((files (or (vc-dir-marked-files) + (list (vc-dir-current-file))))) + (unless absolutep + (setq files (mapcar #'file-relative-name files))) + (let ((string (mapconcat #'shell-quote-argument files " "))) + (if (eq last-command 'kill-region) + (kill-append string nil) + (kill-new string)) + (message "%s" string)))) + (defun vc-dir-isearch () "Search for a string through all marked buffers using Isearch." (interactive) -- 2.40.1 --=-=-=--
Ivan Sokolov <ivan-p-sokolov@HIDDEN>
:bug-gnu-emacs@HIDDEN
.
Full text available.bug-gnu-emacs@HIDDEN
:bug#64531
; Package emacs
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.