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

* bug#34092: Dired move file breaks relative symlinks
  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>
  0 siblings, 2 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2022-05-18 13:19 UTC (permalink / raw)
  To: Q; +Cc: 34092

Q <qiang.fang@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





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

* bug#34092: Dired move file breaks relative symlinks
  2022-05-18 13:19 ` Lars Ingebrigtsen
@ 2022-06-17 12:06   ` Lars Ingebrigtsen
       [not found]   ` <181c6cd6aa6.11db7c83a9832.6239095410226312522@zoho.com.cn>
  1 sibling, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2022-06-17 12:06 UTC (permalink / raw)
  To: Q; +Cc: 34092

Lars Ingebrigtsen <larsi@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





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

* bug#34092: Dired move file breaks relative symlinks
       [not found]   ` <181c6cd6aa6.11db7c83a9832.6239095410226312522@zoho.com.cn>
@ 2022-07-04 10:16     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2022-07-04 10:16 UTC (permalink / raw)
  To: Q; +Cc: 34092

(Please keep the debbugs address in the CCs -- otherwise it won't reach
the bug tracker.)

Q <qiang.fang@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.






^ 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).