(dired.info)Dired User Options


Next: Dired Configuration Prev: Dired Customization Up: Dired Customization

Customization of Dired
----------------------

The following variables are for personal customization in your
`~/.emacs' file.  For example, include a line similar to the following

     (setq dired-listing-switches "-Alt")  ; sort on time, ignore . and ..

   to set your favorite Dired listing switches.

`dired-listing-switches'
     Default: `"-al"'

     Switches passed to `ls' for Dired. Must contain the `l' option.

`dired-trivial-filenames'
     Default: `"^\\.\\.?$\\|^#"'

     Regexp of files to skip when moving point to the first file of a
     new directory listing.  Nil means move to the subdirectory line, t
     means move to first file.

`dired-marker-char'
     Default: `?*' (`?*' is the Lisp notation for the character `*'.)

     In Dired, character used to mark files for later commands.

     This is a variable so that one can write things like

          (let ((dired-marker-char ?X))
             ;; great code using X markers ...
             )

`dired-del-marker'
     Default: `?D'

     Character used to flag files for deletion.

     Usually, marking for commands and flagging for deletion are
     separate features.  (Internally they use the same marking
     mechanism.)  You type `d' to flag with `D' and `x' to delete the
     `D'-flagged files.

     This explains how to make deletion behave just like a special case
     of the general file marking feature, so that you type `m' to mark
     with `*' (as usual) and `d' to delete the `*' (or next N) files:
     In your `~/.emacs', include

          (setq dired-del-marker dired-marker-char) ; use * also for deletions
          (setq dired-load-hook
                (function
                 (lambda ()
                   ;; other customizations here
                   ;; let "d" do the actual deletion:
                   (define-key dired-mode-map "d" 'dired-do-delete))))

     If you do not like that `d' defaults to the current file if there
     are no marks, replace the `define-key' statement in
     `dired-load-hook' above with this one:

              (define-key dired-mode-map "d" 'dired-do-deletions)

`dired-shrink-to-fit'
     Default: `(if (fboundp 'baud-rate) (> (baud-rate)
     search-slow-speed) t)'

     Whether Dired shrinks the display buffer to fit the marked files.

`dired-no-confirm'
     Default: `nil'

     If non-nil, list of commands Dired should not confirm.
     Confirmation for commands that require an argument to be entered
     (like the shell command for `!') means a list of marked files is
     displayed in a pop-up buffer.  Confirmation for commands that do
     not require an argument (like compressing with `C') means you have
     to confirm by typing `y' or `SPC'.

     Except `nil', it can be a sublist of

          '(byte-compile chgrp chmod chown compress copy delete hardlink load
            move print shell symlink uncompress)

     to suppress confirmation for just those commands.

`dired-keep-marker-move'
     Default: `t'

     If nil, moved files are not marked.

     If t, moved marked files are marked with the same marker they had
     before (maybe none if you used the prefix argument to specify the
     next N files).

     If a character, moved files (marked or not) are marked with that
     character.

     This also applies to the following, similar variables for copied,
     and hard or symbolically linked files:

`dired-keep-marker-copy'
     Default: `?C'

`dired-keep-marker-hardlink'
     Default: `?H'

`dired-keep-marker-symlink'
     Default: `?Y'

`dired-dwim-target'
     Default: `nil'

     If non-nil, Dired tries to guess a default target directory: If
     there is a Dired buffer displayed in the next window, use its
     current subdirectory, instead of the current subdirectory of this
     Dired buffer.

     The target is used in the prompt for file copy, move etc., *Note
     Copy and Move Into a Directory::.

`dired-copy-preserve-time'
     Default: `nil'

     If non-nil, Dired preserves the last-modified time in a file copy.
     (This works on only some systems.)  Use `c' (`dired-do-copy') with
     a zero prefix argument to toggle its value.  The prompt of copy
     commands will display `Copy [-p]' instead of just `Copy' if
     preservation of file times is turned on.

`dired-backup-if-overwrite'
     Default: `nil'

     Non-nil if Dired should ask about making backups before
     overwriting files.  Special value `'always' suppresses
     confirmation.


automatically generated by info2www