comparison lisp/dired.el @ 6801:7c587b0670bd

(dired-move-to-filename): Use skip-chars-forward instead of looking-at, for speed.
author Richard M. Stallman <rms@gnu.org>
date Mon, 11 Apr 1994 21:03:28 +0000
parents c451a18c1945
children 51ff777c8fd6
comparison
equal deleted inserted replaced
6800:34cc2fd97a9e 6801:7c587b0670bd
1152 ;; Returns position (point) or nil if no filename on this line." 1152 ;; Returns position (point) or nil if no filename on this line."
1153 (defun dired-move-to-filename (&optional raise-error eol) 1153 (defun dired-move-to-filename (&optional raise-error eol)
1154 ;; This is the UNIX version. 1154 ;; This is the UNIX version.
1155 (or eol (setq eol (progn (end-of-line) (point)))) 1155 (or eol (setq eol (progn (end-of-line) (point))))
1156 (beginning-of-line) 1156 (beginning-of-line)
1157 (if (and (re-search-forward dired-move-to-filename-regexp eol t) 1157 (or (if (re-search-forward dired-move-to-filename-regexp eol t)
1158 (looking-at " \\([0-9][0-9]:[0-9][0-9]\\| [0-9]+\\|[0-9]+ \\) ")) 1158 (progn
1159 (progn 1159 (goto-char (match-end 0))
1160 (goto-char (match-end 0)) 1160 (if (= 7 (skip-chars-forward " 0-9:" (+ (point) 7)))
1161 (point)) 1161 (point))))
1162 (if raise-error 1162 (if raise-error
1163 (error "No file on this line") 1163 (error "No file on this line"))))
1164 nil)))
1165 1164
1166 (defun dired-move-to-end-of-filename (&optional no-error) 1165 (defun dired-move-to-end-of-filename (&optional no-error)
1167 ;; Assumes point is at beginning of filename, 1166 ;; Assumes point is at beginning of filename,
1168 ;; thus the rwx bit re-search-backward below will succeed in *this* 1167 ;; thus the rwx bit re-search-backward below will succeed in *this*
1169 ;; line if at all. So, it should be called only after 1168 ;; line if at all. So, it should be called only after