comparison lisp/dired.el @ 16782:97849649b875

(dired-permission-flags-regexp): New variable. (dired-move-to-end-of-filename): Use it instead of a constant.
author Richard M. Stallman <rms@gnu.org>
date Mon, 30 Dec 1996 04:57:17 +0000
parents 7064fa2cb0d7
children 2de3fd99ae88
comparison
equal deleted inserted replaced
16781:d63e41403d58 16782:97849649b875
1276 ;; It should be reasonably fast, though, as it is called in 1276 ;; It should be reasonably fast, though, as it is called in
1277 ;; dired-get-filename. 1277 ;; dired-get-filename.
1278 (concat (or dir default-directory) file)) 1278 (concat (or dir default-directory) file))
1279 1279
1280 (defun dired-make-relative (file &optional dir no-error) 1280 (defun dired-make-relative (file &optional dir no-error)
1281 ;;"Convert FILE (an absolute pathname) to a pathname relative to DIR. 1281 ;;"Convert FILE (an absolute file name) to a name relative to DIR.
1282 ;; Else error (unless NO-ERROR is non-nil, then FILE is returned unchanged) 1282 ;; Else error (unless NO-ERROR is non-nil, then FILE is returned unchanged)
1283 ;;DIR defaults to default-directory." 1283 ;;DIR defaults to default-directory."
1284 ;; DIR must be file-name-as-directory, as with all directory args in 1284 ;; DIR must be file-name-as-directory, as with all directory args in
1285 ;; Emacs Lisp code. 1285 ;; Emacs Lisp code.
1286 (or dir (setq dir default-directory)) 1286 (or dir (setq dir default-directory))
1298 1298
1299 (defvar dired-move-to-filename-regexp 1299 (defvar dired-move-to-filename-regexp
1300 " [A-Za-z\xa0-\xff][A-Za-z\xa0-\xff][A-Za-z\xa0-\xff] [0-3 ][0-9]\ 1300 " [A-Za-z\xa0-\xff][A-Za-z\xa0-\xff][A-Za-z\xa0-\xff] [0-3 ][0-9]\
1301 [ 0-9][0-9][:0-9][0-9][ 0-9] " 1301 [ 0-9][0-9][:0-9][0-9][ 0-9] "
1302 "Regular expression to match a month abbreviation followed date/time.") 1302 "Regular expression to match a month abbreviation followed date/time.")
1303
1304 (defvar dired-permission-flags-regexp
1305 "\\([^ ]\\)[-r][-w]\\([^ ]\\)[-r][-w]\\([^ ]\\)[-r][-w]\\([^ ]\\)"
1306 "Regular expression to match the permission flags in `ls -l'.")
1303 1307
1304 ;; Move to first char of filename on this line. 1308 ;; Move to first char of filename on this line.
1305 ;; Returns position (point) or nil if no filename on this line." 1309 ;; Returns position (point) or nil if no filename on this line."
1306 (defun dired-move-to-filename (&optional raise-error eol) 1310 (defun dired-move-to-filename (&optional raise-error eol)
1307 ;; This is the UNIX version. 1311 ;; This is the UNIX version.
1332 ;; Restrict perm bits to be non-blank, 1336 ;; Restrict perm bits to be non-blank,
1333 ;; otherwise this matches one char to early (looking backward): 1337 ;; otherwise this matches one char to early (looking backward):
1334 ;; "l---------" (some systems make symlinks that way) 1338 ;; "l---------" (some systems make symlinks that way)
1335 ;; "----------" (plain file with zero perms) 1339 ;; "----------" (plain file with zero perms)
1336 (if (re-search-backward 1340 (if (re-search-backward
1337 "\\([^ ]\\)[-r][-w]\\([^ ]\\)[-r][-w]\\([^ ]\\)[-r][-w]\\([^ ]\\)" 1341 dired-permission-flags-regexp nil t)
1338 nil t)
1339 (setq file-type (char-after (match-beginning 1)) 1342 (setq file-type (char-after (match-beginning 1))
1340 symlink (eq file-type ?l) 1343 symlink (eq file-type ?l)
1341 ;; Only with -F we need to know whether it's an executable 1344 ;; Only with -F we need to know whether it's an executable
1342 executable (and 1345 executable (and
1343 used-F 1346 used-F