dired.elc 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. (defvar dired-listing-switches "-al" "Switches passed to ls for dired. MUST contain the 'l' option.
  2. CANNOT contain the 'F' option.")
  3. (or (fboundp (quote view-file)) (autoload (quote view-file) "view" "View FILE in View mode, returning to previous buffer when done.
  4. The usual Emacs commands are not available; instead,
  5. a special set of commands (mostly letters and punctuation)
  6. are defined for moving around in the buffer.
  7. Space scrolls forward, Delete scrolls backward.
  8. For list of all View commands, type ? or h while viewing." t))
  9. (defun dired-readin (dirname buffer) (byte-code "Šqˆ
  10. Ç ˆÈ ˆÉ !‰ˆÊ !ƒ$ËÌ
  11. 
  12. &‚9Í !Ë
  13. 
  14. ÎÏ ÐÑ !R&)ˆebˆm?…LÒcˆÓÔ!ˆ‚=ˆeb))‡" [buffer buffer-read-only nil dirname dired-listing-switches default-directory shell-file-name widen erase-buffer expand-file-name file-directory-p call-process "ls" file-name-directory "-c" "ls " " " file-name-nondirectory " " forward-line 1] 21))
  15. (defun dired-find-buffer (dirname) (byte-code "Æ Å…-Š@qˆ
  16. Ç=…È \"ƒ$@ ‰‚(A‰)ˆ‚ˆ †IÉÊ \"ƒB ËÌO‰‚CňÍÎ !!*‡" [blist found major-mode dired-directory dirname nil buffer-list dired-mode equal string-match "/$" 0 -1 create-file-buffer file-name-nondirectory] 20))
  17. (defun dired (dirname) "\
  18. \"Edit\" directory DIRNAME. Delete some files in it.
  19. Dired displays a list of files in DIRNAME.
  20. You can move around in it with the usual commands.
  21. You can mark files for deletion with C-d
  22. and then delete them by typing `x'.
  23. Type `h' after entering dired for more info." (interactive (list (read-file-name "Dired (directory): " nil default-directory nil))) (byte-code "ÀˆÃÄ
  24. !!‡" [nil default-directory dirname switch-to-buffer dired-noselect] 4))
  25. (defun dired-other-window (dirname) "\
  26. \"Edit\" directory DIRNAME. Like M-x dired but selects in another window." (interactive (list (read-file-name "Dired in other window (directory): " nil default-directory nil))) (byte-code "ÀˆÃÄ
  27. !!‡" [nil default-directory dirname pop-to-buffer dired-noselect] 4))
  28. (defun dired-noselect (dirname) "\
  29. Like M-x dired but returns the dired buffer as value, does not select it." (byte-code "† ‰ˆÃÄ\"ƒÅÆO‰‚LjÈ!‰ˆÃÉ\"?…3Ê!…3ËP‰ˆÌ!Š
  30. qˆÍ
  31. \"ˆÎ!)ˆ
  32. )‡" [dirname default-directory buffer string-match "./$" 0 -1 nil expand-file-name "/$" file-directory-p "/" dired-find-buffer dired-readin dired-mode] 19))
  33. (defun dired-revert (&optional arg) (byte-code "`Æ
  34. \" Ç ˆÈ p\"ˆ …ÉÊË !ÌQ
  35. #†$bˆÍ +‡" [odot ofile t buffer-read-only nil dired-directory dired-get-filename erase-buffer dired-readin re-search-forward " " regexp-quote "$" beginning-of-line] 14))
  36. (defvar dired-mode-map nil "Local keymap for dired-mode buffers.")
  37. (defun dired-mode (dirname) "\
  38. Mode for \"editing\" directory listings.
  39. In dired, you are \"editing\" a list of the files in a directory.
  40. You can move using the usual cursor motion commands.
  41. Letters no longer insert themselves.
  42. Instead, type d to mark a file for Deletion.
  43. Type u to Unmark a file (remove its D mark).
  44. Type Rubout to back up one line and unmark.
  45. Type x to eXecute the deletions requested.
  46. Type f to Find the current line's file
  47. (or Dired it, if it is a directory).
  48. Type o to find file or dired directory in Other window.
  49. Type # to mark temporary files (names beginning with #) for Deletion.
  50. Type ~ to mark backup files (names ending with ~) for Deletion.
  51. Type r to rename a file.
  52. Type c to copy a file.
  53. Type v to view a file in View mode, returning to Dired when done.
  54. Space can be used to move down and up by lines." (byte-code "Ì ˆÍÀ!ˆÎ‰ˆÏ‰ˆÐ‰ˆÍÃ!ˆ ‰ˆÑ !ƒ% ‚(Ò !‰ˆ‰ˆÓ ÔQ‰ˆ ?ƒ¦Õ ‰ ˆÖ !ˆ ×ØIˆ ÙÚIˆ ÛÚIˆ ÜÝIˆ ÞßIˆ àáIˆ âãIˆ äåIˆ æçIˆ èéIˆ êëIˆ ìíIˆ îïIˆ ðñIˆ òóI‚§Çˆ ‰
  55. ˆô !‡" [revert-buffer-function major-mode mode-name dired-directory dirname default-directory case-fold-search nil mode-line-format dired-mode-map buffer-read-only t kill-all-local-variables make-local-variable dired-revert dired-mode "Dired" file-directory-p file-name-directory "--Directory " " %M %[(%m)%]----%p--%-" make-keymap suppress-keymap 114 dired-rename-file 4 dired-mark-file-deleted 100 118 dired-view-file 102 dired-find-file 111 dired-find-file-other-window 117 dired-unmark 120 dired-do-deletions 127 dired-backup-unmark 63 dired-summary 99 dired-copy-file 35 dired-mark-auto-save-files 126 dired-mark-backup-files 104 describe-mode 32 next-line use-local-map] 23))
  56. (defun dired-repeat-over-lines (arg function) (byte-code " ˆÃV… m?…S‰ˆÄ !ˆÅÆ!ˆ‚ˆÃW…'o?…:T‰ˆÅÇ!ˆÄ !ˆ‚‡" [arg function beginning-of-line 0 funcall forward-line 1 -1] 11))
  57. (defun dired-mark-file-deleted (arg) "\
  58. In dired, mark the current line's file for deletion.
  59. With arg, repeat over several lines." (interactive "p") (byte-code "ÁˆÂÃ\"‡" [arg nil dired-repeat-over-lines (lambda nil (let ((buffer-read-only nil)) (if (looking-at " d") nil (delete-char 1) (insert "D"))))] 3))
  60. (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"] 3))
  61. (defun dired-unmark (arg) "\
  62. In dired, mark the current line's file for deletion." (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))
  63. (defun dired-backup-unmark (arg) "\
  64. In dired, move up a line and remove deletion mark there." (interactive "p") (byte-code "ÁˆÂ[!‡" [arg nil dired-unmark] 3))
  65. (defun dired-find-file nil "\
  66. In dired, visit the file named on this line." (interactive) (byte-code "ÀˆÁ ˆÂÃ!ƒÄÅ !‚ÆÅ !‡" [nil beginning-of-line looking-at " d" dired dired-get-filename find-file] 10))
  67. (defun dired-view-file nil "\
  68. In dired, examine a file in view mode, returning to dired when done." (interactive) (byte-code "ÀˆÁ ˆÂÃ!?ƒÄÅ !‚À‡" [nil beginning-of-line looking-at " d" view-file dired-get-filename] 7))
  69. (defun dired-find-file-other-window nil "\
  70. In dired, visit this file in another window." (interactive) (byte-code "ÀˆÁ ˆÂÃ!ƒÄÅ !‚ÆÅ !‡" [nil beginning-of-line looking-at " d" dired-other-window dired-get-filename find-file-other-window] 10))
  71. (defun dired-get-filename (&optional localp no-error-if-not-filep) "\
  72. In dired, return name of file mentioned on this line.
  73. Value returned normally includes the directory name.
  74. A non-nil 1st argument means do not include it. A non-nil 2nd argument
  75. says return nil if no filename on this line, otherwise an error occurs." (byte-code "ÅŠÆ ˆ`‰ˆÇ ˆÈÉ #ƒ>ÊË!ˆÊÌ\"ˆÊË\"ˆ`ÊÍ!ˆ ƒ4Î
  76. `\"‚: Î
  77. `\"P)‚?Å))‡" [eol no-error-if-not-filep beg localp default-directory 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 " " "^ " "^
  78. " buffer-substring] 20))
  79. (defun dired-move-to-filename nil "\
  80. In dired, move to first char of filename on this line.
  81. Returns position (dot) 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 " " "^ " nil] 13))
  82. (defun dired-mark-auto-save-files nil "\
  83. Mark for deletion files whose names suggest they are auto save files." (interactive) (byte-code "ÁˆŠ ebˆm?…SÄÅ!?…Kl?…KÆÇ!ƒ3È \"
  84. ƒ.Ç
  85. !‚/Á)‚?É ƒ>ÄÊ!‚?Á…KË ˆÌÍ!ˆÎ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] 22))
  86. (defun dired-mark-backup-files nil "\
  87. Mark all backup files (names ending with ~) for deletion." (interactive) (byte-code "ÁˆŠ ebˆm?…7ÂÃ!?…/l?…/Ä ˆÅÆ!ˆÂÇ!…/È ˆÉÊ!ˆËcˆÌÊ!ˆ‚))‡" [buffer-read-only nil looking-at " d" end-of-line forward-char -1 "~" beginning-of-line delete-char 1 "D" forward-line] 15))
  88. (defun dired-mark-backup-and-auto-save-files nil "\
  89. Mark all backup and temporary files for deletion.
  90. Backup files have names ending in ~. Auto save file names usually
  91. start with #." (interactive) (byte-code "ÀˆÁ ˆÂ ‡" [nil dired-mark-backup-files dired-mark-auto-save-files] 4))
  92. (defun dired-rename-file (to-file) "\
  93. Rename this file to TO-FILE." (interactive "sRename to: ") (byte-code "ˆÃÄ Å!‰\"ˆ
  94. Æ ˆÇ`ÈÉ!ˆ`\"ˆÅ!‰ˆÊË!Ì!\")‡" [to-file buffer-read-only nil rename-file dired-get-filename expand-file-name beginning-of-line delete-region forward-line 1 dired-add-entry file-name-directory file-name-nondirectory] 17))
  95. (defun dired-copy-file (to-file) "\
  96. Copy this file to TO-FILE." (interactive "sCopy to: ") (byte-code "ÁˆÂà \"ˆÄ!‰ˆÅÆ!Ç!\"‡" [to-file nil copy-file dired-get-filename expand-file-name dired-add-entry file-name-directory file-name-nondirectory] 9))
  97. (defun dired-add-entry (directory filename) (byte-code "É \"ƒG ÊË P&ˆÌÍ!ˆÎcˆÏ ˆ`Ð ˆ`Ñ\"‰ˆÒ\"ˆÓ!c*ˆÔ )‚HÇ" [directory default-directory buffer-read-only nil t dired-listing-switches filename beg end string-equal call-process "ls" forward-line -1 " " dired-move-to-filename end-of-line buffer-substring delete-region file-name-nondirectory beginning-of-line] 19))
  98. (defun dired-do-deletions nil "\
  99. In dired, delete the files marked for deletion." (interactive) (byte-code "ˆÂŠÈbˆÉÊ
  100. #… Ë !`SBB‰ˆ‚
  101. )ˆ?ƒ-ÌÍ!‚U΋ˆ ƒT …P @Abˆ
  102. ÂÏÐ�)ˆ A‰ˆ‚6)‚UÂ*‡" [delete-list answer nil t fill-column l buffer-read-only default-directory 1 re-search-forward "^D" dired-get-filename message "(No deletions requested)" ((byte-code "ÄÅ!ˆÆ ˆÇ‰ˆÈ
  103. ! …<iÉVƒÊc‚.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? "] 17)) (byte-code " @@P!ˆÃ`ÄÅ!ˆ`\"‡" [default-directory l delete-file delete-region forward-line 1] 6) ((error (byte-code "ÀÁ!ˆÂc‡" [delete-char 1 " "] 3)))] 20))