comparison lisp/ido.el @ 63066:bf364cb1c987

(ido-first-match, ido-only-match, ido-subdir) (ido-indicator): Remove -face suffix from face names.
author Kim F. Storm <storm@cua.dk>
date Mon, 06 Jun 2005 12:48:02 +0000
parents d1cbfe7309c1
children 37a47a1de226
comparison
equal deleted inserted replaced
63065:58dcb71db77b 63066:bf364cb1c987
297 297
298 ;; Highlighting 298 ;; Highlighting
299 ;; ------------ 299 ;; ------------
300 300
301 ;; The highlighting of matching items is controlled via ido-use-faces. 301 ;; The highlighting of matching items is controlled via ido-use-faces.
302 ;; The faces used are ido-first-match-face, ido-only-match-face and 302 ;; The faces used are ido-first-match, ido-only-match and
303 ;; ido-subdir-face. 303 ;; ido-subdir.
304 ;; Colouring of the matching item was suggested by 304 ;; Colouring of the matching item was suggested by
305 ;; Carsten Dominik (dominik@strw.leidenuniv.nl). 305 ;; Carsten Dominik (dominik@strw.leidenuniv.nl).
306 306
307 ;; Replacement for read-buffer and read-file-name 307 ;; Replacement for read-buffer and read-file-name
308 ;; ---------------------------------------------- 308 ;; ----------------------------------------------
738 "*Non-nil means use ido faces to highlighting first match, only match and 738 "*Non-nil means use ido faces to highlighting first match, only match and
739 subdirs in the alternatives." 739 subdirs in the alternatives."
740 :type 'boolean 740 :type 'boolean
741 :group 'ido) 741 :group 'ido)
742 742
743 (defface ido-first-match-face '((t (:bold t))) 743 (defface ido-first-match '((t (:bold t)))
744 "*Font used by ido for highlighting first match." 744 "*Font used by ido for highlighting first match."
745 :group 'ido) 745 :group 'ido)
746 746
747 (defface ido-only-match-face '((((class color)) 747 (defface ido-only-match '((((class color))
748 (:foreground "ForestGreen")) 748 (:foreground "ForestGreen"))
749 (t (:italic t))) 749 (t (:italic t)))
750 "*Font used by ido for highlighting only match." 750 "*Font used by ido for highlighting only match."
751 :group 'ido) 751 :group 'ido)
752 752
753 (defface ido-subdir-face '((((min-colors 88) (class color)) 753 (defface ido-subdir '((((min-colors 88) (class color))
754 (:foreground "red1")) 754 (:foreground "red1"))
755 (((class color)) 755 (((class color))
756 (:foreground "red")) 756 (:foreground "red"))
757 (t (:underline t))) 757 (t (:underline t)))
758 "*Font used by ido for highlighting subdirs in the alternatives." 758 "*Font used by ido for highlighting subdirs in the alternatives."
759 :group 'ido) 759 :group 'ido)
760 760
761 (defface ido-indicator-face '((((min-colors 88) (class color)) 761 (defface ido-indicator '((((min-colors 88) (class color))
762 (:foreground "yellow1" 762 (:foreground "yellow1"
763 :background "red1" 763 :background "red1"
764 :width condensed)) 764 :width condensed))
765 (((class color)) 765 (((class color))
766 (:foreground "yellow" 766 (:foreground "yellow"
4037 (ind (and (consp (car comps)) (> (length (cdr (car comps))) 1) 4037 (ind (and (consp (car comps)) (> (length (cdr (car comps))) 1)
4038 ido-merged-indicator)) 4038 ido-merged-indicator))
4039 first) 4039 first)
4040 4040
4041 (if (and ind ido-use-faces) 4041 (if (and ind ido-use-faces)
4042 (put-text-property 0 1 'face 'ido-indicator-face ind)) 4042 (put-text-property 0 1 'face 'ido-indicator ind))
4043 4043
4044 (if (and ido-use-faces comps) 4044 (if (and ido-use-faces comps)
4045 (let* ((fn (ido-name (car comps))) 4045 (let* ((fn (ido-name (car comps)))
4046 (ln (length fn))) 4046 (ln (length fn)))
4047 (setq first (format "%s" fn)) 4047 (setq first (format "%s" fn))
4048 (put-text-property 0 ln 'face 4048 (put-text-property 0 ln 'face
4049 (if (= (length comps) 1) 4049 (if (= (length comps) 1)
4050 'ido-only-match-face 4050 'ido-only-match
4051 'ido-first-match-face) 4051 'ido-first-match)
4052 first) 4052 first)
4053 (if ind (setq first (concat first ind))) 4053 (if ind (setq first (concat first ind)))
4054 (setq comps (cons first (cdr comps))))) 4054 (setq comps (cons first (cdr comps)))))
4055 4055
4056 (cond ((null comps) 4056 (cond ((null comps)
4089 (list (or ido-separator (nth 2 ido-decorations)) ; " | " 4089 (list (or ido-separator (nth 2 ido-decorations)) ; " | "
4090 (let ((str (substring com 0))) 4090 (let ((str (substring com 0)))
4091 (if (and ido-use-faces 4091 (if (and ido-use-faces
4092 (not (string= str first)) 4092 (not (string= str first))
4093 (ido-final-slash str)) 4093 (ido-final-slash str))
4094 (put-text-property 0 (length str) 'face 'ido-subdir-face str)) 4094 (put-text-property 0 (length str) 'face 'ido-subdir str))
4095 str))))) 4095 str)))))
4096 comps)))))) 4096 comps))))))
4097 4097
4098 (concat 4098 (concat
4099 ;; put in common completion item -- what you get by pressing tab 4099 ;; put in common completion item -- what you get by pressing tab