* bug#48254: 28.0.50; minibuffer does not show the prompt of a command on first invocation
@ 2021-05-06 13:47 max.brieiev
2021-05-06 19:23 ` Gregory Heytings
0 siblings, 1 reply; 12+ messages in thread
From: max.brieiev @ 2021-05-06 13:47 UTC (permalink / raw)
To: 48254
I can't reproduce this with 'emacs -Q'.
Create '.emacs' file that contains just this single line:
(add-hook 'change-major-mode-hook
(lambda () (set-input-method "english-dvorak")))
Now start Emacs.
Press 'M-x' or 'C-x C-f' or likely any other keybinding that would
activate minibuffer. Notice that on the first invocation the command
prompt does not appear in the minibuffer. The prompt appears only after
you have started typing command argument or pressing keybinding
repeatedly.
In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.29, cairo version 1.17.4)
of 2021-05-04 built on arch-max
Repository revision: 0d815d986db038dd3fcee9740da844a9f1d7f2f0
Repository branch: makepkg
Windowing system distributor 'System Description: Arch Linux
Configured using:
'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
--localstatedir=/var --mandir=/usr/share/man --with-gameuser=:games
--with-sound=alsa --with-modules --without-gconf --without-gsettings
--with-native-compilation --with-pgtk --with-x-toolkit=gtk3
--without-xaw3d --without-m17n-flt --with-cairo --with-xwidgets
--without-compress-install 'CFLAGS=-march=x86-64 -mtune=generic -O2
-pipe -fno-plt -fexceptions
-Wp,-D_FORTIFY_SOURCE=2,-D_GLIBCXX_ASSERTIONS -Wformat
-Werror=format-security -fstack-clash-protection -fcf-protection -g
-fuse-ld=gold -g -fuse-ld=gold'
LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'
Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM HARFBUZZ JPEG JSON LCMS2
LIBOTF LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER
PGTK PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS XIM
XWIDGETS GTK3 ZLIB
Important settings:
value of $LC_MESSAGES:
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix
Major mode: ELisp/l
Minor modes in effect:
show-paren-mode: t
display-battery-mode: t
tooltip-mode: t
global-eldoc-mode: t
eldoc-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
column-number-mode: t
line-number-mode: t
transient-mark-mode: t
Load-path shadows:
/home/max/.emacs.d/elpa/transient-20210315.1902/transient hides /usr/share/emacs/28.0.50/lisp/transient
Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg epg-config mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
comp comp-cstr rx cl-extra vc-mtn vc-hg vc-git diff-mode easy-mmode
vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs vc vc-dispatcher view quail
edmacro kmacro format-spec tango-theme paren gnus nnheader gnus-util
rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums time-date mail-utils
mm-util mail-prsvr wid-edit battery dbus xml cus-load eglot array
filenotify jsonrpc ert pp ewoc debug backtrace help-mode find-func xref
flymake-proc flymake thingatpt warnings compile text-property-search
comint ansi-color ring pcase project imenu info package browse-url url
url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map
url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib
iso-transl tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel term/pgtk-win pgtk-win term/common-win tool-bar
dnd fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer cl-generic
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget hashtable-print-readable backquote threads
xwidget-internal dbusbind inotify dynamic-setting font-render-setting
cairo move-toolbar gtk x-toolkit pgtk lcms2 multi-tty
make-network-process nativecomp emacs)
Memory information:
((conses 16 184299 11606)
(symbols 48 15935 1)
(strings 32 47122 2943)
(string-bytes 1 1543748)
(vectors 16 28937)
(vector-slots 8 543588 23363)
(floats 8 67 51)
(intervals 56 472 0)
(buffers 992 14))
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#48254: 28.0.50; minibuffer does not show the prompt of a command on first invocation
2021-05-06 13:47 bug#48254: 28.0.50; minibuffer does not show the prompt of a command on first invocation max.brieiev
@ 2021-05-06 19:23 ` Gregory Heytings
2021-05-07 14:45 ` max.brieiev
0 siblings, 1 reply; 12+ messages in thread
From: Gregory Heytings @ 2021-05-06 19:23 UTC (permalink / raw)
To: max.brieiev; +Cc: 48254
>
> I can't reproduce this with 'emacs -Q'.
>
> Create '.emacs' file that contains just this single line:
>
> (add-hook 'change-major-mode-hook
> (lambda () (set-input-method "english-dvorak")))
>
> Now start Emacs.
>
> Press 'M-x' or 'C-x C-f' or likely any other keybinding that would
> activate minibuffer. Notice that on the first invocation the command
> prompt does not appear in the minibuffer. The prompt appears only after
> you have started typing command argument or pressing keybinding
> repeatedly.
>
Thanks for your bug report. It's an old behavior, the same effect can be
seen in Emacs 24-27, except that during the first invocation you see a
"[DV@]" in the minibuffer. In Emacs 28 you don't see anything.
IIUC, what you want is to activate english-dvorak input method everywhere.
To do that you can use:
(add-hook 'change-major-mode-hook (lambda () (or (minibufferp) (set-input-method "english-dvorak"))))
(add-hook 'minibuffer-setup-hook (lambda () (set-input-method "english-dvorak")))
If you don't want to activate it in the minibuffer, do not use the second
line.
Does that solve the problem you have?
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#48254: 28.0.50; minibuffer does not show the prompt of a command on first invocation
2021-05-06 19:23 ` Gregory Heytings
@ 2021-05-07 14:45 ` max.brieiev
2021-05-07 15:28 ` Gregory Heytings
0 siblings, 1 reply; 12+ messages in thread
From: max.brieiev @ 2021-05-07 14:45 UTC (permalink / raw)
To: Gregory Heytings; +Cc: 48254
Gregory Heytings <gregory@heytings.org> writes:
> (add-hook 'change-major-mode-hook (lambda () (or (minibufferp) (set-input-method "english-dvorak"))))
> (add-hook 'minibuffer-setup-hook (lambda () (set-input-method "english-dvorak")))
> ...
> Does that solve the problem you have?
Thanks, this solves the issue.
But I have some other issues related to input methods, which I don't
know how to reproduce reliably. Maybe you can give me some hints and I
will report them as separate bugs.
One issue is related to the prompts, where the input is a single key
like "y" or "!", like the prompt shown when you have some modified
buffers while exiting Emacs. Sometimes I have to press the key as it is
laid on qwerty layout, but sometimes it is as on dvorak layout. This is
quite annoying, since I always have to guess, which layout is active for
the shown yes-no prompt.
The other issue is probably somehow related to Edebug. I am learning
elisp, so I often run Edebug just to learn how some functionality
works. Once in a while, when some breakpoint is hit, something bad
happens to Emacs in a way that each keymap that defines just basic
characters (I mean without modifier bits), like Info buffer, or Edebug,
or Gnus is turned to think that underlying layout is dvorak. So pressing
"l" inside Info buffer runs actually 'Info-next' command, which is bound
to "n", istead of going back in history. So to make keybindings operate
normally again I have to press "C-\" in every buffer to reset input
method. The other side effect of this is that read-only edebug buffer
suddenly becomes editable and I can enter text there, though mode line
still shows '%%'.
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#48254: 28.0.50; minibuffer does not show the prompt of a command on first invocation
2021-05-07 14:45 ` max.brieiev
@ 2021-05-07 15:28 ` Gregory Heytings
2021-05-08 8:26 ` max.brieiev
0 siblings, 1 reply; 12+ messages in thread
From: Gregory Heytings @ 2021-05-07 15:28 UTC (permalink / raw)
To: max.brieiev; +Cc: 48254
>> (add-hook 'change-major-mode-hook (lambda () (or (minibufferp) (set-input-method "english-dvorak"))))
>> (add-hook 'minibuffer-setup-hook (lambda () (set-input-method "english-dvorak")))
>> ...
>> Does that solve the problem you have?
>
> Thanks, this solves the issue.
>
Okay.
>
> But I have some other issues related to input methods, which I don't
> know how to reproduce reliably. Maybe you can give me some hints and I
> will report them as separate bugs.
>
> One issue is related to the prompts, where the input is a single key
> like "y" or "!", like the prompt shown when you have some modified
> buffers while exiting Emacs. Sometimes I have to press the key as it is
> laid on qwerty layout, but sometimes it is as on dvorak layout. This is
> quite annoying, since I always have to guess, which layout is active for
> the shown yes-no prompt.
>
I don't use a global input method myself, so I cannot give you a general
advice alas. In my tests, with the two above lines, everything that is
read in the minibuffer (yes-or-no-p, y-or-n-p, read-answer, ...) uses the
Dvorak layout. Without a recipe, I cannot do more.
>
> The other issue is probably somehow related to Edebug. I am learning
> elisp, so I often run Edebug just to learn how some functionality works.
> Once in a while, when some breakpoint is hit, something bad happens to
> Emacs in a way that each keymap that defines just basic characters (I
> mean without modifier bits), like Info buffer, or Edebug, or Gnus is
> turned to think that underlying layout is dvorak. So pressing "l" inside
> Info buffer runs actually 'Info-next' command, which is bound to "n",
> istead of going back in history. So to make keybindings operate normally
> again I have to press "C-\" in every buffer to reset input method. The
> other side effect of this is that read-only edebug buffer suddenly
> becomes editable and I can enter text there, though mode line still
> shows '%%'.
>
Again, in my tests this doesn't happen, so alas I cannot give you an
advice without a recipe.
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#48254: 28.0.50; minibuffer does not show the prompt of a command on first invocation
2021-05-07 15:28 ` Gregory Heytings
@ 2021-05-08 8:26 ` max.brieiev
2021-05-09 22:37 ` Gregory Heytings
0 siblings, 1 reply; 12+ messages in thread
From: max.brieiev @ 2021-05-08 8:26 UTC (permalink / raw)
To: Gregory Heytings; +Cc: 48254
Ok, let's try next recipe.
The content of .emacs file:
(add-hook 'change-major-mode-hook (lambda () (or (minibufferp) (set-input-method "english-dvorak"))))
(add-hook 'minibuffer-setup-hook (lambda () (set-input-method "english-dvorak")))
Then:
- Modify some file buffer.
- Press 'C-x C-c'
- You will be prompted with: "Save file ... (y, n, ., q, ...)"
- Press "q" as in qwerty layout. This will quit the prompt, meaning that
the actual layout is qwerty.
But:
- M-: RET (y-or-n-p "test: ") RET
- then press "y" as in dvorak layout, this is "t" letter in qwerty. This
will exit the prompt, meaning that the actual layout is dvorak.
So in each case I had to guess, which layout is active to actually
answer the prompt.
Another case. I use 'project.el'. When you select the project with
`C-x p p`, you are prompted with a menu like:
[f] Find file [g] Find regexp [d] Dired ...
Previously this menu used to respect qwerty layout only. I re-build
Emacs approximately once in 1-2 weeks and since some recent build it
started to respect only dvorak keys.
I don't have strong opinion here, but I think this is wrong. I think
"one letter prompts" should ignore current input methods, because they
are essentially keybindings just with modifier key omitted. An user
with Japanese input method won't be able to answer any of the prompt
unless she explicitly resets inputh method.
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#48254: 28.0.50; minibuffer does not show the prompt of a command on first invocation
2021-05-08 8:26 ` max.brieiev
@ 2021-05-09 22:37 ` Gregory Heytings
2021-05-11 9:15 ` max.brieiev
0 siblings, 1 reply; 12+ messages in thread
From: Gregory Heytings @ 2021-05-09 22:37 UTC (permalink / raw)
To: max.brieiev; +Cc: 48254
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?
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")))
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.
If what you want is to activate the Dvorak input method only for some
specific commands that use the minibuffer, you can use
(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?
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#48254: 28.0.50; minibuffer does not show the prompt of a command on first invocation
2021-05-09 22:37 ` Gregory Heytings
@ 2021-05-11 9:15 ` max.brieiev
2021-05-11 9:35 ` Gregory Heytings
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: max.brieiev @ 2021-05-11 9:15 UTC (permalink / raw)
To: Gregory Heytings; +Cc: 48254
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.
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#48254: 28.0.50; minibuffer does not show the prompt of a command on first invocation
2021-05-11 9:15 ` max.brieiev
@ 2021-05-11 9:35 ` Gregory Heytings
2021-05-11 9:47 ` max.brieiev
2021-05-11 9:40 ` max.brieiev
2021-05-11 17:47 ` Juri Linkov
2 siblings, 1 reply; 12+ messages in thread
From: Gregory Heytings @ 2021-05-11 9:35 UTC (permalink / raw)
To: max.brieiev; +Cc: 48254
>
> 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 far as I understand, input methods were not designed to do what you
want to do, so while this is not what you expect, it's how things work.
And indeed, C-x C-c is save-buffers-kill-emacs, which calls
save-some-buffers, which uses map-y-or-n-p.
>> (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)
>
> 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)
>
Indeed, it is possible (and perhaps easier for your use case) to reverse
the logic. I'd guess that you'll find other commands to add to that list
as time goes.
>
> Thanks again for taking your time to answer my concerns.
>
You're welcome! Do you have other questions, or can this bug report be
closed?
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#48254: 28.0.50; minibuffer does not show the prompt of a command on first invocation
2021-05-11 9:15 ` max.brieiev
2021-05-11 9:35 ` Gregory Heytings
@ 2021-05-11 9:40 ` max.brieiev
2021-05-11 17:47 ` Juri Linkov
2 siblings, 0 replies; 12+ messages in thread
From: max.brieiev @ 2021-05-11 9:40 UTC (permalink / raw)
To: Gregory Heytings; +Cc: 48254
max.brieiev@gmail.com writes:
>
> (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)
>
My bad. I think this one is more correct.
(defun enable-english-dvorak ()
(if (not (or (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)
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#48254: 28.0.50; minibuffer does not show the prompt of a command on first invocation
2021-05-11 9:15 ` max.brieiev
2021-05-11 9:35 ` Gregory Heytings
2021-05-11 9:40 ` max.brieiev
@ 2021-05-11 17:47 ` Juri Linkov
2 siblings, 0 replies; 12+ messages in thread
From: Juri Linkov @ 2021-05-11 17:47 UTC (permalink / raw)
To: max.brieiev; +Cc: Gregory Heytings, 48254
> 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?
The problem is that `map-y-or-n-p` is still waiting to be converted to
read from the minibuffer like `y-or-n-p` now does.
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2021-05-11 17:47 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-06 13:47 bug#48254: 28.0.50; minibuffer does not show the prompt of a command on first invocation max.brieiev
2021-05-06 19:23 ` Gregory Heytings
2021-05-07 14:45 ` max.brieiev
2021-05-07 15:28 ` Gregory Heytings
2021-05-08 8:26 ` max.brieiev
2021-05-09 22:37 ` Gregory Heytings
2021-05-11 9:15 ` max.brieiev
2021-05-11 9:35 ` Gregory Heytings
2021-05-11 9:47 ` max.brieiev
2021-05-11 11:01 ` Gregory Heytings
2021-05-11 9:40 ` max.brieiev
2021-05-11 17:47 ` Juri Linkov
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).