]> code.delx.au - gnu-emacs/blobdiff - lisp/dired.el
*** empty log message ***
[gnu-emacs] / lisp / dired.el
index d263f0b3044d0a5bee3b85879bc0dbfe4174d671..7e959b89a200d34f7d9bf22161e06c32954bd9c9 100644 (file)
@@ -1,7 +1,7 @@
 ;;; 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
@@ -70,7 +70,7 @@ If nil, `dired-listing-switches' is used.")
 
 ;;;###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"
@@ -335,13 +335,24 @@ Subexpression 2 must end right before the \\n or \\r.")
   "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."
@@ -403,10 +414,10 @@ Subexpression 2 must end right before the \\n or \\r.")
    ;; 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
@@ -584,8 +595,12 @@ Don't use that together with FILTER."
            (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
@@ -1671,14 +1686,14 @@ Otherwise, for buffers inheriting from dired-mode, call `toggle-read-only'."
   "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)
@@ -1994,7 +2009,7 @@ Return the position of the beginning of the filename, or nil if none found."
               (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")))
@@ -3253,6 +3268,9 @@ Anything else means ask for each directory."
        (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.
@@ -3336,7 +3354,7 @@ Ask means pop up a menu for the user to select one of copy, move or link."
           (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))