(dired.info)Making Relative Symbolic Links in Dired


Next: Letting Dired Guess What Shell Command to Apply Prev: Dired Local Variables Up: Tree Dired Extra

Making Relative Symbolic Links in Dired
=======================================

   In GNU Emacs version 18, the built-in function `make-symbolic-link'
always calls `expand-file-name' on its arguments, so relative symlinks
(e.g.  `foo -> ../bar/foo') are impossible to create.

   Dired Extra uses `call-process' and `ln -s' for a workaround.

`dired-make-symbolic-link'
     Arguments NAME1 NAME2 and optional OK-IF-ALREADY-EXISTS.  Create
     file NAME2, a symbolic link pointing to NAME1 (which may be any
     string whatsoever and is passed untouched to `ln -s').
     oK-IF-ALREADY-EXISTS means that NAME2 will be overwritten if it
     already exists.  If it is an integer, user will be asked about
     this.  On error, signals a file-error.

`dired-make-relative-symlink'
     Three arguments: FILE1 FILE2 and optional OK-IF-ALREADY-EXISTS.
     Make a symbolic link FILE2 (pointing to FILE1).  The link is
     relative (if possible), for example

          (dired-make-relative-symlink "/vol/tex/bin/foo"
                                       "/vol/local/bin/foo")

     results in a link

          /vol/local/bin/foo -> ../../tex/bin/foo

`dired-do-relsymlink'
     (binding `S') Symbolically link all marked (or next N) files into
     a directory, or make a symbolic link to the current file.  This
     creates relative symbolic links like

              foo -> ../bar/foo

     not absolute ones like
              foo -> /ugly/path/that/may/change/any/day/bar/foo

`dired-do-relsymlink-regexp'
     (`%S') Symbolically link all marked files containing REGEXP to
     NEWNAME, using relative (not absolute) names.  See functions
     `dired-rename-regexp' and `dired-do-relsymlink' for more info.


automatically generated by info2www