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: Heime
Subject: Re: Passing user selection to a command
Date: Tue, 19 Mar 2024 14:19:54 +0000





Sent with Proton Mail secure email.

On Wednesday, March 20th, 2024 at 12:32 AM, Bruno Barbier <brubar.cs@gmail.com> 
wrote:

> Heime heimeborgia@protonmail.com writes:
> 
> > Sent with Proton Mail secure email.
> > 
> > On Tuesday, March 19th, 2024 at 11:01 PM, Bruno Barbier brubar.cs@gmail.com 
> > wrote:
> > 
> > > 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
> > 
> > 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 ?
> 
> 
> 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 turn 
> previous methods OFF.
> You don't have to do anything.
> 
> 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.



reply via email to

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