unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Peter Povinec <pp_publiclists@yahoo.com>
To: bug-gnu-emacs@gnu.org
Subject: Setting term-default-fg-color/term-default-bg-color has no effect
Date: Sat, 30 Jun 2007 00:17:59 +0000 (UTC)	[thread overview]
Message-ID: <loom.20070630T015509-536@post.gmane.org> (raw)

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  <ppovinec <at> 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)))

             reply	other threads:[~2007-06-30  0:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-30  0:17 Peter Povinec [this message]
2007-07-02 17:28 ` Setting term-default-fg-color/term-default-bg-color has no effect Dan Nicolaescu
2007-07-23 19:22   ` Peter Povinec
2007-08-01  4:10     ` Dan Nicolaescu
2007-08-02  0:50       ` Peter Povinec
2007-08-02  2:28         ` Dan Nicolaescu
2007-08-03  6:35           ` Peter Povinec

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=loom.20070630T015509-536@post.gmane.org \
    --to=pp_publiclists@yahoo.com \
    --cc=bug-gnu-emacs@gnu.org \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).