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 14:19:54 +0000 Message-ID: References: <65f970a1.050a0220.3550.04dd@mx.google.com> <65f985dc.050a0220.20d40.9fcd@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="12535"; 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 15:21:29 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 1rmaLJ-00033D-2Q for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 19 Mar 2024 15:21:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmaKW-0004Cc-Tj; Tue, 19 Mar 2024 10:20:42 -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 1rmaKN-00048v-6s for help-gnu-emacs@gnu.org; Tue, 19 Mar 2024 10:20:32 -0400 Original-Received: from mail-4324.protonmail.ch ([185.70.43.24]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmaKC-0004WX-IK for help-gnu-emacs@gnu.org; Tue, 19 Mar 2024 10:20:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1710858018; x=1711117218; bh=3nSWQBHBEDCOyH9zW+6SUCDAPJRxYN9d1IVWT+dnAbw=; 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=vv1AC/6oiut0ruNkJabS7FFYIkV8nz3tVp4FnMXPsKYTrUxielY3G05RErwmLaGMK ZMgBvaj4y6uW8devQNAMAH87hywDYKXx0uojPcoKq3+i6RC0EkVfcLRlO/64LwVqOJ HpbsyrMkUZ40OCThWBAUUqFNAMFs8yHEb0TFLJIJ5x3w6KClGgPXzrkmZ2/JSi3pp6 KR76QIGrNuhQ360UMsgSVGHkOfjQSi5z9obDFmb+Q5rxXfuOgMI5WRaOaRsR+mN4ul +HRISrOg7JT3rcdf/yf/fYujkhfGpVH1HeMXk6PoPBRJnJidla9B1YJacr0JhrJ2GZ PJKc7hXNUy1SA== In-Reply-To: <65f985dc.050a0220.20d40.9fcd@mx.google.com> Feedback-ID: 57735886:user:proton Received-SPF: pass client-ip=185.70.43.24; envelope-from=heimeborgia@protonmail.com; helo=mail-4324.protonmail.ch 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_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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:146132 Archived-At: Sent with Proton Mail secure email. On Wednesday, March 20th, 2024 at 12:32 AM, Bruno Barbier wrote: > Heime heimeborgia@protonmail.com writes: >=20 > > Sent with Proton Mail secure email. > >=20 > > On Tuesday, March 19th, 2024 at 11:01 PM, Bruno Barbier brubar.cs@gmail= .com wrote: > >=20 > > > 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 > > > 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 > >=20 > > The documentation states that if some other input method is already act= ive, > > it is to be turned off first. How can I make the function do this ? >=20 >=20 > The documentation of `activate-input-method' ? | If INPUT-METHOD is nil, = deactivate any current input method. IIUB (if I understand better ;-) ), as= I'm reading it, it says that` activate-input-method' will take care to tur= n previous methods OFF. > You don't have to do anything. >=20 > Bruno The documentation for activate-input-method says "If some other input method is already active, turn it off first." It is not very clear whether the user should turn it off, or whether the activate-input-method function will turn INPUT-METHOD off automatically.