unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: monnier@IRO.UMontreal.CA
Cc: yandros@mit.edu, emacs-devel@gnu.org, darren.hoo@gmail.com
Subject: Re: Input for TTY menus
Date: Sat, 19 Oct 2013 12:43:34 +0300	[thread overview]
Message-ID: <8338nxmw8p.fsf@gnu.org> (raw)
In-Reply-To: <83fvrxn26f.fsf@gnu.org>

> Date: Sat, 19 Oct 2013 10:35:20 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: yandros@mit.edu, darren.hoo@gmail.com, emacs-devel@gnu.org
> 
> > From: Stefan Monnier <monnier@IRO.UMontreal.CA>
> > Cc: chad <yandros@mit.edu>, emacs-devel@gnu.org, darren.hoo@gmail.com
> > Date: Fri, 18 Oct 2013 16:04:54 -0400
> > 
> > But the tty-menu code should also correctly handle an empty menu.
> > E.g. if I do:
> > 
> > emacs -Q -nw
> > M-: (global-set-key [menu-bar test] '(menu-item "Test" (keymap "Test"))) RET
> > f10
> > 
> > then f10 just tells me "Empty menu" and doesn't let me move to
> > another menu.
> 
> I'd appreciate if you or someone else could fix this, or describe the
> solution in enough detail that I could do it myself.  Keymaps and
> input in general is an area in Emacs where I know very little, and I
> already spent a disproportional amount of time on that aspect of the
> menus (for comparison, the display aspects of the menus started
> working within 2 working days of the code completion).

I can propose the following kludge-around:

=== modified file 'src/term.c'
--- src/term.c	2013-10-17 06:42:21 +0000
+++ src/term.c	2013-10-19 09:37:15 +0000
@@ -3607,8 +3607,8 @@ tty_menu_show (struct frame *f, int x, i
 
   if (menu_items_used <= MENU_ITEMS_PANE_LENGTH)
     {
-      *error_name = "Empty menu";
-      return Qnil;
+      tty_menu_new_item_coords (f, TTYM_NEXT, &x, &y);
+      return Fcons (make_number (x), make_number (y));
     }
 
   /* Make the menu on that window.  */


The problem with this is that this change arbitrarily switches to the
next menu-bar menu, which means that if you use C-b or left-arrow to
move backwards through the menu-bar items, you will be "stuck" when
you get to the empty menu item.  IOW, you can only move past such an
empty menu while moving forward (C-f or right-arrow).

However, if this is deemed "good enough", I will install it.

Btw, what does the non-toolkit menu do with this situation on X, when
triggered by F10?  Doesn't it behave the same?



  reply	other threads:[~2013-10-19  9:43 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-19 13:38 Input for TTY menus Eli Zaretskii
2013-09-19 13:52 ` Masatake YAMATO
2013-09-19 14:33 ` Stefan Monnier
2013-09-19 15:47   ` Eli Zaretskii
2013-09-19 19:21     ` Stefan Monnier
2013-09-23 13:18       ` Eli Zaretskii
2013-09-23 14:43         ` Stefan Monnier
2013-09-21 14:56   ` Eli Zaretskii
2013-10-17  5:34 ` Darren Hoo
2013-10-17 15:49   ` Eli Zaretskii
2013-10-18  4:55     ` Darren Hoo
2013-10-18  6:49       ` Eli Zaretskii
2013-10-18  7:37         ` Darren Hoo
2013-10-18  9:13           ` Eli Zaretskii
2013-10-18 10:39             ` Darren Hoo
2013-10-18 13:38               ` Eli Zaretskii
2013-10-18 13:40               ` Eli Zaretskii
2013-10-19 18:38                 ` Darren Hoo
2013-10-19 18:58                 ` Darren Hoo
2013-10-19 19:07                   ` Darren Hoo
2013-10-20  9:32                     ` Jan Djärv
2013-10-18 14:11         ` Eli Zaretskii
2013-10-18 15:12           ` Stefan Monnier
2013-10-18 15:28             ` Eli Zaretskii
2013-10-18 18:17               ` Stefan Monnier
2013-10-19  8:40             ` Eli Zaretskii
2013-10-19 13:45               ` Stefan Monnier
2013-10-18 17:41         ` chad
2013-10-18 17:43           ` chad
2013-10-18 18:14           ` Eli Zaretskii
2013-10-18 19:26             ` Jan Djärv
2013-10-18 20:04             ` Stefan Monnier
2013-10-19  7:35               ` Eli Zaretskii
2013-10-19  9:43                 ` Eli Zaretskii [this message]
2013-10-19 13:40                   ` Stefan Monnier
2013-10-19 14:45                     ` Eli Zaretskii
2013-10-19 15:25                       ` Stefan Monnier
2013-10-19 16:32                         ` Eli Zaretskii
2013-10-19  8:58             ` Jan Djärv
2013-10-19  9:01               ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8338nxmw8p.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=darren.hoo@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    --cc=yandros@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).