Commits

michaels  committed 90991f9

Synch up to the official Dired 7.10 release.

  • Participants
  • Parent commits 448f049

Comments (0)

Files changed (8)

+2002-04-12  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
+
+	* Dired 7.10.
+
+2002-04-10  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
+
+	* dired.el (dired-re-month-and-time): Make regexp for months more
+	liberal, drawing from GNU Emacs's dired.el, hopefully making
+	things work better in locales other than C.
+	(dired-unmark-subdir-files): Added.
+	(dired-unmark-files-in-region): Added.
+	(dired-unmark): Make it work when looking at subdir, thus making
+	it conform to its own documentation.
+	(dired-repeat-over-lines): Stop when we've reached the wall, thus
+	fixing some infinite recursions.
+
+2002-04-06  James LewisMoss  <dres@lewismoss.org>
+
+	* dired-shell.el (dired-do-shell-command): replace % with %% in
+	the filename.
+
+2000-12-09  Karl M. Hegbloom  <karlheg@debian.org>
+
+	* dired-faces.el: Nicer default faces - fixes black on black
+	permissions face on TTY
+
+2000-10-19  Karl M. Hegbloom  <karlheg@debian.org>
+
+	* dired-xemacs.el: Better movement in permissions field.
+
+2002-04-03  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
+
+	* dired.el (dired-directory-truename): Added.
+	(dired-find-buffer-nocreate): Don't create new buffer if
+	`find-file-compare-truenames' is non-nil and truenames
+	match.
+
+2002-01-01  Adrian Aichner  <adrian@xemacs.org>
+
+	* dired-diff.el (dired-ediff): Invoke ediff-files on two files,
+	ediff-directories on two directories, or exit with warning.
+
+2001-08-14  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
+
+	* dired.el (dired-re-month-and-time): Allow a space as a first
+	digit of `time'.
+
+2001-07-27  Peter Thiemann <thiemann@informatik.uni-freiburg.de>
+
+	* dired-shell.el (dired-postscript-print-command): Don't try to
+	apply concat to a list.
+
+2001-07-03  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
+
+	* dired-xemacs.el: Remove bindings for Home and End.
+
+2001-06-11  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
+
+	* dired.el (dired-insert-subdir-doinsert): Don't indent the
+	listing twice.
+
 2001-06-03  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
 
 	* fixup.el (load-path): Use DIFFMODEDIR.
 
 It is available from
 
-http://www-uk.hpl.hp.com/people/ange/efs
+http://www-pu.informatik.uni-tuebingen.de/users/sperber/software/dired/
 
 For installation instructions, see file INSTALL.
 

