all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#24596: 25.1; `f10' behavior
@ 2016-10-03 15:41 Drew Adams
  2016-10-03 16:13 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Drew Adams @ 2016-10-03 15:41 UTC (permalink / raw)
  To: 24596

`f10' used to just be bound to `tmm-menubar', for both TTY and
graphic-display Emacs.  Now it is bound to `menu-bar-open'.

1. User option `tty-menu-open-use-tmm' makes `f10' use `tmm-menubar'
instead, but only on TTY.  Why not also on graphic displays?  Or why not
have the option value let you choose: always `tmm-menubar', never
`tmm-menubar', or `tmm-menubar only for TTY?  (And of course rename it,
if it is made to apply to more than TTYs.)

2. Why can you not exit `menu-bar-open' (with nil
`tty-menu-open-use-tmm')?  Why is ESC the only way to cancel (at least
on MS Windows)?  Why are not the canonical Emacs ways of canceling
implemented here (`C-g' and `ESC ESC ESC')?

3. The doc string of `menu-bar-open' says nothing about the behavior.
It says nothing about what it does or what keys you can use, etc.  It
should.  Instead, it passes you off to commands `x-menu-bar-open',
`w32-menu-bar-open', `popup-menu', and `tmm-menubar'.

Are the keys you can use different for `x-menu-bar-open' and
`w32-menu-bar-open'?  The latter's doc tells you about keys you can use,
but the former's doc says nothing about keys.

Seems like the doc for `C-h k f10' should give you more info about the
behavior, and the keys you can use for the default behavior (at least).

4. The doc in the Emacs manual (node Menu Bar) is not too bad.  But
AFAICT, `C-g' does NOT work (in MS Windows), as it says it does.  It
also says that you can cancel using `ESC ESC ESC'.  But the doc of
`w32-menu-bar-open' (correctly) says that a single `ESC' cancels.  Dunno
whether this is a doc bug or the behavior (on Windows) is bugged.

5. Overall, it looks a bit like someone wrote `menu-bar-open',
`x-menu-bar-open', and `w32-menu-bar-open', and it was decided to
replace `tmm-menubar' as the binding of `f10'.  But I don't really see
the advantage, especially considering the lack of good doc.


In GNU Emacs 25.1.1 (x86_64-w64-mingw32)
 of 2016-09-17 built on LAPHROAIG
Windowing system distributor 'Microsoft Corp.', version 6.1.7601
Configured using:
 'configure --without-dbus --without-compress-install CFLAGS=-static'





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#24596: 25.1; `f10' behavior
  2016-10-03 15:41 Drew Adams
@ 2016-10-03 16:13 ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2016-10-03 16:13 UTC (permalink / raw)
  To: Drew Adams; +Cc: 24596

severity 24596 minor
thanks

> Date: Mon, 3 Oct 2016 08:41:45 -0700 (PDT)
> From: Drew Adams <drew.adams@oracle.com>
> 
> `f10' used to just be bound to `tmm-menubar', for both TTY and
> graphic-display Emacs.  Now it is bound to `menu-bar-open'.

Not true: F10 in a GUI session, at least on Windows, always activated
the GUI menus from the menu bar.  I just tried that in Emacs 23.1.

What you say is only true for a TTY frame.  It was changed when
text-mode frames learned to display menus.

> 1. User option `tty-menu-open-use-tmm' makes `f10' use `tmm-menubar'
> instead, but only on TTY.  Why not also on graphic displays?

Because F10 never invoked tmm on GUI frames, at least not on
MS-Windows.  If you are asking for a new feature, then I guess it
could be added if enough people want it, but then the variable's name
will need to change, of course.

> Or why not have the option value let you choose: always
> `tmm-menubar', never `tmm-menubar', or `tmm-menubar only for TTY?
> (And of course rename it, if it is made to apply to more than TTYs.)

No reason, except that no one considered this important enough to
write the code.

> 2. Why can you not exit `menu-bar-open' (with nil
> `tty-menu-open-use-tmm')?  Why is ESC the only way to cancel (at least
> on MS Windows)?  Why are not the canonical Emacs ways of canceling
> implemented here (`C-g' and `ESC ESC ESC')?

ESC ESC works for me on MS-Windows GUI frames.  ESC ESC ESC and C-g
work for me on TTY frames.  C-g doesn't work on a GUI frame because
the menu is controlled by Windows, not by Emacs, and Windows doesn't
know about C-g.  IOW, this is a limitation we can do very little
about.

> 3. The doc string of `menu-bar-open' says nothing about the behavior.
> It says nothing about what it does or what keys you can use, etc.  It
> should.  Instead, it passes you off to commands `x-menu-bar-open',
> `w32-menu-bar-open', `popup-menu', and `tmm-menubar'.

