GNU bug report logs - #25575
Make ido respect completions-common-part face

Previous Next

Package: emacs;

Reported by: Luis Gerhorst <privat <at> luisgerhorst.de>

Date: Sun, 29 Jan 2017 22:24:02 UTC

Severity: wishlist

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Luis Gerhorst <privat <at> luisgerhorst.de>
To: bug-gnu-emacs <at> gnu.org
Subject: Make ido respect completions-common-part face
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




This bug report was last modified 4 years and 103 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.