From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: arvid-harnack@lavache.com Newsgroups: gmane.emacs.help Subject: Changing completion-style using the minibuffer Date: Sat, 12 Jun 2021 16:27:59 +0200 (CEST) Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1622"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: "Jean Louis" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 12 16:29:11 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 1ls4dL-0000AR-FQ for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 12 Jun 2021 16:29:11 +0200 Original-Received: from localhost ([::1]:52614 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ls4dJ-00038K-8L for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 12 Jun 2021 10:29:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48022) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ls4cp-00037u-QX for help-gnu-emacs@gnu.org; Sat, 12 Jun 2021 10:28:39 -0400 Original-Received: from ip-8.mailobj.net ([213.182.54.8]:59614 helo=msg-3.mailo.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ls4cn-0001QU-1N for help-gnu-emacs@gnu.org; Sat, 12 Jun 2021 10:28:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=lavache.com; s=mailo; t=1623508079; bh=fSwM1hN3CfvAF5QDai3hLLeURtpJUSxxMMK35NBj/WQ=; h=X-EA-Auth:From:To:Cc:Date:Subject:MIME-Version:X-Mailer: Message-ID:In-Reply-To:Content-Type; b=Vf1ZPlA3+/pDf40CKIkVsPA4yIU8JNwrIIqorCg7/ZNOtx6zlR1lSzODtXW9OYeo3 OI1YqAH27XBbD4P+iuSQZvvgVEX0VwlVewsWw7aRu8DGNaf/odGGPoApYCPFSXo7Km 4vN0/wSsNJWcwpH5vKfyDS5VXChWjdgJWEuN7uz8= Original-Received: by www-7.mailo.com with http webmail; Sat, 12 Jun 2021 16:27:59 +0200 (CEST) X-EA-Auth: jcO0IluMA+flKA9U8NpCPOKZEvb4d2Or/gzVkiV27gFqYwXGltTYxiarHOrwmnuvW58+zIWbauOPtosbsCw7oLCFwEP9Fzz/ X-Priority: 3 X-Mailer: COMS/EA21.01/r20210601 In-Reply-To: Received-SPF: pass client-ip=213.182.54.8; envelope-from=arvid-harnack@lavache.com; helo=msg-3.mailo.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, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.23 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:130775 Archived-At: Is there an alternative to your attempt, so I could use the arrow keys to move from one option to the other? And an option at the and that allows me to manually write down the completion-styles string in the minibuffer. That way I can either use the predefined settings in collections or input my own multiple completion style string in the variable `completion-styles'. Many Thanks From: Jean Louis To: arvid-harnack@lavache.com Subject: Re: Changing completion-style using the minibuffer Date: 12/06/2021 04:49:38 Europe/Paris Cc: help-gnu-emacs@gnu.org * arvid-harnack@lavache.com [2021-06-11 23:03]= : > I have the following code to change completion-styles by calling "M-x mi= nibufrp-complt-style". >=20 >=20 >=20 > But would like to change it so that I can go through the four selections= using the minibuffer. >=20 > What would I need to add exactly to be able to do so ? (defvar k 1) In itself the below function is just looking to variable `k' and makes changes based on its value. If you wish to change the variable `completion-styles' you need not have any other variable. (defun minibufrp-complt-style () (interactive) (pcase k (1 (setq completion-styles '(basic substring)) (setq k 2)) (2 (setq completion-styles '(partial-completion)) (setq k 3)) (3 (setq completion-styles '(initials)) (setq k 4)) (4 (setq completion-styles '(orderless)) (setq k 1)) )) Following could be solution for multiple choice: (defun minibufrp-complt-style () (interactive) (let* ((collection '((?b '(basic substring) "Basic Substring") (?p '(partial-completion) "Partial Completion") (?i '(initials) "Initials") (?o '(orderless) "Orderless"))) (style (read-multiple-choice "Style: " collection))) (setq completion-styles (nth 1 style)))) Overall that does not nicely solve the problem as you may wish to have multiple completion styles in the variable `completion-styles' and you may get in trouble doing it that way. --=20 Jean