henry atting wrote:
how can I customize the face of a file according to a certain suffix?
Let's say the extension is *.nry, now I want to see all files with that
extension listed in a specific colour in eshell or dired.
Check out this entry in dired-font-lock-keywords:
;; Files suffixed with `completion-ignored-extensions'.
'(eval .
;; It is quicker to first find just an extension, then go back to the
;; start of that file name. So we do this complex MATCH-ANCHORED
form.
(list (concat "\\(" (regexp-opt completion-ignored-extensions)
"\\|#\\)$")
'(".+" (dired-move-to-filename) nil (0 dired-ignored-face))))
That suggests you could define a new face and add a similar entry to
dired-font-lock-keywords that references it instead of
dired-ignored-face, for the simple regexp "\\.nry\\'".