GNU bug report logs - #66260
29.0.92; project.el should support copying a file path relative to the project root

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: sbaugh@HIDDEN; dated Thu, 28 Sep 2023 23:28:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 66260 <at> debbugs.gnu.org:


Received: (at 66260) by debbugs.gnu.org; 2 Oct 2023 06:59:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 02 02:59:53 2023
Received: from localhost ([127.0.0.1]:35819 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qnCuG-0006VW-ND
	for submit <at> debbugs.gnu.org; Mon, 02 Oct 2023 02:59:52 -0400
Received: from relay1-d.mail.gandi.net ([217.70.183.193]:49015)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1qnCuE-0006V1-D3
 for 66260 <at> debbugs.gnu.org; Mon, 02 Oct 2023 02:59:50 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id 26570240005;
 Mon,  2 Oct 2023 06:59:25 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#66260: 29.0.92; project.el should support copying a file
 path relative to the project root
In-Reply-To: <834jj98t3b.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 02 Oct
 2023 08:57:12 +0300")
Organization: LINKOV.NET
References: <875y3t2827.fsf@HIDDEN>
 <15010505-0b2f-5dc3-e16a-228183779d43@HIDDEN>
 <834jj98t3b.fsf@HIDDEN>
Date: Mon, 02 Oct 2023 09:53:41 +0300
Message-ID: <865y3pqzoa.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 66260
Cc: Dmitry Gutov <dmitry@HIDDEN>, 66260 <at> debbugs.gnu.org, sbaugh@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 (-)

>> 'C-x p w' does make sense as such, but it would be unfortunate if we
>> find a more important command later which fits the 'w' mnemonics. Maybe
>> 'C-x p W' would be a more conservative choice.
>
> Or even "C-x p C-w".

Or 'C-x p C-c' like 'c' in Info-mode-map for Info-copy-current-node-name.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#66260; Package emacs. Full text available.

Message received at 66260 <at> debbugs.gnu.org:


Received: (at 66260) by debbugs.gnu.org; 2 Oct 2023 05:57:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 02 01:57:35 2023
Received: from localhost ([127.0.0.1]:35764 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qnBvz-0004gg-1E
	for submit <at> debbugs.gnu.org; Mon, 02 Oct 2023 01:57:35 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:52700)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qnBvx-0004gR-BE
 for 66260 <at> debbugs.gnu.org; Mon, 02 Oct 2023 01:57:33 -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 1qnBvb-0001zW-Ho; Mon, 02 Oct 2023 01:57:11 -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=XQ6nXQkcc8JmB+7bjwZeXtTf6hbiP0eKQP1+K8yrafw=; b=jYUpYLcAY3mm
 oI9N7Mc98BGRl8c4Y3wlxvc5G9iMWe5qIFln7A2LsTw02QfNLHH7QVHTrV6QTmwgRT6PW5mT+7A4Y
 mg2Va9f8LRKsSryEo0iaB08ePPhuLFIBmgpgX0lUMBZ2V91fsEuDWH5SJ2ANfjsnGibugOo4b75aQ
 iJm8vwCT+cc0yBjPI1w11+1HKmPhjJj+qNtxgkLELkvoF3dRvqSaucVeM9nKfcfwKH1bZqUHdYAKs
 tF1Rw8RD+6hpbrnFX9xLxpYSevLz4mCpNJKGIsygZLypeg6MxvHG1ANw4Ie0NiTs3QDnxRWI71BSb
 py8xhNoB25KcurUHKxrj2Q==;
Date: Mon, 02 Oct 2023 08:57:12 +0300
Message-Id: <834jj98t3b.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dmitry Gutov <dmitry@HIDDEN>
In-Reply-To: <15010505-0b2f-5dc3-e16a-228183779d43@HIDDEN> (message from
 Dmitry Gutov on Mon, 2 Oct 2023 01:44:38 +0300)
Subject: Re: bug#66260: 29.0.92;
 project.el should support copying a file path relative to the project
 root
References: <875y3t2827.fsf@HIDDEN>
 <15010505-0b2f-5dc3-e16a-228183779d43@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 66260
Cc: sbaugh@HIDDEN, 66260 <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 (---)

> Date: Mon, 2 Oct 2023 01:44:38 +0300
> From: Dmitry Gutov <dmitry@HIDDEN>
> 
> 'C-x p w' does make sense as such, but it would be unfortunate if we 
> find a more important command later which fits the 'w' mnemonics. Maybe 
> 'C-x p W' would be a more conservative choice.

Or even "C-x p C-w".




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#66260; Package emacs. Full text available.

Message received at 66260 <at> debbugs.gnu.org:


Received: (at 66260) by debbugs.gnu.org; 1 Oct 2023 22:45:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 01 18:45:08 2023
Received: from localhost ([127.0.0.1]:35534 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qn5BU-0005L6-Fk
	for submit <at> debbugs.gnu.org; Sun, 01 Oct 2023 18:45:08 -0400
Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:52917)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dmitry@HIDDEN>) id 1qn5BR-0005KD-H9
 for 66260 <at> debbugs.gnu.org; Sun, 01 Oct 2023 18:45:06 -0400
Received: from compute6.internal (compute6.nyi.internal [10.202.2.47])
 by mailout.west.internal (Postfix) with ESMTP id 37AFE32011CD;
 Sun,  1 Oct 2023 18:44:43 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute6.internal (MEProxy); Sun, 01 Oct 2023 18:44:43 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc
 :content-transfer-encoding:content-type: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=
 1696200282; x=1696286682; bh=l7hi23flo/Qb88PHYq3VFi8QO/vH7QJGLpn
 Concwed4=; b=X2yLRQcqLKih7lrEUoO5XfqeYTYGaVRZoGmtKsOPrn4tu6umYTv
 VQCGtyeKKtLQ8E1tdnoMCDUKN+wtVIel/sZO8gVMqI/YvfVB4w2uw97YbP5ywFXA
 eW/iXs/hNApDWeD6E7v+8mc6XUiK8lteDV9xFSGNQ1TzWL+r7bhj0J3Pz68ZiPWU
 fRKi6TXrWDKjVDE7N/c9uPaWbFRaSYHBhaCk3hHoWD6DAe/KAMNqU3f09kP5dw/T
 HVK/r+DGAUenwUO1YKdkev7HX/vBc14xXmvKEPpjG0rfJTKZ/e8J8Hr6M3vBNOlL
 ezf1qFFc5zBCuoaaZDfPDAFdk6ysSOyYB7Q==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-transfer-encoding:content-type
 :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=1696200282; x=
 1696286682; bh=l7hi23flo/Qb88PHYq3VFi8QO/vH7QJGLpnConcwed4=; b=Q
 bkit+ANl0wWLaiEBvoQdpd7sibTV2pbyrrQTswRrGfj+krXe21RBB4OEUy3OTWhA
 Udg007bte/uEap6qoGkl3gDf5FASh7hTRcfswABpnlBXJEtUFUMo5gdFDffd+XeL
 j4Rl/SoXsX265oeyMkf61E90YL/IK42B5tYKbOYVELfUBSM51/kkUbFqjBZBkn9Z
 lB9t3ToYy8cQCkKjnxhr2ZtWWpX8G0WRED/ays4V3Xp1XqT7dQzU7BELjoAQepHz
 V5y+dpqCFFNUGwMZpTP7rYxg8ugSN9mN7zVEUJDIAjWL6nVxpmtJ92MH0XYiTLAC
 401cAnLUteeTOiItrlLVw==
