GNU bug report logs - #34092
Dired move file breaks relative symlinks

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: Q <qiang.fang@HIDDEN>; dated Wed, 16 Jan 2019 02:44:03 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

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


Received: (at submit) by debbugs.gnu.org; 16 Jan 2019 02:43:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 15 21:43:35 2019
Received: from localhost ([127.0.0.1]:60492 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gjbB0-00056I-ED
	for submit <at> debbugs.gnu.org; Tue, 15 Jan 2019 21:43:35 -0500
Received: from eggs.gnu.org ([209.51.188.92]:34037)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <qiang.fang@HIDDEN>) id 1gjZgb-0002u9-Ib
 for submit <at> debbugs.gnu.org; Tue, 15 Jan 2019 20:08:06 -0500
Received: from lists.gnu.org ([209.51.188.17]:41635)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <qiang.fang@HIDDEN>)
 id 1gjZgT-0002v2-Ju
 for submit <at> debbugs.gnu.org; Tue, 15 Jan 2019 20:07:58 -0500
Received: from eggs.gnu.org ([209.51.188.92]:44173)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <qiang.fang@HIDDEN>) id 1gjZgS-0007qd-Ji
 for bug-gnu-emacs@HIDDEN; Tue, 15 Jan 2019 20:07:57 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,HTML_MESSAGE
 autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <qiang.fang@HIDDEN>) id 1gjZgQ-0002sv-Kr
 for bug-gnu-emacs@HIDDEN; Tue, 15 Jan 2019 20:07:56 -0500
Received: from sender2-pp-o92.zoho.com.cn ([163.53.93.251]:25925
 helo=sender1.zoho.com.cn) by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <qiang.fang@HIDDEN>) id 1gjZgO-0002eP-Mz
 for bug-gnu-emacs@HIDDEN; Tue, 15 Jan 2019 20:07:54 -0500
ARC-Seal: i=1; a=rsa-sha256; t=1547600861; cv=none; d=zoho.com.cn; s=zohoarc; 
 b=D0nBq9n7e01RXUVSMPvH7wknp0IBF5tvC0BRHJ6FG7uuO3MD/06ey5Mq6Phrhjs2smi1CI4cJ61TZWt48NMPWXs92ZI2JEQ9Fod6IRzSjF5lzWPAhkdhAwMU9t7laBxwKqz9ZMnxLYPcvdCUQ9iKHeU9cCV0+PAKn3qsAIivmR4=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com.cn;
 s=zohoarc; t=1547600861;
 h=Content-Type:Date:From:MIME-Version:Message-ID:Subject:To:ARC-Authentication-Results;
 bh=GIx4dpPSKqrX0EaYW4bFTTZ+ybtFGfTZnAkcAJ4PIPM=; 
 b=lzfozEN4IEvfkjpG/mfe0C7U3BbghR+ifALOotkx6p0AL5wbeeTlBMd1eelzwWSqXoHZAAUI2izaBIstK3Yb3Q3+mdL/kD5POLwi391AT4sx+BX2VvgsCPYXyS2lQU285QSK6sYqrSVp7esbxSbWrut5G76pP63bUKrsOrzu2Tw=
ARC-Authentication-Results: i=1; mx.zoho.com.cn;
 dkim=pass  header.i=zoho.com.cn;
 spf=pass  smtp.mailfrom=qiang.fang@HIDDEN;
 dmarc=pass header.from=<qiang.fang@HIDDEN>
 header.from=<qiang.fang@HIDDEN>
Received: from mail.baihui.com by mx.zoho.com.cn
 with SMTP id 1547600859762358.40518923751165;
 Wed, 16 Jan 2019 09:07:39 +0800 (CST)
Received: from  [52.69.110.20] by mail.zoho.com.cn
 with HTTP;Wed, 16 Jan 2019 09:07:39 +0800 (CST)
Date: Wed, 16 Jan 2019 09:07:39 +0800
From: Q <qiang.fang@HIDDEN>
To: "bug-gnu-emacs" <bug-gnu-emacs@HIDDEN>
Message-Id: <16854331264.e785034111347.1332308217951283139@HIDDEN>
Subject: Dired move file breaks relative symlinks
MIME-Version: 1.0
Content-Type: multipart/alternative; 
 boundary="----=_Part_29224_266886451.1547600859748"
