branch: elpa/flx commit d21ac098dfad860cd33aea2d3b16669e96a429c5 Author: Le Wang <le.w...@agworld.com.au> Commit: Le Wang <le.w...@agworld.com.au>
add option `flx-ido-use-faces' fixes #17 --- flx-ido.el | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/flx-ido.el b/flx-ido.el index 2519fb23e5..f6c428c85e 100644 --- a/flx-ido.el +++ b/flx-ido.el @@ -13,7 +13,7 @@ ;; Version: 0.2 ;; Last-Updated: ;; By: -;; Update #: 52 +;; Update #: 55 ;; URL: ;; Keywords: ;; Compatibility: @@ -68,6 +68,11 @@ (require 'ido) (require 'flx) + +(defcustom flx-ido-use-faces t + "Use `flx-highlight-face' to indicate characters contributing to best score." + :group 'ido) + (unless (fboundp 'ido-delete-runs) (defun ido-delete-runs (list) "Delete consecutive runs of same item in list. @@ -124,17 +129,19 @@ item, in which case, the ending items are deleted." (defun flx-ido-decorate (things &optional clear) - (let ((decorate-count (min ido-max-prospects - (length things)))) - (nconc - (loop for thing in things - for i from 0 below decorate-count - collect (if clear - (flx-propertize thing nil) - (flx-propertize (car thing) (cdr thing)))) - (if clear - (nthcdr decorate-count things) - (mapcar 'car (nthcdr decorate-count things)))))) + (if flx-ido-use-faces + (let ((decorate-count (min ido-max-prospects + (length things)))) + (nconc + (loop for thing in things + for i from 0 below decorate-count + collect (if clear + (flx-propertize thing nil) + (flx-propertize (car thing) (cdr thing)))) + (if clear + (nthcdr decorate-count things) + (mapcar 'car (nthcdr decorate-count things))))) + (mapcar 'car things))) (defun flx-ido-match-internal (query items) (let* ((matches (loop for item in items