comparison lisp/dired.el @ 9382:ac2649a20967

(dired-font-lock-keywords): New variable. (dired-mode): Set font-lock-keywords locally.
author Richard M. Stallman <rms@gnu.org>
date Fri, 07 Oct 1994 10:02:04 +0000
parents d012275093c1
children 9791aad17859
comparison
equal deleted inserted replaced
9381:535197b3fc42 9382:ac2649a20967
107 107
108 ;;;###autoload 108 ;;;###autoload
109 (defvar dired-copy-preserve-time t 109 (defvar dired-copy-preserve-time t
110 "*If non-nil, Dired preserves the last-modified time in a file copy. 110 "*If non-nil, Dired preserves the last-modified time in a file copy.
111 \(This works on only some systems.)") 111 \(This works on only some systems.)")
112
113 (defvar dired-font-lock-keywords
114 '(;; Put directory headers in italics.
115 ("^ \\(/.+\\)$" 1 font-lock-type-face)
116 ;; Put symlinks in bold italics.
117 ("\\([^ ]+\\) -> [^ ]+$" . font-lock-function-name-face)
118 ;; Put marks in bold.
119 ("^\\([^ ]\\).*$" 1 font-lock-keyword-face t)
120 ;; Put files that are subdirectories in bold.
121 ("^..d.* \\([^ ]+\\)$" 1 font-lock-keyword-face))
122 "Additional expressions to highlight in Dired mode.")
112 123
113 ;;; Hook variables 124 ;;; Hook variables
114 125
115 (defvar dired-load-hook nil 126 (defvar dired-load-hook nil
116 "Run after loading dired. 127 "Run after loading dired.
978 ;; list-buffers uses this to display the dir being edited in this buffer. 989 ;; list-buffers uses this to display the dir being edited in this buffer.
979 (set (make-local-variable 'list-buffers-directory) 990 (set (make-local-variable 'list-buffers-directory)
980 (expand-file-name dired-directory)) 991 (expand-file-name dired-directory))
981 (set (make-local-variable 'dired-actual-switches) 992 (set (make-local-variable 'dired-actual-switches)
982 (or switches dired-listing-switches)) 993 (or switches dired-listing-switches))
994 (make-local-variable 'font-lock-keywords)
995 (setq font-lock-keywords dired-font-lock-keywords)
983 (dired-sort-other dired-actual-switches t) 996 (dired-sort-other dired-actual-switches t)
984 (run-hooks 'dired-mode-hook)) 997 (run-hooks 'dired-mode-hook))
985 998
986 ;; Idiosyncratic dired commands that don't deal with marks. 999 ;; Idiosyncratic dired commands that don't deal with marks.
987 1000