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

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

bug#48254: 28.0.50; minibuffer does not show the prompt of a command on


From: max . brieiev
Subject: bug#48254: 28.0.50; minibuffer does not show the prompt of a command on first invocation
Date: Tue, 11 May 2021 12:15:46 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Gregory Heytings <gregory@heytings.org> writes:

> I'm not sure I understand what you want.  Where do you want the Dvorak
> input method to be active, and where do you want it to be disabled?

My preference here would be to enter text (longer than a single key
press) with dvorak, but to answer one-key-press prompts with dvorak
disabled.

But no matter what my preference is, things should remain consistent. As
you see from previous message, confirmation prompt after 'C-x C-c'
(seems to be `map-y-or-n-p`) must be completed with qwerty, but regular
`y-or-n-p` prompts must be completed with dvorak. Is this expected?

> As I said earlier, if you don't want to enable english-dvorak in the
> minibuffer, all you have to do is to remove the line:
>
> (add-hook 'minibuffer-setup-hook (lambda () (set-input-method 
> "english-dvorak")))

I want to enter text into minibuffer with dvorak, so I keep this
line. In overall, this works good, the issue is when you have to press
just a single key to complete the prompt.

> Then you'll have a consistent behavior: the Dvorak input method will
> be active in buffers you edit, and for everything else (key bindings,
> minibuffer interaction, help buffers, ...) it will be disabled.

Key bindings for any major mode ignore active input method, as far as I
can tell, input method is respected only for self insert commad. So
plain keys in dired or help window are always qwerty layout no matter
what input method is enabled, which I think is the right thing. Hence my
preference is that when I am expected to complete the prompt with a
single key in minibuffer I would like to do it with current inputh
method disabled. But by default this holds true only for some prompts.

> (defun enable-english-dvorak ()
>   (if (memq this-command '(find-file execute-extended-command 
> switch-to-buffer))
>       (set-input-method "english-dvorak")))
> (add-hook 'minibuffer-setup-hook #'enable-english-dvorak)
>
> and adapt the command list to suit your needs.
>
> Does that solve the problem you have?

Thanks. For me this should probably be something like this:

(defun enable-english-dvorak ()
  (if (or (not (memq this-command '(y-or-n-p map-y-or-n-p)))
          (and read-answer-short (equal this-command 'read-answer)))
      (set-input-method "english-dvorak")))
(add-hook 'minibuffer-setup-hook #'enable-english-dvorak)

Thanks again for taking your time to answer my concerns.





reply via email to

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