From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Heime Newsgroups: gmane.emacs.help Subject: Re: Passing user selection to a command Date: Tue, 19 Mar 2024 12:21:00 +0000 Message-ID: References: <65f970a1.050a0220.3550.04dd@mx.google.com> 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="30223"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Heime via Users list for the GNU Emacs text editor To: Bruno Barbier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 19 13:22:14 2024 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 1rmYTu-0007fH-8s for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 19 Mar 2024 13:22:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmYTD-0008Nd-S1; Tue, 19 Mar 2024 08:21:31 -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 1rmYTA-0008N9-Pj for help-gnu-emacs@gnu.org; Tue, 19 Mar 2024 08:21:28 -0400 Original-Received: from mail-0301.mail-europe.com ([188.165.51.139]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmYT7-0005Nn-0z for help-gnu-emacs@gnu.org; Tue, 19 Mar 2024 08:21:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1710850879; x=1711110079; bh=48Rzzt+kVmZ8JEeBjp1CYU3upX5K1DGqFaUclM4kmUY=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=CJRi8pyXoYkFROMQcdBW09fFnmoekVW7Frpv3gGR17cwZvvjlZu7FYWL6K9V/Cc7H 4q1D58UWOvl0bb443jehRxkhYo+hcO6MbKaMwi3Ltvbd1Ar4zawZyPhhT3acAKsvvV /Lt0AtCx1I3SH3IClXEavIIiP11dE18NHBmAz44SzJ33XDv5c1FCAp90JD444Cj3fr bExk/bVKNz7QdOkg8o4vZQ1s9Ns1tuLjGa8KOHVfSeYUF1vS4iW0mzJUrV0PJLgN/o rs8ZB81x11Ww5qLEf6SBcVyhaW64baA92FperRJvwW61cqr1YFg9jdLen4JRzdVd/b a7KQFDaPX60Jw== In-Reply-To: <65f970a1.050a0220.3550.04dd@mx.google.com> Feedback-ID: 57735886:user:proton Received-SPF: pass client-ip=188.165.51.139; envelope-from=heimeborgia@protonmail.com; helo=mail-0301.mail-europe.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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:146130 Archived-At: Sent with Proton Mail secure email. On Tuesday, March 19th, 2024 at 11:01 PM, Bruno Barbier wrote: > Hi, >=20 > Heime heimeborgia@protonmail.com writes: >=20 > > How can I pass the user selection to 'activate-input-method' ? > >=20 > > (defun glossus () > >=20 > > (interactive > > (list > > (let ( (cseq '("italian-alt-postfix" "italian-keyboard" > > "italian-postfix")) ) > > (completing-read > > " Glossus: " cseq nil t "italian-postfix")))) > >=20 > > (setq ispell-local-dictionary "it_IT") > > (activate-input-method "italian-postfix") ) >=20 >=20 > IIUC, you could do this: >=20 > (defun my-glossus (user-sel) ;; <=3D=3D=3D=3D var name here > (interactive > (list > (let ( (cseq '("italian-alt-postfix" "italian-keyboard" > "italian-postfix")) ) > (completing-read > " Glossus: " cseq nil t "italian-postfix")))) >=20 > (setq ispell-local-dictionary "it_IT") > (activate-input-method user-sel)) >=20 > Bruno The documentation states that if some other input method is already active, it is to be turned off first. How can I make the function do this ?