diff options
| author | Richard M. Stallman <rms@gnu.org> | 1994-10-07 10:02:04 +0000 |
|---|---|---|
| committer | Richard M. Stallman <rms@gnu.org> | 1994-10-07 10:02:04 +0000 |
| commit | a1f6b0c60bc056da68f01b0173c7af16586876cf (patch) | |
| tree | ba4dc2eede1881188936e9febb6fc86a283125a2 | |
| parent | 8b1f1a0c15f404c4f46edc7f2cd722457cd50af3 (diff) | |
| download | emacs-a1f6b0c60bc056da68f01b0173c7af16586876cf.tar.gz | |
(dired-font-lock-keywords): New variable.
(dired-mode): Set font-lock-keywords locally.
| -rw-r--r-- | lisp/dired.el | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lisp/dired.el b/lisp/dired.el index 3b0bd1478d3..d3c21d8c3ce 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -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)) |
