changeset 61481:d4014c213e7e

* term.el (term-ansi-current-bold, term-ansi-current-underline) (term-ansi-current-reverse, term-ansi-current-invisible) (term-ansi-face-already-done): Change to boolean. (term-reset-terminal, term-handle-colors-array): Handle the above vars accordingly. (term-buffer-vertical-motion): Rename from buffer-vertical-motion. (term-emulate-terminal): Use the new name. * faces.el (secondary-selection): Use yellow1, not yellow. (trailing-whitespace): Use red1, not red.
author Dan Nicolaescu <dann@ics.uci.edu>
date Mon, 11 Apr 2005 20:47:25 +0000
parents db45074f7e94
children 0d768c0d43e2
files lisp/ChangeLog lisp/faces.el lisp/term.el
diffstat 3 files changed, 51 insertions(+), 41 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Mon Apr 11 19:29:48 2005 +0000
+++ b/lisp/ChangeLog	Mon Apr 11 20:47:25 2005 +0000
@@ -1,3 +1,16 @@
+2005-04-11  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* term.el (term-ansi-current-bold, term-ansi-current-underline)
+	(term-ansi-current-reverse, term-ansi-current-invisible)
+	(term-ansi-face-already-done): Change to boolean.
+	(term-reset-terminal, term-handle-colors-array): Handle the above
+	vars accordingly.
+	(term-buffer-vertical-motion): Rename from buffer-vertical-motion.
+	(term-emulate-terminal): Use the new name.
+
+	* faces.el (secondary-selection): Use yellow1, not yellow.
+	(trailing-whitespace): Use red1, not red.
+
 2005-04-11  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
 
 	* dired.el (dired-mode): Use dnd-* instead of x-dnd-*
--- a/lisp/faces.el	Mon Apr 11 19:29:48 2005 +0000
+++ b/lisp/faces.el	Mon Apr 11 20:47:25 2005 +0000
@@ -2015,7 +2015,7 @@
 
 (defface secondary-selection
   '((((class color) (min-colors 88) (background light))
-     :background "yellow")
+     :background "yellow1")
     (((class color) (min-colors 88) (background dark))
      :background "SkyBlue4")
     (((class color) (min-colors 16) (background light))
@@ -2041,9 +2041,9 @@
 
 (defface trailing-whitespace
   '((((class color) (background light))
-     :background "red")
+     :background "red1")
     (((class color) (background dark))
-     :background "red")
+     :background "red1")
     (t :inverse-video t))
   "Basic face for highlighting trailing whitespace."
   :version "21.1"
--- a/lisp/term.el	Mon Apr 11 19:29:48 2005 +0000
+++ b/lisp/term.el	Mon Apr 11 20:47:25 2005 +0000
@@ -684,14 +684,13 @@
 (defvar term-ansi-at-save-user nil)
 (defvar term-ansi-at-save-pwd nil)
 (defvar term-ansi-at-save-anon nil)
-(defvar term-ansi-current-bold 0)
+(defvar term-ansi-current-bold nil)
 (defvar term-ansi-current-color 0)
-(defvar term-ansi-face-already-done 0)
+(defvar term-ansi-face-already-done nil)
 (defvar term-ansi-current-bg-color 0)
-(defvar term-ansi-current-underline 0)
-(defvar term-ansi-current-highlight 0)
-(defvar term-ansi-current-reverse 0)
-(defvar term-ansi-current-invisible 0)
+(defvar term-ansi-current-underline nil)
+(defvar term-ansi-current-reverse nil)
+(defvar term-ansi-current-invisible nil)
 
 ;;; Four should be enough, if you want more, just add. -mm
 (defvar term-terminal-more-parameters 0)
@@ -732,8 +731,7 @@
      [ "Enable paging" term-pager-toggle (not term-pager-count)]
      [ "Disable paging" term-pager-toggle term-pager-count])))
 