X-ME-Sender: <xms:WvYZZW9QTw0jtEVT4bycf2sXnYsqiHrAjOD61fNWfDk_BtXCDIgFAQ>
 <xme:WvYZZWsVU52IVNwLUKhGFUjiFdfIOvWMo_6eZRLfSMP_ih8VxQHDZWhPlmAu7fd2c
 r02Af72_yM-B43qe9Q>
X-ME-Received: <xmr:WvYZZcCYoiGDKZVz7Ac-gYTFCGHkubKwbW_Q8toU_PEDa81uLYhisBKUgWPKywE>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeggddugecutefuodetggdotefrodftvf
 curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
 uegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvfhfhjggtgfesthejre
 dttdefjeenucfhrhhomhepffhmihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhht
 ohhvrdguvghvqeenucggtffrrghtthgvrhhnpeeghedthedujeeiteeutddtjeekheejte
 eukeehffdutdejuedvfeevueevieduudenucevlhhushhtvghrufhiiigvpedtnecurfgr
 rhgrmhepmhgrihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvh
X-ME-Proxy: <xmx:WvYZZef1Wv2XD22s2J9JyT0aUMkXRDEgrLqvUDbeSugcTWivUMz21A>
 <xmx:WvYZZbMB4NcZBiR_3p3B5OZsNKostV574IDc0W2519NvlDAszB8TQQ>
 <xmx:WvYZZYkn0ndLAamYegiHzrZPk8_aqDu8HdyJpxtKQZSf_si2WsLiXg>
 <xmx:WvYZZdUN4s4vn2P2zn4QirPxX8NauyJXiG5PZkEpDBWnZs2_goLW4g>
Feedback-ID: i0e71465a:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun,
 1 Oct 2023 18:44:41 -0400 (EDT)
Message-ID: <15010505-0b2f-5dc3-e16a-228183779d43@HIDDEN>
Date: Mon, 2 Oct 2023 01:44:38 +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#66260: 29.0.92; project.el should support copying a file path
 relative to the project root
Content-Language: en-US
To: sbaugh@HIDDEN, 66260 <at> debbugs.gnu.org
References: <875y3t2827.fsf@HIDDEN>
From: Dmitry Gutov <dmitry@HIDDEN>
In-Reply-To: <875y3t2827.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.2 (--)
X-Debbugs-Envelope-To: 66260
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 29/09/2023 02:26, sbaugh@HIDDEN wrote:
> When communicating with others, it is often useful to copy a file path
> to the current file which is relative to the project root.  For example
> I'd rather send someone the path lisp/progmodes/project.el than
> ~/src/emacs/trunk/lisp/progmodes/project.el.
> 
> project.el should have a way to copy this file path.
> 
> Almost good enough is:
> 
>   C-x p f       ;; project-find-file
>   M-n	       ;; next-history-element
>   C-k	       ;; kill-line
> 
> but with project--read-file-cpd-relative, if all the files in
> project-files start with a common-parent-directory which is a
> subdirectory of project-root, the resulting file path will not be
> relative to the project-root but to the subdirectory.

A problem with modifying the above function's behavior like that is that 
sometimes it is passed a wider range of file names, where not all of 
them are inside the project root (M-x project-or-external-find-file).

> Maybe the thing to do is just make project--read-file-cpd-relative use
> project-root instead of calculating a common-parent-directory?  I would
> be happy to make that patch if that's acceptable.  I think that's
> probably the best option.
> 
> Alternatively, it might be cool if there was a variation on:
> 
>   C-x C-j     ;; dired-jump
>   M-0	     ;; digit-argument
>   w	     ;; dired-copy-filename-as-kill
> 
> (which copies an absolute path) to instead copy a project-root-relative
> path.

This is unfortunately less discoverable, but sounds good otherwise.

Regarding the potential binding (discussed further downthread), I have 
no opinion: copying the relative name doesn't happen too often for me, 
and when it does, I can usually do that from the VC-Dir buffer (where 
the file in question would usually be 'edited'). Should we add 'w' to 
vc-dir-mode too?

'C-x p w' does make sense as such, but it would be unfortunate if we 
find a more important command later which fits the 'w' mnemonics. Maybe 
'C-x p W' would be a more conservative choice.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#66260; Package emacs. Full text available.
Severity set to 'wishlist' from 'normal' Request was from Stefan Kangas <stefankangas@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 66260 <at> debbugs.gnu.org:


Received: (at 66260) by debbugs.gnu.org; 30 Sep 2023 15:18:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 30 11:18:19 2023
Received: from localhost ([127.0.0.1]:59658 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qmbjW-0006Sx-Mp
	for submit <at> debbugs.gnu.org; Sat, 30 Sep 2023 11:18:18 -0400
Received: from s.wrqvtzvf.outbound-mail.sendgrid.net ([149.72.126.143]:56910)
 by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from
 <bounces+21787432-c45f-66260=debbugs.gnu.org@HIDDEN>)
 id 1qmbjU-0006Sh-EN
 for 66260 <at> debbugs.gnu.org; Sat, 30 Sep 2023 11:18:17 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=catern.com;
 h=from:subject:in-reply-to:references:mime-version:to:cc:content-type:
 content-transfer-encoding:cc:content-type:from:subject:to;
 s=s1; bh=HV0ZwOFEIUdunMV8n94MNW9FtlpMULjNqon/+q9uGvo=;
 b=xh7yS/17qrN0nZceolu8IsCbH8cjBZUq0QvIo1aoTbUWwU/fTxbPSa6rsU9vGr8usSjO
 qFkGZ0pUbraKPkv/lsg8x//FnxWQWBohaeL+BF0T32XhZU4CiRUBZfGVQ0+5xWc0v0nQ8g
 4KPvdsNMNRgW2glSIpy0szrbPIOddpS0bC1SLgebvt9EGNRzdPcUi1knyTyy/xGNySI54c
 aSRB6yi04SbvHwToOh7SlkCel1YS/EfzjYrjxMDFsKxYPd6Cn1TsE7Rb66cRB9uA1KG/o2
 haa9gb4Euu63FqGMaCCPE/suY6caJZCMwzwuOM+B66VAxeft5UYWmdUgtXRO2YSw==