Details of how menus work depend on the toolkit, so we refer to the
toolkit-specific parts for the details.  However, patches are welcome
to describe what every toolkit does, presumably in the manual (because
I suspect the description will be long and complicated).

> Are the keys you can use different for `x-menu-bar-open' and
> `w32-menu-bar-open'?

Yes, I think so.

> The latter's doc tells you about keys you can use, but the former's
> doc says nothing about keys.

w32-menu-bar-open describes just one toolkit, whereas x-menu-bar-open
stands for several different ones.  I believe this is the reason.

> 4. The doc in the Emacs manual (node Menu Bar) is not too bad.  But
> AFAICT, `C-g' does NOT work (in MS Windows), as it says it does.  It
> also says that you can cancel using `ESC ESC ESC'.  But the doc of
> `w32-menu-bar-open' (correctly) says that a single `ESC' cancels.  Dunno
> whether this is a doc bug or the behavior (on Windows) is bugged.

You are trying to apply the description of what happens with TTY menus
to GUI menus.  They don't behave the same.

> 5. Overall, it looks a bit like someone wrote `menu-bar-open',
> `x-menu-bar-open', and `w32-menu-bar-open', and it was decided to
> replace `tmm-menubar' as the binding of `f10'.  But I don't really see
> the advantage, especially considering the lack of good doc.

The advantage is unified behavior across frame types, at least by
default.  The tty-menu-open-use-tmm was added later by popular demand;
initially I didn't imagine someone would want it when true menus are
available.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#24596: 25.1; `f10' behavior
       [not found] ` <<838tu5pg0x.fsf@gnu.org>
@ 2016-10-03 16:33   ` Drew Adams
  2016-10-03 17:23     ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Drew Adams @ 2016-10-03 16:33 UTC (permalink / raw)
  To: Eli Zaretskii, Drew Adams; +Cc: 24596


> > `f10' used to just be bound to `tmm-menubar', for both TTY and
> > graphic-display Emacs.  Now it is bound to `menu-bar-open'.
> 
> Not true: F10 in a GUI session, at least on Windows, always activated
> the GUI menus from the menu bar.  I just tried that in Emacs 23.1.
> 
> What you say is only true for a TTY frame.  It was changed when
> text-mode frames learned to display menus.

You're right about that.  I was thinking of M-`, I guess (which is
still `tmm-menubar' by default).

> > 1. User option `tty-menu-open-use-tmm' makes `f10' use `tmm-menubar'
> > instead, but only on TTY.  Why not also on graphic displays?
> 
> Because F10 never invoked tmm on GUI frames, at least not on
> MS-Windows.  If you are asking for a new feature, then I guess it
> could be added if enough people want it, but then the variable's name
> will need to change, of course.

Yes.

> > 2. Why can you not exit `menu-bar-open' (with nil
> > `tty-menu-open-use-tmm')?  Why is ESC the only way to cancel (at least
> > on MS Windows)?  Why are not the canonical Emacs ways of canceling
> > implemented here (`C-g' and `ESC ESC ESC')?
> 
> ESC ESC works for me on MS-Windows GUI frames.

For me, with emacs -Q, a single ESC cancels.  A second ESC acts as
a prefix key for the next key sequence.

> ESC ESC ESC and C-g
> work for me on TTY frames.  C-g doesn't work on a GUI frame because
> the menu is controlled by Windows, not by Emacs, and Windows doesn't
> know about C-g.  IOW, this is a limitation we can do very little
> about.

OK.  Then the fix is to fix the doc, which says something quite
different from what the behavior really is.

> > 4. The doc in the Emacs manual (node Menu Bar) is not too bad.  But
> > AFAICT, `C-g' does NOT work (in MS Windows), as it says it does.  It
> > also says that you can cancel using `ESC ESC ESC'.  But the doc of
> > `w32-menu-bar-open' (correctly) says that a single `ESC' cancels.  Dunno
> > whether this is a doc bug or the behavior (on Windows) is bugged.
> 
> You are trying to apply the description of what happens with TTY menus
> to GUI menus.  They don't behave the same.

Where do you see that that doc says that what it is describing is
limited to TTYs?  In fact, the faulty description (for MS Windows, in
any case) is in the paragraph _before_ the paragraph that starts
talking about the behavior in a text terminal:

  Instead of using the mouse, you can also invoke the first menu bar
  item by pressing <F10> (to run the command ‘menu-bar-open’).  You can
  then navigate the menus with the arrow keys.  To activate a selected
  menu item, press <RET>; to cancel menu navigation, press ‘C-g’ or ‘<ESC>
  <ESC> <ESC>’.