File dired-diff.el

 ;;;###autoload
 (defun dired-ediff (file)
   "Ediff file at point with FILE.
-FILE defaults to the file at the mark."
+FILE defaults to the file at the mark.
+`ediff-directories' is used if both files are directories."
   (interactive (list (dired-diff-read-file-name "Ediff")))
-  (ediff-files file (dired-get-filename)))
+  (let
+      ((file-at-mark-is-dir
+        (file-directory-p
+         (file-name-as-directory file)))
+       (file-at-point-is-dir
+        (file-directory-p
+         (file-name-as-directory (dired-get-filename)))))
+    (cond
+     ((and file-at-mark-is-dir file-at-point-is-dir)
+      (ediff-directories file (dired-get-filename) ""))
+     ((and (not file-at-mark-is-dir) (not file-at-point-is-dir))
+      (ediff-files file (dired-get-filename)))
+     (t
+      (apply
+       'warn
+       "Cannot compare file %s with directory %s"
+       (if file-at-mark-is-dir
+           (list (dired-get-filename) file)
+         (list file (dired-get-filename))))))))
 
 ;;;###autoload
 (defun dired-epatch (file)

File dired-faces.el

   :group 'dired-faces)
 
 
-(defface dired-face-marked '((((class color))
-			       (:background "PaleVioletRed"))
-			     (t (:underline t)))
+(defface dired-face-marked '((((type x pm mswindows)
+			       (class color))
+			      (:background "PaleVioletRed"))
+			     (((type tty)
+			       (class color mono))
+			      (:bold t)))
   "Face used for marked files."
-  :group 'dired-faces)
+  :group 'dired)
 
-(defface dired-face-flagged '((((class color))
+(defface dired-face-flagged '((((type x pm mswindows)
+				(class color)
+				(background light))
 			       (:background "LightSlateGray"))
-			      (t (:underline t)))
+			      (((type x pm mswindows)
+				(class color)
+				(background dark))
+			       (:background "DarkSlateGray"
+				:underline t)))
   "Face used for flagged files."
-  :group 'dired-faces)
+  :group 'dired)
 
-(defface dired-face-directory '((t (:bold t)))
+(defface dired-face-directory '((((type x pm mswindows tty)
+				  (class color))
+				 (:bold t)))
   "Face used for directories."
-  :group 'dired-faces)
+  :group 'dired)
 
-(defface dired-face-executable '((((class color))
-				  (:foreground "SeaGreen"))
-				 (t (:bold t)))
+(defface dired-face-executable '((((type x pm mswindows)
+				   (class color)
+				   (background light))
+				  (:foreground "green4"))
+				 (((type tty)
+				   (class color))
+				  (:foreground "green"))
+				 (((type x pm mswindows)
+				   (class color)
+				   (background dark))
+				  (:foreground "green"))
+				 (t
+				  (:bold t)))
   "Face used for executables."
-  :group 'dired-faces)
+  :group 'dired)
 
 (defface dired-face-setuid '((((class color))
 			      (:foreground "Red"))
-			     (t (:bold t)))
+			     (t
+			      (:bold t)))
   "Face used for setuid executables."
-  :group 'dired-faces)
+  :group 'dired)
 
-(defface dired-face-boring '((((class color))
-			      (:foreground "Gray65"))
-			     (((class grayscale))
-			      (:foreground "Gray65")))
+(defface dired-face-boring '((((type x pm mswindows)
+			       (class color grayscale)
+			       (background light))
+			      (:foreground "gray30"))
+			     (((type x pm mswindows)
+			       (class color grayscale)
+			       (background dark))
+			      (:foreground "gray65"))
+			     (((type tty)
+			       (class color)
+			       (background dark))
+			      (:foreground "white"
+			       :dim t))
+			     (((type tty)
+			       (class color)
+			       (background light))
+			      (:foreground "gray65")))
   "Face used for unimportant files."
-  :group 'dired-faces)
+  :group 'dired)
 
-(defface dired-face-permissions '((((type tty))
+(defface dired-face-permissions '((((type tty)
+				    (class color))
 				   (:foreground "black"
-				    :background "white"))
-				  (t
-				    (:background "grey75"
-				     :foreground "black")))
+				    :background "cyan"))
+				  (((type x pm mswindows)
+				    (class color))
+				   (:foreground "black"
+				    :background "grey75")))
   "Face used for interactive permissions."
-  :group 'dired-faces)
+  :group 'dired)
 
 (defface dired-face-header '((t (:background "grey75"
                                  :foreground "black")))
 
 (defface dired-face-socket '((((class color))
 			      (:foreground "magenta"))
-			     (t (:bold nil)))
+			     (t
+			      (:bold nil)))
   "Face used to indicate sockets."
-  :group 'dired-faces)
+  :group 'dired)
 
-(defface dired-face-symlink  '((((class color))
-			      (:foreground "cyan"))
-			     (t (:bold t)))
+(defface dired-face-symlink  '((((type x pm mswindows)
+				 (class color)
+				 (background light))
+				(:foreground "cyan4"))
+			       (((class color))
+				(:foreground "cyan"))
+			       (t
+				(:bold t)))
   "Face used to indicate symbolic links."
-  :group 'dired-faces)
+  :group 'dired)
 
 ;;; end of dired-faces.el

File dired-sex.el

 
     inode  [integer] the inode of the file (only for ls -i output)
     s      [integer] the size of the file for ls -s output
-	             (ususally in blocks or, with -k, in KByte)
+	             (usually in blocks or, with -k, in KByte)
     mode   [string]  file permission bits, e.g. \"-rw-r--r--\"
     nlink  [integer] number of links to file
     uid    [string]  owner

File dired-shell.el

 	(require 'ps-print)
 	(concat ps-lpr-command
 		" "
-		(ps-flatten-list (mapcar 'ps-eval-switch ps-lpr-switches))))
+		(mapconcat 'identity
+			   (ps-flatten-list (mapcar 'ps-eval-switch ps-lpr-switches))
+			   " ")))
     (error
      (concat
       (if (boundp 'lpr-command)
    (cons ?v 'dired-file-name-sans-rcs-extension)
    (cons ?z 'dired-file-name-sans-compress-extension))
   "Alist that associates keys with file transformer functions
-Each transformer function should be a funcion of one argument, the file name.
+Each transformer function should be a function of one argument, the file name.
 The keys are characters.")
 
 (defvar dired-shell-failure-marker ?!
      (list
       (dired-read-shell-command
        (concat (if dir
-		   (format "! in %s " (dired-abbreviate-file-name dir))
+		   (format "! in %s " (replace-in-string
+                                       (dired-abbreviate-file-name dir)
+                                       "%" "%%"))
 		 "cd <dir>; ! ")
 	       "on "
 	       (if on-each "each ")

File dired-xemacs.el

       (forward-line direction))
     (goto-char (extent-start-position extent))))
 
+(defun dired-move-to-permissions (domain direction)
+  (skip-chars-backward "^\r\n")
+  (let (extent)
+    (while (not (setq extent (map-extents (function
+					   (lambda (e p)
+					    (and
+					     (char-equal domain (extent-property e p))
+					     e)))
+					  (current-buffer)
+					  (point)
+					  (save-excursion
+					    (skip-chars-forward "^\r\n")
+					    (point))
+					  'dired-permissions)))
+      (forward-line direction))
+    (goto-char (extent-start-position extent))))
+
 ;;; Interactive chmod
 ;;; (based on ideas from Russell Ritchie's dired-chmod.el)
 
 ;; . and .. files
 
 (setq dired-re-month-and-time
-      (let* ((month (concat "\\("
-			  (mapconcat 'identity
-					;; June and July are for HP-UX 9.0
-				     '("Jan" "Feb" "Mar" "Apr" "May" "June?"
-				       "July?" "Aug" "Sep" "Oct" "Nov" "Dec")
-				     "\\|")
-			  "\\)"))
+      (let* ((l "\\([A-Za-z]\\|[^\0-\177]\\)")
+	     ;; In some locales, month abbreviations are as short as 2 letters,
+	     ;; and they can be padded on the right with spaces.
+	     ;; weiand: changed: month ends potentially with . or , or .,
+	     ;;old	 (month (concat l l "+ *"))
+	     (month (concat l l "+[.]?,? *"))
 	     (date "[ 0-3][0-9]")
-	     (time "[012][0-9]:[0-6][0-9]")
+	     (time "[ 012][0-9]:[0-6][0-9]")
 	     (year (concat
 		    "\\("
 		    ;; year on IRIX, NeXT, SunOS, ULTRIX, Apollo, HP-UX, A/UX
 				 dired-subdir-alist)))
 		 (current-buffer))))
     ;; Else just look through the buffer list.
-    (let (found (blist (buffer-list)))
+    (let (found
+	  (search-directory
+	   (if find-file-compare-truenames
+	       (dired-directory-truename dir-or-list)
+	     dir-or-list))
+	  (blist (buffer-list)))
       (or mode (setq mode 'dired-mode))
       (save-excursion
 	(while blist
 	  (set-buffer (car blist))
 	  (if (and (eq major-mode mode)
-		   (equal dired-directory dir-or-list))
+		   (equal (if find-file-compare-truenames
+			      (dired-directory-truename dired-directory)
+			    dired-directory)
+			  search-directory))
 	      (setq found (car blist)
 		    blist nil)
 	    (setq blist (cdr blist)))))
       found)))
 
+(defun dired-directory-truename (dir)
+  "Convert value of `dired-directory' to truename form."
+  (if (consp dir)
+      (cons (file-truename (car dir))
+	    (cdr dir))
+    (file-truename dir)))
+
 (defun dired-initial-position (dirname)
   ;; Where point should go in a new listing of DIRNAME.
   ;; Point assumed at beginning of new subdir line.
 	;; top level directory may contain wildcards:
 	(let ((dired-internal-switches switches))
 	  (dired-readin-insert dired-directory
-			       (null (file-directory-p dired-directory))))
+			       (null (file-directory-p dired-directory)))
+	  (setq end (point-marker)))
       (let ((switches (dired-make-switches-string switches))
 	    (insert-directory-program dired-ls-program))
 	(if (consp dir-or-list)
 		(lambda (x)
 		  (insert-directory x switches t)))
 	       (cdr dir-or-list)))
