From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hongyi Zhao Newsgroups: gmane.emacs.help Subject: Re: Too long completion delay time in LISP interaction mode. Date: Thu, 21 Oct 2021 14:14:15 +0800 Message-ID: References: <87tuhcs2ov.fsf@gnu.org> <87pms0s0ex.fsf@gnu.org> <87lf2orz4c.fsf@gnu.org> <87h7dcrwf0.fsf@gnu.org> <875ytrorog.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="17340"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs To: Tassilo Horn Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 21 08:18:40 2021 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 1mdRPT-0004It-Un for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 21 Oct 2021 08:18:39 +0200 Original-Received: from localhost ([::1]:46020 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mdRPS-0004Db-PA for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 21 Oct 2021 02:18:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40474) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdRLU-00031W-Gr for help-gnu-emacs@gnu.org; Thu, 21 Oct 2021 02:14:32 -0400 Original-Received: from mail-ua1-x92c.google.com ([2607:f8b0:4864:20::92c]:34713) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mdRLQ-00023W-I2; Thu, 21 Oct 2021 02:14:32 -0400 Original-Received: by mail-ua1-x92c.google.com with SMTP id h4so11233126uaw.1; Wed, 20 Oct 2021 23:14:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=x7en6lxS4O/l9fC17vtZgiQm/zICBRy2r4XT0lXD3gg=; b=GQY2oQ7/gYkMcN7JIw2y/QVJ8tkbQ8nHAqcrJCuCOGw/69MrKrqZCkQ2d5QmEoIJls 0WV8k2Rz4zuA8SgBqE3MIfFN6kn5/CCNqwUgp3AN49BTwv5vlSb8gfbLc2rEvqcDoTLD 6zR079+mOV2tJjAmxR8+4gdFMLsoe3d1DRs7kBlqthadB6BmmgOl3zwK5xKOmx3gn7VK rci8KRMnME8Io3GEYk6ehIRrcrxqNz8ThRBD5sEOBGfGEleQGmWpT+DMXUybdVEKm+E9 g6DAA6WeDgxDzvii4PwDj1BxjLkjs3NjoS44hjnCYMuNh3koUyeUbRzWChZKpTaoLCYg HZ1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=x7en6lxS4O/l9fC17vtZgiQm/zICBRy2r4XT0lXD3gg=; b=gY28CRZ5Naaxo8hihvarkfbqKXaFOnOliuSgjDEKmL4K2yHdqq3D+j2xmto/6p4LCU AVFuHYUEbmN7S7AHgHvKvndhcgy/b5BinyDk8GJ+uO6it6+bYZYraUM+vNi7Le9cvxZS v1t7jUs3j+wq1yXj8vIdEOdnhZK2oKx7PUSaxQxTnSsAtlS2Slj2vnco8LOP0UXqDQ5Z prcOV/CZFohsQo9Ww+yaXzzaKUgb+Al0rGqnfZzZFv+EaQ7isr0uwOc1/czr7sp3I8V3 +vWbHjPwTCDi2qMONY3o2gmLCxGiJi4MYYonIVhj7P0soNZwdkaAwZicWmbt8kfacOmM G8ig== X-Gm-Message-State: AOAM530dKoOwKTeCQO853OxvgWxieiVZAFECkhPjKTr+yaJJWcOmgVMC 7xS8LVkOvu9Ol8bQi/pLDZT3tWncKvW7MVNJFvCpf3MFTkWH3fEC X-Google-Smtp-Source: ABdhPJwcWdlV4HLVDZTHgDCBrm1SLaWWbVaGB7pyoZ6G6nbsZmjkgghZ6zfkOQo3SOMV4gNMql3edGgGgsmGs6f7m6g= X-Received: by 2002:a67:edd7:: with SMTP id e23mr4402069vsp.14.1634796866252; Wed, 20 Oct 2021 23:14:26 -0700 (PDT) In-Reply-To: <875ytrorog.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::92c; envelope-from=hongyi.zhao@gmail.com; helo=mail-ua1-x92c.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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.help:133936 Archived-At: On Thu, Oct 21, 2021 at 1:47 PM Tassilo Horn wrote: > > Hongyi Zhao writes: > > >> (setq completion-category-overrides > >> '((project-file > >> (styles partial-completion substring initials)) > >> (file > >> (styles partial-completion substring initials)) > >> (eglot > > > > Can the above line be changed into the following? > > > > ((eglot lsp) > > The docs suggest that the keys are one CATEGORY, not a list of > categories. But you can duplicate the eglot entry for lsp, Thank you for pointing this out. > assuming that lsp-mode defines its own completion category which I don't know > (since I use eglot for my LSP interaction). They are defined as follows: https://github.com/emacs-lsp/lsp-mode/blob/1ece3b81ad10d1b10a2c73c6617b4426e673cbc7/lsp-completion.el#L745 (make-local-variable 'completion-category-defaults) (setf (alist-get 'lsp-capf completion-category-defaults) '((styles . (lsp-passthrough)))) https://github.com/emacs-lsp/lsp-mode/blob/1ece3b81ad10d1b10a2c73c6617b4426e673cbc7/lsp-completion.el#L775 (setq-local completion-category-defaults (cl-remove 'lsp-capf completion-category-defaults :key #'cl-first)) So, I adjusted to the following configuration based on orderless package: (use-package orderless :config ;; https://github.com/oantolin/orderless#ivy (setq ivy-re-builders-alist '((t . orderless-ivy-re-builder)) completion-styles '(partial-completion substring flex orderless) completion-category-overrides '((project-file (styles partial-completion substring initials)) (file (styles partial-completion substring initials)) (eglot (styles partial-completion substring)) (lsp (styles partial-completion substring)) ))) HZ