The part about `C-g' and `ESC ESC ESC' is wrong, for Windows.  And if
`C-g' is Emacs only and `menu-bar-open' passes the behavior off to a
toolkit, then perhaps `C-g' is also incorrect for other toolkits/window
managers?

> > 5. Overall, it looks a bit like someone wrote `menu-bar-open',
> > `x-menu-bar-open', and `w32-menu-bar-open', and it was decided to
> > replace `tmm-menubar' as the binding of `f10'.  But I don't really see
> > the advantage, especially considering the lack of good doc.
> 
> The advantage is unified behavior across frame types, at least by
> default.  The tty-menu-open-use-tmm was added later by popular demand;
> initially I didn't imagine someone would want it when true menus are
> available.

I am not requesting it for myself.  (I use La Carte to access menus
using the keyboard.)

But, as you point out, I was mistaken in thinking that f10 was
`tmm-menubar' in the past.  I was thinking of M-`.

I think that the doc could be improved a bit, but the default behavior
is fine by me.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#24596: 25.1; `f10' behavior
  2016-10-03 16:33   ` Drew Adams
@ 2016-10-03 17:23     ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2016-10-03 17:23 UTC (permalink / raw)
  To: Drew Adams; +Cc: 24596

> Date: Mon, 3 Oct 2016 09:33:47 -0700 (PDT)
> From: Drew Adams <drew.adams@oracle.com>
> Cc: 24596@debbugs.gnu.org
> 
> > > 2. Why can you not exit `menu-bar-open' (with nil
> > > `tty-menu-open-use-tmm')?  Why is ESC the only way to cancel (at least
> > > on MS Windows)?  Why are not the canonical Emacs ways of canceling
> > > implemented here (`C-g' and `ESC ESC ESC')?
> > 
> > ESC ESC works for me on MS-Windows GUI frames.
> 
> For me, with emacs -Q, a single ESC cancels.  A second ESC acts as
> a prefix key for the next key sequence.

Sorry, I omitted a crucial detail: the number of ESC presses needed to
exit the menu depends on whether you already dropped a menu or not.
That is, if you press F10, then the down-arrow, to drop the File menu,
you need 2 ESC: the first will pop down the menu, the second will exit
the menu bar.  But if you just press F10, or only type right-arrow or
left-arrow after that, i.e. there's no menu dropped down, then just
one ESC is enough.

> > ESC ESC ESC and C-g
> > work for me on TTY frames.  C-g doesn't work on a GUI frame because
> > the menu is controlled by Windows, not by Emacs, and Windows doesn't
> > know about C-g.  IOW, this is a limitation we can do very little
> > about.
> 
> OK.  Then the fix is to fix the doc, which says something quite
> different from what the behavior really is.

I can only add a note there saying that with some toolkits the exact
keys to exit the menu might be different.  Any better ideas?

> The part about `C-g' and `ESC ESC ESC' is wrong, for Windows.  And if
> `C-g' is Emacs only and `menu-bar-open' passes the behavior off to a
> toolkit, then perhaps `C-g' is also incorrect for other toolkits/window
> managers?

I guess so, but I don't really know and have no way if verifying
that.  Help is welcome.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#24596: 25.1; `f10' behavior
       [not found]     ` <<834m4tpcsb.fsf@gnu.org>
@ 2016-10-03 17:45       ` Drew Adams
  2016-10-03 18:14         ` Eli Zaretskii
  2016-10-06 18:49         ` Eli Zaretskii
  0 siblings, 2 replies; 7+ messages in thread
From: Drew Adams @ 2016-10-03 17:45 UTC (permalink / raw)
  To: Eli Zaretskii, Drew Adams; +Cc: 24596

> > > ESC ESC works for me on MS-Windows GUI frames.
> >
> > For me, with emacs -Q, a single ESC cancels.  A second ESC acts as
> > a prefix key for the next key sequence.
> 
> Sorry, I omitted a crucial detail: the number of ESC presses needed to
> exit the menu depends on whether you already dropped a menu or not.
> That is, if you press F10, then the down-arrow, to drop the File menu,
> you need 2 ESC: the first will pop down the menu, the second will exit
> the menu bar.  But if you just press F10, or only type right-arrow or
> left-arrow after that, i.e. there's no menu dropped down, then just
> one ESC is enough.

Got it.  Can the doc please say this?  I tried ESC ESC ESC with just
f10, and I thought that the behavior was not as described.

