| 1 | @c This is part of the Emacs manual. |
| 2 | @c Copyright (C) 2004-2012 Free Software Foundation, Inc. |
| 3 | @c See file emacs.texi for copying conditions. |
| 4 | @c |
| 5 | @c This file is included either in emacs-xtra.texi (when producing the |
| 6 | @c printed version) or in the main Emacs manual (for the on-line version). |
| 7 | @node Subdir Switches |
| 8 | @section Subdirectory Switches in Dired |
| 9 | |
| 10 | You can insert subdirectories with specified @command{ls} switches in |
| 11 | Dired buffers using @kbd{C-u i}. You can change the @command{ls} |
| 12 | switches of an already inserted subdirectory at point using @kbd{C-u l}. |
| 13 | |
| 14 | Dired preserves the switches if you revert the buffer. Deleting a |
| 15 | subdirectory forgets about its switches. |
| 16 | |
| 17 | Using @code{dired-undo} |
| 18 | @iftex |
| 19 | (@pxref{Marks vs Flags,,, emacs, the Emacs Manual}) |
| 20 | @end iftex |
| 21 | @ifnottex |
| 22 | (@pxref{Marks vs Flags}) |
| 23 | @end ifnottex |
| 24 | to reinsert or delete |
| 25 | subdirectories that were inserted with explicit switches can bypass |
| 26 | Dired's machinery for remembering (or forgetting) switches. Deleting |
| 27 | a subdirectory using @code{dired-undo} does not forget its switches. |
| 28 | When later reinserted using @kbd{i}, it will be reinserted using its |
| 29 | old switches. Using @code{dired-undo} to reinsert a subdirectory that |
| 30 | was deleted using the regular Dired commands (not @code{dired-undo}) |
| 31 | will originally insert it with its old switches. Reverting the |
| 32 | buffer, however, will relist it using the buffer's default switches. |
| 33 | If any of this yields problems, you can easily correct the situation |
| 34 | using @kbd{C-u i} or @kbd{C-u l}. |
| 35 | |
| 36 | Dired does not remember the @code{R} switch. Inserting a subdirectory |
| 37 | with switches that include the @code{R} switch is equivalent to |
| 38 | inserting each of its subdirectories using all remaining switches. |
| 39 | For instance, updating or killing a subdirectory that was inserted |
| 40 | with the @code{R} switch will not update or kill its subdirectories. |
| 41 | |
| 42 | The buffer's default switches do not affect subdirectories that were |
| 43 | inserted using explicitly specified switches. In particular, |
| 44 | commands such as @kbd{s} that change the buffer's switches do not |
| 45 | affect such subdirectories. (They do, however, affect subdirectories |
| 46 | without explicitly assigned switches.) |
| 47 | |
| 48 | You can make Dired forget about all subdirectory switches and relist |
| 49 | all subdirectories with the buffer's default switches using |
| 50 | @kbd{M-x dired-reset-subdir-switches}. This also reverts the Dired buffer. |