* bug#5908: tooltip-show breaks with multiline tip on Emacs for Windows v22.2.1 @ 2010-04-08 18:10 D Chiesa 2010-04-08 19:17 ` Chong Yidong 2010-04-09 8:02 ` Eli Zaretskii 0 siblings, 2 replies; 9+ messages in thread From: D Chiesa @ 2010-04-08 18:10 UTC (permalink / raw) To: 5908 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 ^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#5908: tooltip-show breaks with multiline tip on Emacs for Windows v22.2.1 2010-04-08 18:10 bug#5908: tooltip-show breaks with multiline tip on Emacs for Windows v22.2.1 D Chiesa @ 2010-04-08 19:17 ` Chong Yidong 2010-04-08 19:35 ` Glenn Morris 2010-04-09 8:02 ` Eli Zaretskii 1 sibling, 1 reply; 9+ messages in thread From: Chong Yidong @ 2010-04-08 19:17 UTC (permalink / raw) To: D Chiesa; +Cc: 5908 "D Chiesa" <dpchiesa@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. ^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#5908: tooltip-show breaks with multiline tip on Emacs for Windows v22.2.1 2010-04-08 19:17 ` Chong Yidong @ 2010-04-08 19:35 ` Glenn Morris 2010-04-09 16:58 ` Jan Djärv 0 siblings, 1 reply; 9+ messages in thread From: Glenn Morris @ 2010-04-08 19:35 UTC (permalink / raw) To: Chong Yidong; +Cc: 5908, D Chiesa Chong Yidong wrote: > "D Chiesa" <dpchiesa@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.) ^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#5908: tooltip-show breaks with multiline tip on Emacs for Windows v22.2.1 2010-04-08 19:35 ` Glenn Morris @ 2010-04-09 16:58 ` Jan Djärv 2010-04-09 22:13 ` YAMAMOTO Mitsuharu 0 siblings, 1 reply; 9+ messages in thread From: Jan Djärv @ 2010-04-09 16:58 UTC (permalink / raw) To: Glenn Morris; +Cc: 5908, Chong Yidong, D Chiesa Glenn Morris skrev 2010-04-08 21.35: > Chong Yidong wrote: > >> "D Chiesa"<dpchiesa@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. ^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#5908: tooltip-show breaks with multiline tip on Emacs for Windows v22.2.1 2010-04-09 16:58 ` Jan Djärv @ 2010-04-09 22:13 ` YAMAMOTO Mitsuharu 2010-04-10 6:45 ` Jan Djärv 0 siblings, 1 reply; 9+ messages in thread From: YAMAMOTO Mitsuharu @ 2010-04-09 22:13 UTC (permalink / raw) To: Jan Djärv; +Cc: 5908, Chong Yidong, D Chiesa >>>>> On Fri, 09 Apr 2010 18:58:51 +0200, Jan Djärv <jan.h.d@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@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; ^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#5908: tooltip-show breaks with multiline tip on Emacs for Windows v22.2.1 2010-04-09 22:13 ` YAMAMOTO Mitsuharu @ 2010-04-10 6:45 ` Jan Djärv 2010-04-10 10:59 ` YAMAMOTO Mitsuharu 0 siblings, 1 reply; 9+ messages in thread From: Jan Djärv @ 2010-04-10 6:45 UTC (permalink / raw) To: YAMAMOTO Mitsuharu; +Cc: 5908, Chong Yidong, D Chiesa 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@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@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; ^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#5908: tooltip-show breaks with multiline tip on Emacs for Windows v22.2.1 2010-04-10 6:45 ` Jan Djärv @ 2010-04-10 10:59 ` YAMAMOTO Mitsuharu 0 siblings, 0 replies; 9+ messages in thread From: YAMAMOTO Mitsuharu @ 2010-04-10 10:59 UTC (permalink / raw) To: Jan Djärv; +Cc: 5908 >>>>> On Sat, 10 Apr 2010 08:45:04 +0200, Jan Djärv <jan.h.d@swipnet.se> said: > This looks cleaner, can you install it? Done. YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp ^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#5908: tooltip-show breaks with multiline tip on Emacs for Windows v22.2.1 2010-04-08 18:10 bug#5908: tooltip-show breaks with multiline tip on Emacs for Windows v22.2.1 D Chiesa 2010-04-08 19:17 ` Chong Yidong @ 2010-04-09 8:02 ` Eli Zaretskii 2010-04-09 14:18 ` D Chiesa 1 sibling, 1 reply; 9+ messages in thread From: Eli Zaretskii @ 2010-04-09 8:02 UTC (permalink / raw) To: D Chiesa; +Cc: 5908 > From: "D Chiesa" <dpchiesa@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. ^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#5908: tooltip-show breaks with multiline tip on Emacs for Windows v22.2.1 2010-04-09 8:02 ` Eli Zaretskii @ 2010-04-09 14:18 ` D Chiesa 0 siblings, 0 replies; 9+ messages in thread From: D Chiesa @ 2010-04-09 14:18 UTC (permalink / raw) To: Eli Zaretskii; +Cc: 5908 > 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)) )))) ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2010-04-10 10:59 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-04-08 18:10 bug#5908: tooltip-show breaks with multiline tip on Emacs for Windows v22.2.1 D Chiesa 2010-04-08 19:17 ` Chong Yidong 2010-04-08 19:35 ` Glenn Morris 2010-04-09 16:58 ` Jan Djärv 2010-04-09 22:13 ` YAMAMOTO Mitsuharu 2010-04-10 6:45 ` Jan Djärv 2010-04-10 10:59 ` YAMAMOTO Mitsuharu 2010-04-09 8:02 ` Eli Zaretskii 2010-04-09 14:18 ` D Chiesa
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.