Mercurial > emacs
comparison lisp/dired.el @ 89943:4c90ffeb71c5
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-15
Merge from emacs--cvs-trunk--0
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-218
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-220
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-221
Restore deleted tagline in etc/TUTORIAL.ru
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-222
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-228
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-229
Remove TeX output files from the archive
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-230
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-247
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-248
src/lisp.h (CYCLE_CHECK): Macro moved from xfaces.c
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-249
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-256
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-258
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-263
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-264
Update from CVS: lispref/display.texi: emacs -> Emacs.
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-265
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-274
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-275
Update from CVS: man/makefile.w32-in: Revert last change
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-276
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-295
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-296
Allow restarting an existing debugger session that's exited
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-297
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-299
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-300
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-327
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-328
Update from CVS: src/.gdbinit (xsymbol): Fix last change.
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-329
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-344
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-345
Tweak source regexps so that building in place won't cause problems
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-346
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-351
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-352
Update from CVS: lisp/flymake.el: New file.
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-353
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-361
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-362
Support " [...]" style defaults in minibuffer-electric-default-mode
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-363
(read-number): Use canonical format for default in prompt.
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-364
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-367
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-368
Improve display-supports-face-attributes-p on non-ttys
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-369
Rewrite face-differs-from-default-p
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-370
Move `display-supports-face-attributes-p' entirely into C code
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-371
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-372
Simplify face-differs-from-default-p; don't consider :stipple.
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-373
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-374
(tty_supports_face_attributes_p): Ensure attributes differ from default
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-375
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-376
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-377
(Fdisplay_supports_face_attributes_p): Work around bootstrapping problem
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-378
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-380
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-381
Face merging cleanups
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-382
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-384
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-385
src/xfaces.c (push_named_merge_point): Return 0 if a cycle is detected
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-386
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-395
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-396
Tweak arch tagging to make build/install-in-place less annoying
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-397
Work around vc-arch problems when building eshell
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-398
Tweak permissions
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-399
Tweak directory permissions
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-400
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-401
More build-in-place tweaking of arch tagging
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-402
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-403
Yet more build-in-place tweaking of arch tagging
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-404
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-409
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-410
Make sure image types are initialized for lookup too
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-411
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-416
Update from CVS
author | Miles Bader <miles@gnu.org> |
---|---|
date | Mon, 28 Jun 2004 07:56:49 +0000 |
parents | 68c22ea6027c e3ace501b5f4 |
children | 97905c4f1a42 |
comparison
equal
deleted
inserted
replaced
89942:9cb747ae49af | 89943:4c90ffeb71c5 |
---|---|
57 On systems such as MS-DOS and MS-Windows, which use `ls' emulation in Lisp, | 57 On systems such as MS-DOS and MS-Windows, which use `ls' emulation in Lisp, |
58 some of the `ls' switches are not supported; see the doc string of | 58 some of the `ls' switches are not supported; see the doc string of |
59 `insert-directory' on ls-lisp.el for more details." | 59 `insert-directory' on ls-lisp.el for more details." |
60 :type 'string | 60 :type 'string |
61 :group 'dired) | 61 :group 'dired) |
62 | |
63 (defvar dired-subdir-switches nil | |
64 "If non-nil, switches passed to `ls' for inserting subdirectories. | |
65 If nil, `dired-listing-switches' is used.") | |
62 | 66 |
63 ; Don't use absolute file names as /bin should be in any PATH and people | 67 ; Don't use absolute file names as /bin should be in any PATH and people |
64 ; may prefer /usr/local/gnu/bin or whatever. However, chown is | 68 ; may prefer /usr/local/gnu/bin or whatever. However, chown is |
65 ; usually not in PATH. | 69 ; usually not in PATH. |
66 | 70 |
272 "-[-r][-w].[-r][-w].[-r][-w][xst]") | 276 "-[-r][-w].[-r][-w].[-r][-w][xst]") |
273 "\\|")) | 277 "\\|")) |
274 (defvar dired-re-perms "[-bcdlps][-r][-w].[-r][-w].[-r][-w].") | 278 (defvar dired-re-perms "[-bcdlps][-r][-w].[-r][-w].[-r][-w].") |
275 (defvar dired-re-dot "^.* \\.\\.?/?$") | 279 (defvar dired-re-dot "^.* \\.\\.?/?$") |
276 | 280 |
277 ;; The subdirectory names in this list are expanded. | 281 ;; The subdirectory names in the next two lists are expanded. |
278 (defvar dired-subdir-alist nil | 282 (defvar dired-subdir-alist nil |
279 "Association list of subdirectories and their buffer positions. | 283 "Association list of subdirectories and their buffer positions. |
280 Each subdirectory has an element: (DIRNAME . STARTMARKER). | 284 Each subdirectory has an element: (DIRNAME . STARTMARKER). |
281 The order of elements is the reverse of the order in the buffer. | 285 The order of elements is the reverse of the order in the buffer. |
282 In simple cases, this list contains one element.") | 286 In simple cases, this list contains one element.") |
287 | |
288 (defvar dired-switches-alist nil | |
289 "Keeps track of which switches to use for inserted subdirectories. | |
290 This is an alist of the form (SUBDIR . SWITCHES).") | |
291 (make-variable-buffer-local 'dired-switches-alist) | |
283 | 292 |
284 (defvar dired-subdir-regexp "^. \\([^\n\r]+\\)\\(:\\)[\n\r]" | 293 (defvar dired-subdir-regexp "^. \\([^\n\r]+\\)\\(:\\)[\n\r]" |
285 "Regexp matching a maybe hidden subdirectory line in `ls -lR' output. | 294 "Regexp matching a maybe hidden subdirectory line in `ls -lR' output. |
286 Subexpression 1 is the subdirectory proper, no trailing colon. | 295 Subexpression 1 is the subdirectory proper, no trailing colon. |
287 The match starts at the beginning of the line and ends after the end | 296 The match starts at the beginning of the line and ends after the end |
869 "Reread the dired buffer. | 878 "Reread the dired buffer. |
870 Must also be called after dired-actual-switches have changed. | 879 Must also be called after dired-actual-switches have changed. |
871 Should not fail even on completely garbaged buffers. | 880 Should not fail even on completely garbaged buffers. |
872 Preserves old cursor, marks/flags, hidden-p." | 881 Preserves old cursor, marks/flags, hidden-p." |
873 (widen) ; just in case user narrowed | 882 (widen) ; just in case user narrowed |
874 (let ((opoint (point)) | 883 (let ((modflag (buffer-modified-p)) |
884 (opoint (point)) | |
875 (ofile (dired-get-filename nil t)) | 885 (ofile (dired-get-filename nil t)) |
876 (mark-alist nil) ; save marked files | 886 (mark-alist nil) ; save marked files |
877 (hidden-subdirs (dired-remember-hidden)) | 887 (hidden-subdirs (dired-remember-hidden)) |
878 (old-subdir-alist (cdr (reverse dired-subdir-alist))) ; except pwd | 888 (old-subdir-alist (cdr (reverse dired-subdir-alist))) ; except pwd |
879 (case-fold-search nil) ; we check for upper case ls flags | 889 (case-fold-search nil) ; we check for upper case ls flags |
896 (goto-char opoint)) ; was before | 906 (goto-char opoint)) ; was before |
897 (dired-move-to-filename) | 907 (dired-move-to-filename) |
898 (save-excursion ; hide subdirs that were hidden | 908 (save-excursion ; hide subdirs that were hidden |
899 (dolist (dir hidden-subdirs) | 909 (dolist (dir hidden-subdirs) |
900 (if (dired-goto-subdir dir) | 910 (if (dired-goto-subdir dir) |
901 (dired-hide-subdir 1))))) | 911 (dired-hide-subdir 1)))) |
912 (unless modflag (restore-buffer-modified-p nil))) | |
902 ;; outside of the let scope | 913 ;; outside of the let scope |
903 ;;; Might as well not override the user if the user changed this. | 914 ;;; Might as well not override the user if the user changed this. |
904 ;;; (setq buffer-read-only t) | 915 ;;; (setq buffer-read-only t) |
905 ) | 916 ) |
906 | 917 |
907 ;; Subroutines of dired-revert | 918 ;; Subroutines of dired-revert |
908 ;; Some of these are also used when inserting subdirs. | 919 ;; Some of these are also used when inserting subdirs. |
1158 (define-key map [menu-bar immediate find-file] | 1169 (define-key map [menu-bar immediate find-file] |
1159 '(menu-item "Find This File" dired-find-file | 1170 '(menu-item "Find This File" dired-find-file |
1160 :help "Edit file at cursor")) | 1171 :help "Edit file at cursor")) |
1161 (define-key map [menu-bar immediate create-directory] | 1172 (define-key map [menu-bar immediate create-directory] |
1162 '(menu-item "Create Directory..." dired-create-directory)) | 1173 '(menu-item "Create Directory..." dired-create-directory)) |
1174 (define-key map [menu-bar immediate wdired-mode] | |
1175 '(menu-item "Edit File Names" wdired-change-to-wdired-mode)) | |
1163 | 1176 |
1164 (define-key map [menu-bar regexp] | 1177 (define-key map [menu-bar regexp] |
1165 (cons "Regexp" (make-sparse-keymap "Regexp"))) | 1178 (cons "Regexp" (make-sparse-keymap "Regexp"))) |
1166 | 1179 |
1167 (define-key map [menu-bar regexp downcase] | 1180 (define-key map [menu-bar regexp downcase] |
1400 dired-directory))) | 1413 dired-directory))) |
1401 (set (make-local-variable 'dired-actual-switches) | 1414 (set (make-local-variable 'dired-actual-switches) |
1402 (or switches dired-listing-switches)) | 1415 (or switches dired-listing-switches)) |
1403 (set (make-local-variable 'font-lock-defaults) | 1416 (set (make-local-variable 'font-lock-defaults) |
1404 '(dired-font-lock-keywords t nil nil beginning-of-line)) | 1417 '(dired-font-lock-keywords t nil nil beginning-of-line)) |
1418 (set (make-local-variable 'desktop-save-buffer) | |
1419 'dired-desktop-buffer-misc-data) | |
1420 (setq dired-switches-alist nil) | |
1405 (dired-sort-other dired-actual-switches t) | 1421 (dired-sort-other dired-actual-switches t) |
1406 (run-mode-hooks 'dired-mode-hook) | 1422 (run-mode-hooks 'dired-mode-hook) |
1407 (when (featurep 'x-dnd) | 1423 (when (featurep 'x-dnd) |
1408 (make-variable-buffer-local 'x-dnd-test-function) | 1424 (make-variable-buffer-local 'x-dnd-test-function) |
1409 (make-variable-buffer-local 'x-dnd-protocol-alist) | 1425 (make-variable-buffer-local 'x-dnd-protocol-alist) |
1425 "d-elete, u-ndelete, x-punge, f-ind, o-ther window, R-ename, C-opy, h-elp")) | 1441 "d-elete, u-ndelete, x-punge, f-ind, o-ther window, R-ename, C-opy, h-elp")) |
1426 | 1442 |
1427 (defun dired-undo () | 1443 (defun dired-undo () |
1428 "Undo in a dired buffer. | 1444 "Undo in a dired buffer. |
1429 This doesn't recover lost files, it just undoes changes in the buffer itself. | 1445 This doesn't recover lost files, it just undoes changes in the buffer itself. |
1430 You can use it to recover marks, killed lines or subdirs. | 1446 You can use it to recover marks, killed lines or subdirs." |
1431 In the latter case, you have to do \\[dired-build-subdir-alist] to | |
1432 parse the buffer again." | |
1433 (interactive) | 1447 (interactive) |
1434 (let (buffer-read-only) | 1448 (let (buffer-read-only) |
1435 (undo) | 1449 (undo)) |
1436 (message "Change in Dired buffer undone. | 1450 (dired-build-subdir-alist) |
1437 Actual changes in files cannot be undone by Emacs."))) | 1451 (message "Change in Dired buffer undone. |
1452 Actual changes in files cannot be undone by Emacs.")) | |
1438 | 1453 |
1439 (defun dired-next-line (arg) | 1454 (defun dired-next-line (arg) |
1440 "Move down lines then position at filename. | 1455 "Move down lines then position at filename. |
1441 Optional prefix ARG says how many lines to move; default is one line." | 1456 Optional prefix ARG says how many lines to move; default is one line." |
1442 (interactive "p") | 1457 (interactive "p") |
1628 ((null file) | 1643 ((null file) |
1629 nil) | 1644 nil) |
1630 ((eq localp 'verbatim) | 1645 ((eq localp 'verbatim) |
1631 file) | 1646 file) |
1632 ((and (not no-error-if-not-filep) | 1647 ((and (not no-error-if-not-filep) |
1633 (save-excursion | 1648 (member file '("." ".."))) |
1634 (beginning-of-line) | |
1635 (looking-at dired-re-dot))) | |
1636 (error "Cannot operate on `.' or `..'")) | 1649 (error "Cannot operate on `.' or `..'")) |
1637 ((and (eq localp 'no-dir) already-absolute) | 1650 ((and (eq localp 'no-dir) already-absolute) |
1638 (file-name-nondirectory file)) | 1651 (file-name-nondirectory file)) |
1639 (already-absolute | 1652 (already-absolute |
1640 (let ((handler (find-file-name-handler file nil))) | 1653 (let ((handler (find-file-name-handler file nil))) |
1694 ;; use ~. | 1707 ;; use ~. |
1695 (if (and (> (length dir) 0) (= (aref dir 0) ?~)) | 1708 (if (and (> (length dir) 0) (= (aref dir 0) ?~)) |
1696 (setq dir (expand-file-name dir))) | 1709 (setq dir (expand-file-name dir))) |
1697 (if (string-match (concat "^" (regexp-quote dir)) file) | 1710 (if (string-match (concat "^" (regexp-quote dir)) file) |
1698 (substring file (match-end 0)) | 1711 (substring file (match-end 0)) |
1699 ;;; (or no-error | 1712 ;;; (or no-error |
1700 ;;; (error "%s: not in directory tree growing at %s" file dir)) | 1713 ;;; (error "%s: not in directory tree growing at %s" file dir)) |
1701 file)) | 1714 file)) |
1702 | 1715 |
1703 ;;; Functions for finding the file name in a dired buffer line. | 1716 ;;; Functions for finding the file name in a dired buffer line. |
1704 | 1717 |
2069 ;; Place a sub directory boundary between lines. | 2082 ;; Place a sub directory boundary between lines. |
2070 (save-excursion | 2083 (save-excursion |
2071 (goto-char (match-beginning 0)) | 2084 (goto-char (match-beginning 0)) |
2072 (beginning-of-line) | 2085 (beginning-of-line) |
2073 (point-marker)))) | 2086 (point-marker)))) |
2074 (if (> count 1) | 2087 (if (and (> count 1) (interactive-p)) |
2075 (message "Buffer includes %d directories" count)) | 2088 (message "Buffer includes %d directories" count)) |
2076 ;; We don't need to sort it because it is in buffer order per | 2089 ;; We don't need to sort it because it is in buffer order per |
2077 ;; constructionem. Return new alist: | 2090 ;; constructionem. Return new alist: |
2078 dired-subdir-alist))) | 2091 dired-subdir-alist))) |
2079 | 2092 |
3016 (reverse subdirs)) | 3029 (reverse subdirs)) |
3017 ;; No pre-R subdir alist, so revert to main directory | 3030 ;; No pre-R subdir alist, so revert to main directory |
3018 ;; listing: | 3031 ;; listing: |
3019 (list (car (reverse dired-subdir-alist)))))))) | 3032 (list (car (reverse dired-subdir-alist)))))))) |
3020 | 3033 |
3021 ;; To make this file smaller, the less common commands | |
3022 ;; go in a separate file. But autoload them here | |
3023 ;; to make the separation invisible. | |
3024 | |
3025 (autoload 'dired-diff "dired-aux" | |
3026 "Compare file at point with file FILE using `diff'. | |
3027 FILE defaults to the file at the mark. (That's the mark set by | |
3028 \\[set-mark-command], not by Dired's \\[dired-mark] command.) | |
3029 The prompted-for file is the first file given to `diff'." | |
3030 t) | |
3031 | |
3032 (autoload 'dired-backup-diff "dired-aux" | |
3033 "Diff this file with its backup file or vice versa. | |
3034 Uses the latest backup, if there are several numerical backups. | |
3035 If this file is a backup, diff it with its original. | |
3036 The backup file is the first file given to `diff'." | |
3037 t) | |
3038 | |
3039 (autoload 'dired-clean-directory "dired-aux" | |
3040 "Flag numerical backups for deletion. | |
3041 Spares `dired-kept-versions' latest versions, and `kept-old-versions' oldest. | |
3042 Positive prefix arg KEEP overrides `dired-kept-versions'; | |
3043 Negative prefix arg KEEP overrides `kept-old-versions' with KEEP made positive. | |
3044 | |
3045 To clear the flags on these files, you can use \\[dired-flag-backup-files] | |
3046 with a prefix argument." | |
3047 t) | |
3048 | |
3049 (autoload 'dired-do-chmod "dired-aux" | |
3050 "Change the mode of the marked (or next ARG) files. | |
3051 This calls chmod, thus symbolic modes like `g+w' are allowed." | |
3052 t) | |
3053 | |
3054 (autoload 'dired-do-chgrp "dired-aux" | |
3055 "Change the group of the marked (or next ARG) files." | |
3056 t) | |
3057 | |
3058 (autoload 'dired-do-chown "dired-aux" | |
3059 "Change the owner of the marked (or next ARG) files." | |
3060 t) | |
3061 | |
3062 (autoload 'dired-do-touch "dired-aux" | |
3063 "Change the timestamp of the marked (or next ARG) files." | |
3064 t) | |
3065 | |
3066 (autoload 'dired-do-print "dired-aux" | |
3067 "Print the marked (or next ARG) files. | |
3068 Uses the shell command coming from variables `lpr-command' and | |
3069 `lpr-switches' as default." | |
3070 t) | |
3071 | |
3072 (autoload 'dired-do-shell-command "dired-aux" | |
3073 "Run a shell command COMMAND on the marked files. | |
3074 If no files are marked or a specific numeric prefix arg is given, | |
3075 the next ARG files are used. Just \\[universal-argument] means the current file. | |
3076 The prompt mentions the file(s) or the marker, as appropriate. | |
3077 | |
3078 If there is a `*' in COMMAND, surrounded by whitespace, this runs | |
3079 COMMAND just once with the entire file list substituted there. | |
3080 | |
3081 If there is no `*', but there is a `?' in COMMAND, surrounded by | |
3082 whitespace, this runs COMMAND on each file individually with the | |
3083 file name substituted for `?'. | |
3084 | |
3085 Otherwise, this runs COMMAND on each file individually with the | |
3086 file name added at the end of COMMAND (separated by a space). | |
3087 | |
3088 `*' and `?' when not surrounded by whitespace have no special | |
3089 significance for `dired-do-shell-command', and are passed through | |
3090 normally to the shell, but you must confirm first. To pass `*' by | |
3091 itself to the shell as a wildcard, type `*\"\"'. | |
3092 | |
3093 If COMMAND produces output, it goes to a separate buffer. | |
3094 | |
3095 This feature does not try to redisplay Dired buffers afterward, as | |
3096 there's no telling what files COMMAND may have changed. | |
3097 Type \\[dired-do-redisplay] to redisplay the marked files. | |
3098 | |
3099 When COMMAND runs, its working directory is the top-level directory of | |
3100 the Dired buffer, so output files usually are created there instead of | |
3101 in a subdir. | |
3102 | |
3103 In a noninteractive call (from Lisp code), you must specify | |
3104 the list of file names explicitly with the FILE-LIST argument." | |
3105 t) | |
3106 | |
3107 (autoload 'dired-do-kill-lines "dired-aux" | |
3108 "Kill all marked lines (not the files). | |
3109 With a prefix arg, kill all lines not marked or flagged." | |
3110 t) | |
3111 | |
3112 (autoload 'dired-do-compress "dired-aux" | |
3113 "Compress or uncompress marked (or next ARG) files." | |
3114 t) | |
3115 | |
3116 (autoload 'dired-do-byte-compile "dired-aux" | |
3117 "Byte compile marked (or next ARG) Emacs Lisp files." | |
3118 t) | |
3119 | |
3120 (autoload 'dired-do-load "dired-aux" | |
3121 "Load the marked (or next ARG) Emacs Lisp files." | |
3122 t) | |
3123 | |
3124 (autoload 'dired-do-redisplay "dired-aux" | |
3125 "Redisplay all marked (or next ARG) files. | |
3126 If on a subdir line, redisplay that subdirectory. In that case, | |
3127 a prefix arg lets you edit the `ls' switches used for the new listing." | |
3128 t) | |
3129 | |
3130 (autoload 'dired-create-directory "dired-aux" | |
3131 "Create a directory called DIRECTORY." | |
3132 t) | |
3133 | |
3134 (autoload 'dired-do-copy "dired-aux" | |
3135 "Copy all marked (or next ARG) files, or copy the current file. | |
3136 Thus, a zero prefix argument copies nothing. But it toggles the | |
3137 variable `dired-copy-preserve-time' (which see)." | |
3138 t) | |
3139 | |
3140 (autoload 'dired-do-symlink "dired-aux" | |
3141 "Make symbolic links to current file or all marked (or next ARG) files. | |
3142 When operating on just the current file, you specify the new name. | |
3143 When operating on multiple or marked files, you specify a directory | |
3144 and new symbolic links are made in that directory | |
3145 with the same names that the files currently have." | |
3146 t) | |
3147 | |
3148 (autoload 'dired-do-hardlink "dired-aux" | |
3149 "Add names (hard links) current file or all marked (or next ARG) files. | |
3150 When operating on just the current file, you specify the new name. | |
3151 When operating on multiple or marked files, you specify a directory | |
3152 and new hard links are made in that directory | |
3153 with the same names that the files currently have." | |
3154 t) | |
3155 | |
3156 (autoload 'dired-do-rename "dired-aux" | |
3157 "Rename current file or all marked (or next ARG) files. | |
3158 When renaming just the current file, you specify the new name. | |
3159 When renaming multiple or marked files, you specify a directory." | |
3160 t) | |
3161 | |
3162 (autoload 'dired-do-rename-regexp "dired-aux" | |
3163 "Rename marked files containing REGEXP to NEWNAME. | |
3164 As each match is found, the user must type a character saying | |
3165 what to do with it. For directions, type \\[help-command] at that time. | |
3166 NEWNAME may contain \\=\\<n> or \\& as in `query-replace-regexp'. | |
3167 REGEXP defaults to the last regexp used. | |
3168 With a zero prefix arg, renaming by regexp affects the full file name; | |
3169 usually only the non-directory part of file names is used and changed." | |
3170 t) | |
3171 | |
3172 (autoload 'dired-do-copy-regexp "dired-aux" | |
3173 "Copy all marked files containing REGEXP to NEWNAME. | |
3174 See function `dired-do-rename-regexp' for more info." | |
3175 t) | |
3176 | |
3177 (autoload 'dired-do-hardlink-regexp "dired-aux" | |
3178 "Hardlink all marked files containing REGEXP to NEWNAME. | |
3179 See function `dired-do-rename-regexp' for more info." | |
3180 t) | |
3181 | |
3182 (autoload 'dired-do-symlink-regexp "dired-aux" | |
3183 "Symlink all marked files containing REGEXP to NEWNAME. | |
3184 See function `dired-do-rename-regexp' for more info." | |
3185 t) | |
3186 | |
3187 (autoload 'dired-upcase "dired-aux" | |
3188 "Rename all marked (or next ARG) files to upper case." | |
3189 t) | |
3190 | |
3191 (autoload 'dired-downcase "dired-aux" | |
3192 "Rename all marked (or next ARG) files to lower case." | |
3193 t) | |
3194 | |
3195 (autoload 'dired-maybe-insert-subdir "dired-aux" | |
3196 "Insert this subdirectory into the same dired buffer. | |
3197 If it is already present, just move to it (type \\[dired-do-redisplay] to refresh), | |
3198 else inserts it at its natural place (as `ls -lR' would have done). | |
3199 With a prefix arg, you may edit the ls switches used for this listing. | |
3200 You can add `R' to the switches to expand the whole tree starting at | |
3201 this subdirectory. | |
3202 This function takes some pains to conform to `ls -lR' output." | |
3203 t) | |
3204 | |
3205 (autoload 'dired-next-subdir "dired-aux" | |
3206 "Go to next subdirectory, regardless of level." | |
3207 t) | |
3208 | |
3209 (autoload 'dired-prev-subdir "dired-aux" | |
3210 "Go to previous subdirectory, regardless of level. | |
3211 When called interactively and not on a subdir line, go to this subdir's line." | |
3212 t) | |
3213 | |
3214 (autoload 'dired-goto-subdir "dired-aux" | |
3215 "Go to end of header line of DIR in this dired buffer. | |
3216 Return value of point on success, otherwise return nil. | |
3217 The next char is either \\n, or \\r if DIR is hidden." | |
3218 t) | |
3219 | |
3220 (autoload 'dired-mark-subdir-files "dired-aux" | |
3221 "Mark all files except `.' and `..'." | |
3222 t) | |
3223 | |
3224 (autoload 'dired-kill-subdir "dired-aux" | |
3225 "Remove all lines of current subdirectory. | |
3226 Lower levels are unaffected." | |
3227 t) | |
3228 | |
3229 (autoload 'dired-tree-up "dired-aux" | |
3230 "Go up ARG levels in the dired tree." | |
3231 t) | |
3232 | |
3233 (autoload 'dired-tree-down "dired-aux" | |
3234 "Go down in the dired tree." | |
3235 t) | |
3236 | |
3237 (autoload 'dired-hide-subdir "dired-aux" | |
3238 "Hide or unhide the current subdirectory and move to next directory. | |
3239 Optional prefix arg is a repeat factor. | |
3240 Use \\[dired-hide-all] to (un)hide all directories." | |
3241 t) | |
3242 | |
3243 (autoload 'dired-hide-all "dired-aux" | |
3244 "Hide all subdirectories, leaving only their header lines. | |
3245 If there is already something hidden, make everything visible again. | |
3246 Use \\[dired-hide-subdir] to (un)hide a particular subdirectory." | |
3247 t) | |
3248 | |
3249 (autoload 'dired-show-file-type "dired-aux" | |
3250 "Print the type of FILE, according to the `file' command. | |
3251 If FILE is a symbolic link and the optional argument DEREF-SYMLINKS is | |
3252 true then the type of the file linked to by FILE is printed instead." | |
3253 t) | |
3254 | |
3255 (autoload 'dired-run-shell-command "dired-aux") | |
3256 | |
3257 (autoload 'dired-query "dired-aux") | |
3258 | |
3259 | 3034 |
3260 ;;;; Drag and drop support | 3035 ;;;; Drag and drop support |
3261 | 3036 |
3262 (defun dired-dnd-test-function (window action types) | 3037 (defun dired-dnd-test-function (window action types) |
3263 "The test function for drag and drop into dired buffers. | 3038 "The test function for drag and drop into dired buffers. |
3270 (if type | 3045 (if type |
3271 (cons action type) | 3046 (cons action type) |
3272 nil))) | 3047 nil))) |
3273 | 3048 |
3274 (defun dired-dnd-popup-notice () | 3049 (defun dired-dnd-popup-notice () |
3275 (x-popup-dialog | 3050 (x-popup-dialog |
3276 t | 3051 t |
3277 '("Recursive copies not enabled.\nSee variable dired-recursive-copies." | 3052 '("Recursive copies not enabled.\nSee variable dired-recursive-copies." |
3278 ("Ok" . nil)))) | 3053 ("Ok" . nil)))) |
3279 | 3054 |
3280 | 3055 |
3281 (defun dired-dnd-do-ask-action (uri) | 3056 (defun dired-dnd-do-ask-action (uri) |
3282 ;; No need to get actions and descriptions from the source, | 3057 ;; No need to get actions and descriptions from the source, |
3283 ;; we only have three actions anyway. | 3058 ;; we only have three actions anyway. |
3284 (let ((action (x-popup-menu | 3059 (let ((action (x-popup-menu |
3285 t | 3060 t |
3286 (list "What action?" | 3061 (list "What action?" |
3287 (cons "" | 3062 (cons "" |
3288 '(("Copy here" . copy) | 3063 '(("Copy here" . copy) |
3289 ("Move here" . move) | 3064 ("Move here" . move) |
3338 ACTION is one of copy, move, link or ask. | 3113 ACTION is one of copy, move, link or ask. |
3339 Ask means pop up a menu for the user to select one of copy, move or link." | 3114 Ask means pop up a menu for the user to select one of copy, move or link." |
3340 (let ((local-file (x-dnd-get-local-file-uri uri))) | 3115 (let ((local-file (x-dnd-get-local-file-uri uri))) |
3341 (if local-file (dired-dnd-handle-local-file local-file action) | 3116 (if local-file (dired-dnd-handle-local-file local-file action) |
3342 nil))) | 3117 nil))) |
3343 | 3118 |
3119 | |
3120 ;;;; Desktop support | |
3121 | |
3122 (eval-when-compile (require 'desktop)) | |
3123 | |
3124 (defun dired-desktop-buffer-misc-data (desktop-dirname) | |
3125 "Auxiliary information to be saved in desktop file." | |
3126 (cons | |
3127 ;; Value of `dired-directory'. | |
3128 (if (consp dired-directory) | |
3129 ;; Directory name followed by list of files. | |
3130 (cons (desktop-file-name (car dired-directory) desktop-dirname) | |
3131 (cdr dired-directory)) | |
3132 ;; Directory name, optionally with with shell wildcard. | |
3133 (desktop-file-name dired-directory desktop-dirname)) | |
3134 ;; Subdirectories in `dired-subdir-alist'. | |
3135 (cdr | |
3136 (nreverse | |
3137 (mapcar | |
3138 (function (lambda (f) (desktop-file-name (car f) desktop-dirname))) | |
3139 dired-subdir-alist))))) | |
3140 | |
3141 ;;;###autoload | |
3142 (defun dired-restore-desktop-buffer (desktop-buffer-file-name | |
3143 desktop-buffer-name | |
3144 desktop-buffer-misc) | |
3145 "Restore a dired buffer specified in a desktop file." | |
3146 ;; First element of `desktop-buffer-misc' is the value of `dired-directory'. | |
3147 ;; This value is a directory name, optionally with with shell wildcard or | |
3148 ;; a directory name followed by list of files. | |
3149 (let* ((dired-dir (car desktop-buffer-misc)) | |
3150 (dir (if (consp dired-dir) (car dired-dir) dired-dir))) | |
3151 (if (file-directory-p (file-name-directory dir)) | |
3152 (progn | |
3153 (dired dired-dir) | |
3154 ;; The following elements of `desktop-buffer-misc' are the keys | |
3155 ;; from `dired-subdir-alist'. | |
3156 (mapcar 'dired-maybe-insert-subdir (cdr desktop-buffer-misc)) | |
3157 (current-buffer)) | |
3158 (message "Desktop: Directory %s no longer exists." dir) | |
3159 (when desktop-missing-file-warning (sit-for 1)) | |
3160 nil))) | |
3344 | 3161 |
3345 | 3162 |
3346 (if (eq system-type 'vax-vms) | 3163 (if (eq system-type 'vax-vms) |
3347 (load "dired-vms")) | 3164 (load "dired-vms")) |
3348 | 3165 |