60 |
:type 'string |
:type 'string |
61 |
:group 'dired) |
: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.") |
66 |
|
|
67 |
; Don't use absolute file names as /bin should be in any PATH and people |
; Don't use absolute file names as /bin should be in any PATH and people |
68 |
; may prefer /usr/local/gnu/bin or whatever. However, chown is |
; may prefer /usr/local/gnu/bin or whatever. However, chown is |
69 |
; usually not in PATH. |
; usually not in PATH. |
278 |
(defvar dired-re-perms "[-bcdlps][-r][-w].[-r][-w].[-r][-w].") |
(defvar dired-re-perms "[-bcdlps][-r][-w].[-r][-w].[-r][-w].") |
279 |
(defvar dired-re-dot "^.* \\.\\.?/?$") |
(defvar dired-re-dot "^.* \\.\\.?/?$") |
280 |
|
|
281 |
;; The subdirectory names in this list are expanded. |
;; The subdirectory names in the next two lists are expanded. |
282 |
(defvar dired-subdir-alist nil |
(defvar dired-subdir-alist nil |
283 |
"Association list of subdirectories and their buffer positions. |
"Association list of subdirectories and their buffer positions. |
284 |
Each subdirectory has an element: (DIRNAME . STARTMARKER). |
Each subdirectory has an element: (DIRNAME . STARTMARKER). |
285 |
The order of elements is the reverse of the order in the buffer. |
The order of elements is the reverse of the order in the buffer. |
286 |
In simple cases, this list contains one element.") |
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) |
292 |
|
|
293 |
(defvar dired-subdir-regexp "^. \\([^\n\r]+\\)\\(:\\)[\n\r]" |
(defvar dired-subdir-regexp "^. \\([^\n\r]+\\)\\(:\\)[\n\r]" |
294 |
"Regexp matching a maybe hidden subdirectory line in `ls -lR' output. |
"Regexp matching a maybe hidden subdirectory line in `ls -lR' output. |
295 |
Subexpression 1 is the subdirectory proper, no trailing colon. |
Subexpression 1 is the subdirectory proper, no trailing colon. |
970 |
(condition-case () |
(condition-case () |
971 |
(progn |
(progn |
972 |
(dired-uncache dir) |
(dired-uncache dir) |
973 |
(dired-insert-subdir dir)) |
(dired-insert-subdir dir) |
974 |
|
(let ((switches (cdr (assoc-string dir dired-switches-alist)))) |
975 |
|
(and switches |
976 |
|
(string-match "R" switches) |
977 |
|
(dolist (cur-ass (copy-sequence old-subdir-alist)) |
978 |
|
(when (dired-in-this-tree (car cur-ass) dir) |
979 |
|
(setq old-subdir-alist |
980 |
|
(delete cur-ass old-subdir-alist))))))) |
981 |
(error nil)))))) |
(error nil)))))) |
982 |
|
|
983 |
(defun dired-uncache (dir) |
(defun dired-uncache (dir) |
1422 |
'(dired-font-lock-keywords t nil nil beginning-of-line)) |
'(dired-font-lock-keywords t nil nil beginning-of-line)) |
1423 |
(set (make-local-variable 'desktop-save-buffer) |
(set (make-local-variable 'desktop-save-buffer) |
1424 |
'dired-desktop-buffer-misc-data) |
'dired-desktop-buffer-misc-data) |
1425 |
|
(setq dired-switches-alist nil) |
1426 |
(dired-sort-other dired-actual-switches t) |
(dired-sort-other dired-actual-switches t) |
1427 |
(run-mode-hooks 'dired-mode-hook) |
(run-mode-hooks 'dired-mode-hook) |
1428 |
(when (featurep 'x-dnd) |
(when (featurep 'x-dnd) |
2090 |
(goto-char (match-beginning 0)) |
(goto-char (match-beginning 0)) |
2091 |
(beginning-of-line) |
(beginning-of-line) |
2092 |
(point-marker)))) |
(point-marker)))) |
2093 |
(if (> count 1) |
(if (and (> count 1) (interactive-p)) |
2094 |
(message "Buffer includes %d directories" count)) |
(message "Buffer includes %d directories" count)) |
2095 |
;; We don't need to sort it because it is in buffer order per |
;; We don't need to sort it because it is in buffer order per |
2096 |
;; constructionem. Return new alist: |
;; constructionem. Return new alist: |
3291 |
nil))) |
nil))) |
3292 |
|
|
3293 |
(defun dired-dnd-popup-notice () |
(defun dired-dnd-popup-notice () |
3294 |
(x-popup-dialog |
(x-popup-dialog |
3295 |
t |
t |
3296 |
'("Recursive copies not enabled.\nSee variable dired-recursive-copies." |
'("Recursive copies not enabled.\nSee variable dired-recursive-copies." |
3297 |
("Ok" . nil)))) |
("Ok" . nil)))) |
3298 |
|
|
3299 |
|
|
3300 |
(defun dired-dnd-do-ask-action (uri) |
(defun dired-dnd-do-ask-action (uri) |
3301 |
;; No need to get actions and descriptions from the source, |
;; No need to get actions and descriptions from the source, |
3302 |
;; we only have three actions anyway. |
;; we only have three actions anyway. |
3303 |
(let ((action (x-popup-menu |
(let ((action (x-popup-menu |
3304 |
t |
t |
3305 |
(list "What action?" |
(list "What action?" |
3306 |
(cons "" |
(cons "" |