[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: address@hidden: RE: tooltip-mode disabled prevents messages in minib
Re: address@hidden: RE: tooltip-mode disabled prevents messages in minibuffer]
Sat, 22 Jul 2006 13:23:54 +0300
> From: Nick Roberts <address@hidden>
> Date: Sat, 22 Jul 2006 17:39:59 +1200
> Cc: address@hidden
> > Evaluate this:
> > (require 'easymenu)
> > (defvar my-menu (copy-tree facemenu-menu) "")
> > (defalias 'my-menu my-menu)
> > (define-key global-map [C-down-mouse-2] 'my-menu)
> > (easy-menu-do-add-item my-menu ["TEST" test t])
> > (defun test () "" (interactive) (message "TTTTTTTTTTTTTTTTT"))
> > (tooltip-mode 1)
> > Use `C-mouse-2' to bring up the facemenu and then click TEST. The
> > message TTTTTTTTTTTT appears in the minibuffer, as it should.
> > Now, do this: (tooltip-mode -1)
> > Try menu item TEST again: no message appears in the minibuffer. The
> > message TTTTTTTTTT appears in *Messages*, however.
> I can't reproduce this on GNU/Linux.
What do you see on GNU/Linux? Do you see the TTTTTTTTTTTTTTTTT
message in the echo area?
Also, what is your Emacs configuration? (The toolkit, if any, is the
most interesting detail.)
> > I don't know if an empty tooltip message in the minibuffer is somehow
> > overwriting the message or what. If that is the problem, how can I
> > control that?
> I don't think so. The item TEST has no help-echo. Messages disappear
> when Emacs receives further input.
This is not entirely accurate, see below: no help-echo causes Emacs to
clear the echo area, probably to erase the previous help-echo.
Anyway, I looked into the code, compared the X version with the w32
version, and frankly, I'm baffled.
Here's what I see in the code: if a menu item doesn't have an
associated help-echo string, both X and w32 versions call
kbd_buffer_store_help_event with nil as its second argument. (For the
w32 version, see w32menu.c:w32menu_display_help; for the X version,
see xmenu.c:menu_highlight_callback.) This nil eventually winds up in
keyboard.c:show_help_echo, which explicitly calls message(0) if its
HELP argument is nil. The call message(0) should clear the echo area,
In the w32 version, if I put a breakpoint inside show_help_echo, it
breaks after I click on TEST in the menu. If I then step through the
function, I clearly see the TTTTTTTTTTTTTTTTT message in the echo area
until Emacs calls message(0), at which point the echo area is cleared.
I don't have access to a GUI version of Emacs on GNU/Linux where I'm
typing this--could someone please see which part of the above
description works differently on GNU/Linux, and why?