changeset 78414:781746b1e97f

Honor term-default-fg-color and term-default-bg-color settings when modifying term-current-face.
author Vinicius Jose Latorre <viniciusjl@ig.com.br>
date Sun, 05 Aug 2007 14:09:30 +0000
parents 15aa7ac77da1
children 73900ddc75ee
files lisp/ChangeLog lisp/term.el
diffstat 2 files changed, 30 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sun Aug 05 12:58:00 2007 +0000
+++ b/lisp/ChangeLog	Sun Aug 05 14:09:30 2007 +0000
@@ -1,3 +1,17 @@
+2007-08-05  Peter Povinec  <ppovinec <at> yahoo.com> (tiny change)
+
+	* term.el: Honor term-default-fg-color and term-default-bg-color
+	settings when modifying term-current-face.
+	(term-default-fg-color, term-default-bg-color): Initialized from
+	default term-current-face.
+	(term-mode, term-reset-terminal): Set term-current-face with
+	term-default-fg-color and term-default-bg-color.
+	(term-handle-colors-array): term-current-face has term-default-fg-color
+	and term-default-bg-color after reset escape sequence.
+	(term-handle-colors-array): Set term-current-color with
+	term-default-fg/bg-color instead of ansi-term-color-vector when the
+	index (term-ansi-current-color or term-ansi-current-bg-color) is zero.
+
 2007-08-05  Vinicius Jose Latorre  <viniciusig@ig.com.br>
 
 	* printing.el: Require lpr and ps-print when loading printing package.
--- a/lisp/term.el	Sun Aug 05 12:58:00 2007 +0000
+++ b/lisp/term.el	Sun Aug 05 14:09:30 2007 +0000
@@ -695,12 +695,12 @@
 
 ;;; faces -mm
 
-(defcustom term-default-fg-color 'unspecified
+(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 'unspecified
+(defcustom term-default-bg-color (face-background term-current-face)
   "Default color for background in `term'."
   :group 'term
   :type 'string)
@@ -1098,6 +1098,8 @@
   (make-local-variable 'term-pending-delete-marker)
   (setq term-pending-delete-marker (make-marker))
   (make-local-variable 'term-current-face)
+  (setq term-current-face (list :background term-default-bg-color
+				:foreground term-default-fg-color))
   (make-local-variable 'term-pending-frame)
   (setq term-pending-frame nil)
   ;; Cua-mode's keybindings interfere with the term keybindings, disable it.
@@ -3055,7 +3057,8 @@
   (setq term-scroll-start 0)
   (setq term-scroll-end term-height)
   (setq term-insert-mode nil)
-  (setq term-current-face 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,7 +3120,8 @@
 
 ;;; 0 (Reset) or unknown (reset anyway)
    (t
-    (setq term-current-face 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)
@@ -3154,11 +3158,11 @@
 	    (setq term-current-face
 		  (list :background
 			(if (= term-ansi-current-color 0)
-			    (face-foreground 'default)
+			    term-default-fg-color
 			  (elt ansi-term-color-vector term-ansi-current-color))
 			:foreground
 			(if (= term-ansi-current-bg-color 0)
-			    (face-background 'default)
+			    term-default-bg-color
 			  (elt ansi-term-color-vector term-ansi-current-bg-color))))
 	    (when term-ansi-current-bold
 	      (setq term-current-face
@@ -3181,9 +3185,13 @@
 		  )
 	  (setq term-current-face
 		(list :foreground
-		      (elt ansi-term-color-vector term-ansi-current-color)
+		      (if (= term-ansi-current-color 0)
+			  term-default-fg-color
+			(elt ansi-term-color-vector term-ansi-current-color))
 		      :background
-		      (elt ansi-term-color-vector term-ansi-current-bg-color)))
+		      (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)))