From: Richard Stallman <rms@gnu.org>
To: emacs-devel@gnu.org
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 [thread overview]
Message-ID: <E1I4nKz-0002tj-H5@fencepost.gnu.org> (raw)
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 <pp_publiclists@yahoo.com>
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 <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)))
_______________________________________________
bug-gnu-emacs mailing list
bug-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs
------- End of forwarded message -------
reply other threads:[~2007-07-01 0:30 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1I4nKz-0002tj-H5@fencepost.gnu.org \
--to=rms@gnu.org \
--cc=emacs-devel@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.