-(if term-mode-map
-    nil
+(unless term-mode-map
   (setq term-mode-map (make-sparse-keymap))
   (define-key term-mode-map "\ep" 'term-previous-input)
   (define-key term-mode-map "\en" 'term-next-input)
@@ -1062,7 +1060,6 @@
   (make-local-variable 'term-ansi-face-already-done)
   (make-local-variable 'term-ansi-current-bg-color)
   (make-local-variable 'term-ansi-current-underline)
-  (make-local-variable 'term-ansi-current-highlight)
   (make-local-variable 'term-ansi-current-reverse)
   (make-local-variable 'term-ansi-current-invisible)
 
@@ -2509,14 +2506,14 @@
 (defun term-horizontal-column ()
   (- (term-current-column) (term-start-line-column)))
 
-;; Calls either vertical-motion or buffer-vertical-motion
+;; Calls either vertical-motion or term-buffer-vertical-motion
 (defmacro term-vertical-motion (count)
   (list 'funcall 'term-vertical-motion count))
 
 ;; An emulation of vertical-motion that is independent of having a window.
 ;; Instead, it uses the term-width variable as the logical window width.
 
-(defun buffer-vertical-motion (count)
+(defun term-buffer-vertical-motion (count)
   (cond ((= count 0)
 	 (move-to-column (* term-width (/ (current-column) term-width)))
 	 0)
@@ -2701,7 +2698,7 @@
 	      (setq term-vertical-motion (symbol-function 'vertical-motion))
 	      (term-check-size proc))
 	  (setq term-vertical-motion
-		(symbol-function 'buffer-vertical-motion)))
+		(symbol-function 'term-buffer-vertical-motion)))
 
 	(setq save-marker (copy-marker (process-mark proc)))
 
@@ -3041,12 +3038,12 @@
   (setq term-current-column 1)
   (setq term-insert-mode nil)
   (setq term-current-face nil)
-  (setq term-ansi-current-underline 0)
-  (setq term-ansi-current-bold 0)
-  (setq term-ansi-current-reverse 0)
+  (setq term-ansi-current-underline nil)
+  (setq term-ansi-current-bold nil)
+  (setq term-ansi-current-reverse nil)
   (setq term-ansi-current-color 0)
-  (setq term-ansi-current-invisible 0)
-  (setq term-ansi-face-already-done 0)
+  (setq term-ansi-current-invisible nil)
+  (setq term-ansi-face-already-done nil)
   (setq term-ansi-current-bg-color 0))
 
 ;;; New function to deal with ansi colorized output, as you can see you can
@@ -3057,32 +3054,32 @@
 
 ;;; Bold  (terminfo: bold)
    ((eq parameter 1)
-    (setq term-ansi-current-bold 1))
+    (setq term-ansi-current-bold t))
 
 ;;; Underline
    ((eq parameter 4)
-    (setq term-ansi-current-underline 1))
+    (setq term-ansi-current-underline t))
 
 ;;; Blink (unsupported by Emacs), will be translated to bold.
 ;;; This may change in the future though.
    ((eq parameter 5)
-    (setq term-ansi-current-bold 1))
+    (setq term-ansi-current-bold t))
 
 ;;; Reverse
    ((eq parameter 7)
-    (setq term-ansi-current-reverse 1))
+    (setq term-ansi-current-reverse t))
 
 ;;; Invisible
    ((eq parameter 8)
-    (setq term-ansi-current-invisible 1))
+    (setq term-ansi-current-invisible t))
 
 ;;; Reset underline (i.e. terminfo rmul)
    ((eq parameter 24)
-    (setq term-ansi-current-underline 0))
+    (setq term-ansi-current-underline nil))
 
 ;;; Reset reverse (i.e. terminfo rmso)
    ((eq parameter 27)
-    (setq term-ansi-current-reverse 0))
+    (setq term-ansi-current-reverse nil))
 
 ;;; Foreground
    ((and (>= parameter 30) (<= parameter 37))
@@ -3103,12 +3100,12 @@
 ;;; 0 (Reset) or unknown (reset anyway)
    (t
     (setq term-current-face nil)
-    (setq term-ansi-current-underline 0)
-    (setq term-ansi-current-bold 0)
-    (setq term-ansi-current-reverse 0)
+    (setq term-ansi-current-underline nil)
+    (setq term-ansi-current-bold nil)
+    (setq term-ansi-current-reverse nil)
     (setq term-ansi-current-color 0)
-    (setq term-ansi-current-invisible 0)
-    (setq term-ansi-face-already-done 1)
+    (setq term-ansi-current-invisible nil)
+    (setq term-ansi-face-already-done t)
     (setq term-ansi-current-bg-color 0)))
 
 ;	(message "Debug: U-%d R-%d B-%d I-%d D-%d F-%d B-%d"
@@ -3121,9 +3118,9 @@
 ;		   term-ansi-current-bg-color)
 
 
-  (if (= term-ansi-face-already-done 0)
-      (if (= term-ansi-current-reverse 1)
-	  (if (= term-ansi-current-invisible 1)
+  (unless term-ansi-face-already-done
+      (if term-ansi-current-reverse
+	  (if term-ansi-current-invisible
 	      (setq term-current-face
 		    (if (= term-ansi-current-color 0)
 			(list :background
@@ -3145,13 +3142,13 @@
 			(if (= term-ansi-current-bg-color 0)
 			    (face-background 'default)
 			(elt ansi-term-color-vector term-ansi-current-bg-color))))
-	    (if (= term-ansi-current-bold 1)
+	    (when term-ansi-current-bold
 		(setq term-current-face
 		      (append '(:weight bold) term-current-face)))
-	    (if (= term-ansi-current-underline 1)
+	    (when term-ansi-current-underline
 		(setq term-current-face
 		      (append '(:underline t) term-current-face))))
-	(if (= term-ansi-current-invisible 1)
+	(if term-ansi-current-invisible
 	    (setq term-current-face
 		  (if (= term-ansi-current-bg-color 0)
 		      (list :background
@@ -3169,15 +3166,15 @@
 		      (elt ansi-term-color-vector term-ansi-current-color)
 		      :background
 		      (elt ansi-term-color-vector term-ansi-current-bg-color)))
-	  (if (= term-ansi-current-bold 1)
+	  (when term-ansi-current-bold
 	      (setq term-current-face
 		    (append '(:weight bold) term-current-face)))
-	  (if (= term-ansi-current-underline 1)
+	  (when term-ansi-current-underline
 	      (setq term-current-face
 		    (append '(:underline t) term-current-face))))))
 
 ;;;	(message "Debug %S" term-current-face)
-  (setq term-ansi-face-already-done 0))
+  (setq term-ansi-face-already-done nil))
 
 
 ;;; Handle a character assuming (eq terminal-state 2) -