all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Juanma Barranquero" <lekktu@gmail.com>
To: "martin rudalics" <rudalics@gmx.at>
Cc: 1032@emacsbugs.donarmstrong.com
Subject: bug#1032: foreground-color in default-frame-alist affects tooltips, while background-color does not
Date: Thu, 30 Oct 2008 11:24:20 +0100	[thread overview]
Message-ID: <f7ccd24b0810300324s172aed49j2510e21daee550a1@mail.gmail.com> (raw)
In-Reply-To: <49096121.2080607@gmx.at>

On Thu, Oct 30, 2008 at 08:24, martin rudalics <rudalics@gmx.at> wrote:

> This doesn't make sense to me.  When `tooltip-show' calls `x-show-tip'
> it does so with _params_ and not with `tooltip-frame-parameters'.
> What's the reason to do the `copy-sequence' in the first place?  Maybe
> it's all about the 'left or 'top paramters.

Judging from the code, I think the idea is not to modify
`tooltip-frame-parameters', *except* for
(foreground|background|border)-color, if they appear (if they don't,
they are not added). The reasoning being that allowing such parameters
with values that are not being obeyed would be misleading.

> At least, such a reset should occur at the time the variable is
> customized and not when the tooltip is displayed.

The right thing to do, IMHO, is to change tooltip-show not to modify
`tooltip-frame-parameters', and fix the variable's docstring to
explain that the color attributes of the tooltip frame come from the
tooltip face. WDYT about the attached patch?

> When I now move the mouse to the next menu entry
>
>     "Tools->Version Control->Update ChangeLog"
>
> the old tooltip remains displayed.  Do you see that?  Is that a w32-only
> problem?

I cannot reproduce it. The new tooltip appears after a small delay.

  Juanma


2008-10-30  Juanma Barranquero  <lekktu@gmail.com>

	* tooltip.el (tooltip-frame-parameters): Doc fix.
	(tooltip-set-param): Remove.
	(tooltip-show): Don't modify `tooltip-frame-parameters'.


Index: lisp/tooltip.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/tooltip.el,v
retrieving revision 1.89
diff -u -2 -r1.89 tooltip.el
--- lisp/tooltip.el	29 Oct 2008 12:10:33 -0000	1.89
+++ lisp/tooltip.el	30 Oct 2008 10:16:32 -0000
@@ -122,5 +122,8 @@

 If `left' or `top' parameters are included, they specify the absolute
-position to pop up the tooltip."
+position to pop up the tooltip.
+
+Note that font and color parameters are ignored, and the attributes
+of the `tooltip' face are used instead."
   :type 'sexp
   :group 'tooltip)
@@ -204,14 +207,4 @@
 ;;; Displaying tips

-(defun tooltip-set-param (alist key value)
-  "Change the value of KEY in alist ALIST to VALUE.
-If there's no association for KEY in ALIST, add one, otherwise
-change the existing association.  Value is the resulting alist."
-  (let ((param (assq key alist)))
-    (if (consp param)
-	(setcdr param value)
-      (push (cons key value) alist))
-    alist))
-
 (declare-function x-show-tip "xfns.c"
 		  (string &optional frame parms timeout dx dy))
@@ -233,12 +226,13 @@
       (tooltip-show-help-non-mode text)
     (condition-case error
-	(let ((params (copy-sequence tooltip-frame-parameters))
+	(let ((params tooltip-frame-parameters)
 	      (fg (face-attribute 'tooltip :foreground))
 	      (bg (face-attribute 'tooltip :background)))
 	  (when (stringp fg)
-	    (setq params (tooltip-set-param params 'foreground-color fg))
-	    (setq params (tooltip-set-param params 'border-color fg)))
+	    (setq params (append `((foreground-color . ,fg)
+				   (border-color . ,fg))
+				 params)))
 	  (when (stringp bg)
-	    (setq params (tooltip-set-param params 'background-color bg)))
+	    (setq params (cons (cons 'background-color bg) params)))
 	  (x-show-tip (propertize text 'face 'tooltip)
 		      (selected-frame)






  reply	other threads:[~2008-10-30 10:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <f7ccd24b0810291843l2edc56fbx3b275a029ba0ee81@mail.gmail.com>
2008-09-26  8:40 ` bug#1032: foreground-color in default-frame-alist affects tooltips, while background-color does not Juanma Barranquero
2008-09-26 15:14   ` martin rudalics
2008-09-26 15:34     ` Juanma Barranquero
2008-09-26 16:13       ` martin rudalics
2008-09-26 19:03         ` Juanma Barranquero
2008-10-30  1:50   ` bug#1032: marked as done (foreground-color in default-frame-alist affects tooltips, while background-color does not) Emacs bug Tracking System
2008-10-30  7:24 ` bug#1032: foreground-color in default-frame-alist affects tooltips, while background-color does not martin rudalics
2008-10-30 10:24   ` Juanma Barranquero [this message]
2008-10-30 11:40     ` martin rudalics
2008-10-30 11:55       ` Juanma Barranquero
2008-10-30 15:48         ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f7ccd24b0810300324s172aed49j2510e21daee550a1@mail.gmail.com \
    --to=lekktu@gmail.com \
    --cc=1032@emacsbugs.donarmstrong.com \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.