;;; dired.el --- directory-browsing commands
;; Copyright (C) 1985, 1986, 1992, 1993, 1994, 1995, 1996, 1997, 2000,
-;; 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+;; 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Author: Sebastian Kremer <sk@thp.uni-koeln.de>
;; Maintainer: FSF
;;;###autoload
(defvar dired-chown-program
- (if (memq system-type '(hpux dgux usg-unix-v irix linux gnu/linux cygwin))
+ (if (memq system-type '(hpux usg-unix-v irix linux gnu/linux cygwin))
"chown"
(if (file-exists-p "/usr/sbin/chown")
"/usr/sbin/chown"
"Face name used for flagged files.")
(defface dired-warning
- '((t (:inherit font-lock-comment-face)))
+ ;; Inherit from font-lock-warning-face since with min-colors 8
+ ;; font-lock-comment-face is not colored any more.
+ '((t (:inherit font-lock-warning-face)))
"Face used to highlight a part of a buffer that needs user attention."
:group 'dired-faces
:version "22.1")
(defvar dired-warning-face 'dired-warning
"Face name used for a part of a buffer that needs user attention.")
+(defface dired-warn-writable
+ '((((type w32 pc)) :inherit default) ;; These default to rw-rw-rw.
+ (t (:inherit font-lock-warning-face)))
+ "Face used to highlight permissions of group- and world-writable files."
+ :group 'dired-faces
+ :version "22.2")
+(defvar dired-warn-writable-face 'dired-warn-writable
+ "Face name used for permissions of group- and world-writable files.")
+
(defface dired-directory
'((t (:inherit font-lock-function-name-face)))
"Face used for subdirectories."
;; fields with keymaps to frob the permissions, somewhat a la XEmacs.
(list (concat dired-re-maybe-mark dired-re-inode-size
"[-d]....\\(w\\)....") ; group writable
- '(1 dired-warning-face))
+ '(1 dired-warn-writable-face))
(list (concat dired-re-maybe-mark dired-re-inode-size
"[-d].......\\(w\\).") ; world writable
- '(1 dired-warning-face))
+ '(1 dired-warn-writable-face))
;;
;; Subdirectories.
(list dired-re-dir
(if (next-read-file-uses-dialog-p)
(read-directory-name (format "Dired %s(directory): " str)
nil default-directory nil)
- (read-file-name (format "Dired %s(directory): " str)
- nil default-directory nil)))))
+ (let ((default (and buffer-file-name
+ (abbreviate-file-name buffer-file-name))))
+ (minibuffer-with-setup-hook
+ (lambda () (setq minibuffer-default default))
+ (read-file-name (format "Dired %s(directory): " str)
+ nil default-directory nil)))))))
;;;###autoload (define-key ctl-x-map "d" 'dired)
;;;###autoload
"Move down lines then position at filename.
Optional prefix ARG says how many lines to move; default is one line."
(interactive "p")
- (next-line arg)
+ (forward-line arg)
(dired-move-to-filename))
(defun dired-previous-line (arg)
"Move up lines then position at filename.
Optional prefix ARG says how many lines to move; default is one line."
(interactive "p")
- (previous-line arg)
+ (forward-line (- arg))
(dired-move-to-filename))
(defun dired-next-dirline (arg &optional opoint)
(forward-char -1))))
(or no-error
(not (eq opoint (point)))
- (error (if hidden
+ (error "%s" (if hidden
(substitute-command-keys
"File line is hidden, type \\[dired-hide-subdir] to unhide")
"No file on this line")))
(cond ;; if split-height-threshold is enabled, use the largest window
((and (> (window-height (setq w2 (get-largest-window)))
split-height-threshold)
- (= (frame-width) (window-width w2)))
+ (window-full-width-p w2))
(setq window w2))
;; if the least-recently-used window is big enough, use it
((and (> (window-height (setq w2 (get-lru-window)))
(* 2 window-min-height))
- (= (frame-width) (window-width w2)))
+ (window-full-width-p w2))
(setq window w2)))
(save-excursion
(set-buffer buf)
(dired-dnd-handle-local-file uri action)
nil)))
+(declare-function dired-relist-entry "dired-aux" (file))
+(declare-function make-symbolic-link "fileio.c")
+
(defun dired-dnd-handle-local-file (uri action)
"Copy, move or link a file to the dired directory.
URI is the file to handle, ACTION is one of copy, move, link or ask.
(dired dired-dir)
;; The following elements of `desktop-buffer-misc' are the keys
;; from `dired-subdir-alist'.
- (mapcar 'dired-maybe-insert-subdir (cdr desktop-buffer-misc))
+ (mapc 'dired-maybe-insert-subdir (cdr desktop-buffer-misc))
(current-buffer))
(message "Desktop: Directory %s no longer exists." dir)
(when desktop-missing-file-warning (sit-for 1))