From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#34092: Dired move file breaks relative symlinks Date: Wed, 18 May 2022 15:19:24 +0200 Message-ID: <871qwrc71f.fsf@gnus.org> References: <16854331264.e785034111347.1332308217951283139@zoho.com.cn> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40017"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 34092@debbugs.gnu.org To: Q Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 18 15:20:58 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nrJbl-000A6t-Hr for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 18 May 2022 15:20:57 +0200 Original-Received: from localhost ([::1]:37120 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nrJbk-0000x6-2z for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 18 May 2022 09:20:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34410) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nrJas-0000vA-SW for bug-gnu-emacs@gnu.org; Wed, 18 May 2022 09:20:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37287) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nrJas-0000R2-Ip for bug-gnu-emacs@gnu.org; Wed, 18 May 2022 09:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nrJas-000406-B2 for bug-gnu-emacs@gnu.org; Wed, 18 May 2022 09:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 May 2022 13:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34092 X-GNU-PR-Package: emacs Original-Received: via spool by 34092-submit@debbugs.gnu.org id=B34092.165287997715329 (code B ref 34092); Wed, 18 May 2022 13:20:02 +0000 Original-Received: (at 34092) by debbugs.gnu.org; 18 May 2022 13:19:37 +0000 Original-Received: from localhost ([127.0.0.1]:59414 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nrJaS-0003zA-Sd for submit@debbugs.gnu.org; Wed, 18 May 2022 09:19:37 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:39690) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nrJaR-0003yu-5r for 34092@debbugs.gnu.org; Wed, 18 May 2022 09:19:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=makzwzbZHbtt7E7XxU1L4/7NZMuuJMpIS3tpRW+X/uA=; b=pD3WoGHM8Us8M2CYvfTIIB9CHW WvbhjJy7+6pr4g8X0vi7/bHEUSohbhz+RwG7EIE2JxxJEW8hro7e6AaEXyAPGmQcTWJ3cmb5nZi/p ajULw7U1vZKjmzzu3mlhR8lI3XAepcDO9O5DCkcGEu08OT2WUHLIay3Et+/oNnmSgRDc=; Original-Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nrJaG-0007aF-Ux; Wed, 18 May 2022 15:19:27 +0200 X-Now-Playing: Nils Petter =?UTF-8?Q?Molv=C3=A6r's?= _Solid Ether_: "Solid Ether" In-Reply-To: <16854331264.e785034111347.1332308217951283139@zoho.com.cn> (Q.'s message of "Wed, 16 Jan 2019 09:07:39 +0800") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:232562 Archived-At: Q writes: > Dired move file breaks relative symlinks. Maybe we can call this a > bug. I find a workaround with this advice. I use this to move files > (rel symlinks) around in a git-annex repo without brokening it. I am > quite new to emacs, I am not sure if that has any side effect. > > (defun my-rename-file (file newname &optional ok-if-already-exists) > "fix path for relative symlink" > (if (file-symlink-p newname) > (let ((target (expand-file-name (file-symlink-p newname) (file-name-directory > file)))) > (if (and target (string-equal system-type "gnu/linux") (not (file-exists-p > newname))) > (dired-make-relative-symlink target newname t))))) > (advice-add #'rename-file :after #'my-rename-file) (I'm going through old bug reports that unfortunately weren't resolved at the time.) I'm unable to reproduce this in Emacs 29. I did: touch file ln -s file symfile And then moved the file and the relative symlink with `R' in Dired, and they were moved as expected (i.e., still relative). Do you have a recipe for the problem you were seeing, or has this been fixed in the years since it was reported? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no