]> git.eshelyaron.com Git - emacs.git/commitdiff
(dired-font-lock-keywords): New variable.
authorRichard M. Stallman <rms@gnu.org>
Fri, 7 Oct 1994 10:02:04 +0000 (10:02 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 7 Oct 1994 10:02:04 +0000 (10:02 +0000)
(dired-mode): Set font-lock-keywords locally.

lisp/dired.el

index 3b0bd1478d3cbc184d6fc535aadd6719ac9d667f..d3c21d8c3cebedd6fd298c47b5daa83dd0f594b0 100644 (file)
@@ -110,6 +110,17 @@ The target is used in the prompt for file copy, rename etc.")
   "*If non-nil, Dired preserves the last-modified time in a file copy.
 \(This works on only some systems.)")
 
+(defvar dired-font-lock-keywords
+  '(;; Put directory headers in italics.
+    ("^  \\(/.+\\)$" 1 font-lock-type-face)
+    ;; Put symlinks in bold italics.
+    ("\\([^ ]+\\) -> [^ ]+$" . font-lock-function-name-face)
+    ;; Put marks in bold.
+    ("^\\([^ ]\\).*$" 1 font-lock-keyword-face t)
+    ;; Put files that are subdirectories in bold.
+    ("^..d.* \\([^ ]+\\)$" 1 font-lock-keyword-face))
+  "Additional expressions to highlight in Dired mode.")
+
 ;;; Hook variables
 
 (defvar dired-load-hook nil
@@ -980,6 +991,8 @@ Keybindings:
        (expand-file-name dired-directory))
   (set (make-local-variable 'dired-actual-switches)
        (or switches dired-listing-switches))
+  (make-local-variable 'font-lock-keywords)
+  (setq font-lock-keywords dired-font-lock-keywords)
   (dired-sort-other dired-actual-switches t)
   (run-hooks 'dired-mode-hook))
 \f