-	  (insert-directory dirname switches nil t))))
+	  (insert-directory dirname switches nil t))
+	(setq end (point-marker))
+	(dired-indent-listing begin end)
+	(dired-insert-set-properties begin end)))
     (message "Reading directory %s...done" dirname)
-    (setq end (point-marker))
-    (dired-indent-listing begin end)
-    (dired-insert-set-properties begin end)
     ;;  call dired-insert-headerline afterwards, as under VMS dired-ls
     ;;  does insert the headerline itself and the insert function just
     ;;  moves point.
 	    (while  (not (or (save-excursion (dired-move-to-filename))
 			     (setq wall (funcall check-fun))))
 	      (forward-line advance))
-	    (or wall
-		(progn
-		  (save-excursion (funcall function))
-		  (forward-line advance)
-		  (while (not (or (save-excursion (dired-move-to-filename))
-				  (setq wall (funcall check-fun))))
-		    (forward-line advance))
-		  (setq done (or (zerop (setq n (1- n))) wall)))))
+	    (if wall
+		(setq done t)
+	      (save-excursion (funcall function))
+	      (forward-line advance)
+	      (while (not (or (save-excursion (dired-move-to-filename))
+			      (setq wall (funcall check-fun))))
+		(forward-line advance))
+	      (setq done (or (zerop (setq n (1- n))) wall))))
 	(if (save-excursion (dired-move-to-filename))
 	    (save-excursion (funcall function)))
 	(setq done t))))
   "Unmark the current (or next ARG) files.
 If looking at a subdir, unmark all its files except `.' and `..'."
   (interactive "p")
