From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: minor enhancement request - let set-background-color, set-foreground-color take FRAME arg Date: Tue, 13 Dec 2005 13:49:00 -0800 Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1134510776 7292 80.91.229.2 (13 Dec 2005 21:52:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 13 Dec 2005 21:52:56 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 13 22:52:55 2005 Return-path: Original-Received: from [199.232.75.2] (helo=lists.gnu.org) by ciao.gmane.org with esmtp (Exim 4.43) id 1EmI2O-0002Hu-6r for ged-emacs-devel@m.gmane.org; Tue, 13 Dec 2005 22:50:20 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EmI2t-0005gD-35 for ged-emacs-devel@m.gmane.org; Tue, 13 Dec 2005 16:50:51 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EmI25-0005OZ-Vc for emacs-devel@gnu.org; Tue, 13 Dec 2005 16:50:02 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EmI1p-0005GL-Cp for emacs-devel@gnu.org; Tue, 13 Dec 2005 16:50:00 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EmI1p-0005GA-0i for emacs-devel@gnu.org; Tue, 13 Dec 2005 16:49:45 -0500 Original-Received: from [148.87.122.30] (helo=rgminet01.oracle.com) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1EmI3l-0005Qk-On for emacs-devel@gnu.org; Tue, 13 Dec 2005 16:51:46 -0500 Original-Received: from rgmsgw300.us.oracle.com (rgmsgw300.us.oracle.com [138.1.186.49]) by rgminet01.oracle.com (Switch-3.1.6/Switch-3.1.6) with ESMTP id jBDLn2A7019799 for ; Tue, 13 Dec 2005 14:49:02 -0700 Original-Received: from rgmsgw300.us.oracle.com (localhost [127.0.0.1]) by rgmsgw300.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id jBDLn2OE029178 for ; Tue, 13 Dec 2005 14:49:02 -0700 Original-Received: from dradamslap (dhcp-amer-rmdc-csvpn-gw5-141-144-106-118.vpn.oracle.com [141.144.106.118]) by rgmsgw300.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with SMTP id jBDLn0UU029163 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Tue, 13 Dec 2005 14:49:01 -0700 Original-To: "Emacs-Devel" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org X-Broken-Reverse-DNS: no host name found for IP address 199.232.75.2 Xref: news.gmane.org gmane.emacs.devel:47639 Archived-At: Now is normally not the time for enhancement requests, but perhaps this minor request could be considered: let commands `set-background-color' and `set-foreground-color' take an optional FRAME argument. This would make them more useful for Lisp code. This change should have no effect on existing code, beyond the definition itself. The definition could be more or less equivalent to this: (defun set-background-color (color-name &optional frame) "Set the background color of the FRAME to COLOR-NAME. When called interactively, prompt for the name of the color to use. To get the frame's current background color, use `frame-parameters'." (interactive (list (facemenu-read-color))) (modify-frame-parameters (or frame (selected-frame)) (list (cons 'background-color color-name))) (frame-set-background-mode (or frame (selected-frame)))) For reference, here is the current definition: (defun set-background-color (color-name) "Set the background color of the selected frame to COLOR-NAME. When called interactively, prompt for the name of the color to use. To get the frame's current background color, use `frame-parameters'." (interactive (list (facemenu-read-color))) (modify-frame-parameters (selected-frame) (list (cons 'background-color color-name))) (or window-system (face-set-after-frame-default (selected-frame)))) I'm not an expert on frames or faces, so perhaps the last line of the proposed definition is not exactly what is required. Is `frame-set-background-mode' or `face-set-after-frame-default' more appropriate here? Perhaps a test for `window-system' is needed? What do others think about the general idea of adding a FRAME parameter, regardless of the exact function definition?