From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: [pp_publiclists@yahoo.com: Setting term-default-fg-color/term-default-bg-color has no effect] Date: Sat, 30 Jun 2007 20:30:49 -0400 Message-ID: Reply-To: rms@gnu.org NNTP-Posting-Host: lo.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1183250047 962 80.91.229.12 (1 Jul 2007 00:34:07 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 1 Jul 2007 00:34:07 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 01 02:34:01 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1I4nO4-0000B2-C2 for ged-emacs-devel@m.gmane.org; Sun, 01 Jul 2007 02:34:00 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I4nO3-0001Rl-SZ for ged-emacs-devel@m.gmane.org; Sat, 30 Jun 2007 20:33:59 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I4nL1-0006BN-SW for emacs-devel@gnu.org; Sat, 30 Jun 2007 20:30:51 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I4nL0-0006AL-I1 for emacs-devel@gnu.org; Sat, 30 Jun 2007 20:30:51 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I4nL0-0006AE-B9 for emacs-devel@gnu.org; Sat, 30 Jun 2007 20:30:50 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1I4nL0-0002Xs-0f for emacs-devel@gnu.org; Sat, 30 Jun 2007 20:30:50 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.60) (envelope-from ) id 1I4nKz-0002tj-H5; Sat, 30 Jun 2007 20:30:49 -0400 X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) 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 Xref: news.gmane.org gmane.emacs.devel:74081 Archived-At: This can be installed as a tiny change. Would someone please check whether it is a good idea, and DTRT? ------- Start of forwarded message ------- X-Spam-Status: No, score=0.9 required=5.0 tests=FORGED_YAHOO_RCVD, SPF_HELO_PASS,SPF_PASS,UNPARSEABLE_RELAY autolearn=no version=3.1.0 To: bug-gnu-emacs@gnu.org From: Peter Povinec Date: Sat, 30 Jun 2007 00:17:59 +0000 (UTC) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Setting term-default-fg-color/term-default-bg-color has no effect Hi! I use ansi-term a lot and like to have different color scheme for my term buffers. After upgrading to Emacs22 from 21.4 I notice that my setting of term-default-fg-color/term-default-bg-color no longer has any effect. I found no documentation stating that it was not supported in Emacs22, so I suppose it is a bug. I looked at the old 21.4 code and based on that created the following minimalist patch, which is satisfactory in addressing the issue. HTH, - --Peter 2007-06-25 Peter Povinec yahoo.com> * term.el: Honor term-default-fg-color and term-default-bg-color settings when modifying term-current-face. *** /home/ppovinec/term.el.orig 2007-06-24 01:04:07.298996000 -0700 - --- /home/ppovinec/term.el 2007-06-25 16:40:33.434255000 -0700 *************** *** 695,710 **** ;;; faces -mm ! (defcustom term-default-fg-color 'unspecified "Default color for foreground in `term'." :group 'term :type 'string) ! (defcustom term-default-bg-color 'unspecified "Default color for background in `term'." :group 'term :type 'string) ;;; Use the same colors that xterm uses, see `xterm-standard-colors'. (defvar ansi-term-color-vector [unspecified "black" "red3" "green3" "yellow3" "blue2" - --- 695,714 ---- ;;; faces -mm ! (defcustom term-default-fg-color (face-foreground term-current-face) "Default color for foreground in `term'." :group 'term :type 'string) ! (defcustom term-default-bg-color (face-background term-current-face) "Default color for background in `term'." :group 'term :type 'string) + ;;; Start with requested fg/bg. + (setq term-current-face (list :background term-default-bg-color + :foreground term-default-fg-color)) + ;;; Use the same colors that xterm uses, see `xterm-standard-colors'. (defvar ansi-term-color-vector [unspecified "black" "red3" "green3" "yellow3" "blue2" *************** *** 3055,3061 **** (setq term-scroll-start 0) (setq term-scroll-end term-height) (setq term-insert-mode nil) ! (setq term-current-face nil) (setq term-ansi-current-underline nil) (setq term-ansi-current-bold nil) (setq term-ansi-current-reverse nil) - --- 3059,3066 ---- (setq term-scroll-start 0) (setq term-scroll-end term-height) (setq term-insert-mode nil) ! (setq term-current-face (list :background term-default-bg-color ! :foreground term-default-fg-color)) (setq term-ansi-current-underline nil) (setq term-ansi-current-bold nil) (setq term-ansi-current-reverse nil) *************** *** 3117,3123 **** ;;; 0 (Reset) or unknown (reset anyway) (t ! (setq term-current-face nil) (setq term-ansi-current-underline nil) (setq term-ansi-current-bold nil) (setq term-ansi-current-reverse nil) - --- 3122,3129 ---- ;;; 0 (Reset) or unknown (reset anyway) (t ! (setq term-current-face (list :background term-default-bg-color ! :foreground term-default-fg-color)) (setq term-ansi-current-underline nil) (setq term-ansi-current-bold nil) (setq term-ansi-current-reverse nil) *************** *** 3154,3164 **** (setq term-current-face (list :background (if (= term-ansi-current-color 0) ! (face-foreground 'default) (elt ansi-term-color-vector term-ansi-current-color)) :foreground (if (= term-ansi-current-bg-color 0) ! (face-background 'default) (elt ansi-term-color-vector term-ansi-current-bg-color)))) (when term-ansi-current-bold (setq term-current-face - --- 3160,3170 ---- (setq term-current-face (list :background (if (= term-ansi-current-color 0) ! term-default-fg-color (elt ansi-term-color-vector term-ansi-current-color)) :foreground (if (= term-ansi-current-bg-color 0) ! term-default-bg-color (elt ansi-term-color-vector term-ansi-current-bg-color)))) (when term-ansi-current-bold (setq term-current-face *************** *** 3181,3189 **** ) (setq term-current-face (list :foreground ! (elt ansi-term-color-vector term-ansi-current-color) :background (elt ansi-term-color-vector term-ansi-current-bg-color))) (when term-ansi-current-bold (setq term-current-face (append '(:weight bold) term-current-face))) - --- 3187,3200 ---- ) (setq term-current-face (list :foreground ! (if (= term-ansi-current-color 0) ! term-default-fg-color ! (elt ansi-term-color-vector term-ansi-current-color)) :background + (if (= term-ansi-current-bg-color 0) + term-default-bg-color (elt ansi-term-color-vector term-ansi-current-bg-color))) + ) (when term-ansi-current-bold (setq term-current-face (append '(:weight bold) term-current-face))) _______________________________________________ bug-gnu-emacs mailing list bug-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs ------- End of forwarded message -------