From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Juanma Barranquero" Newsgroups: gmane.emacs.bugs 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 Message-ID: References: <48DCFC54.7060809@gmx.at> <48DD0A16.9090402@gmx.at> <49096121.2080607@gmx.at> Reply-To: Juanma Barranquero , 1032@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1225363834 26141 80.91.229.12 (30 Oct 2008 10:50:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 30 Oct 2008 10:50:34 +0000 (UTC) Cc: 1032@emacsbugs.donarmstrong.com To: "martin rudalics" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 30 11:51:36 2008 connect(): Connection refused Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KvV7i-0004Kg-R2 for geb-bug-gnu-emacs@m.gmane.org; Thu, 30 Oct 2008 11:51:31 +0100 Original-Received: from localhost ([127.0.0.1]:44722 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KvV6c-0002DJ-9G for geb-bug-gnu-emacs@m.gmane.org; Thu, 30 Oct 2008 06:50:22 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KvV6W-0002AD-3k for bug-gnu-emacs@gnu.org; Thu, 30 Oct 2008 06:50:16 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KvV6U-00028I-TR for bug-gnu-emacs@gnu.org; Thu, 30 Oct 2008 06:50:15 -0400 Original-Received: from [199.232.76.173] (port=53707 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KvV6U-000280-N4 for bug-gnu-emacs@gnu.org; Thu, 30 Oct 2008 06:50:14 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:51352) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KvV6T-0004NR-VJ for bug-gnu-emacs@gnu.org; Thu, 30 Oct 2008 06:50:14 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9UAo32V014192; Thu, 30 Oct 2008 03:50:04 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m9UAU3nY009325; Thu, 30 Oct 2008 03:30:03 -0700 X-Loop: don@donarmstrong.com Resent-From: "Juanma Barranquero" Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs , don@donarmstrong.com Resent-Date: Thu, 30 Oct 2008 10:30:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1032 X-Emacs-PR-Package: emacs,w32 X-Emacs-PR-Keywords: Original-Received: via spool by 1032-submit@emacsbugs.donarmstrong.com id=B1032.12253622648074 (code B ref 1032); Thu, 30 Oct 2008 10:30:03 +0000 Original-Received: (at 1032) by emacsbugs.donarmstrong.com; 30 Oct 2008 10:24:24 +0000 Original-Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.249]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9UAOKVI008068 for <1032@emacsbugs.donarmstrong.com>; Thu, 30 Oct 2008 03:24:22 -0700 Original-Received: by an-out-0708.google.com with SMTP id b20so52728ana.9 for <1032@emacsbugs.donarmstrong.com>; Thu, 30 Oct 2008 03:24:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=kr30bEG0I/tcRtLRr3HXJxoBzQ9EKA40NZvmbBP5qmo=; b=Cuc5VDa4HJEnKe7vYse8fWdxRmN0INPHVwZy+XVoU9HOxNzqiX3ENCebVnQG7g8Vip ya8c3M2WRrU9O+LzLhI1MOvbw9P2RscVIE2K/b503UJbZQ6BWY9tV051cGNm2y51MBLy k/DlIsRlIaPxoLzu2ii4gghN1/WqnYyB9Hvo4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=iBbvQTX0RRwWJ4RfKIDlIfW9tz6qEoyW827d/0qXdbL5w+0nKZpOxyK/wYa9V6Ljmd vuHKR16I5xysrjcAQ/OqCDQQPhU1GW6NxnuSLRnwHNJdG2D1MVS5mzd+M821T2F4dhi1 unwbAD2OMlCDB5T4bg0OMqYt6Luh7yVAgboDY= Original-Received: by 10.100.93.19 with SMTP id q19mr423724anb.156.1225362260511; Thu, 30 Oct 2008 03:24:20 -0700 (PDT) Original-Received: by 10.100.13.13 with HTTP; Thu, 30 Oct 2008 03:24:20 -0700 (PDT) In-Reply-To: <49096121.2080607@gmx.at> Content-Disposition: inline X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Thu, 30 Oct 2008 06:50:15 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:22035 Archived-At: On Thu, Oct 30, 2008 at 08:24, martin rudalics 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 * 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)