emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/term.el


From: Dan Nicolaescu
Subject: [Emacs-diffs] Changes to emacs/lisp/term.el
Date: Mon, 11 Apr 2005 16:47:29 -0400

Index: emacs/lisp/term.el
diff -c emacs/lisp/term.el:1.65 emacs/lisp/term.el:1.66
*** emacs/lisp/term.el:1.65     Fri Apr  8 20:55:08 2005
--- emacs/lisp/term.el  Mon Apr 11 20:47:24 2005
***************
*** 684,697 ****
  (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-color 0)
! (defvar term-ansi-face-already-done 0)
  (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)
  
  ;;; Four should be enough, if you want more, just add. -mm
  (defvar term-terminal-more-parameters 0)
--- 684,696 ----
  (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 nil)
  (defvar term-ansi-current-color 0)
! (defvar term-ansi-face-already-done nil)
  (defvar term-ansi-current-bg-color 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,739 ****
       [ "Enable paging" term-pager-toggle (not term-pager-count)]
       [ "Disable paging" term-pager-toggle term-pager-count])))
  
! (if term-mode-map
!     nil
    (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)
--- 731,737 ----
       [ "Enable paging" term-pager-toggle (not term-pager-count)]
       [ "Disable paging" term-pager-toggle term-pager-count])))
  
! (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,1068 ****
    (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)
  
--- 1060,1065 ----
***************
*** 2509,2522 ****
  (defun term-horizontal-column ()
    (- (term-current-column) (term-start-line-column)))
  
! ;; Calls either vertical-motion or 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)
    (cond ((= count 0)
         (move-to-column (* term-width (/ (current-column) term-width)))
         0)
--- 2506,2519 ----
  (defun term-horizontal-column ()
    (- (term-current-column) (term-start-line-column)))
  
! ;; 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 term-buffer-vertical-motion (count)
    (cond ((= count 0)
         (move-to-column (* term-width (/ (current-column) term-width)))
         0)
***************
*** 2701,2707 ****
              (setq term-vertical-motion (symbol-function 'vertical-motion))
              (term-check-size proc))
          (setq term-vertical-motion
!               (symbol-function 'buffer-vertical-motion)))
  
        (setq save-marker (copy-marker (process-mark proc)))
  
--- 2698,2704 ----
              (setq term-vertical-motion (symbol-function 'vertical-motion))
              (term-check-size proc))
          (setq term-vertical-motion
!               (symbol-function 'term-buffer-vertical-motion)))
  
        (setq save-marker (copy-marker (process-mark proc)))
  
***************
*** 3041,3052 ****
    (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-color 0)
!   (setq term-ansi-current-invisible 0)
!   (setq term-ansi-face-already-done 0)
    (setq term-ansi-current-bg-color 0))
  
  ;;; New function to deal with ansi colorized output, as you can see you can
--- 3038,3049 ----
    (setq term-current-column 1)
    (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)
    (setq term-ansi-current-color 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,3088 ****
  
  ;;; Bold  (terminfo: bold)
     ((eq parameter 1)
!     (setq term-ansi-current-bold 1))
  
  ;;; Underline
     ((eq parameter 4)
!     (setq term-ansi-current-underline 1))
  
  ;;; 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))
  
  ;;; Reverse
     ((eq parameter 7)
!     (setq term-ansi-current-reverse 1))
  
  ;;; Invisible
     ((eq parameter 8)
!     (setq term-ansi-current-invisible 1))
  
  ;;; Reset underline (i.e. terminfo rmul)
     ((eq parameter 24)
!     (setq term-ansi-current-underline 0))
  
  ;;; Reset reverse (i.e. terminfo rmso)
     ((eq parameter 27)
!     (setq term-ansi-current-reverse 0))
  
  ;;; Foreground
     ((and (>= parameter 30) (<= parameter 37))
--- 3054,3085 ----
  
  ;;; Bold  (terminfo: bold)
     ((eq parameter 1)
!     (setq term-ansi-current-bold t))
  
  ;;; Underline
     ((eq parameter 4)
!     (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 t))
  
  ;;; Reverse
     ((eq parameter 7)
!     (setq term-ansi-current-reverse t))
  
  ;;; Invisible
     ((eq parameter 8)
!     (setq term-ansi-current-invisible t))
  
  ;;; Reset underline (i.e. terminfo rmul)
     ((eq parameter 24)
!     (setq term-ansi-current-underline nil))
  
  ;;; Reset reverse (i.e. terminfo rmso)
     ((eq parameter 27)
!     (setq term-ansi-current-reverse nil))
  
  ;;; Foreground
     ((and (>= parameter 30) (<= parameter 37))
***************
*** 3103,3114 ****
  ;;; 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-color 0)
!     (setq term-ansi-current-invisible 0)
!     (setq term-ansi-face-already-done 1)
      (setq term-ansi-current-bg-color 0)))
  
  ;     (message "Debug: U-%d R-%d B-%d I-%d D-%d F-%d B-%d"
--- 3100,3111 ----
  ;;; 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)
      (setq term-ansi-current-color 0)
!     (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,3129 ****
  ;                term-ansi-current-bg-color)
  
  
!   (if (= term-ansi-face-already-done 0)
!       (if (= term-ansi-current-reverse 1)
!         (if (= term-ansi-current-invisible 1)
              (setq term-current-face
                    (if (= term-ansi-current-color 0)
                        (list :background
--- 3118,3126 ----
  ;                term-ansi-current-bg-color)
  
  
!   (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,3157 ****
                        (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)
                (setq term-current-face
                      (append '(:weight bold) term-current-face)))
!           (if (= term-ansi-current-underline 1)
                (setq term-current-face
                      (append '(:underline t) term-current-face))))
!       (if (= term-ansi-current-invisible 1)
            (setq term-current-face
                  (if (= term-ansi-current-bg-color 0)
                      (list :background
--- 3142,3154 ----
                        (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
                      (append '(:weight bold) term-current-face)))
!           (when term-ansi-current-underline
                (setq term-current-face
                      (append '(:underline t) term-current-face))))
!       (if term-ansi-current-invisible
            (setq term-current-face
                  (if (= term-ansi-current-bg-color 0)
                      (list :background
***************
*** 3169,3183 ****
                      (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)
              (setq term-current-face
                    (append '(:weight bold) term-current-face)))
!         (if (= term-ansi-current-underline 1)
              (setq term-current-face
                    (append '(:underline t) term-current-face))))))
  
  ;;;   (message "Debug %S" term-current-face)
!   (setq term-ansi-face-already-done 0))
  
  
  ;;; Handle a character assuming (eq terminal-state 2) -
--- 3166,3180 ----
                      (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)))
!         (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 nil))
  
  
  ;;; Handle a character assuming (eq terminal-state 2) -




reply via email to

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