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

Previous Next

Package: emacs;

Reported by: Q <qiang.fang <at> zoho.com.cn>

Date: Wed, 16 Jan 2019 02:44:03 UTC

Severity: wishlist

Tags: moreinfo

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 34092 in the body.
You can then email your comments to 34092 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#34092; Package emacs. (Wed, 16 Jan 2019 02:44:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Q <qiang.fang <at> zoho.com.cn>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 16 Jan 2019 02:44:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Q <qiang.fang <at> zoho.com.cn>
To: "bug-gnu-emacs" <bug-gnu-emacs <at> gnu.org>
Subject: Dired move file breaks relative symlinks
Date: Wed, 16 Jan 2019 09:07:39 +0800
[Message part 1 (text/plain, inline)]
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) There are some complicated examples of dealing with symlink : https://www.emacswiki.org/emacs/symlink-fix.el I am not sure if windows has relative shortcuts. This link show you can use symlinks in windows: https://github.com/sensorflo/sensorflo-emacs/blob/master/site-lisp/w32-symlinks.el
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34092; Package emacs. (Wed, 18 May 2022 13:20:02 GMT) Full text and rfc822 format available.

Message #8 received at 34092 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Q <qiang.fang <at> zoho.com.cn>
Cc: 34092 <at> debbugs.gnu.org
Subject: Re: bug#34092: Dired move file breaks relative symlinks
Date: Wed, 18 May 2022 15:19:24 +0200
Q <qiang.fang <at> zoho.com.cn> 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




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 18 May 2022 13:20:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34092; Package emacs. (Fri, 17 Jun 2022 12:07:02 GMT) Full text and rfc822 format available.

Message #13 received at 34092 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Q <qiang.fang <at> zoho.com.cn>
Cc: 34092 <at> debbugs.gnu.org
Subject: Re: bug#34092: Dired move file breaks relative symlinks
Date: Fri, 17 Jun 2022 14:06:37 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> 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?

More information was requested, but no response was given within a
month, so I'm closing this bug report.  If the problem still exists,
please respond to this email and we'll reopen the bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 34092 <at> debbugs.gnu.org and Q <qiang.fang <at> zoho.com.cn> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 17 Jun 2022 12:07:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34092; Package emacs. (Mon, 04 Jul 2022 10:18:01 GMT) Full text and rfc822 format available.

Message #18 received at 34092 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Q <qiang.fang <at> zoho.com.cn>
Cc: 34092 <at> debbugs.gnu.org
Subject: Re: bug#34092: Dired move file breaks relative symlinks
Date: Mon, 04 Jul 2022 12:16:49 +0200
(Please keep the debbugs address in the CCs -- otherwise it won't reach
the bug tracker.)

Q <qiang.fang <at> zoho.com.cn> writes:

> Good to know it is fixed on Emacs 29.
> I tried what you did on Emacs 28, and the bug is still there.

I tried the recipe in Emacs 28.1, and I couldn't reproduce it there,
either.

Are you testing with "emacs -Q"?  If so, can you try to give a complete
step by step recipe for what you're doing, because it seems we're
doing two different things.





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 01 Aug 2022 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 240 days ago.

Previous Next


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