From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Samuel Wales Newsgroups: gmane.emacs.help Subject: Re: can vertico approximate this ido setup? Date: Sun, 4 Jun 2023 18:07:26 -0700 Message-ID: References: <87zg5f37j1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13379"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Tassilo Horn Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 05 03:08:02 2023 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q5yhW-0003KI-O9 for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 05 Jun 2023 03:08:02 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q5yh8-0001QH-0g; Sun, 04 Jun 2023 21:07:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q5yh3-0001Mk-G3 for help-gnu-emacs@gnu.org; Sun, 04 Jun 2023 21:07:34 -0400 Original-Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q5yh1-0003Ig-GM; Sun, 04 Jun 2023 21:07:33 -0400 Original-Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-4f3af42459bso482393e87.0; Sun, 04 Jun 2023 18:07:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685927248; x=1688519248; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=KDcgnsdEPa1ShUdDx/e2ch74qO+CF/9exvMaW8v6IEs=; b=MV5p/KNAHlyj11T2QRTa5OwNk9QdmzzEGx6H/HWucLlOxXSpg+t8cypIbHKIV+WlXe 7jDUJob46rQjE6E5oNiphCMnQw6yqNC9X2v7o6HC5niGGJBeKx4JLPlj4DeFbEw/0854 9fzyu1Kk5b35Wgx1A4P31g43KtHztCDOF3djPw3oSDflOtuR6rtL8UKBWciDubvqcgQt ZydbmbJisW7uRp6xuiJ59EJNKjAm6R2toq4QTlD7s0UL9h9Ksb9GMipKo8BlwEJZtrh/ xcJ6IJdBbt3mXyLtnmoKFNGJR4ipLVVzynhM37S2Zo5yidvCG93iAIEygcNdbrnb50Ro 9obg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685927248; x=1688519248; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=KDcgnsdEPa1ShUdDx/e2ch74qO+CF/9exvMaW8v6IEs=; b=PcGSZqYHo8/j/VZYqDs6DBEuZdF17x9gL3NUsWf7EDw2LxoESRosa1bMGVconmsuhd j+ZAHqt6guvJ1zZNKq437CFMagPCGpgbt3K5VKdQeyYdODJM+PSpK7Q56E5sfhmSh1GX BcQpM8MPNjK3IX9Q0mnbeVKVOpwsjFvVw0wmm2/rxIqY3YleGl6nrfRMcRypyuyx27+6 KEU9hppElpVR4yKTEL6kt3R16+Jlfs4IZ3UP63c0lc2rPMPkp/+dsVVwJNYZsFJP1bhd nJNUXiF/O3vn4yYy18VKPyS054Ce96Obc3CUd+WAS7pPZGU4tid4m1H7ELdlFhiHD8p1 QPXg== X-Gm-Message-State: AC+VfDzQKtR86jGJkNVYtIR9I9yEQL9aChbI5I8ge9jxQHl2KamZHBR2 syHd1t7bhgUMScgaUgtCFUzfJZ33HRGUaxkibiNImsTbqMv0khUC X-Google-Smtp-Source: ACHHUZ4Geml4+ndDvUXbpVz/41UKdBHw0OmvzYfkMqAYO2ZEneiAcLaQIfau+/oqwDR5dU6y7jtoHqHbdRTFCfaeEBU= X-Received: by 2002:ac2:4345:0:b0:4f5:1cfb:18df with SMTP id o5-20020ac24345000000b004f51cfb18dfmr4891484lfl.4.1685927247887; Sun, 04 Jun 2023 18:07:27 -0700 (PDT) Original-Received: by 2002:aa6:c432:0:b0:265:2782:6da8 with HTTP; Sun, 4 Jun 2023 18:07:26 -0700 (PDT) In-Reply-To: <87zg5f37j1.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::136; envelope-from=samologist@gmail.com; helo=mail-lf1-x136.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:143866 Archived-At: On 6/4/23, Tassilo Horn wrote: hi tasillo, > Samuel Wales writes: > Define "very wrong", e.g., with a screenshot of what you get and a > statement what you'd expect to get. i will have to do that when i am able to. not able to get my brain to think about what makes a good test case etc. now. > > FWIW, I see that you put the flex and orderless completion style in > completion-styles. You have to be aware that at least flex matches very > distant candidates, e.g., foo matches after-some-root. Ok, that's the ok. my sequening sounds like it could be bad. to me, above would be more desirable if f were not a single letter. to match above i might do ftoot not foo or foot. i think ido-clever-match got that right: https://github.com/Bogdanp/ido-clever-match . it is almost perfect. btw i have trouble understanding the emacs manual on completion. the completion styles don't make sense to me whent they talk about text after point. idk what i am missing there. the descriptions are a bit over my head i guess. here is a big long quote from ido-clever-match exactly what it does. i wonder if vertico/orderless can do it similarly? vvv The matcher ranks the input against each item by class and then by some sub-metric within that class if applicable (length difference between the two strings in the case of substr, the cumulative distance of consecutive characters in the case of flex, whether the match was case-sensitive or not, etc.). The match classes are: exact Exact matches score the highest and they require an exact string match. prefix Prefix matches score second highest. They are treated as a special case of substring matches and will always rank higher. This class differentiates between sub-matches by comparing the length of the input and each match: the closer the two numbers are, the higher the score will be. substring Substring matches score third highest. This class differentiates between sub-matches in the same way that prefix matches do with an additional check on the distance between the beginning of the string and the first occurrence of the text within that string: the further away the substring is from the beginning of the string, the lower it will score. flex Flex matches score lowest. This class differentiates between sub-matches by computing the cumulative distance of consecutive characters: the higher that distance is, the lower the score. ^^^ > purpose of the style but I think it's only useful if you place it at the > very end of completion-styles with more exact styles at the beginning, > e.g. (partial-completion substring flex). ok. even after orderless? > > Orderless can also be slightly confusing because fo-ba matches bar-foo. > Again, that's the purpose of the style but maybe it's also better used > later in completion-styles, e.g., it's much more exact than flex but > less so than partial-completion or substring. i presume just before flex. btw, in ido, i use c-spc to limit the candidates then enter the second string when i need bar-foo. > > Also, I have the experience that some completion styles work great for > one kind/category of completion but not for others, so I use > completion-category-overrides. > > --8<---------------cut here---------------start------------->8--- > (setopt completion-styles '(partial-completion substring flex)) ok so we are out of the territory of cl-pushnew or add-to-list i think now and i have to do my own setopt. like setq? > > (setopt completion-category-overrides > '((project-file > (styles partial-completion substring initials)) > (file > (styles partial-completion substring initials)) i'd want almple or alcp to match .../alpha-completion.el. not sure if this would do it without flex? unfamiliar with projects and eglot. > (eglot > (styles partial-completion substring)))) > --8<---------------cut here---------------end--------------->8--- > >> - faces don't seem to get recognized when i specify them >> - also i don't get variable pitch >> - also i don't understand the completion-first-difference face > > I go with the defaults (of my theme) so cannot comment on that. I guess > that also completion-first-difference is not well-defined with styles > where matching is not anchored at the beginning of the candidate. I > think it's always the character after the last matched character. ok. it seems a bit redundant in vertico to me; i can see immediately that the grey matching text has an end and a first char after that without this face. so it must serve a purpose. but it jumps around. > >> - have not tried consult yet >> - embark uses more than window height or confuses >> [...] >> i am very limited in computer use, so before i try new things or >> search, i want to know if it is worth trying to configure vertico to >> work approximately like my setup. my question is whether it is >> configurable to come close-ish to my ido. > > I'd rather start out small, i.e., vertico / corfu / marginalia and add > more stuff (orderless, consult, cape, embark) later on if I feel that > I'm missing something here and there. I think ido supports some special well if i could get it to work, i think i could maybe just use vertico only to begin with. > things (creating directories, deleting files during file completion or > killing buffers during buffer completion?) which you could probably do > with embark but well... i don't use those in ido. embark might have other stuff i'd use. > > Bye, > Tassilo > -- The Kafka Pandemic A blog about science, health, human rights, and misopathy: https://thekafkapandemic.blogspot.com