X-Priority: Medium
User-Agent: ZohoCN Mail
X-Mailer: ZohoCN Mail
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 163.53.93.251
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Spam-Score: 0.9 (/)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Tue, 15 Jan 2019 21:43:33 -0500
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.1 (/)

------=_Part_29224_266886451.1547600859748
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Dired move file breaks relative symlinks. Maybe we can call this a bug. I f=
ind a workaround with this advice.=C2=A0 I use this to move files (rel syml=
inks) around in a git-annex repo without brokening it.=C2=A0 I am quite new=
 to emacs, I am not sure if that has any side effect. =C2=A0=C2=A0=C2=A0 (d=
efun my-rename-file (file newname &optional ok-if-already-exists) =C2=A0=C2=
=A0=C2=A0 "fix path for relative symlink" =C2=A0=C2=A0=C2=A0 (if (file-syml=
ink-p newname) =C2=A0=C2=A0=C2=A0 (let ((target (expand-file-name (file-sym=
link-p newname) (file-name-directory file)))) =C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0 (if (and target (string-equal system-type "gnu/=
linux") (not (file-exists-p newname))) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (dired-make-relative-symlink tar=
get newname t))))) =C2=A0=C2=A0=C2=A0 (advice-add #'rename-file :after #'my=
-rename-file) There are some complicated examples of dealing with symlink :=
 https://www.emacswiki.org/emacs/symlink-fix.el I am not sure if windows ha=
s relative shortcuts. This link show you can use symlinks in windows: https=
://github.com/sensorflo/sensorflo-emacs/blob/master/site-lisp/w32-symlinks.=
el
------=_Part_29224_266886451.1547600859748
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head>=
<meta content=3D"text/html;charset=3DUTF-8" http-equiv=3D"Content-Type"></h=
ead><body ><div style=3D'font-size:10pt;font-family:Verdana,Arial,Helvetica=
,sans-serif;color:#00000;'><div>Dired move file breaks relative symlinks. M=
aybe we can call this a<br></div><div>bug. I find a workaround with this ad=
vice.&nbsp; I use this to move files<br></div><div>(rel symlinks) around in=
 a git-annex repo without brokening it.&nbsp; I am<br></div><div>quite new =
to emacs, I am not sure if that has any side effect.<br></div><div><br></di=
v><div>&nbsp;&nbsp;&nbsp; (defun my-rename-file (file newname &amp;optional=
 ok-if-already-exists)<br></div><div>&nbsp;&nbsp;&nbsp; "fix path for relat=
ive symlink"<br></div><div>&nbsp;&nbsp;&nbsp; (if (file-symlink-p newname)<=
br></div><div>&nbsp;&nbsp;&nbsp; (let ((target (expand-file-name (file-syml=
ink-p newname) (file-name-directory file))))<br></div><div>&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (if (and target (string-equal system=
-type "gnu/linux") (not (file-exists-p newname)))<br></div><div>&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (dired-=
make-relative-symlink target newname t)))))<br></div><div>&nbsp;&nbsp;&nbsp=
; (advice-add #'rename-file :after #'my-rename-file)<br></div><div><br></di=
v><div>There are some complicated examples of dealing with symlink : <br></=
div><div><a target=3D"_blank" href=3D"https://www.emacswiki.org/emacs/symli=
nk-fix.el">https://www.emacswiki.org/emacs/symlink-fix.el</a> <br></div><di=
v>I am not sure if windows has relative shortcuts. This link show you can u=
se symlinks in windows:<br></div><div><a target=3D"_blank" href=3D"https://=
github.com/sensorflo/sensorflo-emacs/blob/master/site-lisp/w32-symlinks.el"=
>https://github.com/sensorflo/sensorflo-emacs/blob/master/site-lisp/w32-sym=
links.el</a><br></div><div><br></div></div><br></body></html>
------=_Part_29224_266886451.1547600859748--






Acknowledgement sent to Q <qiang.fang@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#34092; 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, 25 Nov 2019 12:00:02 UTC

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