4

If I want to do recursive hardlinks of a directory I have to use cp -r -l dir in bash instead of ln -h. How do I replicate this in dired, because dired-do-hardlink uses ln underneath?

I can use M-! cp -r -l dir but I would like to not have to treat directories differently when linking files around.

3

Use diredp-do-hardlink-recursive, from library Dired+.

diredp-do-hardlink-recursive is an interactive compiled Lisp function
in `dired+.el'.

(diredp-do-hardlink-recursive &optional IGNORE-MARKS-P)

Add hard links for marked files, including those in marked subdirs.
Like `dired-do-hardlink', but act recursively on subdirs to pick up the
files to link.

The files included are those that are marked in the current Dired
buffer, or all files in the directory if none are marked.  Marked
subdirectories are handled recursively in the same way.

With a prefix argument, ignore all marks - include all files in this
Dired buffer and all subdirs, recursively.
  • It always impress me that you will know an answer to almost everything, Drew. – ReneFroger Feb 23 '16 at 23:05
  • If I install dired+ using package-install I lose default dired behavior. How do I just use dired as a library of functions? – salotz Feb 23 '16 at 23:28
  • You lose what default Dired behavior? Dired+ is a superset of Dired. Please be specific - perhaps the same behavior is there, but not where you are looking for it. – Drew Feb 23 '16 at 23:48
  • 1
    @ReneFroger: Not at all. I know nothing about most of the things asked here - nothing about Org or Spacemacs or Prelude or AUCTex or.... I do know some things about a few parts of Emacs. Dired is one of those parts. Anyone would, after spending a lot of time trying to customize things - like you all are doing. Spend as much time with the Dired code as I have (over a long period of time) and you are bound to have picked up a few things. It's the same story for everyone, really. – Drew Feb 23 '16 at 23:52
  • It automatically toggled dired-hide-details-mode, so I just had to toggle it again with (. It does change the look and feel though too. – salotz Feb 24 '16 at 14:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.