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: Wed, 26 Oct 2005 14:57:46 -0400

Index: emacs/lisp/term.el
diff -c emacs/lisp/term.el:1.77 emacs/lisp/term.el:1.78
*** emacs/lisp/term.el:1.77     Thu Oct 20 15:28:58 2005
--- emacs/lisp/term.el  Wed Oct 26 18:57:44 2005
***************
*** 1221,1226 ****
--- 1221,1227 ----
  ;; Which would be better:  "\e[A" or "\eOA"? readline accepts either.
  ;; For my configuration it's definitely better \eOA but YMMV. -mm
  ;; For example: vi works with \eOA while elm wants \e[A ...
+ ;;; (terminfo: kcuu1, kcud1, kcuf1, kcub1, khome, kend, kpp, knp, kdch1, kbs)
  (defun term-send-up    () (interactive) (term-send-raw-string "\eOA"))
  (defun term-send-down  () (interactive) (term-send-raw-string "\eOB"))
  (defun term-send-right () (interactive) (term-send-raw-string "\eOC"))
***************
*** 2819,2825 ****
                               (1- (- term-width (term-current-column)))))
                            (when (= term-width (term-current-column))
                              (term-move-columns -1))))
!                        ((eq char ?\r)
                          ;; Optimize CRLF at end of buffer:
                          (cond ((and (< (setq temp (1+ i)) str-length)
                                      (eq (aref str temp) ?\n)
--- 2820,2826 ----
                               (1- (- term-width (term-current-column)))))
                            (when (= term-width (term-current-column))
                              (term-move-columns -1))))
!                        ((eq char ?\r)  ;; (terminfo: cr)
                          ;; Optimize CRLF at end of buffer:
                          (cond ((and (< (setq temp (1+ i)) str-length)
                                      (eq (aref str temp) ?\n)
***************
*** 2835,2841 ****
                                (t ;; Not followed by LF or can't optimize:
                                 (term-vertical-motion 0)
                                 (setq term-current-column 
term-start-line-column))))
!                        ((eq char ?\n)
                          (if (not (and term-kill-echo-list
                                        (term-check-kill-echo-list)))
                              (term-down 1 t)))
--- 2836,2842 ----
                                (t ;; Not followed by LF or can't optimize:
                                 (term-vertical-motion 0)
                                 (setq term-current-column 
term-start-line-column))))
!                        ((eq char ?\n)  ;; (terminfo: cud1, ind)
                          (if (not (and term-kill-echo-list
                                        (term-check-kill-echo-list)))
                              (term-down 1 t)))
***************
*** 2846,2861 ****
                         ((eq char 0))         ; NUL: Do nothing
                         ((eq char ?\016))     ; Shift Out - ignored
                         ((eq char ?\017))     ; Shift In - ignored
!                        ((eq char ?\^G)
!                         (beep t))     ; Bell
                         ((eq char ?\032)
                          (let ((end (string-match "\r?$" str i)))
                            (if end
                                (funcall term-command-hook
                                         (prog1 (substring str (1+ i) end)
                                           (setq i (match-end 0))))
!                             (setq term-terminal-parameter
!                                   (substring str i))
                              (setq term-terminal-state 4)
                              (setq i str-length))))
                         (t   ; insert char FIXME: Should never happen
--- 2847,2861 ----
                         ((eq char 0))         ; NUL: Do nothing
                         ((eq char ?\016))     ; Shift Out - ignored
                         ((eq char ?\017))     ; Shift In - ignored
!                        ((eq char ?\^G) ;; (terminfo: bel)
!                         (beep t))
                         ((eq char ?\032)
                          (let ((end (string-match "\r?$" str i)))
                            (if end
                                (funcall term-command-hook
                                         (prog1 (substring str (1+ i) end)
                                           (setq i (match-end 0))))
!                             (setq term-terminal-parameter (substring str i))
                              (setq term-terminal-state 4)
                              (setq i str-length))))
                         (t   ; insert char FIXME: Should never happen
***************
*** 3072,3078 ****
     ((eq parameter 5)
      (setq term-ansi-current-bold t))
  
! ;;; Reverse
     ((eq parameter 7)
      (setq term-ansi-current-reverse t))
  
--- 3072,3078 ----
     ((eq parameter 5)
      (setq term-ansi-current-bold t))
  
! ;;; Reverse (terminfo: smso)
     ((eq parameter 7)
      (setq term-ansi-current-reverse t))
  
***************
*** 3080,3090 ****
     ((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))
  
--- 3080,3090 ----
     ((eq parameter 8)
      (setq term-ansi-current-invisible t))
  
! ;;; Reset underline (terminfo: rmul)
     ((eq parameter 24)
      (setq term-ansi-current-underline nil))
  
! ;;; Reset reverse (terminfo: rmso)
     ((eq parameter 27)
      (setq term-ansi-current-reverse nil))
  
***************
*** 3189,3195 ****
  
  (defun term-handle-ansi-escape (proc char)
    (cond
!    ((or (eq char ?H)  ; cursor motion (terminfo: cup)
        ;; (eq char ?f) ; xterm seems to handle this sequence too, not
        ;; needed for now
        )
--- 3189,3195 ----
  
  (defun term-handle-ansi-escape (proc char)
    (cond
!    ((or (eq char ?H)  ; cursor motion (terminfo: cup,home)
        ;; (eq char ?f) ; xterm seems to handle this sequence too, not
        ;; needed for now
        )
***************
*** 3211,3217 ****
     ;; \E[B - cursor down (terminfo: cud)
     ((eq char ?B)
      (term-down (max 1 term-terminal-parameter) t))
!    ;; \E[C - cursor right (terminfo: cuf)
     ((eq char ?C)
      (term-move-columns
       (max 1
--- 3211,3217 ----
     ;; \E[B - cursor down (terminfo: cud)
     ((eq char ?B)
      (term-down (max 1 term-terminal-parameter) t))
!    ;; \E[C - cursor right (terminfo: cuf, cuf1)
     ((eq char ?C)
      (term-move-columns
       (max 1
***************
*** 3230,3243 ****
     ;; \E[L - insert lines (terminfo: il, il1)
     ((eq char ?L)
      (term-insert-lines (max 1 term-terminal-parameter)))
!    ;; \E[M - delete lines
     ((eq char ?M)
      (term-delete-lines (max 1 term-terminal-parameter)))
!    ;; \E[P - delete chars
     ((eq char ?P)
      (term-delete-chars (max 1 term-terminal-parameter)))
!    ;; \E[@ - insert spaces
!    ((eq char ?@) ;; (terminfo: ich)
      (term-insert-spaces (max 1 term-terminal-parameter)))
     ;; \E[?h - DEC Private Mode Set
     ((eq char ?h)
--- 3230,3243 ----
     ;; \E[L - insert lines (terminfo: il, il1)
     ((eq char ?L)
      (term-insert-lines (max 1 term-terminal-parameter)))
!    ;; \E[M - delete lines (terminfo: dl, dl1)
     ((eq char ?M)
      (term-delete-lines (max 1 term-terminal-parameter)))
!    ;; \E[P - delete chars (terminfo: dch, dch1)
     ((eq char ?P)
      (term-delete-chars (max 1 term-terminal-parameter)))
!    ;; \E[@ - insert spaces (terminfo: ich)
!    ((eq char ?@)
      (term-insert-spaces (max 1 term-terminal-parameter)))
     ;; \E[?h - DEC Private Mode Set
     ((eq char ?h)




reply via email to

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