Received: by filterdrecv-8684c58db7-nd6mk with SMTP id
 filterdrecv-8684c58db7-nd6mk-1-65183C22-15
 2023-09-30 15:17:54.754758172 +0000 UTC m=+759092.505623576
Received: from earth.catern.com (unknown) by geopod-ismtpd-23 (SG) with ESMTP
 id 98bRTk0vRROytNB0gvWJQg Sat, 30 Sep 2023 15:17:54.487 +0000 (UTC)
X-Comment: SPF check N/A for local connections - client-ip=::1; helo=localhost;
 envelope-from=sbaugh@HIDDEN; receiver=eshelyaron.com 
Received: from localhost (localhost [IPv6:::1])
 by earth.catern.com (Postfix) with ESMTPSA id F155965929;
 Sat, 30 Sep 2023 11:17:53 -0400 (EDT)
From: sbaugh@HIDDEN
Subject: Re: bug#66260: 29.0.92; project.el should support copying a file path
 relative to the project root
In-Reply-To: <m1a5t3hg5l.fsf@HIDDEN> (Eshel Yaron's message of "Sat,
 30 Sep 2023 16:47:18 +0200")
References: <875y3t2827.fsf@HIDDEN> <86il7tihzl.fsf@HIDDEN>
 <8734yv22jb.fsf@HIDDEN> <m1a5t3hg5l.fsf@HIDDEN>
Date: Sat, 30 Sep 2023 15:17:54 +0000 (UTC)
Message-ID: <87zg13zo4e.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
X-SG-EID: =?us-ascii?Q?ZgbRq7gjGrt0q=2FPjvxk7wM0yQFRdOkTJAtEbkjCkHbK07N+nhvoRc2TBCIawc+?=
 =?us-ascii?Q?4QTIcHvf8hdmzV5jd2kfLEK7xozg4ZJQ229r4kG?=
 =?us-ascii?Q?3h+WhH6C=2FiZpJ9PfCFcpJ8+Tfls5X5NYQCpLpbx?=
 =?us-ascii?Q?=2FqvmesnuWLwZLeWiN7cll5Pn9+qMWdEgWC6T3bp?=
 =?us-ascii?Q?tUZF9F+Gr29b2ZSIdLvOfZDTg2jrKrGZBfQ=3D=3D?=
To: Eshel Yaron <me@HIDDEN>
X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q==
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 66260
Cc: 66260 <at> debbugs.gnu.org, Juri Linkov <juri@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 (-)

Eshel Yaron <me@HIDDEN> writes:
> Hi,
>
> sbaugh@HIDDEN writes:
>
>> Juri Linkov <juri@HIDDEN> writes:
>>> Sometimes an absolute path is needed too even in project directories.
>>> Maybe it's possible to find a new prefix argument to copy
>>> a project-root-relative path like 'C-u C-u w'?
>>
>> I initially considered M-1 w, but that loses the ability to mark files
>> and then only copy one of them.  C-u C-u seems good.
>
> FWIW I think a separate command and binding would be preferable, namely
> `C-x p w`.  That'd leave `w` intact and clearly indicate the
> project-related nature of the (new) command, so it's arguably more
> intuitive than `C-u C-u w`.  We could also have that binding in
> non-Dired buffers, and have it operate on the visited file.

I don't think there's any need to avoid modifying w, so even if we added
this other C-x p w command, I would still like C-u C-u w to work.  It's
useful when navigating a project tree in dired.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#66260; Package emacs. Full text available.

Message received at 66260 <at> debbugs.gnu.org:


Received: (at 66260) by debbugs.gnu.org; 30 Sep 2023 14:47:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 30 10:47:41 2023
Received: from localhost ([127.0.0.1]:59634 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qmbFs-0005RB-EL
	for submit <at> debbugs.gnu.org; Sat, 30 Sep 2023 10:47:41 -0400
Received: from mail.eshelyaron.com ([107.175.124.16]:55010 helo=eshelyaron.com)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <me@HIDDEN>) id 1qmbFo-0005R0-Dh
 for 66260 <at> debbugs.gnu.org; Sat, 30 Sep 2023 10:47:40 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com;
 s=mail; t=1696085240;
 bh=2HtsINsXmFMaXJB+otLVTXKWJruZi+67mxsJl1twMaM=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=gLyOku07UXiRpUudpjyYWyi0qLJ8AGtTH2QC6OBhlWkGRmeK9H21DqVBJ3LInUTAk
 /pWSnQOfrLJ+8TTqQR0CrVo31XNz31NmhigL1uZXNkqEhGYJJHNumG0DjERXYl+1rD
 xQ0fllZBXDiLJJb9ustP8G5aBK1jUqRX0GHHZ1eq/s/IT/IarrJPQ29cmogEGjMCuF
 di49/3L2+qI89pUt7CILfllr/yf9Cy0Jg3kKw+p8wZRUjzVZ8WvEGGQFsajDED1XX/
 VOjnZHY5igr2iNnWxsExBr0uUJ1pbFQ92niAK6MxWELdDJP5qsSyu3nUbqkEoFpgRp
 D7wxbSm+ZcWbA==
From: Eshel Yaron <me@HIDDEN>
To: sbaugh@HIDDEN
Subject: Re: bug#66260: 29.0.92; project.el should support copying a file
 path relative to the project root
In-Reply-To: <8734yv22jb.fsf@HIDDEN> (sbaugh@HIDDEN's message of "Sat, 
 30 Sep 2023 13:50:33 +0000 (UTC)")
References: <875y3t2827.fsf@HIDDEN> <86il7tihzl.fsf@HIDDEN>
 <8734yv22jb.fsf@HIDDEN>
X-Hashcash: 1:20:230930:sbaugh@HIDDEN::axFEve5tmRw+EWxU:0ggf
X-Hashcash: 1:20:230930:juri@HIDDEN::LH2uu6EjfzIrffQG:4DU0
X-Hashcash: 1:20:230930:66260 <at> debbugs.gnu.org::9xw2PEQ+hjcmBKer:E8E/
Date: Sat, 30 Sep 2023 16:47:18 +0200
Message-ID: <m1a5t3hg5l.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: 66260
Cc: 66260 <at> debbugs.gnu.org, Juri Linkov <juri@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 (-)

Hi,

sbaugh@HIDDEN writes:

> Juri Linkov <juri@HIDDEN> writes:
>> Sometimes an absolute path is needed too even in project directories.
>> Maybe it's possible to find a new prefix argument to copy
>> a project-root-relative path like 'C-u C-u w'?
>
> I initially considered M-1 w, but that loses the ability to mark files
> and then only copy one of them.  C-u C-u seems good.

FWIW I think a separate command and binding would be preferable, namely
`C-x p w`.  That'd leave `w` intact and clearly indicate the
project-related nature of the (new) command, so it's arguably more
intuitive than `C-u C-u w`.  We could also have that binding in
non-Dired buffers, and have it operate on the visited file.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#66260; Package emacs. Full text available.

Message received at 66260 <at> debbugs.gnu.org:


Received: (at 66260) by debbugs.gnu.org; 30 Sep 2023 13:51:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 30 09:51:02 2023
Received: from localhost ([127.0.0.1]:57863 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qmaN4-0003R3-9T
	for submit <at> debbugs.gnu.org; Sat, 30 Sep 2023 09:51:02 -0400
Received: from s.wrqvtzvf.outbound-mail.sendgrid.net ([149.72.126.143]:2992)
 by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from
 <bounces+21787432-c45f-66260=debbugs.gnu.org@HIDDEN>)
 id 1qmaMy-0003QR-0l
 for 66260 <at> debbugs.gnu.org; Sat, 30 Sep 2023 09:51:01 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=catern.com;
 h=from:subject:in-reply-to:references:mime-version:to:cc:content-type:
 cc:content-type:from:subject:to;
 s=s1; bh=ycrKjgIrgy/YbmoYkSfUsAW4qi9QI5BMC0aFviQmJ94=;
 b=Ulo3VQKhKM3MOwi7GNMGeYMcg99VuY06PNx8PSPz0ivhGkghBvmW0JvHkcR+2maQdFal
 +32xTcqiaKQhRDvm9quGKRccoZSkC4aY1ICaBG862hD11HczOIIx7p5hfcO9cvq9frBup6
 xr9RSjLYskfsV77yWsXiYek/q85bqJfAhJgcD9S7Z/v5RV6ffsWT04AFOetqckOnfTuKDU
 n+39NSHT3OA6kuH1wIV2FWf86VVzibrnHP2j4kLcMnXCxv/EO7Cn23obJr55azLcZZ33pk
 5t9df01VZfoz1m/mqTaL0c04OfPU0glCQsdrnLHryZd08Mis4HQi9s6mtvFfQqag==
Received: by filterdrecv-8684c58db7-5vsrj with SMTP id
 filterdrecv-8684c58db7-5vsrj-1-651827A9-16
 2023-09-30 13:50:33.555806704 +0000 UTC m=+238988.294772895
Received: from earth.catern.com (unknown) by geopod-ismtpd-32 (SG) with ESMTP
 id RhOrKL30Q0iwGjFdxyR5DA Sat, 30 Sep 2023 13:50:33.227 +0000 (UTC)
X-Comment: SPF check N/A for local connections - client-ip=::1; helo=localhost;
 envelope-from=sbaugh@HIDDEN; receiver=linkov.net 
Received: from localhost (localhost [IPv6:::1])
 by earth.catern.com (Postfix) with ESMTPSA id 890A36584B;
 Sat, 30 Sep 2023 09:50:32 -0400 (EDT)
From: sbaugh@HIDDEN
Subject: Re: bug#66260: 29.0.92; project.el should support copying a file path
 relative to the project root
In-Reply-To: <86il7tihzl.fsf@HIDDEN> (Juri Linkov's message of "Fri, 
 29 Sep 2023 09:57:50 +0300")
References: <875y3t2827.fsf@HIDDEN> <86il7tihzl.fsf@HIDDEN>
Date: Sat, 30 Sep 2023 13:50:33 +0000 (UTC)
Message-ID: <8734yv22jb.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
X-SG-EID: =?us-ascii?Q?ZgbRq7gjGrt0q=2FPjvxk7wM0yQFRdOkTJAtEbkjCkHbLDZ4OA+uecRKF6HGxytE?=
 =?us-ascii?Q?24Dlu5Y8Kx=2FB=2FAIOFnAkTqGjOAkCaZUnuNmmpqg?=
 =?us-ascii?Q?SfainFy4ifqxV74vsDj40xFG=2FniYAGvv9kRyLmm?=
 =?us-ascii?Q?NulGm=2FxYgmZX=2FlGOqXvqgkNyPZNwjbHfk2jW47Y?=
 =?us-ascii?Q?jdbCiAK60KY=2FAm16UitvD5+yyMNTN3bnGog=3D=3D?=
To: Juri Linkov <juri@HIDDEN>
X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q==
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 66260
Cc: 66260 <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; charset=us-ascii
Content-Transfer-Encoding: 7bit

Juri Linkov <juri@HIDDEN> writes:
> Sometimes an absolute path is needed too even in project directories.
> Maybe it's possible to find a new prefix argument to copy
> a project-root-relative path like 'C-u C-u w'?

I initially considered M-1 w, but that loses the ability to mark files
and then only copy one of them.  C-u C-u seems good.

Here's the implementation.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline;
 filename=0001-Project-support-in-dired-copy-filename-as-kill.patch

From 95bd0a8775284dc59119198b02fcc64b904c4d7f Mon Sep 17 00:00:00 2001
From: Spencer Baugh <sbaugh@HIDDEN>
Date: Sat, 30 Sep 2023 09:49:03 -0400
Subject: [PATCH] Project support in dired-copy-filename-as-kill

It is often useful to get a filename relative to project-root; now it
is easier.

* lisp/dired.el (dired-get-filename): Support 'project.
(dired-copy-filename-as-kill): Make C-u C-u pass 'project.
---
 lisp/dired.el | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/lisp/dired.el b/lisp/dired.el
index cc8c74839b9..cc2cf24fac2 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -3016,6 +3016,12 @@ dired-get-filename
 	(if (and handler (not (get handler 'safe-magic)))
 	    (concat "/:" file)
 	  file)))
+     ((eq localp 'project)
+      (if-let ((project (project-current nil (dired-current-directory))))
+          (file-relative-name
+           (concat (dired-current-directory) file)
+           (project-root project))
+        (concat (dired-current-directory t) file)))
      (t
       (concat (dired-current-directory localp) file)))))
 
@@ -3240,6 +3246,7 @@ dired-copy-filename-as-kill
 With a zero prefix arg, use the absolute file name of each marked file.
 With \\[universal-argument], use the file name relative to the Dired buffer's
 `default-directory'.  (This still may contain slashes if in a subdirectory.)
+With \\[universal-argument] \\[universal-argument], use the file name relative to `project-root'.
 
 If on a subdir headerline, use absolute subdirname instead;
 prefix arg and marked files are ignored in this case.
@@ -3251,8 +3258,10 @@ dired-copy-filename-as-kill
               (if arg
                   (cond ((zerop (prefix-numeric-value arg))
                          (dired-get-marked-files))
-                        ((consp arg)
+                        ((and (consp arg) (= 4 (prefix-numeric-value arg)))
                          (dired-get-marked-files t))
+                        ((and (consp arg) (>= 16 (prefix-numeric-value arg)))
+                         (dired-get-marked-files 'project))
                         (t
                          (dired-get-marked-files
 			  'no-dir (prefix-numeric-value arg))))
-- 
2.41.0


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#66260; Package emacs. Full text available.

Message received at 66260 <at> debbugs.gnu.org:


Received: (at 66260) by debbugs.gnu.org; 29 Sep 2023 07:00:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 29 03:00:13 2023
Received: from localhost ([127.0.0.1]:55025 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qm7Tu-0000n4-5H
	for submit <at> debbugs.gnu.org; Fri, 29 Sep 2023 03:00:13 -0400
Received: from relay8-d.mail.gandi.net ([2001:4b98:dc4:8::228]:52981)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1qm7Tp-0000kt-Kc
 for 66260 <at> debbugs.gnu.org; Fri, 29 Sep 2023 03:00:08 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id 831A21BF206;
 Fri, 29 Sep 2023 06:59:40 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: sbaugh@HIDDEN
Subject: Re: bug#66260: 29.0.92; project.el should support copying a file
 path relative to the project root
In-Reply-To: <875y3t2827.fsf@HIDDEN> (sbaugh@HIDDEN's message of "Thu, 
 28 Sep 2023 23:26:41 +0000 (UTC)")
Organization: LINKOV.NET
References: <875y3t2827.fsf@HIDDEN>
Date: Fri, 29 Sep 2023 09:57:50 +0300
Message-ID: <86il7tihzl.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 66260
Cc: 66260 <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.7 (-)

> When communicating with others, it is often useful to copy a file path
> to the current file which is relative to the project root.  For example
> I'd rather send someone the path lisp/progmodes/project.el than
> ~/src/emacs/trunk/lisp/progmodes/project.el.

I have the same problem.  Often for a project directory I give
a name of the current branch, but later after switching branches
sending an absolute file path with an obsolete directory name
would be very confusing.  So every time need to spend too much time
manually removing the prefix.

> project.el should have a way to copy this file path.
>
> Almost good enough is:
>
>  C-x p f       ;; project-find-file
>  M-n	       ;; next-history-element
>  C-k	       ;; kill-line
>
> but with project--read-file-cpd-relative, if all the files in
> project-files start with a common-parent-directory which is a
> subdirectory of project-root, the resulting file path will not be
> relative to the project-root but to the subdirectory.
>
> Maybe the thing to do is just make project--read-file-cpd-relative use
> project-root instead of calculating a common-parent-directory?  I would
> be happy to make that patch if that's acceptable.  I think that's
> probably the best option.

Sorry, I have no opinion about the option above, because I always use
dired-copy-filename-as-kill with the zero prefix argument:

> Alternatively, it might be cool if there was a variation on:
>
>  C-x C-j     ;; dired-jump
>  M-0	     ;; digit-argument
>  w	     ;; dired-copy-filename-as-kill
>
> (which copies an absolute path) to instead copy a project-root-relative
> path.

Sometimes an absolute path is needed too even in project directories.
Maybe it's possible to find a new prefix argument to copy
a project-root-relative path like 'C-u C-u w'?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#66260; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 28 Sep 2023 23:27:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 28 19:27:22 2023
Received: from localhost ([127.0.0.1]:54709 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qm0PX-0003vm-FL
	for submit <at> debbugs.gnu.org; Thu, 28 Sep 2023 19:27:22 -0400
Received: from lists.gnu.org ([2001:470:142::17]:36944)
 by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from
 <bounces+21787432-3678-bug-gnu-emacs=gnu.org@HIDDEN>)
 id 1qm0PS-0003vD-Q8
 for submit <at> debbugs.gnu.org; Thu, 28 Sep 2023 19:27:10 -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
 <bounces+21787432-3678-bug-gnu-emacs=gnu.org@HIDDEN>)
 id 1qm0P8-0003xR-MB
 for bug-gnu-emacs@HIDDEN; Thu, 28 Sep 2023 19:26:46 -0400
Received: from s.wrqvwxzv.outbound-mail.sendgrid.net ([149.72.154.232])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from
 <bounces+21787432-3678-bug-gnu-emacs=gnu.org@HIDDEN>)
 id 1qm0P6-0007cV-8y
 for bug-gnu-emacs@HIDDEN; Thu, 28 Sep 2023 19:26:46 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=catern.com;
 h=from:subject:mime-version:to:content-type:content-transfer-encoding:
 cc:content-type:from:subject:to;
 s=s1; bh=u7mLK1BfEfoVJNLJKfrnHKgJydTizx3o74adj0HwIds=;
 b=FgtIqZHLwu/+6ROY7dBQ2q7MFnWVM2upu/W10oJcC1l/HDtubQJ9FJZuzkSPlPKFeTcG
 x9TwoI8XUJ/T3WJyE2vPQmeAt0ltrs3AYJ3dCkUkN5vrSe5HCzARt7y1ZX9iQ8EQyepII/
 sbg1HHT2I3Qg/Wa0oFRpCkzhMU2zcHO40psdCINz74er8/RsrnfoWFENNxEn6PbGd9L6qQ
 rWXjsssF8nTdzk/Cjf57GCPCKTJdDbfGDsGARlbC6yzJTHSiTk67VoNg1hYVYFX17xUxiy
 RoNggTq4CeHYn3H7fQ4snUoEB1xMPTjyQXa9OdazepPjF2gOLKawRLOsB8dsCiKQ==
Received: by filterdrecv-84b96456cb-qhzcj with SMTP id
 filterdrecv-84b96456cb-qhzcj-1-65160BB1-1A
 2023-09-28 23:26:41.940779837 +0000 UTC m=+615615.031687384
Received: from earth.catern.com (unknown) by geopod-ismtpd-0 (SG) with ESMTP
 id ppYzs7siQHGRjvMs27vRgA for <bug-gnu-emacs@HIDDEN>;
 Thu, 28 Sep 2023 23:26:41.667 +0000 (UTC)
X-Comment: SPF check N/A for local connections - client-ip=::1; helo=localhost;
 envelope-from=sbaugh@HIDDEN; receiver=gnu.org 
Received: from localhost (localhost [IPv6:::1])
 by earth.catern.com (Postfix) with ESMTPSA id C40CA6019D
 for <bug-gnu-emacs@HIDDEN>; Thu, 28 Sep 2023 19:26:40 -0400 (EDT)
From: sbaugh@HIDDEN
Subject: 29.0.92; project.el should support copying a file path relative to
 the project root
Date: Thu, 28 Sep 2023 23:26:41 +0000 (UTC)
Message-ID: <875y3t2827.fsf@HIDDEN>
MIME-Version: 1.0
X-SG-EID: =?us-ascii?Q?ZgbRq7gjGrt0q=2FPjvxk7wM0yQFRdOkTJAtEbkjCkHbKMQ6S=2F4gf8r4PqQs9x0q?=
 =?us-ascii?Q?05ke3JXUnDxocy=2FJ8LZ9r0mwyMFP=2FPtcFnvUlCs?=
 =?us-ascii?Q?ndMyWY0dWw9UdaR+AFYAznO3UeDPzWVaBvaq2uS?=
 =?us-ascii?Q?j1MaYxXz3c9WixniVMitmJvhBkti2V=2F48+C8qEN?=
 =?us-ascii?Q?clRR4sWtuJ6Jwy2RYgPCgP8Xhghhj0MZuew=3D=3D?=
To: bug-gnu-emacs@HIDDEN
X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q==
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=149.72.154.232;
 envelope-from=bounces+21787432-3678-bug-gnu-emacs=gnu.org@HIDDEN;
 helo=s.wrqvwxzv.outbound-mail.sendgrid.net
X-Spam_score_int: 6
X-Spam_score: 0.6
X-Spam_bar: /
X-Spam_report: (0.6 / 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, RCVD_IN_BL_SPAMCOP_NET=1.347,
 RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_RPBL=1.31, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 2.2 (++)
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:  When communicating with others, it is often useful to copy
 a file path to the current file which is relative to the project root. For
 example I'd rather send someone the path lisp/progmodes/project.el [...] 
 Content analysis details:   (2.2 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 1.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in
 bl.spamcop.net
 [Blocked - see <https://www.spamcop.net/bl.shtml?149.72.154.232>]
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
 0.0 UNPARSEABLE_RELAY      Informational: message has unparseable relay
 lines
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: -0.0 (/)


When communicating with others, it is often useful to copy a file path
to the current file which is relative to the project root.  For example
I'd rather send someone the path lisp/progmodes/project.el than
~/src/emacs/trunk/lisp/progmodes/project.el.

project.el should have a way to copy this file path.

Almost good enough is:

 C-x p f       ;; project-find-file
 M-n	       ;; next-history-element
 C-k	       ;; kill-line

but with project--read-file-cpd-relative, if all the files in
project-files start with a common-parent-directory which is a
subdirectory of project-root, the resulting file path will not be
relative to the project-root but to the subdirectory.

Maybe the thing to do is just make project--read-file-cpd-relative use
project-root instead of calculating a common-parent-directory?  I would
be happy to make that patch if that's acceptable.  I think that's
probably the best option.

Alternatively, it might be cool if there was a variation on:

 C-x C-j     ;; dired-jump
 M-0	     ;; digit-argument
 w	     ;; dired-copy-filename-as-kill

(which copies an absolute path) to instead copy a project-root-relative
path.


In GNU Emacs 29.0.92 (build 68, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.16.0, Xaw3d scroll bars) of 2023-07-15 built on earth
Repository revision: 36d3460f9f6064c03fd88e0c969c8e4f4d645235
Repository branch: emacs-29
Windowing system distributor 'The X.Org Foundation', version 11.0.12101008
System Description: NixOS 23.05 (Stoat)

Configured using:
 'configure --cache-file=3Dconfig.cache --with-x-toolkit=3Dlucid
 --with-tree-sitter --with-xinput2 CC=3Dgcc PKG_CONFIG=3Dpkg-config
 PKG_CONFIG_PATH=3D/nix/store/s3r15m8wbl4wqk4khqlf41ikryhjm1bi-file-5.44-de=
v/lib/pkgconfig:/nix/store/f9jbn419h46c78z1pi49yn9a8742b0ql-gnutls-3.8.0-de=
v/lib/pkgconfig:/nix/store/knq0pv08wm4dins7m4jh0n7cv7pjvdjr-nettle-3.9.1-de=
v/lib/pkgconfig:/nix/store/dy8p07vrrhdgpnl45xz9c0k0didbikdh-gmp-with-cxx-6.=
2.1-dev/lib/pkgconfig:/nix/store/6hkdabzyqhyq5ypq4c9b2cibr1d1zg1s-harfbuzz-=
7.3.0-dev/lib/pkgconfig:/nix/store/hyns944pqgblw4icskylvlpm5krmfvcr-graphit=
e2-1.3.14-dev/lib/pkgconfig:/nix/store/08cdp9vgvy023ysfa2y01gzsm2jv6phx-jan=
sson-2.14/lib/pkgconfig:/nix/store/nqlbk40lh7igs61l77dwgdkn8dc2akcm-libxml2=
-2.10.4-dev/lib/pkgconfig:/nix/store/b3axl73v3yvqqx7g47njqb5wzxvm280p-zlib-=
1.2.13-dev/lib/pkgconfig:/nix/store/3f2rc4inlcxmq11718qmz94v2rpybw70-ncurse=
s-6.4-dev/lib/pkgconfig:/nix/store/bxy745kyb1fwhpfkiaaz3wgvpkpvwcpq-dbus-1.=
14.8-dev/lib/pkgconfig:/nix/store/9714v7c4cgpm4yqcyqk6n9xw9iq3a1bs-expat-2.=
5.0-dev/lib/pkgconfig:/nix/store/zzi7pcadidqh798yddxv6pwdbwpkikma-libselinu=
x-3.3-dev/lib/pkgconfig:/nix/store/w14j7y5nl14vy4ikcivss35jmrqq3fxj-libotf-=
0.9.16-dev/lib/pkgconfig:/nix/store/arhk7hsch4scyv6m24fw03yq6wq5wbbx-m17n-l=
ib-1.8.2/lib/pkgconfig:/nix/store/1jbbrny8xcjb68lb5m30cvxycfkyhvsv-sqlite-3=
.42.0-dev/lib/pkgconfig:/nix/store/5vx779yqkxaysv48gicwlgv0ippbrhc4-systemd=
-253.5-dev/lib/pkgconfig:/nix/store/5vx779yqkxaysv48gicwlgv0ippbrhc4-system=
d-253.5-dev/share/pkgconfig:/nix/store/djifahvk3qp06ssqxv6gy1ixdnnypr9s-tre=
e-sitter-0.20.8/lib/pkgconfig:/nix/store/74aasy1d2r5y27zn68cs1rxwy1llzn05-l=
ibwebp-1.3.0/lib/pkgconfig:/nix/store/8sk7bp89iwb4gw96fq6xakb6lcy2x52n-Xaw3=
d-1.6.3/lib/pkgconfig:/nix/store/ppvb3ha8148am3ajnzxnm6i3ri38c01n-libXmu-1.=
1.3-dev/lib/pkgconfig:/nix/store/jyxf8cjbj3nzh00x48nfram79i63chdi-libX11-1.=
8.6-dev/lib/pkgconfig:/nix/store/zk9v0nr5zdfi1ybkhcfifmxsng7hfl23-xorgproto=
-2021.5/share/pkgconfig:/nix/store/3q1k18v8aa6mxs538bha4ry0mp3m321l-libxcb-=
1.14-dev/lib/pkgconfig:/nix/store/hcscz68zvfk1skyb25wrnha959f6hhrc-libXt-1.=
2.1-dev/lib/pkgconfig:/nix/store/kl55wj6qc3v481jsgvzm5w2csnhm84zf-libSM-1.2=
.3-dev/lib/pkgconfig:/nix/store/s3f67kvsn55rxp2rc98xv0hkq364yci1-libICE-1.0=
.10-dev/lib/pkgconfig:/nix/store/rsw4ri8025jgln8vpsrmg82bzgbcw3zr-cairo-1.1=
6.0-dev/lib/pkgconfig:/nix/store/jir0rqbcy0d9qr9kf5cwf2yphql4ykyw-fontconfi=
g-2.14.2-dev/lib/pkgconfig:/nix/store/n2g3xblaz1k4civv1z6hhm1nsmp3m17p-free=
type-2.13.0-dev/lib/pkgconfig:/nix/store/isbmyzm2shmp0wsjr4cy45v2i58h2zvw-b=
zip2-1.0.8-dev/lib/pkgconfig:/nix/store/bl2qwy78jr2sqm260imgxmd5dzhjqvag-br=
otli-1.0.9-dev/lib/pkgconfig:/nix/store/z96jh9ag5b3565lwwb5chjb9bfp5i2qv-li=
bpng-apng-1.6.39-dev/lib/pkgconfig:/nix/store/jjd4z18grhky6lh8n463v648nnf56=
28b-pixman-0.42.2/lib/pkgconfig:/nix/store/qd14wrazwcspjv3q65vgh35pl7b8nifq=
-libXext-1.3.4-dev/lib/pkgconfig:/nix/store/gj8i21xx87ip9b971j2d1m0rmrzyhbi=
r-libXau-1.0.9-dev/lib/pkgconfig:/nix/store/4gpinwwdqhi927xkrfpr1hvdd56baxg=
k-libXrender-0.9.10-dev/lib/pkgconfig:/nix/store/d1jbygs6hcn6dysk706i9zf07y=
d18wmr-xcb-util-0.4.1-dev/lib/pkgconfig:/nix/store/hdc4ika0mb1cv0cf6dchwxbr=
004rc50i-glib-2.76.3-dev/lib/pkgconfig:/nix/store/wxyh848a6xcqy2v8727vcwspr=
i53pqwi-libffi-3.4.4-dev/lib/pkgconfig:/nix/store/42jx72681qzliic0xsjhvx24c=
il2gapk-libGL-1.6.0-dev/lib/pkgconfig:/nix/store/b9lmdkxpvgkj6zc956fvhshzis=
qpi767-libglvnd-1.6.0-dev/lib/pkgconfig:/nix/store/gff29sbhg1gcw969mpm5rb69=
3kj5v18w-libXaw-1.0.14-dev/lib/pkgconfig:/nix/store/776xijk8rsb1b4c0dsxwq0k=
82bvm7mm9-libXpm-3.5.15-dev/lib/pkgconfig:/nix/store/qizdmm43xi65mdngal8bpb=
pqcdc8290d-libjpeg-turbo-2.1.5.1-dev/lib/pkgconfig:/nix/store/db7ix62fx4nvr=
9j1fjdvnznl2npff4pr-librsvg-2.55.1-dev/lib/pkgconfig:/nix/store/q0hg0951w1d=
v9y40m9ggln8phwil6lxc-gdk-pixbuf-2.42.10-dev/lib/pkgconfig:/nix/store/34rr5=
nvgljsc4bi3mxjxg8abmjr1f7hn-libtiff-4.5.0-dev/lib/pkgconfig:/nix/store/zwkr=
4kjcjs213pw9mhzi46bzlw6qwxzq-libdeflate-1.18/lib/pkgconfig:/nix/store/6na55=
2yzwml88j8g5vqf5h9ir3vw8myi-xz-5.4.3-dev/lib/pkgconfig
 CXX=3Dg++'

Configured features:
CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON
LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY
PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS
TREE_SITTER WEBP X11 XAW3D XDBE XIM XPM LUCID ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: notmuch-search

Minor modes in effect:
  hl-line-mode: t
  envrc-global-mode: t
  envrc-mode: t
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  shell-dirtrack-mode: t
  server-mode: t
  windmove-mode: t
  pixel-scroll-precision-mode: t
  savehist-mode: t
  save-place-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tab-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  context-menu-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  buffer-read-only: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/home/sbaugh/.emacs.d/elpa/transient-0.3.7/transient hides /home/sbaugh/src=
/emacs/emacs-29/lisp/transient

Features:
(shadow emacsbug wdired tramp-archive tramp-gvfs nov recentf tree-widget
magit-bookmark bookmark esxml-query arc-mode archive-mode dired-aux
dired-x textsec uni-scripts idna-mapping ucs-normalize uni-confusable
textsec-check sort mail-extr em-unix em-term term disp-table ehelp
em-script em-prompt em-ls em-hist em-pred em-glob em-extpipe em-cmpl
em-dirs esh-var em-basic em-banner em-alias esh-mode eshell esh-cmd
esh-ext esh-opt esh-proc esh-io esh-arg esh-module esh-groups esh-util
whitespace log-view pcmpl-unix erc-pcomplete erc-goodies erc erc-backend
erc-networks erc-common erc-compat erc-loaddefs debug backtrace
tramp-cmds cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align
cc-engine cc-vars cc-defs pulse color xref bug-reference completion
cl-print shortdoc help-fns radix-tree pcmpl-linux tramp-cache time-stamp
tramp-sh tramp tramp-loaddefs trampver tramp-integration tramp-compat
mm-archive vc-git package-vc vc vc-dispatcher lisp-mnt network-stream
url-cache url-http url-auth url-gw nsm display-line-numbers org-element
org-persist org-id org-refile avl-tree generator oc-basic ol-eww eww xdg
url-queue mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect
gnus-art mm-uu mml2015 gnus-sum shr pixel-fill kinsoku url-file svg dom
gnus-group gnus-undo gnus-start gnus-dbus dbus xml gnus-cloud nnimap
nnmail mail-source utf7 nnoo parse-time gnus-spec gnus-int gnus-range
gnus-win gnus nnheader range ol-docview doc-view jka-compr image-mode
exif ol-bibtex bibtex iso8601 ol-bbdb ol-w3m ol-doi org-link-doi org
org-macro org-pcomplete org-list org-footnote org-faces org-entities
noutline outline ob-python python compat ob ob-tangle org-src ob-ref
ob-lob ob-table ob-exp ob-comint ob-emacs-lisp ob-core ob-eval org-cycle
org-table ol org-fold org-fold-core org-keys oc org-loaddefs find-func
org-version org-compat org-macs ffap mule-util misearch multi-isearch
notmuch notmuch-tree notmuch-jump notmuch-hello notmuch-show
notmuch-print notmuch-crypto notmuch-mua notmuch-message notmuch-draft
notmuch-maildir-fcc notmuch-address notmuch-company notmuch-parser
notmuch-wash coolj goto-addr icalendar diary-lib diary-loaddefs cal-menu
calendar cal-loaddefs notmuch-tag notmuch-lib notmuch-compat hl-line
mm-view mml-smime smime dig sh-script smie treesit executable project
files-x face-remap exwm-randr xcb-randr exwm exwm-input xcb-keysyms
xcb-xkb exwm-manage exwm-floating xcb-cursor xcb-render exwm-layout
exwm-workspace exwm-core xcb-ewmh xcb-icccm xcb xcb-xproto xcb-types
xcb-debug lui-autopaste circe advice lui-irc-colors irc gnutls lcs
lui-logging lui-format lui tracking shorten thingatpt flyspell ispell
circe-compat agda2 envrc inheritenv page-ext magit-extras
magit-submodule magit-obsolete magit-blame magit-stash magit-reflog
magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote
magit-commit magit-sequence magit-notes magit-worktree magit-tag
magit-merge magit-branch magit-reset magit-files magit-refs magit-status
magit magit-repos magit-apply magit-wip magit-log which-func imenu
magit-diff smerge-mode diff diff-mode git-commit rx log-edit message
sendmail yank-media puny dired desktop frameset dired-loaddefs rfc822
mml mml-sec epa derived epg rfc6068 epg-config gnus-util
text-property-search time-date mm-decode mm-bodies mm-encode mail-parse
rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev
mail-utils gmm-utils mailheader pcvs-util add-log magit-core
magit-autorevert autorevert filenotify magit-margin magit-transient
magit-process with-editor shell pcomplete comint ansi-osc server
ansi-color magit-mode transient cl-extra edmacro kmacro help-mode
format-spec magit-git magit-section magit-utils crm dash windmove
easy-mmode pixel-scroll cua-base ring modus-vivendi-theme modus-themes
pcase cus-edit pp cus-load icons wid-edit savehist saveplace finder-inf
ace-window-autoloads auctex-autoloads tex-site avy-autoloads
circe-autoloads corfu-autoloads compat-autoloads csv-mode-autoloads
cyberpunk-theme-autoloads debbugs-autoloads eat-autoloads
envrc-autoloads exwm-autoloads ggtags-autoloads
graphviz-dot-mode-autoloads htmlize-autoloads inheritenv-autoloads
magit-autoloads git-commit-autoloads markdown-mode-autoloads
mastodon-autoloads mentor-autoloads async-autoloads mpv-autoloads
nix-mode-autoloads magit-section-autoloads dash-autoloads
notmuch-autoloads persist-autoloads request-autoloads
rust-mode-autoloads transient-autoloads url-scgi-autoloads
vundo-autoloads which-key-autoloads info with-editor-autoloads
xelb-autoloads xml-rpc-autoloads package browse-url url url-proxy
url-privacy url-expand url-methods url-history url-cookie
generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x
map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc
iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook
vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads dbusbind inotify dynamic-setting system-font-setting
font-render-setting cairo x-toolkit x multi-tty make-network-process
emacs)

Memory information:
((conses 16 1626286 137327)
 (symbols 48 54331 39)
 (strings 32 272934 16451)
 (string-bytes 1 8527712)
 (vectors 16 136502)
 (vector-slots 8 2511205 204833)
 (floats 8 581 399)
 (intervals 56 122255 2589)
 (buffers 984 43))




Acknowledgement sent to sbaugh@HIDDEN:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#66260; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 2 Oct 2023 07:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.