comparison lisp/efs/dired.el @ 138:6608ceec7cf8 r20-2b3

Import from CVS: tag r20-2b3
author cvs
date Mon, 13 Aug 2007 09:31:46 +0200
parents 7d55a9ba150c
children 1856695b1fa9
comparison
equal deleted inserted replaced
137:cae984061f40 138:6608ceec7cf8
420 420
421 (defvar dired-omit-regexps '("^#" "^\\.") 421 (defvar dired-omit-regexps '("^#" "^\\.")
422 "*File names matching these regexp may be omitted (buffer-local). 422 "*File names matching these regexp may be omitted (buffer-local).
423 This only has effect when the subdirectory is in omission mode. 423 This only has effect when the subdirectory is in omission mode.
424 To make omission mode the default, set `dired-omit-files' to t. 424 To make omission mode the default, set `dired-omit-files' to t.
425 This only has effect when `dired-omit-files-p' is t. 425 This only has effect when `dired-omit-files' is t.
426 See also `dired-omit-extensions'.") 426 See also `dired-omit-extensions'.")
427 (make-variable-buffer-local 'dired-omit-files-regexp) 427 (make-variable-buffer-local 'dired-omit-regexps)
428 428
429 (defvar dired-filename-re-ext "\\..+$" ; start from the first dot. last dot? 429 (defvar dired-filename-re-ext "\\..+$" ; start from the first dot. last dot?
430 "*Defines what is the extension of a file name. 430 "*Defines what is the extension of a file name.
431 \(match-beginning 0\) for this regexp in the file name without directory will 431 \(match-beginning 0\) for this regexp in the file name without directory will
432 be taken to be the start of the extension.") 432 be taken to be the start of the extension.")
1561 ;; successfully use dired functions (e.g. dired-get-filename) 1561 ;; successfully use dired functions (e.g. dired-get-filename)
1562 ;; as the subdir-alist has been built in dired-readin. 1562 ;; as the subdir-alist has been built in dired-readin.
1563 (run-hooks 'dired-after-readin-hook) 1563 (run-hooks 'dired-after-readin-hook)
1564 ;; I put omit-expunge after the dired-after-readin-hook 1564 ;; I put omit-expunge after the dired-after-readin-hook
1565 ;; in case that hook marks files. Does this make sense? Also, users 1565 ;; in case that hook marks files. Does this make sense? Also, users
1566 ;; might want to set dired-omit-files-p in some incredibly clever 1566 ;; might want to set dired-omit-files in some incredibly clever
1567 ;; way depending on the contents of the directory... I don't know... 1567 ;; way depending on the contents of the directory... I don't know...
1568 (if dired-omit-files 1568 (if dired-omit-files
1569 (dired-omit-expunge nil t)) 1569 (dired-omit-expunge nil t))
1570 (goto-char (point-min)) 1570 (goto-char (point-min))
1571 (dired-initial-position dirname)) 1571 (dired-initial-position dirname))
5271 ;; For historical reasons, we still use the term expunge, although nothing 5271 ;; For historical reasons, we still use the term expunge, although nothing
5272 ;; is expunged from the buffer. 5272 ;; is expunged from the buffer.
5273 5273
5274 (defun dired-omit-toggle (&optional arg) 5274 (defun dired-omit-toggle (&optional arg)
5275 "Toggle between displaying and omitting files matching 5275 "Toggle between displaying and omitting files matching
5276 `dired-omit-files-regexp' in the current subdirectory. 5276 `dired-omit-regexps' in the current subdirectory.
5277 With a positive prefix, omits files in the entire tree dired buffer. 5277 With a positive prefix, omits files in the entire tree dired buffer.
5278 With a negative prefix, forces all files in the tree dired buffer to be 5278 With a negative prefix, forces all files in the tree dired buffer to be
5279 displayed." 5279 displayed."
5280 (interactive "P") 5280 (interactive "P")
5281 (if arg 5281 (if arg
5315 (setq result (cons (car elt) result)))) 5315 (setq result (cons (car elt) result))))
5316 result)) 5316 result))
5317 5317
5318 (defun dired-omit-expunge (&optional regexp full-buffer) 5318 (defun dired-omit-expunge (&optional regexp full-buffer)
5319 ;; Hides all unmarked files matching REGEXP. 5319 ;; Hides all unmarked files matching REGEXP.
5320 ;; If REGEXP is nil or not specified, uses `dired-omit-files-regexp', 5320 ;; If REGEXP is nil or not specified, uses `dired-omit-regexps',
5321 ;; and also omits filenames ending in `dired-omit-extensions'. 5321 ;; and also omits filenames ending in `dired-omit-extensions'.
5322 ;; If REGEXP is the empty string, this function is a no-op. 5322 ;; If REGEXP is the empty string, this function is a no-op.
5323 (let ((omit-re (or regexp (dired-omit-regexp))) 5323 (let ((omit-re (or regexp (dired-omit-regexp)))
5324 (alist dired-subdir-alist) 5324 (alist dired-subdir-alist)
5325 elt min) 5325 elt min)