Commit 5d831bed authored by Karl Heuer's avatar Karl Heuer

(dired-move-to-filename): Handle leading blanks.

parent 7ec2a18c
...@@ -1154,18 +1154,10 @@ Optional arg NO-ERROR-IF-NOT-FILEP means return nil if no filename on ...@@ -1154,18 +1154,10 @@ Optional arg NO-ERROR-IF-NOT-FILEP means return nil if no filename on
;; This is the UNIX version. ;; This is the UNIX version.
(or eol (setq eol (progn (end-of-line) (point)))) (or eol (setq eol (progn (end-of-line) (point))))
(beginning-of-line) (beginning-of-line)
(if (re-search-forward (if (and (re-search-forward dired-move-to-filename-regexp eol t)
dired-move-to-filename-regexp (looking-at " \\([0-9][0-9]:[0-9][0-9]\\| [0-9]+\\|[0-9]+ \\) "))
eol t)
(progn (progn
(skip-chars-forward " ") ; there is one SPC after day of month (goto-char (match-end 0))
(skip-chars-forward "^ " eol) ; move after time of day (or year)
(skip-chars-forward " " eol) ; there is space before the file name
;; Actually, if the year instead of clock time is displayed,
;; there are (only for some ls programs?) two spaces instead
;; of one before the name.
;; If we could depend on ls inserting exactly one SPC we
;; would not bomb on names _starting_ with SPC.
(point)) (point))
(if raise-error (if raise-error
(error "No file on this line") (error "No file on this line")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment