Hi,
I've got your address from Gerd Moelmann, previous maintainer of Emacs.
I have implemented keyboard controlling mechanism for controlling menus in
CVS version of GNU Emacs. Richard asked me if I can make it work with
Lesstif. I have made some study there and Lesstif (and openmotif too) seems
to call deactivate callbacks many more times it should.
I have attached parts of my communication with Richard and Gerd. The most
informative e-mail is the last one.
I use lesstif-0.93.14-110 from SuSE Linux 8.0 for development and am
willing to provide any informations you need. Please keep me in CC: when
talking about this issue.
Can you please help us to solve this issue?
--- Begin Message ---
Topics:
Re: C-l while in menu?
Re: C-l while in menu?
Re: C-l while in menu?
--- End Message ---
--- Begin Message ---
From: Richard Stallman <[EMAIL PROTECTED]>
Date: Sat, 20 Apr 2002 11:27:13 -0600 (MDT)
> Can you see what is required to make this feature work with LessTif too?
> If you can't figure out from the docs what needs doing,
> perhaps [EMAIL PROTECTED] could give you advice.
Well, it almost works. Current CVS just process only the first key,
because popup_activated_flag is 1 only at that moment. After the first key
is processed, popup_deactivate_callback is called (many times) and that
variable is zeroed. And from now on, key in menu are no longer processed.
Good. After:
--- /home/pavel/.Emacs/Work/emacs/src/xmenu.c Mon Jan 7 06:48:44 2002
+++ ./xmenu.c Sat Apr 20 21:54:41 2002
@@ -1154,7 +1154,7 @@
LWLIB_ID id;
XtPointer client_data;
{
- popup_activated_flag = 1;
+ popup_activated_flag += 1;
}
/* This callback is invoked when a dialog or menu is finished being
@@ -1166,7 +1166,7 @@
LWLIB_ID id;
XtPointer client_data;
{
- popup_activated_flag = 0;
+ popup_activated_flag -= 1;
}
/* Lwlib callback called when menu items are highlighted/unhighlighted
Menu works, because popup_activated_flag is going to negative numbers very
fast... But I can no longer enter any character in the buffer, because
those keypress events are processed in menu... So I think it is not about
Lesstif knowledge, it is about how Lesstif is used in Emacs. I do not use
Lesstif so perhaps Gerd can help me. Or anyone else?
> Another useful feature is to provide ways to activate the menus from
> the keyboard, compatible with what people expect in other programs.
> I am told that XEmacs has this feature too.
Yes, this will be the second step. But I;d like to finish this one before
doing additional things.
> It might not be easy to find key bindings for it, though.
I think it is very easy. We should use F10, and invent new variable
f10-should-use-tmm (this is only idea to exactly describe its meaning...)
defaulting to nil.
--
Pavel Jan�k
panic ("No CPUs found. System halted.\n");
-- 2.4.3 arch/parisc/kernel/setup.c
_______________________________________________
Emacs-devel mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/emacs-devel
--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] (Pavel Jan�k) writes:
> Menu works, because popup_activated_flag is going to negative numbers very
> fast... But I can no longer enter any character in the buffer, because
> those keypress events are processed in menu... So I think it is not about
> Lesstif knowledge, it is about how Lesstif is used in Emacs. I do not use
> Lesstif so perhaps Gerd can help me.
That sounds like a problem I had with Lesstif in the past, and which
got fixed in Lesstif with the friendly help of Lesstif hackers, IIRC.
I'd check the behavior with OpenMotif and with the newest Lesstif from
CVS. If it works in OpenMotif and doesn't work in Lesstif, I think
[EMAIL PROTECTED] would be interested in fixing it in Lesstif.
Otherwise, I'm pretty sure someone will be willing to help out. They
were very cooperative last time I tried.
--- End Message ---
--- Begin Message ---
From: [EMAIL PROTECTED] (Gerd Moellmann)
Date: 21 Apr 2002 13:17:03 +0200
> I'd check the behavior with OpenMotif and with the newest Lesstif from
> CVS. If it works in OpenMotif and doesn't work in Lesstif, I think
> [EMAIL PROTECTED] would be interested in fixing it in Lesstif.
>
> Otherwise, I'm pretty sure someone will be willing to help out. They
> were very cooperative last time I tried.
The problem still remains. I still think it is not problem in lesstif or
openmotif. I'll try to describe the problem again with more details:
I use popup_activated_flag to dispatch KeyPress events. Its value is
changed with these two functions from xmenu.c:
static void
popup_activate_callback (widget, id, client_data)
Widget widget;
LWLIB_ID id;
XtPointer client_data;
{
popup_activated_flag = 1;
}
static void
popup_deactivate_callback (widget, id, client_data)
Widget widget;
LWLIB_ID id;
XtPointer client_data;
{
popup_activated_flag = 0;
}
The problem is, that the current code (in lwlib-Xm.c) doesn't work as
expected. When you activate menu File, you can control the menu via
keyboard (Up, Down). This works, but just after highlighting the next
top-level item in the menu-bar (ie. Edit), our variable
popup_activated_flag got zeroed.
What is the reason? It is simple. First, popup_activate_callback of the new
menu is called and thus popup_activated_flag is set to 1, but after
a moment, popup_deactivate_callback is called many times because it is
called for all menu-items in the previous (File) menu.
I do not personally use Motif code, but I think that the false value of
popup_activated_flag (it can very easy be 1 even when the popup is not
activated) is dangerous and could be the source of potential problems (I
saw that it is used to temporary disable redisplay etc).
What is the right approach to this problem?
--
Pavel Jan�k
"when" is not a word I find useful about most bios bugs. Try "if" or
"less likely that being hit on the head by an asteroid"
-- Alan Cox in LKML about possibility of fixing BIOS bugs
_______________________________________________
Emacs-devel mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/emacs-devel
--- End Message ---
--
Pavel Jan�k
I wouldn't use this kernel in an atomic plant.. ;-)
-- Bernhard Kaindl