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, 6 Nov 2019 00:01:33 +0200 Message-ID: References: <4c5631d4-9dfd-04c6-c573-b83c67fcc2fa@yandex.ru> <87pni7p83l.fsf@gmail.com> <87h83ipoi0.fsf@gmail.com> 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="102327"; 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: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 05 23:09:16 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 1iS70h-000QPr-J1 for ged-emacs-devel@m.gmane.org; Tue, 05 Nov 2019 23:09:11 +0100 Original-Received: from localhost ([::1]:50894 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iS70g-0005Xg-5w for ged-emacs-devel@m.gmane.org; Tue, 05 Nov 2019 17:09:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58122) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iS6tO-0007pV-Q8 for emacs-devel@gnu.org; Tue, 05 Nov 2019 17:01:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iS6tN-0001R0-FA for emacs-devel@gnu.org; Tue, 05 Nov 2019 17:01:38 -0500 Original-Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:53237) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iS6tN-0001Pu-8R for emacs-devel@gnu.org; Tue, 05 Nov 2019 17:01:37 -0500 Original-Received: by mail-wm1-x32d.google.com with SMTP id c17so1086279wmk.2 for ; Tue, 05 Nov 2019 14:01:37 -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=ajWcCk8Y0VStEM1HtW2hRXiism/2ucTH1AlkuXbLRco=; b=CmY5AyOu7QlJN0mB5GRWeUsmEJbpN7akvJPse8eP4CXNNi3q1BUepEDHthGaQ+PsfK BE3iSfFc5B+YrWyS3X5EMBFHFuZiIt4DlcPpEgfqlhOE3FRHPHTJqs7wfSHjHjyPjKuh edxO4hf8otPmK2hFlReCkEbasCw9cOlEwOW2QnKqaXbVmpEgz/lmyvto47z9BIMqdGnY fAyGPY7DrfkWMkLrE2XQM8RVuW/C6J2+5Sq0/h0rsUt6R/gw6GmiGoPHZCdW6h7565Hx uYzU4WowiGqvvqPXZS4f8FwoBs2GH12dYcg7o7eCYmGS4B405q3d+ruAK2OcR+sjRb5r XnTA== 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=ajWcCk8Y0VStEM1HtW2hRXiism/2ucTH1AlkuXbLRco=; b=Ikyd1JzwvpwlHObdAePaOzsosB0fTYD63s6hmGWb6ppHmIlYjv7XetcIXhYVgF600M bFSkWgdGzqUBCwHPg/e8Y61DS1txHTmwssDjmfk9Ena0QT41L8QdaeRY+G/40b0shuwA NlXIeYIxDaHAHV3SrFTAMVqZBBkm2laOtiulktn0tUc9RJltN1hAw3Msd4XCWPnv4kd+ JwSM1S1UeeADZ/ULtLNRU8/VcoJ1/GdASdKsSNlwbYiU1q2J98Vr1rC8HnKIghhdYRwX tDM/lCQBkGj2EoqvW+RVFnsqGKCpxv/YjXeP/Se1rC7MUZ4dVig9goi44plhHWXhY2Iv qC1w== X-Gm-Message-State: APjAAAWQU4bJAKIC6cf28zG9rN2PmEieyCER/ecc07CKuUFITDxuHdt1 CUedZi5i1bRLkvlghnY47vMWipWwhhQ= X-Google-Smtp-Source: APXvYqzrQretZ3Amco87DzEsHXTzRByTbLJmLeA8p40vepbzH0AtNJ7nX+CsN3g1cfrydt+wlncqug== X-Received: by 2002:a1c:c90c:: with SMTP id f12mr916351wmb.97.1572991295744; Tue, 05 Nov 2019 14:01:35 -0800 (PST) Original-Received: from [192.168.0.5] ([212.50.117.215]) by smtp.googlemail.com with ESMTPSA id w12sm652592wmi.17.2019.11.05.14.01.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Nov 2019 14:01:35 -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::32d 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:241828 Archived-At: On 05.11.2019 17:44, Stefan Monnier wrote: >> I've tried to implement my idea, but somehow the added highlighting gets >> eaten before the buffer is displayed. But the attached patch should >> illustrate it anyway. > > Regardless of how we implement this, the question remains: do we want to > highlight the common-part of the prefix/basic completion differently > from the other cases? We might. But I'd rather do that per-completion rather per completion style, hence the proposed patch. > > Stefan > > > PS: I think the approach used in your patch will lead to undesirable > behavior when some matches (but not all) have all chars before > first-diff highlighted with common-part. E.g. > > src/emacs -Q --eval '(setq completion-styles (quote (partial-completion)))' > M-x re-b ? > > where `re-builder` would be highlighted with a "trivial common part" ^ won't be ^nontrivial > whereas `rename-buffer` would be highlighted differently. Indeed. That's the whole idea. "re" and "-b" in "rename-buffer" would indeed be highlighted since the match is nontrivial. > You might consider it as a feature, of course. Yes. That's the idea. As for how it would work in practice, we'll have to see once the patch is functioning.