(defun dired-readin (dirname buffer) (byte-code "\"	q  !!)	&>!	!R&)ebm?Qc!Beb)\")" [dirname buffer buffer-read-only nil dired-listing-switches default-directory shell-file-name message "Reading directory %s..." widen erase-buffer expand-file-name file-directory-p call-process "ls" file-name-directory "-c" "ls " " " file-name-nondirectory "  " forward-line 1 "Reading directory %s...done"] 18))

(defun dired-find-buffer (dirname) (byte-code " -@q
=\"$@ʼn(A)	7!!*" [blist found major-mode dired-directory dirname nil buffer-list dired-mode equal create-file-buffer directory-file-name] 5))

(defun dired (dirname) "\
\"Edit\" directory DIRNAME--delete, rename, print, etc. some files in it.
Dired displays a list of files in DIRNAME.
You can move around in it with the usual commands.
You can flag files for deletion with C-d
and then delete them by typing `x'.
Type `h' after entering dired for more info." (interactive (byte-code "	$C" [nil default-directory read-file-name "Dired (directory): "] 5)) (byte-code "
!!" [nil default-directory dirname switch-to-buffer dired-noselect] 3))

(defun dired-other-window (dirname) "\
\"Edit\" directory DIRNAME.  Like M-x dired but selects in another window." (interactive (byte-code "	$C" [nil default-directory read-file-name "Dired in other window (directory): "] 5)) (byte-code "
!!" [nil default-directory dirname switch-to-buffer-other-window dired-noselect] 3))

(defun dired-noselect (dirname) "\
Like M-x dired but returns the dired buffer as value, does not select it." (byte-code "	!!!!!
\" !)
)" [dirname default-directory buffer expand-file-name directory-file-name file-directory-p file-name-as-directory dired-find-buffer dired-readin dired-move-to-filename dired-mode] 9))

(defun dired-revert (&optional arg noconfirm) (byte-code "`\" 
p\"		!Q#$b +" [opoint ofile t buffer-read-only nil dired-directory dired-get-filename erase-buffer dired-readin re-search-forward " " regexp-quote "$" beginning-of-line] 8))

(defvar dired-mode-map nil "\
Local keymap for dired-mode buffers.")

(if dired-mode-map nil (setq dired-mode-map (make-keymap)) (suppress-keymap dired-mode-map) (define-key dired-mode-map "r" (quote dired-rename-file)) (define-key dired-mode-map "" (quote dired-flag-file-deleted)) (define-key dired-mode-map "d" (quote dired-flag-file-deleted)) (define-key dired-mode-map "v" (quote dired-view-file)) (define-key dired-mode-map "e" (quote dired-find-file)) (define-key dired-mode-map "f" (quote dired-find-file)) (define-key dired-mode-map "o" (quote dired-find-file-other-window)) (define-key dired-mode-map "u" (quote dired-unflag)) (define-key dired-mode-map "x" (quote dired-do-deletions)) (define-key dired-mode-map "" (quote dired-backup-unflag)) (define-key dired-mode-map "?" (quote dired-summary)) (define-key dired-mode-map "c" (quote dired-copy-file)) (define-key dired-mode-map "#" (quote dired-flag-auto-save-files)) (define-key dired-mode-map "~" (quote dired-flag-backup-files)) (define-key dired-mode-map "." (quote dired-clean-directory)) (define-key dired-mode-map "h" (quote describe-mode)) (define-key dired-mode-map " " (quote dired-next-line)) (define-key dired-mode-map "" (quote dired-next-line)) (define-key dired-mode-map "" (quote dired-previous-line)) (define-key dired-mode-map "n" (quote dired-next-line)) (define-key dired-mode-map "p" (quote dired-previous-line)) (define-key dired-mode-map "g" (quote revert-buffer)) (define-key dired-mode-map "C" (quote dired-compress)) (define-key dired-mode-map "U" (quote dired-uncompress)) (define-key dired-mode-map "B" (quote dired-byte-recompile)) (define-key dired-mode-map "M" (quote dired-chmod)) (define-key dired-mode-map "G" (quote dired-chgrp)) (define-key dired-mode-map "O" (quote dired-chown)))

(put (quote dired-mode) (quote mode-class) (quote special))

(defun dired-mode (&optional dirname) "\
Mode for \"editing\" directory listings.
In dired, you are \"editing\" a list of the files in a directory.
You can move using the usual cursor motion commands.
Letters no longer insert themselves.
Instead, type d to flag a file for Deletion.
Type u to Unflag a file (remove its D flag).
  Type Rubout to back up one line and unflag.
Type x to eXecute the deletions requested.
Type f to Find the current line's file
  (or Dired it, if it is a directory).
Type o to find file or dired directory in Other window.
Type # to flag temporary files (names beginning with #) for Deletion.
Type ~ to flag backup files (names ending with ~) for Deletion.
Type . to flag numerical backups for Deletion.
  (Spares dired-kept-versions or its numeric argument.)
Type r to rename a file.
Type c to copy a file.
Type v to view a file in View mode, returning to Dired when done.
Type g to read the directory again.  This discards all deletion-flags.
Space and Rubout can be used to move down and up by lines.
Also: C -- compress this file.  U -- uncompress this file.
      B -- byte compile this file.
 M, G, O -- change file's mode, group or owner.
\\{dired-mode-map}" (interactive) (byte-code "Ȉ !ΉωЉ!
4!/2!Ӊȉʉ	!!" [revert-buffer-function major-mode mode-name dired-directory dirname default-directory mode-line-buffer-identification case-fold-search nil buffer-read-only t dired-mode-map kill-all-local-variables make-local-variable dired-revert dired-mode "Dired" file-directory-p file-name-directory ("Dired: %17b") use-local-map run-hooks dired-mode-hook] 8))

(defun dired-repeat-over-lines (arg function) (byte-code " Vm?4S o$!$!	!)! W=o?XT!  	!)5" [arg function beginning-of-line 0 looking-at "  total" error "No file on this line" funcall forward-line 1 dired-move-to-filename -1] 13))

(defun dired-flag-file-deleted (arg) "\
In dired, flag the current line's file for deletion.
With arg, repeat over several lines." (interactive "p") (byte-code "\"" [arg nil dired-repeat-over-lines (lambda nil (let ((buffer-read-only nil)) (delete-char 1) (insert "D")))] 3))

(defun dired-summary nil (interactive) (byte-code "!" [nil message "d-elete, u-ndelete, x-ecute, f-ind, o-ther window, r-ename, c-opy, v-iew"] 2))

(defun dired-unflag (arg) "\
In dired, remove the current line's delete flag then move to next line." (interactive "p") (byte-code "\"" [arg nil dired-repeat-over-lines (lambda nil (let ((buffer-read-only nil)) (delete-char 1) (insert " ") (forward-char -1)))] 3))

(defun dired-backup-unflag (arg) "\
In dired, move up a line and remove deletion flag there." (interactive "p") (byte-code "[!" [arg nil dired-unflag] 2))

(defun dired-next-line (arg) "\
Move down ARG lines then position at filename." (interactive "p") (byte-code "! " [arg nil next-line dired-move-to-filename] 3))

(defun dired-previous-line (arg) "\
Move up ARG lines then position at filename." (interactive "p") (byte-code "! " [arg nil previous-line dired-move-to-filename] 3))

(defun dired-find-file nil "\
In dired, visit the file or directory named on this line." (interactive) (byte-code " !" [nil find-file dired-get-filename] 3))

(defun dired-view-file nil "\
In dired, examine a file in view mode, returning to dired when done." (interactive) (byte-code " ! ! !" [nil file-directory-p dired-get-filename dired view-file] 7))

(defun dired-find-file-other-window nil "\
In dired, visit this file or directory in another window." (interactive) (byte-code " !" [nil find-file-other-window dired-get-filename] 3))

(defun dired-get-filename (&optional localp no-error-if-not-filep) "\
In dired, return name of file mentioned on this line.
Value returned normally includes the directory name.
A non-nil 1st argument means do not include it.  A non-nil 2nd argument
says return nil if no filename on this line, otherwise an error occurs." (byte-code " ` #>!\"\"`!4
FƂI!))" [eol t beg localp default-directory no-error-if-not-filep nil end-of-line beginning-of-line re-search-forward "\\(Jan\\|Feb\\|Mar\\|Apr\\|May\\|Jun\\|Jul\\|Aug\\|Sep\\|Oct\\|Nov\\|Dec\\)[ ]+[0-9]+" skip-chars-forward " " "^ " "^ 
" buffer-substring error "No file on this line"] 12))

(defun dired-move-to-filename nil "\
In dired, move to first char of filename on this line.
Returns position (point) or nil if no filename on this line." (byte-code " ` #!\"\"`)" [eol t end-of-line beginning-of-line re-search-forward "\\(Jan\\|Feb\\|Mar\\|Apr\\|May\\|Jun\\|Jul\\|Aug\\|Sep\\|Oct\\|Nov\\|Dec\\)[ ]+[0-9]+" skip-chars-forward " " "^ "] 8))

(defun dired-map-dired-file-lines (fn) "\
perform fn with point at the end of each non-directory line:
arguments are the short and long filename" (byte-code "ebm?;!?2l?2\"\"2 
+)" [filename longfilename buffer-read-only nil t fn looking-at "  d" dired-get-filename end-of-line funcall forward-line 1] 9))

(defun dired-flag-auto-save-files nil "\
Flag for deletion files whose names suggest they are auto save files." (interactive) (byte-code "ebm?K!?Cl?C!/\"
!)7 7!C !c!))" [buffer-read-only nil fn t looking-at "  d" fboundp auto-save-file-name-p dired-get-filename dired-move-to-filename "#" beginning-of-line delete-char 1 "D" forward-line] 11))

(defun dired-clean-directory (keep) "\
Flag numerical backups for Deletion.
Spares dired-kept-versions latest versions, and kept-old-versions oldest.
Positive numeric arg overrides dired-kept-versions;
negative numeric arg overrides kept-old-versions with minus the arg." (interactive "P") (byte-code "ƈ!
	W[X&	'!
\"	Z\"\"@A\"*A2)!+" [keep dired-kept-versions early-retention kept-old-versions late-retention file-version-assoc-list nil fval sorted-v-list v-count prefix-numeric-value 0 dired-map-dired-file-lines dired-collect-file-versions q sort < rplacd nthcdr dired-trample-file-versions] 10))

(defun dired-collect-file-versions (ignore fn) "\
If it looks like fn has versions, we make a list of the versions.
We may want to flag some for deletion." (byte-code "	!PG	!\"\" 	B
B," [base-versions fn bv-length possibilities versions file-version-assoc-list file-name-nondirectory ".~" file-name-all-completions file-name-directory mapcar backup-extract-version] 6))

(defun dired-trample-file-versions (ignore fn) (byte-code "	\"'	O\"'	\\O!
>?' *" [start-vn fn base-version-list file-version-assoc-list string-match "\\.~[0-9]+~$" nil assoc 0 string-to-int 2 dired-flag-this-line-for-DEATH] 6))

(defun dired-flag-this-line-for-DEATH nil (byte-code " !c" [beginning-of-line delete-char 1 "D"] 3))

(defun dired-flag-backup-files nil "\
Flag all backup files (names ending with ~) for deletion." (interactive) (byte-code "ebm?M!?El?E!/\"
!)9 !!E !c!))" [buffer-read-only nil fn t looking-at "  d" fboundp backup-file-name-p dired-get-filename end-of-line forward-char -1 "~" beginning-of-line delete-char 1 "D" forward-line] 12))

(defun dired-flag-backup-and-auto-save-files nil "\
Flag all backup and temporary files for deletion.
Backup files have names ending in ~.  Auto save file names usually
start with #." (interactive) (byte-code "  " [nil dired-flag-backup-files dired-flag-auto-save-files] 3))

(defun dired-rename-file (to-file) "\
Rename this file to TO-FILE." (interactive (byte-code " !\" #C" [nil read-file-name format "Rename %s to: " file-name-nondirectory dired-get-filename] 8)) (byte-code "	! 	\" `!`\"	!	!	!\")" [nil to-file buffer-read-only expand-file-name rename-file dired-get-filename beginning-of-line delete-region forward-line 1 dired-add-entry file-name-directory file-name-nondirectory] 12))

(defun dired-copy-file (to-file) "\
Copy this file to TO-FILE." (interactive "FCopy to: ") (byte-code " \"!!!\"" [to-file nil copy-file dired-get-filename expand-file-name dired-add-entry file-name-directory file-name-nondirectory] 8))

(defun dired-add-entry (directory filename) (byte-code "	\"H 
P&!c ` `\"\"!c* )" [directory default-directory buffer-read-only nil t dired-listing-switches filename beg end string-equal beginning-of-line call-process "ls" "-d" forward-line -1 "  " dired-move-to-filename end-of-line buffer-substring delete-region file-name-nondirectory] 11))

(defun dired-compress nil "\
Compress this file." (interactive) (byte-code "! P\"\"\"ώ
q )
q U)K\"
!\")!," [buffer-read-only nil error-buffer from-file to-file get-buffer-create " *Dired compress output*" dired-get-filename ".Z" string-match "\\.Z$" error "%s is already compressed!" message "Compressing %s..." ((byte-code "!" [error-buffer kill-buffer] 2)) erase-buffer call-process "compress" "-f" 0 buffer-size "Compressing %s... done" kill-buffer display-buffer "Compress error on %s." dired-redisplay] 14))

(defun dired-uncompress nil "\
Uncompress this file." (interactive) (byte-code "! O\"\"\"Ў
q )
q U)P\"
!\")!," [buffer-read-only nil error-buffer from-file to-file get-buffer-create " *Dired compress output*" dired-get-filename 0 -2 string-match "\\.Z$" error "%s is not compressed!" message "Uncompressing %s..." ((byte-code "!" [error-buffer kill-buffer] 2)) erase-buffer call-process "uncompress" "-f" buffer-size "Uncompressing %s... done" kill-buffer display-buffer "Uncompress error on %s." dired-redisplay] 14))

(defun dired-byte-recompile nil "\
Byte recompile this file." (interactive) (byte-code " 
!+" [buffer-read-only nil from-file to-file dired-get-filename 0 -3 string-match "\\.el$" error "%s is uncompilable!" byte-compile-file] 5))

(defun dired-chmod (mode) "\
Change mode of this file." (interactive "sChange to Mode: ") (byte-code " 
!*" [buffer-read-only nil file mode dired-get-filename call-process "/bin/chmod" dired-redisplay] 8))

(defun dired-chgrp (group) "\
Change group of this file." (interactive "sChange to Group: ") (byte-code " 
!*" [buffer-read-only nil file group dired-get-filename call-process "/bin/chgrp" dired-redisplay] 8))

(defun dired-chown (owner) "\
Change Owner of this file." (interactive "sChange to Owner: ") (byte-code " 
!*" [buffer-read-only nil file owner dired-get-filename call-process "/etc/chown" dired-redisplay] 8))

(defun dired-redisplay (file) "\
Redisplay this line." (byte-code " `!`\"!!\" " [file beginning-of-line delete-region forward-line 1 dired-add-entry file-name-directory file-name-nondirectory dired-move-to-filename] 8))

(defun dired-do-deletions nil "\
In dired, delete the files flagged for deletion." (interactive) (byte-code "ˆb# !`SBB
)?-!a΋	a
A9`!\"**" [delete-list answer nil t fill-column l failures buffer-read-only 1 re-search-forward "^D" dired-get-filename message "(No deletions requested)" ((byte-code "! lj
!	<iVc.o.i\\\"\"\"	@@c	A)eb!" [fill-column l delete-list answer switch-to-buffer " *Deletions*" erase-buffer 70 reverse 59 10 indent-to * / 19 20 1 yes-or-no-p "Delete these files? "] 9)) (byte-code "	
@@P! %!!#!`!`\")" [fn default-directory l nil file-directory-p call-process "rmdir" file-exists-p delete-file delete-region forward-line 1] 9) ((error (byte-code "!c	@@B" [failures l delete-char 1 " "] 3))) "Deletions failed: %s" prin1-to-string] 7))

(provide (quote dired))