From 2225a1961e91b3b32a14e9f2ab03699345aab697 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 22 May 2005 13:35:21 +0000 Subject: [PATCH] (dired-font-lock-keywords): Fontify files with junk extensions even if marked by -F. --- lisp/dired.el | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/lisp/dired.el b/lisp/dired.el index 43f05dcf881..4665e961b81 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -418,7 +418,24 @@ Subexpression 2 must end right before the \\n or \\r.") ;; 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))))) + '(".+" (dired-move-to-filename) nil (0 dired-ignored-face)))) + ;; + ;; Files suffixed with `completion-ignored-extensions' + ;; plus a character put in by -F. + '(eval . + (list (concat "\\(" (regexp-opt completion-ignored-extensions) + "\\|#\\)[*=|]$") + '(".+" (progn + (end-of-line) + ;; If the last character is not part of the filename, + ;; move back to the start of the filename + ;; so it can be fontified. + ;; Otherwise, leave point at the end of the line; + ;; that way, nothing is fontified. + (unless (get-text-property (1- (point)) 'mouse-face) + (dired-move-to-filename))) + nil (0 dired-ignored-face)))) +) "Additional expressions to highlight in Dired mode.") ;;; Macros must be defined before they are used, for the byte compiler. -- 2.39.2