GNU bug report logs - #5908
tooltip-show breaks with multiline tip on Emacs for Windows v22.2.1

Previous Next

Packages: emacs, w32;

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.

Full log


Message #19 received at 5908 <at> debbugs.gnu.org (full text, mbox):

From: "D Chiesa" <dpchiesa <at> hotmail.com>
To: "Eli Zaretskii" <eliz <at> gnu.org>
Cc: 5908 <at> debbugs.gnu.org
Subject: Re: bug#5908: tooltip-show breaks with multiline tip on Emacs for
	Windows v22.2.1
Date: Fri, 9 Apr 2010 10:18:27 -0400
> 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))
             ))))








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.