help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Passing user selection to a command


From: Bruno Barbier
Subject: Re: Passing user selection to a command
Date: Tue, 19 Mar 2024 12:01:51 +0100

Hi,

Heime <heimeborgia@protonmail.com> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]