summaryrefslogtreecommitdiff
path: root/lisp/term.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2021-08-26 15:21:52 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2021-08-26 15:21:52 +0200
commit2e2400a13f3146ca790bf5c59a95389b1ac45e91 (patch)
tree1414d958600256c39dd0cc7649299de083f2ce2a /lisp/term.el
parente1ca0ba7d43d4ab68019c86dcc8234afd189b91e (diff)
downloademacs-2e2400a13f3146ca790bf5c59a95389b1ac45e91.tar.gz
Revert "Add support for "bright" ANSI colors in term-mode"
This reverts commit 2b2a103db0c3597c7685d3ffff4bca7f2e4d094e. Jim Porter's paperwork isn't finalized yet.
Diffstat (limited to 'lisp/term.el')
-rw-r--r--lisp/term.el133
1 files changed, 31 insertions, 102 deletions
diff --git a/lisp/term.el b/lisp/term.el
index ef2532182c8..b3870a814d2 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -727,15 +727,7 @@ Buffer local variable.")
term-color-blue
term-color-magenta
term-color-cyan
- term-color-white
- term-color-bright-black
- term-color-bright-red
- term-color-bright-green
- term-color-bright-yellow
- term-color-bright-blue
- term-color-bright-magenta
- term-color-bright-cyan
- term-color-bright-white])
+ term-color-white])
(defcustom term-default-fg-color nil
"If non-nil, default color for foreground in Term mode."
@@ -805,48 +797,8 @@ Buffer local variable.")
:group 'term)
(defface term-color-white
- '((t :foreground "grey90" :background "gray90"))
- "Face used to render white color code."
- :group 'term)
-
-(defface term-color-bright-black
- '((t :foreground "gray30" :background "gray30"))
- "Face used to render bright black color code."
- :group 'term)
-
-(defface term-color-bright-red
- '((t :foreground "red2" :background "red2"))
- "Face used to render bright red color code."
- :group 'term)
-
-(defface term-color-bright-green
- '((t :foreground "green2" :background "green2"))
- "Face used to render bright green color code."
- :group 'term)
-
-(defface term-color-bright-yellow
- '((t :foreground "yellow2" :background "yellow2"))
- "Face used to render bright yellow color code."
- :group 'term)
-
-(defface term-color-bright-blue
- '((t :foreground "blue1" :background "blue1"))
- "Face used to render bright blue color code."
- :group 'term)
-
-(defface term-color-bright-magenta
- '((t :foreground "magenta2" :background "magenta2"))
- "Face used to render bright magenta color code."
- :group 'term)
-
-(defface term-color-bright-cyan
- '((t :foreground "cyan2" :background "cyan2"))
- "Face used to render bright cyan color code."
- :group 'term)
-
-(defface term-color-bright-white
'((t :foreground "white" :background "white"))
- "Face used to render bright white color code."
+ "Face used to render white color code."
:group 'term)
(defcustom term-buffer-maximum-size 8192
@@ -3273,15 +3225,6 @@ option is enabled. See `term-set-goto-process-mark'."
;; FIXME: No idea why this is here, it looks wrong. --Stef
(setq term-ansi-face-already-done nil))
-(defun term--maybe-brighten-color (color bold)
- "Possibly convert COLOR to its bright variant.
-COLOR is an index into `ansi-term-color-vector'. If BOLD and
-`ansi-color-bold-is-bright' are non-nil and COLOR is a regular color,
-return the bright version of COLOR; otherwise, return COLOR."
- (if (and ansi-color-bold-is-bright bold (<= 1 color 8))
- (+ color 8)
- color))
-
;; New function to deal with ansi colorized output, as you can see you can
;; have any bold/underline/fg/bg/reverse combination. -mm
@@ -3321,10 +3264,6 @@ return the bright version of COLOR; otherwise, return COLOR."
((and (>= parameter 30) (<= parameter 37))
(setq term-ansi-current-color (- parameter 29)))
- ;; Bright foreground
- ((and (>= parameter 90) (<= parameter 97))
- (setq term-ansi-current-color (- parameter 81)))
-
;; Reset foreground
((eq parameter 39)
(setq term-ansi-current-color 0))
@@ -3333,10 +3272,6 @@ return the bright version of COLOR; otherwise, return COLOR."
((and (>= parameter 40) (<= parameter 47))
(setq term-ansi-current-bg-color (- parameter 39)))
- ;; Bright foreground
- ((and (>= parameter 100) (<= parameter 107))
- (setq term-ansi-current-bg-color (- parameter 91)))
-
;; Reset background
((eq parameter 49)
(setq term-ansi-current-bg-color 0))
@@ -3355,43 +3290,37 @@ return the bright version of COLOR; otherwise, return COLOR."
;; term-ansi-current-bg-color)
(unless term-ansi-face-already-done
- (let ((current-color (term--maybe-brighten-color
- term-ansi-current-color
- term-ansi-current-bold))
- (current-bg-color (term--maybe-brighten-color
- term-ansi-current-bg-color
- term-ansi-current-bold)))
- (if term-ansi-current-invisible
- (let ((color
- (if term-ansi-current-reverse
- (face-foreground
- (elt ansi-term-color-vector current-color)
- nil 'default)
- (face-background
- (elt ansi-term-color-vector current-bg-color)
- nil 'default))))
- (setq term-current-face
- (list :background color
- :foreground color))
- ) ;; No need to bother with anything else if it's invisible.
- (setq term-current-face
- (list :foreground
- (face-foreground
- (elt ansi-term-color-vector current-color)
- nil 'default)
- :background
- (face-background
- (elt ansi-term-color-vector current-bg-color)
- nil 'default)
- :inverse-video term-ansi-current-reverse))
-
- (when term-ansi-current-bold
+ (if term-ansi-current-invisible
+ (let ((color
+ (if term-ansi-current-reverse
+ (face-foreground
+ (elt ansi-term-color-vector term-ansi-current-color)
+ nil 'default)
+ (face-background
+ (elt ansi-term-color-vector term-ansi-current-bg-color)
+ nil 'default))))
(setq term-current-face
- `(,term-current-face :inherit term-bold)))
+ (list :background color
+ :foreground color))
+ ) ;; No need to bother with anything else if it's invisible.
+ (setq term-current-face
+ (list :foreground
+ (face-foreground
+ (elt ansi-term-color-vector term-ansi-current-color)
+ nil 'default)
+ :background
+ (face-background
+ (elt ansi-term-color-vector term-ansi-current-bg-color)
+ nil 'default)
+ :inverse-video term-ansi-current-reverse))
+
+ (when term-ansi-current-bold
+ (setq term-current-face
+ `(,term-current-face :inherit term-bold)))
- (when term-ansi-current-underline
- (setq term-current-face
- `(,term-current-face :inherit term-underline))))))
+ (when term-ansi-current-underline
+ (setq term-current-face
+ `(,term-current-face :inherit term-underline)))))
;; (message "Debug %S" term-current-face)
;; FIXME: shouldn't we set term-ansi-face-already-done to t here? --Stef