annotate lisp/dired/dired-xemacs-highlight.el @ 16:0293115a14e9 r19-15b91

Import from CVS: tag r19-15b91
author cvs
date Mon, 13 Aug 2007 08:49:20 +0200
parents 376386a54a3c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; Copyright (C) 1993 Cengiz Alaettinoglu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;;; Cengiz Alaettinoglu <ca@cs.umd.edu>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;;; Copyright (C) 1991 Tim Wilson and Sebastian Kremer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;;; Tim.Wilson@cl.cam.ac.uk
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;;; Sebastian Kremer <sk@thp.uni-koeln.de>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;;; Modified to work with XEmacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;; Keywords: dired extensions, faces
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;; XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; XEmacs is distributed in the hope that it will be useful, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;; General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;; You should have received a copy of the GNU General Public License
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
24 ;; along with XEmacs; see the file COPYING. If not, write to the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
25 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
26 ;; Boston, MA 02111-1307, USA.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;;; Synched up with: Not synched with FSF.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ; How to install
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 ; (add-hook 'dired-load-hook '(lambda () (require 'dired-xemacs-highlight)) t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 (require 'dired)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 (require 'dired-extra "dired-x")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 (provide 'dired-xemacs-highlight)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 (or (find-face 'dired-face-marked)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 (and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 (make-face 'dired-face-marked)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 (or (face-differs-from-default-p 'dired-face-marked)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 (if (eq (device-class) 'color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 (set-face-foreground 'dired-face-marked (face-foreground 'default))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 (set-face-background 'dired-face-marked "PaleVioletRed"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 (set-face-underline-p 'dired-face-marked t)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 (or (find-face 'dired-face-deleted)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 (and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 (make-face 'dired-face-deleted)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 (or (face-differs-from-default-p 'dired-face-deleted)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 (if (eq (device-class) 'color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 (set-face-foreground 'dired-face-deleted
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 (face-foreground 'default))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 (set-face-background 'dired-face-deleted "LightSlateGray"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 (set-face-underline-p 'dired-face-deleted t)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 (or (find-face 'dired-face-directory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 (and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 (make-face 'dired-face-directory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 (or (face-differs-from-default-p 'dired-face-directory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 (if (eq (device-class) 'color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (set-face-foreground 'dired-face-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 (face-foreground 'default))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 (make-face-bold 'dired-face-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 (make-face-bold-italic 'dired-face-directory)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 (or (find-face 'dired-face-executable)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 (and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 (make-face 'dired-face-executable)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 (or (face-differs-from-default-p 'dired-face-executable)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 (if (eq (device-class) 'color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 (set-face-foreground 'dired-face-executable "SeaGreen")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 (make-face-bold 'dired-face-executable)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 (or (find-face 'dired-face-setuid)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 (and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 (make-face 'dired-face-setuid)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 (or (face-differs-from-default-p 'dired-face-setuid)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 (if (eq (device-class) 'color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 (set-face-foreground 'dired-face-setuid "Red")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 (make-face-bold 'dired-face-setuid)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 (or (find-face 'dired-face-socket)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 (and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 (make-face 'dired-face-socket)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 (or (face-differs-from-default-p 'dired-face-socket)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 (if (eq (device-class) 'color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 (set-face-foreground 'dired-face-socket "Gold")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 (make-face-italic 'dired-face-socket)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 (or (find-face 'dired-face-symlink)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 (and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 (make-face 'dired-face-symlink)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 (or (face-differs-from-default-p 'dired-face-symlink)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 (if (eq (device-class) 'color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 (set-face-foreground 'dired-face-symlink "MediumBlue")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 (make-face-bold 'dired-face-symlink))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 (make-face-italic 'dired-face-symlink)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 (or (find-face 'dired-face-boring)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 (and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 (make-face 'dired-face-boring)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 (or (face-differs-from-default-p 'dired-face-boring)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 (if (eq (device-class) 'color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 (set-face-foreground 'dired-face-boring "Grey")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 (set-face-background-pixmap
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 'dired-face-boring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 [32 2 "\125\125\125\125\252\252\252\252"])))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 (defvar dired-do-permission-highlighting-too nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 "Set if we think we should use dired-chmod style permission highlighting.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 This is determined at first-pass time, to avoid filtering the buffer twice.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 (defvar dired-x11-re-boring (if (fboundp 'dired-omit-regexp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 (dired-omit-regexp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 "^#\\|~$")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 "Regexp to match backup, autosave and otherwise boring files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 Those files are displayed in a boring color such as grey (see
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 variable `dired-x11-boring-color').")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 (defvar dired-re-socket
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 (concat dired-re-maybe-mark dired-re-inode-size "s"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 (defvar dired-re-setuid
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 (concat dired-re-maybe-mark dired-re-inode-size
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 "-[-r][-w][Ss][-r][-w][sx][-r][-w][xst]")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 "setuid plain file (even if not executable)")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 (defvar dired-re-setgid
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 (concat dired-re-maybe-mark dired-re-inode-size
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 "-[-r][-w][-x][-r][-w][Ss][-r][-w][xst]")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 "setgid plain file (even if not executable)")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 (defun dired-xemacs-highlight-one (face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 (and (dired-move-to-filename t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 (set-extent-face (make-extent (dired-move-to-filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 (dired-move-to-end-of-filename))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 face)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 (defun dired-xemacs-highlight ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 (message "Highlighting... directory")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 ;; Let's try to do this in one pass...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 (setq dired-do-permission-highlighting-too
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 (or dired-do-permission-highlighting-too (featurep 'dired-chmod)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 (if (and dired-do-permission-highlighting-too
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 (member 'dired-permissions-highlight dired-after-readin-hook))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 (remove-hook 'dired-after-readin-hook 'dired-permissions-highlight))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 (while (not (eobp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 (and (not (eolp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 ((re-search-forward
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 dired-x11-re-boring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 (dired-xemacs-highlight-one 'dired-face-boring))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 ((looking-at dired-re-dir)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 (dired-xemacs-highlight-one 'dired-face-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 ((looking-at dired-re-sym)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 (dired-xemacs-highlight-one 'dired-face-symlink))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 ((or (looking-at dired-re-setuid)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 (looking-at dired-re-setgid))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 (dired-xemacs-highlight-one 'dired-face-setuid))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 ((looking-at dired-re-exe)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 (dired-xemacs-highlight-one 'dired-face-executable))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 ((looking-at dired-re-socket)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 (dired-xemacs-highlight-one 'dired-face-socket)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 (if dired-do-permission-highlighting-too
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 (dired-make-permissions-interactive))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 (forward-line 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 (message "Highlighting...done")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 ;FSF's version?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 ;(defconst dired-font-lock-keywords
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 ; (list (cons "^\\*.*$" 'dired-face-marked)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 ; (cons "^\\D.*$" 'dired-face-deleted)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 (defconst dired-font-lock-keywords (purecopy
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 (let ((bn (concat "\\(Jan\\|Feb\\|Mar\\|Apr\\|May\\|Jun\\|Jul\\|"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 "Aug\\|Sep\\|Oct\\|Nov\\|Dec\\) +[0-9]+ +[0-9:]+")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 '("^ [/~].*:$" . bold-italic) ; Header
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 (list (concat "^\\(\\([^ ].*\\)" bn "\\) \\(.*\\)$") 1 'bold) ; Marked
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 (list (concat "^. +d.*" bn " \\(.*\\)$") 2 'bold) ; Subdirs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 (list (concat "^. +l.*" bn " \\(.*\\)$") 2 'italic) ; Links
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 (cons (concat "^. +-..[xsS]......\\|" ; Regular files with executable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 "^. +-.....[xsS]...\\|" ; or setuid/setgid bits set
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 "^. +-........[xsS]")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 'bold)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 ;; Possibly we should highlight more types of files differently:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 ;; backups; autosaves; core files? Those with ignored-extensions?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 "Expressions to highlight in Dired buffers.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 (put 'dired-mode 'font-lock-keywords 'dired-font-lock-keywords)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 (add-hook 'dired-after-readin-hook 'dired-xemacs-highlight)