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: Sun, 3 Nov 2019 23:53:19 +0200 Message-ID: <4c5631d4-9dfd-04c6-c573-b83c67fcc2fa@yandex.ru> 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="39447"; 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 Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 03 22:53:39 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 1iRNoY-000A9A-IJ for ged-emacs-devel@m.gmane.org; Sun, 03 Nov 2019 22:53:38 +0100 Original-Received: from localhost ([::1]:56556 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iRNoX-0002QH-Cc for ged-emacs-devel@m.gmane.org; Sun, 03 Nov 2019 16:53:37 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58369) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iRNoQ-0002Q5-J3 for emacs-devel@gnu.org; Sun, 03 Nov 2019 16:53:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iRNoP-0000Ki-Bs for emacs-devel@gnu.org; Sun, 03 Nov 2019 16:53:30 -0500 Original-Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:42107) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iRNoP-0000Im-5Q for emacs-devel@gnu.org; Sun, 03 Nov 2019 16:53:29 -0500 Original-Received: by mail-wr1-x42c.google.com with SMTP id a15so14889720wrf.9 for ; Sun, 03 Nov 2019 13:53:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=hyWtenBT8xK67FH90IF8I88Eh2u4U5074GQartWH6cw=; b=ChWkwWf+nwJX2Gd4IQ1xM5akIDQRiRjbJDujRMQqEgtEz6ydpMZKB82UITwhTJXuKu 9r7gd/SWBcmjhNj5PMITye2VCCQejlD01gJ6Hd6xz/jnVcZULDM8Mw/SQevJ1LiMlyDe C/2MiJEx+ikXYsLk2BFvR5ffMXa2JJIEBbQctuaiRNEPIAAEIOiNLUyupHVsSlRdnxds 4AzZCO+O5fK0SI3ARJjR4jXumQgKwtpcys1GAlMIbsaNRKtFfbzSNI5Sg9h3N48Rd0eU W5OXQqKGQQ2tucJNl1nlYzMxNx2QkcGOtCsk958rUaJUC9nl7uIUez6hdT51CjfjQ5lm n3xQ== 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:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=hyWtenBT8xK67FH90IF8I88Eh2u4U5074GQartWH6cw=; b=ZhtpQr3NXKuJuXeu+evS8+6L3RpsnoWHx0Nchkh6a3wuQeZu4ZEPG/UqdsD5bXcGyU dBLOE5UIU5gFh60v6ok+/gMjHitnViZsPVHhj/DOfsPykpppaj2xRNZ2g/P0iwBvG8IP UTU93Cz/D5Ol5wP6HM/gfX+C734j9W8xyiiMeYBt2t6cWtRg29NEyd4cdfZhEy+NokYr XVouNTNxKaCdqzXthjcDbeK/Ac205dscgQXbj+Av074BIf0CS9/mLEdh+lu1Q5+mOGZx +33/ntkywjR9G7Vi0wUv8eB3SicsOT7m2bUOGARt/DA6zA43hTdP8GGVbXekdWOLkKfP 1VgA== X-Gm-Message-State: APjAAAWeB0bhQgvqRFEQNjMA1yzIi98JlerdpZUABKXdnQsB9PtoiSy5 gUgHuK5AAJmFiP/BdHhavwEXe1//G9I= X-Google-Smtp-Source: APXvYqxEbBsRxI6RxklfLBPBGhiQz+H7tHGDFaPSkBYKDDfl9jJJyOZbeDalyYv5ynpIyGDDdCA+nw== X-Received: by 2002:adf:e747:: with SMTP id c7mr20419535wrn.384.1572818006778; Sun, 03 Nov 2019 13:53:26 -0800 (PST) Original-Received: from [192.168.0.5] ([212.50.117.215]) by smtp.googlemail.com with ESMTPSA id b4sm26413156wrh.87.2019.11.03.13.53.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 Nov 2019 13:53:25 -0800 (PST) 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::42c 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:241767 Archived-At: On 30.10.2019 3:49, Stefan Monnier wrote: > It has an explanatory value which makes the completion-style more > understandable (e.g. I'm pretty sure there are still users who don't > know about the `partial-completion` style that's enabled by default: > they just occasionally see completion lists which they don't understand > and shrug it off). And just use it, probably. Even if they don't exactly see what matches what. > But no, I don't know how important it is (I do find it useful when > implementing/debugging the code to make sure it worked right ;-) Indeed, but that's covered by your ability to customize the face anyway. > This said, it seems that highlighting the common part is the "standard" > behavior is all other completion systems whereas highlighting the "first > difference" seems to be specific to Emacs. Probably, but "all other completion systems" use a popup, which is a significantly different UI. They usually have some different background for that rectangle, and a different foreground as well. So there's some pre-existing theming/styling work there. Further, none of the other systems AFAIK use a fallback list of completion styles. So normally the matching is fuzzy to begin with, and in that case, highlighting the matches is moderately useful. They won't see a situation with a long list of simple prefix matches where the first column is highlighted uniformly. >>> 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... > > FWIW, I'm no big fan of underline (maybe it's the LaTeX influence speaking). > But I found it tolerable for first-difference after trying it out. I'm more against using bold for the common part. Underline is less aggravating. > It's a bit more subtle than that (and the "first-difference" name is > a misnomer, due to history): when I revamped the default completion > system for Emacs-24, adding partial-completion (as well as `basic` which > is a bit more sophisticated than just "prefix completion", in reality), > I had to decide what to do with "first-difference" since it doesn't have > as clear a meaning as for the plain old prefix completion. So the way > I adapted it to the new reality is that "first difference" now really > means "first char after point". If you do > > M-x dovi C-b C-b ? > > you'll see that `completions-first-difference` is applied to the "c" > of the "doc-view..." commands because that's the first character after > the position in the candidate that corresponds to the position of > point in the pattern. I'm having trouble reproducing this. Should I be using icomplete-mode? Anyway, it bold-s the whole current selected completion. And if I type "(dovi" in an Elisp buffer, C-M-i moves point to after the common part. So I get what you're hinting at, in theory, but these cases should indeed be rare. And there might be other things we could do about them. > 2- depending on the completion style, there might be further > character that still keep the desired completion while > eliminating more of the others. > For example let's say you want to run > `doc-view-fit-height-to-window`; after you do `M-x doc-view- ?` > you'll see that the `f` is highlighted as first-difference > but if hit `f` you still have 5 remaining choices, whereas if you > hit `h` your choice is the only remaining one. This one in interesting. Some pre-computation could give a better hint in this regard, but it could be disorienting as well, if one is used for first-difference to be the char after point.