all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#25575: Make ido respect completions-common-part face
@ 2017-01-29 22:22 Luis Gerhorst
  2017-02-09  1:23 ` Dmitry Gutov
  0 siblings, 1 reply; 3+ messages in thread
From: Luis Gerhorst @ 2017-01-29 22:22 UTC (permalink / raw)
  To: 25575

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





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-05 13:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-29 22:22 bug#25575: Make ido respect completions-common-part face Luis Gerhorst
2017-02-09  1:23 ` Dmitry Gutov
2021-02-05 13:26   ` Lars Ingebrigtsen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.