From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: BIKESHED: completion faces Date: Wed, 30 Oct 2019 01:11:52 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="127617"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 To: Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 30 00:16:18 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iPaio-000Wz2-0f for ged-emacs-devel@m.gmane.org; Wed, 30 Oct 2019 00:16:18 +0100 Original-Received: from localhost ([::1]:34974 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iPaik-0005Mp-GR for ged-emacs-devel@m.gmane.org; Tue, 29 Oct 2019 19:16:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51781) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iPaec-0002zP-3h for emacs-devel@gnu.org; Tue, 29 Oct 2019 19:11:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iPaea-00026v-Ee for emacs-devel@gnu.org; Tue, 29 Oct 2019 19:11:57 -0400 Original-Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:53104) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iPaea-00024j-4x for emacs-devel@gnu.org; Tue, 29 Oct 2019 19:11:56 -0400 Original-Received: by mail-wm1-x32f.google.com with SMTP id p21so123642wmg.2 for ; Tue, 29 Oct 2019 16:11:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=jZs73vmheHpwawAypFbs6WnKNZnLz8p0XFjcV0ImkUw=; b=i22lMJAK9ZBe7IVFKExqn1dKK2YDJ8LCuaU197saLeosX6YLVh8rTFIUpah7PlOjth 0wS4giQhlTEo2PsaIfJ40CtFdbKpTTzzF3NfXj45LaQhdqK0XUtp1t77vOBeR4TLttqJ j60m5FhxRyL3DRFWQKZhUz3h8ff7mdW8IgDxzxkmGoxxkuvA+U5VhI9BzA2s5/SveU8O cVdyChFcYCDCvdKMhAo3MT2Zi9d7neCBXpZkzxjhZ/R/90zyWAmohBIAZTw4yNwF4teZ 0Moj8TyqEToLnxHMl3Et46zmRmYPMIb+XFwkmIGXii6eYmMHCFpg40VWUMjlQmJue4v0 dJ9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=jZs73vmheHpwawAypFbs6WnKNZnLz8p0XFjcV0ImkUw=; b=HWF4OBuvdx7z+DdGPnYFgj5hr237J16quY7cO7L3Y2hbaQUV/Sy7BGHQW2uFVm3su3 bYbPClkfsY9UqUqKur80Y88FYHf0p9frrVSL+DAIvO3MpaNO11awPo4Ohkjano5qPtPn l3XQINY4rwXxLVhWTMzgKdea7H7gxFZrNy3BMfgw3p6PqJjEfa6lKmHMrMSI097p6LKa O6ilUFwQjv5AkR1AmJPRSl9kkiekZcBh0P3d7NDVWM4dSKhVMDARc4E42lZcMw+QW/Bd 4AIGTcHvwPGXS70m9suZ8EhnGqDLoJmZ0Zn3KuQepr+s1kZW9I90eQ5ClcmfOra9SaIg KpFg== X-Gm-Message-State: APjAAAUS6pz7DV52e4InMsZ3vuRJ1RaTpa918p20ZdI1F2gafXCab0gr aoRB63+2cPZa26xtfPlwf3QQDqQtFm4= X-Google-Smtp-Source: APXvYqycR4HtElLRG07HPliZp6pmLNjDCONr4lsJd3IHzlrBWV3E3nQSiOXO/83GNfmPinG9xA99PQ== X-Received: by 2002:a1c:4c11:: with SMTP id z17mr5930383wmf.59.1572390714284; Tue, 29 Oct 2019 16:11:54 -0700 (PDT) Original-Received: from [192.168.0.5] ([212.50.117.215]) by smtp.googlemail.com with ESMTPSA id w9sm477459wrt.85.2019.10.29.16.11.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Oct 2019 16:11:53 -0700 (PDT) In-Reply-To: Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32f X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:241609 Archived-At: On 27.10.2019 3:58, Stefan Monnier wrote: > In Emacs-26, completion faces looked like the following: > > - the "common" part shown like the default face. > - the "first-difference" shown in bold. > - everything else uses the default face. > > The "common" part is the part applied to the characters that are also > found in the current minibuffer. E.g. when completing > > M-x ne-li ? > > the "ne" and "-li" chars in the *Completions* are the "common" part. > > With the basic, prefix completion, the "common" part is not very > important and is separated from the rest at the "first-difference", so > the default faces make a fair bit of sense there. > > But for other completion styles such as `substring`, > `partial-completion`, and even more so for `flex`, it's not always > immediately obvious how the minibuffer contents relate to the possible > completions displayed in *Completions*. I wonder if it's *that* important, to be able to see the matching chars. The -first-difference face shows actionable info: the next character to type, to narrow down the completions list as much as possible while ensuring that a given completion is still in. You could type other chars, but the likelihood of ending up with several options (and no more characters to type) will be higher. So IMHO we could do nothing, and it will be a valid choice. As long as all completion styles highlight completion-first-difference properly. Furthermore, the position of -first-difference also hints at what characters were matched (definitely ones before it). > For this reason, it is common in other completion systems to > highlight the "common" part somehow (e.g. underline, bold, ...). Personally, I'm not a big fan of underline, italic and even bold (unless it's used sparingly, like it is now). With that said... > I think Emacs's defaults should be changed so that the "common" part > (which uses the `completions-common-part` face) is highlighted somehow. > > So, what should we go for: > - bold (but then we need to change the `completions-first-difference` > face to keep it different, e.g. underlined)? If we end up doing this, we might as well change completions-first-difference to be indistinguishable from 'default'. Because the common part, when highlighted, duplicates the information. The "first difference" character is simply the one after the last segment of the common part, isn't it? > - underlined (tho I don't like underlined text very much)? > - some foreground color? > - some background color? > - something else? If we do end up highlighting completions-common-part somehow, I vote for background color, some very subtle one. Because using bold is going to be annoying with prefix-based styles, and I don't think we can/should use different methods for different styles. Using "white smoke" seems okay with the default theme, as well as with the light-background theme I'm using. No idea what color would be good with dark-background themes.