;; Description: The DIRectory EDitor is for manipulating, and running
;; commands on files in a directory.
-(defconst dired-version (substring "#Revision: 7.1
5 $" 11 -2)
+(defconst dired-version (substring "#Revision: 7.1 $" 11 -2)
"The revision number of Tree Dired (as a string).
Don't forget to mention this when reporting bugs to:
(defcustom dired-listing-switches "-al"
"*Switches passed to ls for dired. MUST contain the `l' option.
-Can contain even `F', `b', `i' and `s'."
+Can contain even `F', `b', `i' and `s'."
"Regular expression matching from the date to the filename.
This regexp MUST match all the way to first character of the filename.")
+ (concat ".*[0-9]+[BkKMGTPEZY]? \\(" dired-re-month-and-time "\\)")
+ "Regular expression matching a portion of a directory line up to the filename.
+This regexp MUST match all the way to first character of the filename.
+The first submatch is the date portion of the filename.")
;; Regexp matching a maybe hidden subdirectory line in ls -lR output.
; separator, node #, separator, owner,
- (re-search-forward dired-re-
month-and-time eol t))
+ (re-search-forward dired-re-me eol t))
(defun dired-get-file-size ()
;; Returns the file size in bytes of the current file, as an integer.
;; Assumes that it is on a valid file line. It's the caller's responsibility
- ;; to ensure this. Assumes that match 0 for dired-re-month-and-time is
- ;; at the end of the file size.
- (search-backward-regexp dired-re-month-and-time)
+ (re-search-forward dired-re-before-filename)
+ (goto-char (match-beginning 1))
(skip-chars-backward " ")
- (string-to-int (buffer-substring (point)
- (progn (skip-chars-backward "0-9")
+ (buffer-substring (point)
+ (progn (skip-chars-backward "^ ")
+(defun dired-size-spec-to-size (size-spec)
+ "Convert a size specification to a size in bytes."
+ (if (string-match "^[0-9]+$" size-spec)
+ (string-to-int size-spec)
+ (let* ((size (length size-spec))
+ (num (string-to-int (substring size-spec 0 (- size 1))))
+ (assoc (aref size-spec (- size 1))
+ '((?B . 0) (?k . 1) (?K . 1) (?M . 2) (?G . 3) (?T . 4) (?P . 5))))
+ 1)))))) ; probably bogus, but we don't know any better
(defun dired-copy-filenames-as-kill (&optional arg)
"Copy names of marked (or next ARG) files into the kill ring.
-(if (or (boundp 'MULE) (featurep 'mule)) (load "dired-mule"))
+(if (or (boundp 'MULE) (featurep 'mule)) (load "dired-mule"))
;; Run load hook for user customization.