Subject: Make ido respect completions-common-part face

From: Luis Gerhorst <[email-masked]>
Date: Sun, 29 Jan 2017 23:22:27 +0100

Hi,
This would allow the user to customize the display of the common part of completions, e.g. remove the decorators around it and only distinguish it by using a different face (which looks much cleaner). Company also display the common part this way (see the `company-preview-common` face).

Here's a advice based snippet that does what I want. It does not seem to handle colors properly but since completions-common-part just underlines text for me, it's ok:

(defun luis-propertize-ido-common-match-string (&rest _)
  (when ido-common-match-string
    (setq ido-common-match-string
          (propertize ido-common-match-string
                      'face 'completions-common-part))))

(defun luis-unpropertize-ido-common-match-string (&rest _)
  (when ido-common-match-string
    (setq ido-common-match-string
          (propertize ido-common-match-string
                      'face nil))))

(advice-add 'ido-completions :before
            #'luis-propertize-ido-common-match-string)
(advice-add 'ido-completions :after
            #'luis-unpropertize-ido-common-match-string)

Best regards,
Luis