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: Juanma Barranquero
Subject: [Emacs-diffs] Changes to emacs/lisp/term.el
Date: Thu, 09 Jun 2005 20:43:13 -0400

Index: emacs/lisp/term.el
diff -c emacs/lisp/term.el:1.69 emacs/lisp/term.el:1.70
*** emacs/lisp/term.el:1.69     Thu May 26 13:17:27 2005
--- emacs/lisp/term.el  Fri Jun 10 00:43:13 2005
***************
*** 597,603 ****
    "Function to actually send to PROCESS the STRING submitted by user.
  Usually this is just 'term-simple-send, but if your mode needs to
  massage the input string, this is your hook.  This is called from
! the user command term-send-input.  term-simple-send just sends
  the string plus a newline.")
  
  (defcustom term-eol-on-send t
--- 597,603 ----
    "Function to actually send to PROCESS the STRING submitted by user.
  Usually this is just 'term-simple-send, but if your mode needs to
  massage the input string, this is your hook.  This is called from
! the user command term-send-input.  `term-simple-send' just sends
  the string plus a newline.")
  
  (defcustom term-eol-on-send t
***************
*** 888,894 ****
    (while (< i 128)
      (define-key map (make-string 1 i) 'term-send-raw)
      ;; Avoid O and [. They are used in escape sequences for various keys.
!     (unless (or (eq i ?O) (eq i 91)) 
                (define-key esc-map (make-string 1 i) 'term-send-raw-meta))
      (setq i (1+ i)))
    (dolist (elm (generic-character-list))
--- 888,894 ----
    (while (< i 128)
      (define-key map (make-string 1 i) 'term-send-raw)
      ;; Avoid O and [. They are used in escape sequences for various keys.
!     (unless (or (eq i ?O) (eq i 91))
                (define-key esc-map (make-string 1 i) 'term-send-raw-meta))
      (setq i (1+ i)))
    (dolist (elm (generic-character-list))
***************
*** 941,951 ****
                (make-display-table)))
          i)
      ;; avoid changing the display table for ^J
!     (setq i 0) 
      (while (< i 10)
        (aset dt i (vector i))
        (setq i (1+ i)))
!     (setq i 11) 
      (while (< i 32)
        (aset dt i (vector i))
        (setq i (1+ i)))
--- 941,951 ----
                (make-display-table)))
          i)
      ;; avoid changing the display table for ^J
!     (setq i 0)
      (while (< i 10)
        (aset dt i (vector i))
        (setq i (1+ i)))
!     (setq i 11)
      (while (< i 32)
        (aset dt i (vector i))
        (setq i (1+ i)))
***************
*** 983,989 ****
  If you accidentally suspend your process, use \\[term-continue-subjob]
  to continue it.
  
! This mode can be customised to create specific modes for running
  particular subprocesses.  This can be done by setting the hooks
  `term-input-filter-functions', `term-input-filter',
  `term-input-sender' and `term-get-old-input' to appropriate functions,
--- 983,989 ----
  If you accidentally suspend your process, use \\[term-continue-subjob]
  to continue it.
  
! This mode can be customized to create specific modes for running
  particular subprocesses.  This can be done by setting the hooks
  `term-input-filter-functions', `term-input-filter',
  `term-input-sender' and `term-get-old-input' to appropriate functions,
***************
*** 1273,1279 ****
  (defun term-check-proc (buffer)
    "True if there is a process associated w/buffer BUFFER, and
  it is alive (status RUN or STOP).  BUFFER can be either a buffer or the
! name of one"
    (let ((proc (get-buffer-process buffer)))
      (and proc (memq (process-status proc) '(run stop)))))
  
--- 1273,1279 ----
  (defun term-check-proc (buffer)
    "True if there is a process associated w/buffer BUFFER, and
  it is alive (status RUN or STOP).  BUFFER can be either a buffer or the
! name of one."
    (let ((proc (get-buffer-process buffer)))
      (and proc (memq (process-status proc) '(run stop)))))
  
***************
*** 2088,2094 ****
  (defun term-simple-send (proc string)
    "Default function for sending to PROC input STRING.
  This just sends STRING plus a newline.  To override this,
! set the hook TERM-INPUT-SENDER."
    (term-send-string proc string)
    (term-send-string proc "\n"))
  
--- 2088,2094 ----
  (defun term-simple-send (proc string)
    "Default function for sending to PROC input STRING.
  This just sends STRING plus a newline.  To override this,
! set the hook `term-input-sender'."
    (term-send-string proc string)
    (term-send-string proc "\n"))
  
***************
*** 2180,2186 ****
  If your process is choking on big inputs, try lowering the value.")
  
  (defun term-send-string (proc str)
!   "Send PROCESS the contents of STRING as input.
  This is equivalent to process-send-string, except that long input strings
  are broken up into chunks of size term-input-chunk-size.  Processes
  are given a chance to output between chunks.  This can help prevent processes
--- 2180,2186 ----
  If your process is choking on big inputs, try lowering the value.")
  
  (defun term-send-string (proc str)
!   "Send to PROC the contents of STR as input.
  This is equivalent to process-send-string, except that long input strings
  are broken up into chunks of size term-input-chunk-size.  Processes
  are given a chance to output between chunks.  This can help prevent processes
***************
*** 2195,2203 ****
        (setq i next-i)))))
  
  (defun term-send-region (proc start end)
!   "Sends to PROC the region delimited by START and END.
  This is a replacement for process-send-region that tries to keep
! your process from hanging on long inputs.  See term-send-string."
    (term-send-string proc (buffer-substring start end)))
  
  
--- 2195,2203 ----
        (setq i next-i)))))
  
  (defun term-send-region (proc start end)
!   "Send to PROC the region delimited by START and END.
  This is a replacement for process-send-region that tries to keep
! your process from hanging on long inputs.  See `term-send-string'."
    (term-send-string proc (buffer-substring start end)))
  
  
***************
*** 2427,2433 ****
  ;;; This is pretty stupid about strings.  It decides we're in a string
  ;;; if there's a quote on both sides of point on the current line.
  (defun term-extract-string ()
!   "Returns string around POINT that starts the current line or nil."
    (save-excursion
      (let* ((point (point))
           (bol (progn (beginning-of-line) (point)))
--- 2427,2433 ----
  ;;; This is pretty stupid about strings.  It decides we're in a string
  ;;; if there's a quote on both sides of point on the current line.
  (defun term-extract-string ()
!   "Return string around `point' that starts the current line or nil."
    (save-excursion
      (let* ((point (point))
           (bol (progn (beginning-of-line) (point)))
***************
*** 2601,2607 ****
  
  (defun term-adjust-current-row-cache (delta)
    (when term-current-row
!     (setq term-current-row 
          (max 0 (+ term-current-row delta)))))
  
  (defun term-terminal-pos ()
--- 2601,2607 ----
  
  (defun term-adjust-current-row-cache (delta)
    (when term-current-row
!     (setq term-current-row
          (max 0 (+ term-current-row delta)))))
  
  (defun term-terminal-pos ()
***************
*** 2781,2791 ****
                            ;; In insert if the if the current line
                            ;; has become too long it needs to be
                            ;; chopped off.
!                           (when term-insert-mode 
                              (setq pos (point))
                              (end-of-line)
                              (when (> (current-column) term-width)
!                               (delete-region (- (point) (- (current-column) 
term-width)) 
                                               (point)))
                              (goto-char pos)))
                          (setq term-current-column nil)
--- 2781,2791 ----
                            ;; In insert if the if the current line
                            ;; has become too long it needs to be
                            ;; chopped off.
!                           (when term-insert-mode
                              (setq pos (point))
                              (end-of-line)
                              (when (> (current-column) term-width)
!                               (delete-region (- (point) (- (current-column) 
term-width))
                                               (point)))
                              (goto-char pos)))
                          (setq term-current-column nil)
***************
*** 2804,2818 ****
                          (setq count (term-current-column))
                          ;; The line cannot exceed term-width. TAB at
                          ;; the end of a line should not cause wrapping.
!                         (setq count (min term-width 
                                           (+ count 8 (- (mod count 8)))))
                          (if (> term-width count)
                            (progn
!                             (term-move-columns 
                               (- count (term-current-column)))
                              (setq term-current-column count))
                            (when (> term-width (term-current-column))
!                             (term-move-columns 
                               (1- (- term-width (term-current-column)))))
                            (when (= term-width (term-current-column))
                              (term-move-columns -1))))
--- 2804,2818 ----
                          (setq count (term-current-column))
                          ;; The line cannot exceed term-width. TAB at
                          ;; the end of a line should not cause wrapping.
!                         (setq count (min term-width
                                           (+ count 8 (- (mod count 8)))))
                          (if (> term-width count)
                            (progn
!                             (term-move-columns
                               (- count (term-current-column)))
                              (setq term-current-column count))
                            (when (> term-width (term-current-column))
!                             (term-move-columns
                               (1- (- term-width (term-current-column)))))
                            (when (= term-width (term-current-column))
                              (term-move-columns -1))))
***************
*** 2903,2909 ****
                              (term-goto (car term-saved-cursor)
                                         (cdr term-saved-cursor)))
                          (setq term-terminal-state 0))
!                        ((eq char ?c) ;; \Ec - Reset (terminfo: rs1) 
                          ;; This is used by the "clear" program.
                          (setq term-terminal-state 0)
                          (term-reset-terminal))
--- 2903,2909 ----
                              (term-goto (car term-saved-cursor)
                                         (cdr term-saved-cursor)))
                          (setq term-terminal-state 0))
!                        ((eq char ?c) ;; \Ec - Reset (terminfo: rs1)
                          ;; This is used by the "clear" program.
                          (setq term-terminal-state 0)
                          (term-reset-terminal))
***************
*** 3035,3041 ****
          (setq term-current-row (1- term-height))))))
  
  ;;; Reset the terminal, delete all the content and set the face to the
! ;;; default one. 
  (defun term-reset-terminal ()
    (erase-buffer)
    (setq term-current-row 0)
--- 3035,3041 ----
          (setq term-current-row (1- term-height))))))
  
  ;;; Reset the terminal, delete all the content and set the face to the
! ;;; default one.
  (defun term-reset-terminal ()
    (erase-buffer)
    (setq term-current-row 0)
***************
*** 3189,3195 ****
     ((or (eq char ?H)  ; cursor motion (terminfo: cup)
        ;; (eq char ?f) ; xterm seems to handle this sequence too, not
        ;; needed for now
!       ) 
      (if (<= term-terminal-parameter 0)
        (setq term-terminal-parameter 1))
      (if (<= term-terminal-previous-parameter 0)
--- 3189,3195 ----
     ((or (eq char ?H)  ; cursor motion (terminfo: cup)
        ;; (eq char ?f) ; xterm seems to handle this sequence too, not
        ;; needed for now
!       )
      (if (<= term-terminal-parameter 0)
        (setq term-terminal-parameter 1))
      (if (<= term-terminal-previous-parameter 0)
***************
*** 3210,3217 ****
      (term-down (max 1 term-terminal-parameter) t))
     ;; \E[C - cursor right (terminfo: cuf)
     ((eq char ?C)
!     (term-move-columns 
!      (max 1 
          (if (>= (+ term-terminal-parameter (term-current-column)) term-width)
              (- term-width (term-current-column)  1)
            term-terminal-parameter))))
--- 3210,3217 ----
      (term-down (max 1 term-terminal-parameter) t))
     ;; \E[C - cursor right (terminfo: cuf)
     ((eq char ?C)
!     (term-move-columns
!      (max 1
          (if (>= (+ term-terminal-parameter (term-current-column)) term-width)
              (- term-width (term-current-column)  1)
            term-terminal-parameter))))
***************
*** 3252,3258 ****
          ))
  
  ;;; Modified to allow ansi coloring -mm
!    ;; \E[m - Set/reset modes, set bg/fg 
     ;;(terminfo: smso,rmso,smul,rmul,rev,bold,sgr0,invis,op,setab,setaf)
     ((eq char ?m)
      (when (= term-terminal-more-parameters 1)
--- 3252,3258 ----
          ))
  
  ;;; Modified to allow ansi coloring -mm
!    ;; \E[m - Set/reset modes, set bg/fg
     ;;(terminfo: smso,rmso,smul,rmul,rev,bold,sgr0,invis,op,setab,setaf)
     ((eq char ?m)
      (when (= term-terminal-more-parameters 1)
***************
*** 3297,3303 ****
            (not (and (= term-scroll-start 0)
                      (= term-scroll-end term-height)))))
    (term-move-columns (- (term-current-column)))
!   (term-goto 
     term-scroll-start (term-current-column)))
  
  ;; (defun term-switch-to-alternate-sub-buffer (set)
--- 3297,3303 ----
            (not (and (= term-scroll-start 0)
                      (= term-scroll-end term-height)))))
    (term-move-columns (- (term-current-column)))
!   (term-goto
     term-scroll-start (term-current-column)))
  
  ;; (defun term-switch-to-alternate-sub-buffer (set)
***************
*** 3846,3852 ****
  
  
  (defun term-word (word-chars)
!   "Return the word of WORD-CHARS at point, or nil if non is found.
  Word constituents are considered to be those in WORD-CHARS, which is like the
  inside of a \"[...]\" (see `skip-chars-forward')."
    (save-excursion
--- 3846,3852 ----
  
  
  (defun term-word (word-chars)
!   "Return the word of WORD-CHARS at point, or nil if none is found.
  Word constituents are considered to be those in WORD-CHARS, which is like the
  inside of a \"[...]\" (see `skip-chars-forward')."
    (save-excursion
***************
*** 3863,3869 ****
  
  
  (defun term-match-partial-filename ()
!   "Return the filename at point, or nil if non is found.
  Environment variables are substituted.  See `term-word'."
    (let ((filename (term-word "~/A-Za-z0-9+@:_.$#,={}-")))
      (and filename (substitute-in-file-name filename))))
--- 3863,3869 ----
  
  
  (defun term-match-partial-filename ()
!   "Return the filename at point, or nil if none is found.
  Environment variables are substituted.  See `term-word'."
    (let ((filename (term-word "~/A-Za-z0-9+@:_.$#,={}-")))
      (and filename (substitute-in-file-name filename))))




reply via email to

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