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.

Full log


View this message in rfc822 format

From: Q <qiang.fang <at> zoho.com.cn>
To: 34092 <at> debbugs.gnu.org
Subject: bug#34092: 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)]

This bug report was last modified 2 years and 317 days ago.

Previous Next


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