[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Customize face according to extension

From: Kevin Rodgers
Subject: Re: Customize face according to extension
Date: Tue, 27 May 2008 21:33:17 -0600
User-agent: Thunderbird (Macintosh/20080421)

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\\'".

Kevin Rodgers
Denver, Colorado, USA

reply via email to

[Prev in Thread] Current Thread [Next in Thread]