-  (let (buffer-read-only)
-    (dired-repeat-over-lines
-     arg
-     (function
-      (lambda ()
-	(let ((char (char-after (point))))
-	  (or (memq char '(?\  ?\n ?\r))
-	      (progn
-		(cond
-		 ((char-equal char dired-marker-char)
-		  (setq dired-marks-number (max (1- dired-marks-number) 0)))
-		 ((char-equal char dired-del-marker)
-		  (setq dired-del-flags-number
-			(max (1- dired-del-flags-number) 0)))
-		 ((setq dired-other-marks-number
-			(max (1- dired-other-marks-number) 0))))
-		(dired-substitute-marker (point) char ?\ )))))))
-    (dired-update-mode-line-modified)))
+  (if (dired-get-subdir)
+      (dired-unmark-subdir-files)
+    (let (buffer-read-only)
+      (dired-repeat-over-lines
+       arg
+       (function
+	(lambda ()
+	  (let ((char (char-after (point))))
+	    (or (memq char '(?\  ?\n ?\r))
+		(progn
+		  (cond
+		   ((char-equal char dired-marker-char)
+		    (setq dired-marks-number (max (1- dired-marks-number) 0)))
+		   ((char-equal char dired-del-marker)
+		    (setq dired-del-flags-number
+			  (max (1- dired-del-flags-number) 0)))
+		   ((setq dired-other-marks-number
+			  (max (1- dired-other-marks-number) 0))))
+		  (dired-substitute-marker (point) char ?\ )))))))
+      (dired-update-mode-line-modified))))
+
+(defun dired-unmark-subdir-files ()
+  "Unmark all files except `.' and `..'."
+  (interactive)
+  (save-excursion
+    (dired-unmark-files-in-region (dired-subdir-min) (dired-subdir-max))))
 
 (defun dired-mark-prefix (&optional arg)
   "Mark the next ARG files with the next character typed.
       (forward-line 1)))
   (dired-update-mode-line-modified))
 
+(defun dired-unmark-files-in-region (start end)
+  (let (buffer-read-only)
+    (if (> start end)
+	(error "start > end"))
+    (goto-char start)			; assumed at beginning of line
+    (while (< (point) end)
+      ;; Skip subdir line and following garbage like the `total' line:
+      (while (and (< (point) end) (dired-between-files))
+	(forward-line 1))
+      (let ((char (char-after (point))))
+	(or (memq char '(?\  ?\n ?\r))
+	    (progn
+	      (cond
+	       ((char-equal char dired-marker-char)
+		(setq dired-marks-number (max (1- dired-marks-number) 0)))
+	       ((char-equal char dired-del-marker)
+		(setq dired-del-flags-number
+		      (max (1- dired-del-flags-number) 0)))
+	       ((setq dired-other-marks-number
+		      (max (1- dired-other-marks-number) 0))))
+	      (dired-substitute-marker (point) char ?\ ))))
+      (forward-line 1)))
+  (dired-update-mode-line-modified))
+
 (defun dired-mark-list ()
   ;; Returns a list of all marks currently used in the buffer.
   (let ((result nil)
   ;;   the new files.  Target may be a plain file if only one marked
   ;;   file exists.
   ;; OP-SYMBOL is the symbol for the operation.  Function `dired-mark-pop-up'
-  ;;   will determine wether pop-ups are appropriate for this OP-SYMBOL.
+  ;;   will determine whether pop-ups are appropriate for this OP-SYMBOL.
   ;; FILE-CREATOR and OPERATION as in dired-create-files.
   ;; ARG as in dired-get-marked-files.
   ;; PROMPTER is a function of one-arg, the list of files, to return a prompt