bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Face handling bug in term.el (patch included)


From: Yong Lu
Subject: Face handling bug in term.el (patch included)
Date: 30 Oct 2001 01:19:44 +0800
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

In GNU Emacs 21.1.1 (i386-mingw-nt5.0.2195)
 of 2001-10-23 on ODYSSEY
configured using `configure --with-gcc (2.95)'
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: CHS
  locale-coding-system: chinese-iso-8bit-dos
  default-enable-multibyte-characters: t

term.el fails to handle multiple text property correctly.  For
example, if a character is to be displayed as both bold and with blue
foreground, it is displayed only as a 'bold'.  The reason is that when
calling 'put-text-property, the value of the face property, in this
case '(term-bold term-blue term-default-bg), has conflicting settings.

term-bold and term-blue both get their properties from default, so if
the default face has a 'gray85 foreground, term-blue's foreground
setting has no effect at all.

To fix this problem, I deleted the 'copy-face lines in face
initialization code.  It can display multiple property faces after
this patch.

Regards,

Yong LU



------8<------8<------8<------o------>8------>8------>8------
*** term.el.orig        Mon Oct 29 22:32:12 2001
--- term.el     Tue Oct 30 00:51:06 2001
***************
*** 23,29 ****
  ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  ;; Boston, MA 02111-1307, USA.
  
! ;;; Marck 13 2001
  ;;; Fixes for CJK support by Yong Lu <address@hidden>.
  
  ;;; Dir/Hostname tracking and ANSI colorization by
--- 23,32 ----
  ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  ;; Boston, MA 02111-1307, USA.
  
! ;;; Oct 29 2001
! ;;; Fix for multiple property handling by Yong Lu <address@hidden>
! 
! ;;; March 13 2001
  ;;; Fixes for CJK support by Yong Lu <address@hidden>.
  
  ;;; Dir/Hostname tracking and ANSI colorization by
***************
*** 736,765 ****
    (make-face 'term-invisible)
    (make-face 'term-invisible-inv)
  
-   (copy-face 'default 'term-default-fg)
-   (copy-face 'default 'term-default-bg)
    (term-ignore-error
!    (set-face-foreground 'term-default-fg term-default-fg-color))
    (term-ignore-error
!    (set-face-background 'term-default-bg term-default-bg-color))
  
-   (copy-face 'default 'term-default-fg-inv)
-   (copy-face 'default 'term-default-bg-inv)
    (term-ignore-error
!    (set-face-foreground 'term-default-fg-inv term-default-bg-color))
    (term-ignore-error
!    (set-face-background 'term-default-bg-inv term-default-fg-color))
  
-   (copy-face 'default 'term-invisible)
    (term-ignore-error
!    (set-face-background 'term-invisible term-default-bg-color))
  
-   (copy-face 'default 'term-invisible-inv)
    (term-ignore-error
!    (set-face-background 'term-invisible-inv term-default-fg-color))
! 
!   (copy-face 'default 'term-bold)
!   (copy-face 'default 'term-underline)
  
    ;; Set the colors of the new faces.
    (term-ignore-error
--- 739,765 ----
    (make-face 'term-invisible)
    (make-face 'term-invisible-inv)
  
    (term-ignore-error
!    (set-face-foreground 'term-default-fg (or term-default-fg-color
!                                            (face-foreground 'default))))
    (term-ignore-error
!    (set-face-background 'term-default-bg (or term-default-bg-color
!                                            (face-background 'default))))
  
    (term-ignore-error
!    (set-face-foreground 'term-default-fg-inv (or term-default-bg-color
!                                                (face-background 'default))))
    (term-ignore-error
!    (set-face-background 'term-default-bg-inv (or term-default-fg-color
!                                                (face-foreground 'default))))
  
    (term-ignore-error
!    (set-face-background 'term-invisible (or term-default-bg-color
!                                           (face-background 'default))))
  
    (term-ignore-error
!    (set-face-background 'term-invisible-inv (or term-default-fg-color
!                                               (face-foreground 'default))))
  
    ;; Set the colors of the new faces.
    (term-ignore-error
***************
*** 778,805 ****
    (make-face 'term-cyan)
    (make-face 'term-white)
  
-   (copy-face 'default 'term-black)
    (term-ignore-error
     (set-face-foreground 'term-black "black"))
-   (copy-face 'default 'term-red)
    (term-ignore-error
     (set-face-foreground 'term-red "red"))
-   (copy-face 'default 'term-green)
    (term-ignore-error
     (set-face-foreground 'term-green "green"))
-   (copy-face 'default 'term-yellow)
    (term-ignore-error
     (set-face-foreground 'term-yellow "yellow"))
-   (copy-face 'default 'term-blue)
    (term-ignore-error
     (set-face-foreground 'term-blue "blue"))
-   (copy-face 'default 'term-magenta)
    (term-ignore-error
     (set-face-foreground 'term-magenta "magenta"))
-   (copy-face 'default 'term-cyan)
    (term-ignore-error
     (set-face-foreground 'term-cyan "cyan"))
-   (copy-face 'default 'term-white)
    (term-ignore-error
     (set-face-foreground 'term-white "white"))
  
--- 778,797 ----
***************
*** 813,840 ****
    (make-face 'term-cyanbg)
    (make-face 'term-whitebg)
  
-   (copy-face 'default 'term-blackbg)
    (term-ignore-error
     (set-face-background 'term-blackbg "black"))
-   (copy-face 'default 'term-redbg)
    (term-ignore-error
     (set-face-background 'term-redbg "red"))
-   (copy-face 'default 'term-greenbg)
    (term-ignore-error
     (set-face-background 'term-greenbg "green"))
-   (copy-face 'default 'term-yellowbg)
    (term-ignore-error
     (set-face-background 'term-yellowbg "yellow"))
-   (copy-face 'default 'term-bluebg)
    (term-ignore-error
     (set-face-background 'term-bluebg "blue"))
-   (copy-face 'default 'term-magentabg)
    (term-ignore-error
     (set-face-background 'term-magentabg "magenta"))
-   (copy-face 'default 'term-cyanbg)
    (term-ignore-error
     (set-face-background 'term-cyanbg "cyan"))
-   (copy-face 'default 'term-whitebg)
    (term-ignore-error
     (set-face-background 'term-whitebg "white")))
  
--- 805,824 ----



reply via email to

[Prev in Thread] Current Thread [Next in Thread]