> > > ESC ESC ESC and C-g
> > > work for me on TTY frames.  C-g doesn't work on a GUI frame because
> > > the menu is controlled by Windows, not by Emacs, and Windows doesn't
> > > know about C-g.  IOW, this is a limitation we can do very little
> > > about.
> >
> > OK.  Then the fix is to fix the doc, which says something quite
> > different from what the behavior really is.
> 
> I can only add a note there saying that with some toolkits the exact
> keys to exit the menu might be different.  Any better ideas?

That will help.  Thx.  Is the ESC behavior as you described above?  If
so then it would help to mention it, I think.

I guess you are also saying that C-g is supported for at least some
toolkits.

> > The part about `C-g' and `ESC ESC ESC' is wrong, for Windows.  And if
> > `C-g' is Emacs only and `menu-bar-open' passes the behavior off to a
> > toolkit, then perhaps `C-g' is also incorrect for other toolkits/window
> > managers?
> 
> I guess so, but I don't really know and have no way if verifying
> that.  Help is welcome.

Hopefully someone with another platform/toolkit will help here.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#24596: 25.1; `f10' behavior
  2016-10-03 17:45       ` bug#24596: 25.1; `f10' behavior Drew Adams
@ 2016-10-03 18:14         ` Eli Zaretskii
  2016-10-06 18:49         ` Eli Zaretskii
  1 sibling, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2016-10-03 18:14 UTC (permalink / raw)
  To: Drew Adams; +Cc: 24596

> Date: Mon, 3 Oct 2016 10:45:19 -0700 (PDT)
> From: Drew Adams <drew.adams@oracle.com>
> Cc: 24596@debbugs.gnu.org
> 
> I guess you are also saying that C-g is supported for at least some
> toolkits.

It is definitely supported with the basic X menus we display when
built with no toolkits at all, because then everything is done by
Emacs.  But I don't expect any toolkits to support C-g.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#24596: 25.1; `f10' behavior
  2016-10-03 17:45       ` bug#24596: 25.1; `f10' behavior Drew Adams
  2016-10-03 18:14         ` Eli Zaretskii
@ 2016-10-06 18:49         ` Eli Zaretskii
  1 sibling, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2016-10-06 18:49 UTC (permalink / raw)
  To: Drew Adams; +Cc: 24596-done

> Date: Mon, 3 Oct 2016 10:45:19 -0700 (PDT)
> From: Drew Adams <drew.adams@oracle.com>
> Cc: 24596@debbugs.gnu.org
> 
> > > > ESC ESC works for me on MS-Windows GUI frames.
> > >
> > > For me, with emacs -Q, a single ESC cancels.  A second ESC acts as
> > > a prefix key for the next key sequence.
> > 
> > Sorry, I omitted a crucial detail: the number of ESC presses needed to
> > exit the menu depends on whether you already dropped a menu or not.
> > That is, if you press F10, then the down-arrow, to drop the File menu,
> > you need 2 ESC: the first will pop down the menu, the second will exit
> > the menu bar.  But if you just press F10, or only type right-arrow or
> > left-arrow after that, i.e. there's no menu dropped down, then just
> > one ESC is enough.
> 
> Got it.  Can the doc please say this?  I tried ESC ESC ESC with just
> f10, and I thought that the behavior was not as described.
> 
> > > > ESC ESC ESC and C-g
> > > > work for me on TTY frames.  C-g doesn't work on a GUI frame because
> > > > the menu is controlled by Windows, not by Emacs, and Windows doesn't
> > > > know about C-g.  IOW, this is a limitation we can do very little
> > > > about.
> > >
> > > OK.  Then the fix is to fix the doc, which says something quite
> > > different from what the behavior really is.
> > 
> > I can only add a note there saying that with some toolkits the exact
> > keys to exit the menu might be different.  Any better ideas?
> 
> That will help.  Thx.  Is the ESC behavior as you described above?  If
> so then it would help to mention it, I think.

I've now done that, and I'm marking this bug done.

Thanks.





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-10-06 18:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <<<ef8ce118-4fc8-4bc1-9606-468839196ffb@default>
     [not found] ` <<<838tu5pg0x.fsf@gnu.org>
     [not found]   ` <<c37596f6-47bc-4624-b948-c938c87bc74e@default>
     [not found]     ` <<834m4tpcsb.fsf@gnu.org>
2016-10-03 17:45       ` bug#24596: 25.1; `f10' behavior Drew Adams
2016-10-03 18:14         ` Eli Zaretskii
2016-10-06 18:49         ` Eli Zaretskii
     [not found] <<ef8ce118-4fc8-4bc1-9606-468839196ffb@default>
     [not found] ` <<838tu5pg0x.fsf@gnu.org>
2016-10-03 16:33   ` Drew Adams
2016-10-03 17:23     ` Eli Zaretskii
2016-10-03 15:41 Drew Adams
2016-10-03 16:13 ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.