unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#34092: Dired move file breaks relative symlinks
@ 2019-01-16  1:07 Q
  2022-05-18 13:19 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Q @ 2019-01-16  1:07 UTC (permalink / raw)
  To: 34092

[-- Attachment #1: Type: text/plain, Size: 1044 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1920 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-07-04 10:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-16  1:07 bug#34092: Dired move file breaks relative symlinks Q
2022-05-18 13:19 ` Lars Ingebrigtsen
2022-06-17 12:06   ` Lars Ingebrigtsen
     [not found]   ` <181c6cd6aa6.11db7c83a9832.6239095410226312522@zoho.com.cn>
2022-07-04 10:16     ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).