diff -c -w "files-CVS-2008-02-29.el" "files-patched-2008-03-04a.el"
*** files-CVS-2008-02-29.el	Fri Feb 29 14:59:08 2008
--- files-patched-2008-03-04a.el	Tue Mar  4 14:04:36 2008
***************
*** 5284,5302 ****
  		      (if val
  			  (put-text-property pos (point)
  					     'dired-filename t)))))))
! 
! 	  (if full-directory-p
! 	      ;; Try to insert the amount of free space.
  	      (save-excursion
  		(goto-char beg)
! 		;; First find the line to put it on.
! 		(when (re-search-forward "^ *\\(total\\)" nil t)
! 		  (let ((available (get-free-disk-space ".")))
! 		    (when available
! 		      ;; Replace "total" with "used", to avoid confusion.
! 		      (replace-match "total used in directory" nil nil nil 1)
! 		      (end-of-line)
! 		      (insert " available " available)))))))))))
  
  (defun insert-directory-adj-pos (pos error-lines)
    "Convert `ls --dired' file name position value POS to a buffer position.
--- 5284,5444 ----
  		      (if val
  			  (put-text-property pos (point)
  					     'dired-filename t)))))))
! 	  (when full-directory-p
!             (save-excursion
!               (goto-char beg)
!               (while (re-search-forward "^ *\\(total\\)" nil t)
!                 (beginning-of-line)
!                 (insert "files " (number-to-string (save-match-data
!                                                      (count-dired-files)))
!                         "/" (number-to-string
!                              (- (length (directory-files default-directory
!                                                          nil nil t)) 2))
!                         " ")
!                 (goto-char beg)
!                 (re-search-forward "^files [0-9]+/[0-9]+ \\(total\\)" nil t)
!                 (replace-match "space used" nil nil nil 1)
!                 (let ((available (and (fboundp 'get-free-disk-space)
!                                       (get-free-disk-space ".")))
!                       (map (make-sparse-keymap)))
!                   (define-key map [mouse-2] 'dired-mouse-describe-listed-directory)
!                   (define-key map "\r" 'dired-describe-listed-directory)
!                   (when available (end-of-line) (insert " available " available))
!                   (add-text-properties
!                    (save-excursion (beginning-of-line) (+ 2 (point)))
!                    (1- (match-beginning 1))
!                    `(mouse-face highlight keymap ,map
!                      help-echo "Files shown / total files in directory \
! \[RET, mouse-2: more info]"))
!                   (add-text-properties
!                    (match-beginning 1) (save-excursion (end-of-line) (point))
!                    `(mouse-face highlight keymap ,map
!                      help-echo "Kbytes used in directory, Kbytes \
! available on disk [RET, mouse-2: more info]")))))))))))
! 
! (defun count-dired-files ()
!   "Returns the number of files in the current Dired directory listing.
! This includes directory entries, as well as files, but it excludes `.'
! and `..'."
!   ;; Should we skip `#' files also, as in `dired-trivial-filenames'? Dunno.
    (save-excursion
+     (re-search-backward "^$" nil 'to-bob)
+     (re-search-forward dired-move-to-filename-regexp nil t)
+     (let* ((beg (line-beginning-position))
+            (end (save-excursion (re-search-forward "^$" nil t)))
+            (dots-p (save-excursion      ; Is `..' present?
                       (goto-char beg)
!                      (re-search-forward
!                       (concat directory-listing-before-filename-regexp
!                               "\\.\\./?$")
!                       end t))))
!       (if dots-p (- (count-lines beg end) 2) (count-lines beg end)))))
! 
! (add-hook 'dired-after-readin-hook 'update-dired-files-count)
! (defun update-dired-files-count ()
!   "Update file count in Dired header for each directory listed."
!   (save-restriction
!     (widen)
!     (let ((num-files (number-to-string (count-dired-files))))
!       (save-excursion
!         (goto-char (point-min))
!         (while (re-search-forward "^  files \\([0-9]+\\)/\\([0-9]+\\)" nil t)
!           (let ((buffer-read-only nil)
!                 (map (make-sparse-keymap)))
!             (define-key map [mouse-2] 'dired-mouse-describe-listed-directory)
!             (define-key map "\r" 'dired-describe-listed-directory)
!             (replace-match (number-to-string (save-match-data (count-dired-files)))
!                            nil nil nil 1)
!             (replace-match (number-to-string
!                             (- (length (directory-files default-directory
!                                                         nil nil t)) 2))
!                            nil nil nil 2)
!             (add-text-properties
!              (save-excursion (beginning-of-line) (+ 2 (point))) (match-end 2)
!              `(mouse-face highlight keymap ,map
!                help-echo "Files shown / total files in directory \
! \[RET, mouse-2: more info]")))
!           (set-buffer-modified-p nil))))))
! 
! (defun dired-describe-listed-directory ()
!   "In Dired, describe the current listed directory."
!   (interactive)
!   (let ((dirname (save-excursion
!                    (forward-line -1)
!                    (skip-syntax-forward " ")
!                    (buffer-substring
!                     (point)
!                     (save-excursion (end-of-line) (1- (point))))))) ; Up to colon.
!     
!     (describe-file dirname)))
! 
! (defun dired-mouse-describe-listed-directory (event)
!   "Describe the current listed directory."
!   (interactive "e")
!   (save-excursion
!     (set-buffer (window-buffer (posn-window (event-end event))))
!     (goto-char (posn-point (event-end event)))
!     (dired-describe-listed-directory)))
! 
! (defun dired-describe-file ()
!   "In Dired, describe this file or directory."
!   (interactive)
!   (describe-file (dired-get-filename nil t)))
! 
! (defun dired-mouse-describe-file (event)
!   "Describe the clicked file."
!   (interactive "e")
!   (let (file)
!     (save-excursion
!       (set-buffer (window-buffer (posn-window (event-end event))))
!       (goto-char (posn-point (event-end event)))
!       (setq file (dired-get-filename nil t)))
!     (describe-file file)))
! 
! ;; This is the same definition as in `help-fns+.el' and `help+20.el'.
! (defun describe-file (filename)
!   "Describe the file named FILENAME.
! If FILENAME is nil, describe the current directory."
!   (interactive "FDescribe file: ")
!   (unless filename (setq filename default-directory))
!   (help-setup-xref (list #'describe-file filename) (interactive-p))
!   (let ((attrs (file-attributes filename)))
!     (unless attrs (error(format "Cannot open file `%s'" filename)))
!     (let* ((type            (nth 0 attrs))
!            (numlinks        (nth 1 attrs))
!            (uid             (nth 2 attrs))
!            (gid             (nth 3 attrs))
!            (last-access     (nth 4 attrs))
!            (last-mod        (nth 5 attrs))
!            (last-status-chg (nth 6 attrs))
!            (size            (nth 7 attrs))
!            (permissions     (nth 8 attrs))
!            ;; Skip 9: t iff file's gid would change if file were deleted
!            ;; and recreated.
!            (inode           (nth 10 attrs))
!            (device          (nth 11 attrs))
!            (help-text
!             (concat
!              (format "Properties of `%s':\n\n" filename)
!              (format "Type:                       %s\n"
!                      (cond ((eq t type) "Directory")
!                            ((stringp type) (format "Symbolic link to `%s'" type))
!                            (t "Normal file")))
!              (format "Permissions:                %s\n" permissions)
!              (and (not (eq t type)) (format "Size in bytes:              %g\n" size))
!              (format-time-string
!               "Time of last access:        %a %b %e %T %Y (%Z)\n" last-access)
!              (format-time-string
!               "Time of last modification:  %a %b %e %T %Y (%Z)\n" last-mod)
!              (format-time-string
!               "Time of last status change: %a %b %e %T %Y (%Z)\n" last-status-chg)
!              (format "Number of links:            %d\n" numlinks)
!              (format "User ID (UID):              %s\n" uid)
!              (format "Group ID (GID):             %s\n" gid)
!              (format "Inode:                      %S\n" inode)
!              (format "Device number:              %s\n" device))))
!       (with-output-to-temp-buffer "*Help*" (princ help-text))
!       help-text)))                      ; Return displayed text.
  
  (defun insert-directory-adj-pos (pos error-lines)
    "Convert `ls --dired' file name position value POS to a buffer position.
