GNU bug report logs -
#5908
tooltip-show breaks with multiline tip on Emacs for Windows v22.2.1
Previous Next
Reported by: "D Chiesa" <dpchiesa <at> hotmail.com>
Date: Thu, 8 Apr 2010 18:27:02 UTC
Severity: normal
Merged with 2423
Done: Chong Yidong <cyd <at> stupidchicken.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 5908 in the body.
You can then email your comments to 5908 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#5908
; Package
emacs
.
(Thu, 08 Apr 2010 18:27:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
"D Chiesa" <dpchiesa <at> hotmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Thu, 08 Apr 2010 18:27:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Emacs doesn't properly display long text tooltips, or multi-line tooltips,
on Windows.
You can see a picture of the problem here:
http://i42.tinypic.com/qqu0ja.jpg
And you can demonstrate it for yourself by doing
(tooltip-show "very very long string message........" )
You'll see that the last line in the displayed tooltip is clipped.
It seems that the size of the tooltip is not correctly calculated.
Appending a newline '\n' to the string to be displayed, allows the tooltip
to be seen in its entirety, although with more "border" than is necessary on
the bottom of the text.
In GNU Emacs 22.2.1 (i386-mingw-nt6.0.6001)
of 2008-03-26 on RELEASE
Windowing system distributor `Microsoft Corp.', version 6.0.6001
configured using `configure --with-gcc (3.4)'
Important settings:
value of $LC_ALL: nil
value of $LC_COLLATE: nil
value of $LC_CTYPE: nil
value of $LC_MESSAGES: nil
value of $LC_MONETARY: nil
value of $LC_NUMERIC: nil
value of $LC_TIME: nil
value of $LANG: ENU
locale-coding-system: cp1252
default-enable-multibyte-characters: t
Major mode: Emacs-Lisp
Minor modes in effect:
yas/minor-mode: t
shell-dirtrack-mode: t
nxhtml-global-minor-mode: t
encoded-kbd-mode: t
tooltip-mode: t
tool-bar-mode: t
mouse-wheel-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
unify-8859-on-encoding-mode: t
utf-translate-cjk-mode: t
auto-compression-mode: t
line-number-mode: t
Recent input:
<backspace> s <down> <down> <down> <escape> SPC <up>
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up>
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up>
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up>
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up>
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> C-u
C-x TAB C-w C-y <help-echo> <help-echo> C-x C-s C-x
b b <backspace> C-g C-x C-f f l y <tab> j <tab> <return>
<escape> > <up> <C-left> <C-left> <C-right> <right>
f o r - <down> C-x C-s C-x C-e <return> C-x b <return>
C-x C-e <return> <help-echo> <help-echo> C-p C-p C-p
C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p
C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p
C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p
C-p C-p C-p C-n C-n C-k C-k C-k C-k C-k C-k C-y C-p
C-w C-k C-n C-n C-p C-e C-d C-c 1 C-e C-k C-c 1 C-e
C-k C-c 1 C-n C-a C-k C-k C-n C-k C-k C-k C-k C-k C-k
C-p C-p C-p <escape> SPC C-n C-n C-n C-n C-n C-n C-n
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n <escape>
C-r C-p C-p C-p C-p C-p C-p C-n <backspace> C-c 1 C-n
C-a <backspace> C-c 1 <backspace> C-b <backspace> C-p
C-p C-a <backspace> C-c 1 <backspace> C-e C-d C-c 1
<backspace> C-n C-n C-n C-a <backspace> C-c 1 <backspace>
C-n C-p C-n C-n C-n <escape> SPC C-p C-p C-p C-p C-p
C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-u C-x TAB
C-w C-y C-x C-s <help-echo> <escape> x r e p o r t
- e m <tab> <return>
Recent messages:
Wrote c:/Users/dinoch/elisp/flymake-for-jslint.el
Compiling c:/Users/dinoch/elisp/flymake-for-jslint.el...done
Wrote c:/Users/dinoch/elisp/flymake-for-jslint.elc
Compiling c:/Users/dinoch/elisp/flymake-for-csharp.el...done
Wrote c:/Users/dinoch/elisp/flymake-for-csharp.elc
Mark set
Mark activated
Mark set [2 times]
Wrote c:/Users/dinoch/elisp/flymake-for-csharp.el
Loading emacsbug...done
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#5908
; Package
emacs
.
(Thu, 08 Apr 2010 19:18:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 5908 <at> debbugs.gnu.org (full text, mbox):
"D Chiesa" <dpchiesa <at> hotmail.com> writes:
> Emacs doesn't properly display long text tooltips, or multi-line
> tooltips, on Windows.
>
> You can see a picture of the problem here:
> http://i42.tinypic.com/qqu0ja.jpg
I seem to recall that this bug was fixed for Emacs 23.1. I don't
remember which checkin, though. Someone with access to a Windows port
should verify this.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#5908
; Package
emacs
.
(Thu, 08 Apr 2010 19:36:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 5908 <at> debbugs.gnu.org (full text, mbox):
Chong Yidong wrote:
> "D Chiesa" <dpchiesa <at> hotmail.com> writes:
>
>> Emacs doesn't properly display long text tooltips, or multi-line
>> tooltips, on Windows.
[...]
> I seem to recall that this bug was fixed for Emacs 23.1.
I though this was a duplicate of the (still open) bug#2423.
Maybe it was fixed and never closed, but I don't recall it.
(Multiline tooltips still don't work the first time in GNU/Linux.)
Merged 2423 5908.
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Fri, 09 Apr 2010 07:36:01 GMT)
Full text and
rfc822 format available.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#5908
; Package
emacs
.
(Fri, 09 Apr 2010 08:05:02 GMT)
Full text and
rfc822 format available.
Message #16 received at 5908 <at> debbugs.gnu.org (full text, mbox):
> From: "D Chiesa" <dpchiesa <at> hotmail.com>
> Date: Thu, 8 Apr 2010 14:10:20 -0400
> Cc:
>
> Emacs doesn't properly display long text tooltips, or multi-line tooltips,
> on Windows.
>
> You can see a picture of the problem here:
> http://i42.tinypic.com/qqu0ja.jpg
>
> And you can demonstrate it for yourself by doing
>
> (tooltip-show "very very long string message........" )
>
> You'll see that the last line in the displayed tooltip is clipped.
This is a known and a nasty problem, present in Emacs 23 as well. The
ugly part is that the behavior depends on the size of the font used
for the tooltips. If you play with that font's definition, you will
eventually find a size where the clipping doesn't happen. (The value
depends on the size and resolution of your monitor.)
Someone who knows much more about GUI display than I do should look
into this, because I can spot nothing wrong in the code.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#5908
; Package
emacs
.
(Fri, 09 Apr 2010 14:21:02 GMT)
Full text and
rfc822 format available.
Message #19 received at 5908 <at> debbugs.gnu.org (full text, mbox):
> This is a known and a nasty problem, present in Emacs 23 as well. The
> ugly part is that the behavior depends on the size of the font used
> for the tooltips. If you play with that font's definition, you will
> eventually find a size where the clipping doesn't happen. (The value
> depends on the size and resolution of your monitor.)
>
> Someone who knows much more about GUI display than I do should look
> into this, because I can spot nothing wrong in the code.
>
Thanks I'll look into adjusting the font myself.
As another workaround, individuals can use advice on tooltip-show. If you
append a newline onto the text, it tends to display without clipping,
although you get the opposite problem - too much dead space.
(defun cheeso-reform-string (limit arg)
(let ((orig arg) (modified "") (curline "") word
(words (split-string arg " ")))
(while words
(progn
(setq curline "")
(while (and words (< (length curline) limit))
(progn
(setq word (car words))
(setq words (cdr words))
(setq curline (concat curline " " word))))
(setq modified (concat modified curline "\n"))))
(setq modified (concat modified " \n")))
)
(defadvice tooltip-show (before
flymake-csharp-fixup-tooltip
(arg &optional use-echo-area)
activate compile)
(progn
(if (and (not use-echo-area)
(eq major-mode 'csharp-mode))
(let ((orig (ad-get-arg 0)))
(ad-set-arg 0 (cheeso-reform-string 72 orig))
))))
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#5908
; Package
emacs
.
(Fri, 09 Apr 2010 16:59:02 GMT)
Full text and
rfc822 format available.
Message #22 received at 5908 <at> debbugs.gnu.org (full text, mbox):
Glenn Morris skrev 2010-04-08 21.35:
> Chong Yidong wrote:
>
>> "D Chiesa"<dpchiesa <at> hotmail.com> writes:
>>
>>> Emacs doesn't properly display long text tooltips, or multi-line
>>> tooltips, on Windows.
> [...]
>> I seem to recall that this bug was fixed for Emacs 23.1.
>
> I though this was a duplicate of the (still open) bug#2423.
> Maybe it was fixed and never closed, but I don't recall it.
> (Multiline tooltips still don't work the first time in GNU/Linux.)
I have checked in a fix for multiline tooltips the first time for X.
try_window aborts if fonts_changed_p is set, and the first time one loads the
tip font, this is what happens.
Jan D.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#5908
; Package
emacs
.
(Fri, 09 Apr 2010 22:14:02 GMT)
Full text and
rfc822 format available.
Message #25 received at 5908 <at> debbugs.gnu.org (full text, mbox):
>>>>> On Fri, 09 Apr 2010 18:58:51 +0200, Jan Djärv <jan.h.d <at> swipnet.se> said:
>> I though this was a duplicate of the (still open) bug#2423. Maybe
>> it was fixed and never closed, but I don't recall it. (Multiline
>> tooltips still don't work the first time in GNU/Linux.)
> I have checked in a fix for multiline tooltips the first time for X.
> try_window aborts if fonts_changed_p is set, and the first time one
> loads the tip font, this is what happens.
Or maybe we could introduce a flag for try_window to ignore
fonts_changed_p, because glyph matrices are not adjusted for the
tooltip case, anyway.
YAMAMOTO Mitsuharu
mituharu <at> math.s.chiba-u.ac.jp
=== modified file 'src/dispextern.h'
*** src/dispextern.h 2010-03-22 07:26:56 +0000
--- src/dispextern.h 2010-04-09 22:04:46 +0000
***************
*** 2831,2836 ****
--- 2831,2840 ----
XRectangle *));
#endif
+ /* Flags passed to try_window. */
+ #define TRY_WINDOW_CHECK_MARGINS (1 << 0)
+ #define TRY_WINDOW_IGNORE_FONTS_CHANGE (1 << 1)
+
/* Defined in fringe.c */
int lookup_fringe_bitmap (Lisp_Object);
=== modified file 'src/xdisp.c'
*** src/xdisp.c 2010-04-05 15:46:29 +0000
--- src/xdisp.c 2010-04-09 22:04:15 +0000
***************
*** 13603,13609 ****
= try_window_reusing_current_matrix (w)))
{
IF_DEBUG (debug_method_add (w, "1"));
! if (try_window (window, startp, 1) < 0)
/* -1 means we need to scroll.
0 means we need new matrices, but fonts_changed_p
is set in that case, so we will detect it below. */
--- 13603,13609 ----
= try_window_reusing_current_matrix (w)))
{
IF_DEBUG (debug_method_add (w, "1"));
! if (try_window (window, startp, TRY_WINDOW_CHECK_MARGINS) < 0)
/* -1 means we need to scroll.
0 means we need new matrices, but fonts_changed_p
is set in that case, so we will detect it below. */
***************
*** 13954,13966 ****
Value is 1 if successful. It is zero if fonts were loaded during
redisplay which makes re-adjusting glyph matrices necessary, and -1
if point would appear in the scroll margins.
! (We check that only if CHECK_MARGINS is nonzero. */
int
! try_window (window, pos, check_margins)
Lisp_Object window;
struct text_pos pos;
! int check_margins;
{
struct window *w = XWINDOW (window);
struct it it;
--- 13954,13968 ----
Value is 1 if successful. It is zero if fonts were loaded during
redisplay which makes re-adjusting glyph matrices necessary, and -1
if point would appear in the scroll margins.
! (We check the former only if TRY_WINDOW_IGNORE_FONTS_CHANGE is
! unset in FLAGS, and the latter only if TRY_WINDOW_CHECK_MARGINS is
! set in FLAGS.) */
int
! try_window (window, pos, flags)
Lisp_Object window;
struct text_pos pos;
! int flags;
{
struct window *w = XWINDOW (window);
struct it it;
***************
*** 13982,13993 ****
{
if (display_line (&it))
last_text_row = it.glyph_row - 1;
! if (fonts_changed_p)
return 0;
}
/* Don't let the cursor end in the scroll margins. */
! if (check_margins
&& !MINI_WINDOW_P (w))
{
int this_scroll_margin;
--- 13984,13995 ----
{
if (display_line (&it))
last_text_row = it.glyph_row - 1;
! if (fonts_changed_p && !(flags & TRY_WINDOW_IGNORE_FONTS_CHANGE))
return 0;
}
/* Don't let the cursor end in the scroll margins. */
! if ((flags & TRY_WINDOW_CHECK_MARGINS)
&& !MINI_WINDOW_P (w))
{
int this_scroll_margin;
=== modified file 'src/xfns.c'
*** src/xfns.c 2010-03-22 07:26:56 +0000
--- src/xfns.c 2010-04-09 22:03:33 +0000
***************
*** 5196,5202 ****
clear_glyph_matrix (w->desired_matrix);
clear_glyph_matrix (w->current_matrix);
SET_TEXT_POS (pos, BEGV, BEGV_BYTE);
! try_window (FRAME_ROOT_WINDOW (f), pos, 0);
/* Compute width and height of the tooltip. */
width = height = 0;
--- 5196,5202 ----
clear_glyph_matrix (w->desired_matrix);
clear_glyph_matrix (w->current_matrix);
SET_TEXT_POS (pos, BEGV, BEGV_BYTE);
! try_window (FRAME_ROOT_WINDOW (f), pos, TRY_WINDOW_IGNORE_FONTS_CHANGE);
/* Compute width and height of the tooltip. */
width = height = 0;
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#5908
; Package
emacs
.
(Sat, 10 Apr 2010 06:46:02 GMT)
Full text and
rfc822 format available.
Message #28 received at 5908 <at> debbugs.gnu.org (full text, mbox):
This looks cleaner, can you install it?
Jan D.
YAMAMOTO Mitsuharu skrev 2010-04-10 00.13:
>>>>>> On Fri, 09 Apr 2010 18:58:51 +0200, Jan Djärv<jan.h.d <at> swipnet.se> said:
>
>>> I though this was a duplicate of the (still open) bug#2423. Maybe
>>> it was fixed and never closed, but I don't recall it. (Multiline
>>> tooltips still don't work the first time in GNU/Linux.)
>
>> I have checked in a fix for multiline tooltips the first time for X.
>> try_window aborts if fonts_changed_p is set, and the first time one
>> loads the tip font, this is what happens.
>
> Or maybe we could introduce a flag for try_window to ignore
> fonts_changed_p, because glyph matrices are not adjusted for the
> tooltip case, anyway.
>
> YAMAMOTO Mitsuharu
> mituharu <at> math.s.chiba-u.ac.jp
>
> === modified file 'src/dispextern.h'
> *** src/dispextern.h 2010-03-22 07:26:56 +0000
> --- src/dispextern.h 2010-04-09 22:04:46 +0000
> ***************
> *** 2831,2836 ****
> --- 2831,2840 ----
> XRectangle *));
> #endif
>
> + /* Flags passed to try_window. */
> + #define TRY_WINDOW_CHECK_MARGINS (1<< 0)
> + #define TRY_WINDOW_IGNORE_FONTS_CHANGE (1<< 1)
> +
> /* Defined in fringe.c */
>
> int lookup_fringe_bitmap (Lisp_Object);
>
> === modified file 'src/xdisp.c'
> *** src/xdisp.c 2010-04-05 15:46:29 +0000
> --- src/xdisp.c 2010-04-09 22:04:15 +0000
> ***************
> *** 13603,13609 ****
> = try_window_reusing_current_matrix (w)))
> {
> IF_DEBUG (debug_method_add (w, "1"));
> ! if (try_window (window, startp, 1)< 0)
> /* -1 means we need to scroll.
> 0 means we need new matrices, but fonts_changed_p
> is set in that case, so we will detect it below. */
> --- 13603,13609 ----
> = try_window_reusing_current_matrix (w)))
> {
> IF_DEBUG (debug_method_add (w, "1"));
> ! if (try_window (window, startp, TRY_WINDOW_CHECK_MARGINS)< 0)
> /* -1 means we need to scroll.
> 0 means we need new matrices, but fonts_changed_p
> is set in that case, so we will detect it below. */
> ***************
> *** 13954,13966 ****
> Value is 1 if successful. It is zero if fonts were loaded during
> redisplay which makes re-adjusting glyph matrices necessary, and -1
> if point would appear in the scroll margins.
> ! (We check that only if CHECK_MARGINS is nonzero. */
>
> int
> ! try_window (window, pos, check_margins)
> Lisp_Object window;
> struct text_pos pos;
> ! int check_margins;
> {
> struct window *w = XWINDOW (window);
> struct it it;
> --- 13954,13968 ----
> Value is 1 if successful. It is zero if fonts were loaded during
> redisplay which makes re-adjusting glyph matrices necessary, and -1
> if point would appear in the scroll margins.
> ! (We check the former only if TRY_WINDOW_IGNORE_FONTS_CHANGE is
> ! unset in FLAGS, and the latter only if TRY_WINDOW_CHECK_MARGINS is
> ! set in FLAGS.) */
>
> int
> ! try_window (window, pos, flags)
> Lisp_Object window;
> struct text_pos pos;
> ! int flags;
> {
> struct window *w = XWINDOW (window);
> struct it it;
> ***************
> *** 13982,13993 ****
> {
> if (display_line (&it))
> last_text_row = it.glyph_row - 1;
> ! if (fonts_changed_p)
> return 0;
> }
>
> /* Don't let the cursor end in the scroll margins. */
> ! if (check_margins
> && !MINI_WINDOW_P (w))
> {
> int this_scroll_margin;
> --- 13984,13995 ----
> {
> if (display_line (&it))
> last_text_row = it.glyph_row - 1;
> ! if (fonts_changed_p&& !(flags& TRY_WINDOW_IGNORE_FONTS_CHANGE))
> return 0;
> }
>
> /* Don't let the cursor end in the scroll margins. */
> ! if ((flags& TRY_WINDOW_CHECK_MARGINS)
> && !MINI_WINDOW_P (w))
> {
> int this_scroll_margin;
>
> === modified file 'src/xfns.c'
> *** src/xfns.c 2010-03-22 07:26:56 +0000
> --- src/xfns.c 2010-04-09 22:03:33 +0000
> ***************
> *** 5196,5202 ****
> clear_glyph_matrix (w->desired_matrix);
> clear_glyph_matrix (w->current_matrix);
> SET_TEXT_POS (pos, BEGV, BEGV_BYTE);
> ! try_window (FRAME_ROOT_WINDOW (f), pos, 0);
>
> /* Compute width and height of the tooltip. */
> width = height = 0;
> --- 5196,5202 ----
> clear_glyph_matrix (w->desired_matrix);
> clear_glyph_matrix (w->current_matrix);
> SET_TEXT_POS (pos, BEGV, BEGV_BYTE);
> ! try_window (FRAME_ROOT_WINDOW (f), pos, TRY_WINDOW_IGNORE_FONTS_CHANGE);
>
> /* Compute width and height of the tooltip. */
> width = height = 0;
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#5908
; Package
emacs
.
(Sat, 10 Apr 2010 11:00:02 GMT)
Full text and
rfc822 format available.
Message #31 received at 5908 <at> debbugs.gnu.org (full text, mbox):
>>>>> On Sat, 10 Apr 2010 08:45:04 +0200, Jan Djärv <jan.h.d <at> swipnet.se> said:
> This looks cleaner, can you install it?
Done.
YAMAMOTO Mitsuharu
mituharu <at> math.s.chiba-u.ac.jp
bug reassigned from package 'emacs' to 'emacs,w32'.
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Mon, 12 Apr 2010 06:27:02 GMT)
Full text and
rfc822 format available.
bug closed, send any further explanations to "D Chiesa" <dpchiesa <at> hotmail.com>
Request was from
Chong Yidong <cyd <at> stupidchicken.com>
to
control <at> debbugs.gnu.org
.
(Thu, 04 Nov 2010 19:37:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Fri, 03 Dec 2010 12:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 14 years and 202 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.