Re: Dired patch for Emacs 19.29 -- font-lock -- patch HERE
Martin Maechler (maechler@stat.math.ethz.ch)
Mon, 11 Sep 95 13:48:15 +0200
Answering to my own posting....
It was easy to put font-lock support into current efs-dired
This is a context diff against a dired.el as it was AFTER Sandy's patch was
applied:
--- dired.el.~2~ Tue Jul 25 17:14:43 1995
+++ dired.el Mon Sep 11 13:43:52 1995
@@ -413,6 +413,17 @@
\(match-beginning 0\) for this regexp in the file name without directory will
be taken to be the start of the extension.")
+(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.
+ ("^[^ ]" . font-lock-reference-face)
+ ;; 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
@@ -1428,6 +1439,7 @@
(lambda ()
(if (memq this-command dired-modeline-tracking-cmds)
(dired-update-mode-line t))))))
+ (set (make-local-variable 'font-lock-defaults) '(dired-font-lock-keywords t))
(dired-sort-other dired-internal-switches t)
(dired-hack-local-variables)
(run-hooks 'dired-mode-hook)
;; Martin Maechler <maechler@stat.math.ethz.ch> <>< _
;; Seminar fuer Statistik, SOL F5 _| |_
;; ETH (Federal Inst. Technology) 8092 Zurich SWITZERLAND |_ _|
;; phone: x-41-1-632-3408 fax: ...-1086 |_|
;; http://www.stat.math.ethz.ch/~maechler/