Re: Dired 7.9 bug: characterp [dired.el] -- UNDEFINED in Emacs 19.34

David S. Goldberg (dsg@mitre.org)
08 Sep 1998 11:55:24 -0400


I did the following to get fontification in dired-7.9 with
efs-1.16/1.56 and Emacs 20.2:

(add-hook 'dired-mode-hook (lambda ()
			     (setq font-lock-defaults
				   '(dired-font-lock-keywords nil nil nil nil))
			     (turn-on-font-lock)))

I think this also worked in 19.34 but I don't remember for certain.

I have dired-font-lock-keywords set to:

(defvar dired-font-lock-keywords
  (list
   ;;
   ;; Directory headers.
   (list dired-subdir-regexp '(1 font-lock-type-face))
   ;;
   ;; We make heavy use of MATCH-ANCHORED, since the regexps don't identify the
   ;; file name itself.  We search for Dired defined regexps, and then use the
   ;; Dired defined function `dired-move-to-filename' before searching for the
   ;; simple regexp ".+".  It is that regexp which matches the file name.
   ;;
   ;; Dired marks.
   (list dired-re-mark
	 '(0 font-lock-reference-face)
	 '(".+" (dired-move-to-filename) nil (0 font-lock-warning-face)))
   ;; People who are paranoid about security would consider this more
   ;; important than other things such as whether it is a directory.
   ;; But we don't want to encourage paranoia, so our default
   ;; should be what's most useful for non-paranoids. -- rms.
   ;;
   ;; Files that are group or world writable.
   (list (concat dired-re-maybe-mark dired-re-inode-size
		 "\\([-d]\\(....w....\\|.......w.\\)\\)")
	 '(1 font-lock-comment-face)
	 '(".+" (dired-move-to-filename) nil (0 font-lock-comment-face)))
   ;;
   ;; Subdirectories.
   (list dired-re-dir
	 '(".+" (dired-move-to-filename) nil (0 font-lock-function-name-face)))
   ;;
   ;; Symbolic links.
   (list dired-re-sym 
	 '(".+" (dired-move-to-filename) nil (0 font-lock-keyword-face)))
   ;;
   ;; Files suffixed with `completion-ignored-extensions'.
   '(eval .
     (let ((extensions (mapcar 'regexp-quote completion-ignored-extensions)))
       ;; 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 "\\(" (mapconcat 'identity extensions "\\|") "\\|#\\)$")
	     '(".+" (dired-move-to-filename) nil (0 font-lock-string-face))))))
  "Additional expressions to highlight in Dired mode.")

Which I believe is verbatim from one of the GNU Emacs dired .el
files.  At least I don't recall making any changes to it.

--
Dave Goldberg
Post: The Mitre Corporation\MS B305\202 Burlington Rd.\Bedford, MA 01730
Phone: 781-271-3887
Email: dsg@mitre.org