From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bruno Barbier Newsgroups: gmane.emacs.help Subject: Re: Passing user selection to a command Date: Tue, 19 Mar 2024 12:01:51 +0100 Message-ID: <65f970a1.050a0220.3550.04dd@mx.google.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17782"; mail-complaints-to="usenet@ciao.gmane.io" To: Heime , Heime via Users list for the GNU Emacs text editor Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 19 12:02:34 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 1rmXEo-0004Qi-2x for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 19 Mar 2024 12:02:34 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmXEE-0007wA-Cn; Tue, 19 Mar 2024 07:01:58 -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 1rmXED-0007vn-5U for help-gnu-emacs@gnu.org; Tue, 19 Mar 2024 07:01:57 -0400 Original-Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmXEB-0006JQ-NF for help-gnu-emacs@gnu.org; Tue, 19 Mar 2024 07:01:56 -0400 Original-Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-513d3746950so6610704e87.1 for ; Tue, 19 Mar 2024 04:01:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710846114; x=1711450914; darn=gnu.org; h=mime-version:date:references:in-reply-to:subject:to:from:message-id :from:to:cc:subject:date:message-id:reply-to; bh=cBydsayt7QUGqc1rCGAKYu2Ym2G2rRjH7h79iK//WJc=; b=lKVnyaZJZUFvv2XXnjzrZOdRWoJvErLo+Q+DztnpphkAxoVThIvTWVWVI3DtE08Tg7 7aeJxbeSnktbP+oHCqLBQM6J15XLAkaO9RPCHdz6bRJ49tXeU4r0iZvqDZgF+G+TgPXm c16z24rsPQwsNvX3Uxf+KQ4pb7OuZOA8yr/8QvUjz6uuSS/H2+J/ScJtc/L3PmnwVGJf ncWkTy9jSrhH6QNUE6OxalkQORpUi2FYxWNHHNHiy5oWbHk4JHL6X0/d0HBttYl2QnrS RzTEgYHW2NSF6mZbueg8GdUJRQVQSdjmxODGe3ODt5XQMsKHQxZmnhL6tVXCvarLxold aT5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710846114; x=1711450914; h=mime-version:date:references:in-reply-to:subject:to:from:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cBydsayt7QUGqc1rCGAKYu2Ym2G2rRjH7h79iK//WJc=; b=W4JjAOo2xY5WEcgAA7W5onxvqybGRSMId1zrom2Anv8d1pywZSiEuCMxaT2/OXTr+s TEwO2y1FEkW9aybBSrp+481uqJK14K9110QoxKm2A58FEJePuboYWv9o2yotTNANDQp8 q/O37sPpiZs/svgAMPkpGV30Mo8R/qAR2wD3OXO7ZJhVFV7ZzT3O7HEoaW4rHYBopkN/ btyzxUbTA2bYdx5uO1poOu/k28jOQjAffJZhAtAuikIoPJSnpaWyuOLFU2Fa3VuwbjE+ uVOmltr2KNlExiZHTVOH2wV51ik+ixIq7j/+RI7WDXzSaDcmKJ8dE6V5durRlJLU1qBX es1w== X-Forwarded-Encrypted: i=1; AJvYcCVeOqQHycH4MhY8+iwEh2VCZMaJqXMe7PDvtqUooId2xA07vYEn1uidHHCfDdZuDSQytz8b/i1aUCOe1j5VMt5JJLsPvtKZ X-Gm-Message-State: AOJu0YzF7u9hfK1JEztHhFIMyoS8L+WRf0IUx+YGrZr0FBoUDaBfo+Ki Eit4Y1gNp69CVflI3HEORTpgS+59Dx0psWrj6ge9WiWIkh47zHSx X-Google-Smtp-Source: AGHT+IE06HgE1v4Vd1GXsYqe4F48xlxYtawepl22go73Z75nzR72o0v/J4qLIu0EHmbIRS+MFKM7Aw== X-Received: by 2002:a05:6512:3159:b0:513:cbaf:d149 with SMTP id s25-20020a056512315900b00513cbafd149mr8713672lfi.64.1710846113371; Tue, 19 Mar 2024 04:01:53 -0700 (PDT) Original-Received: from keynux ([2a01:e0a:505:3460:1c18:688d:ece4:372e]) by smtp.gmail.com with ESMTPSA id t14-20020a05600c450e00b0041409db0349sm9690111wmo.48.2024.03.19.04.01.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 04:01:53 -0700 (PDT) Original-Received: by keynux (sSMTP sendmail emulation); Tue, 19 Mar 2024 12:01:51 +0100 In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::12a; envelope-from=brubar.cs@gmail.com; helo=mail-lf1-x12a.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, MSGID_FROM_MTA_HEADER=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:146129 Archived-At: Hi, Heime writes: > How can I pass the user selection to 'activate-input-method' ? > > > (defun glossus () > > (interactive > (list > (let ( (cseq '("italian-alt-postfix" "italian-keyboard" > "italian-postfix")) ) > (completing-read > " Glossus: " cseq nil t "italian-postfix")))) > > (setq ispell-local-dictionary "it_IT") > (activate-input-method "italian-postfix") ) IIUC, you could do this: (defun my-glossus (user-sel) ;; <==== var name here (interactive (list (let ( (cseq '("italian-alt-postfix" "italian-keyboard" "italian-postfix")) ) (completing-read " Glossus: " cseq nil t "italian-postfix")))) (setq ispell-local-dictionary "it_IT") (activate-input-method user-sel)) Bruno