Debugger entered--Lisp error: (args-out-of-range "\376\374\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376" -1) aref("\376\374\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376" -1) (char-charset (aref decoded-substring (- count 1 partial))) (eq (char-charset (aref decoded-substring (- count 1 partial))) 'eight-bit) (while (eq (char-charset (aref decoded-substring (- count 1 partial))) 'eight-bit) (setq partial (1+ partial))) (let ((partial 0) (count (length decoded-substring))) (while (eq (char-charset (aref decoded-substring (- count 1 partial))) 'eight-bit) (setq partial (1+ partial))) (if (> partial 0) (progn (setq term-terminal-undecoded-bytes (substring decoded-substring (- partial))) (setq decoded-substring (substring decoded-substring 0 (- partial))) (setq str-length (- str-length partial)) (setq funny (- funny partial))))) proc = # str = "\376\374\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376" i = 0 funny = 25 decoded-substring = "\376\374\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376" save-point = # save-marker = # win = nil selected = # last-win = nil str-length = 25 save-selected-window--state = (# (# . #)) ctl-params = nil ctl-params-end = nil ctl-end = 26 partial = 25 count = 25 (progn (let ((partial 0) (count (length decoded-substring))) (while (eq (char-charset (aref decoded-substring (- count 1 partial))) 'eight-bit) (setq partial (1+ partial))) (if (> partial 0) (progn (setq term-terminal-undecoded-bytes (substring decoded-substring (- partial))) (setq decoded-substring (substring decoded-substring 0 (- partial))) (setq str-length (- str-length partial)) (setq funny (- funny partial)))))) (if (= funny str-length) (progn (let ((partial 0) (count (length decoded-substring))) (while (eq (char-charset (aref decoded-substring (- count 1 partial))) 'eight-bit) (setq partial (1+ partial))) (if (> partial 0) (progn (setq term-terminal-undecoded-bytes (substring decoded-substring (- partial))) (setq decoded-substring (substring decoded-substring 0 (- partial))) (setq str-length (- str-length partial)) (setq funny (- funny partial))))))) (progn (if term-do-line-wrapping (progn (term-down 1 t) (term-move-to-column 0) (setq term-do-line-wrapping nil))) (setq decoded-substring (decode-coding-string (substring str i funny) locale-coding-system t)) (if (= funny str-length) (progn (let ((partial 0) (count (length decoded-substring))) (while (eq (char-charset (aref decoded-substring (- count 1 partial))) 'eight-bit) (setq partial (1+ partial))) (if (> partial 0) (progn (setq term-terminal-undecoded-bytes (substring decoded-substring (- partial))) (setq decoded-substring (substring decoded-substring 0 (- partial))) (setq str-length (- str-length partial)) (setq funny (- funny partial))))))) (let ((old-column (term-horizontal-column)) (old-point (point)) columns) (if term-suppress-hard-newline nil (while (> (+ (length decoded-substring) old-column) term-width) (insert (substring decoded-substring 0 (- term-width old-column))) (delete-region (point) (line-end-position)) (term-down 1 t) (term-move-columns (- (term-current-column))) (add-text-properties (1- (point)) (point) '(term-line-wrap t rear-nonsticky t)) (setq decoded-substring (substring decoded-substring (- term-width old-column))) (setq old-column 0))) (insert decoded-substring) (setq term-current-column (current-column) columns (- term-current-column old-column)) (if (not (or (eobp) term-insert-mode)) (progn (let ((pos (point))) (term-move-columns columns) (delete-region pos (point)) (setq term-current-column nil)))) (if term-insert-mode (progn (let ((pos (point))) (end-of-line) (if (> (current-column) term-width) (progn (delete-region (- (point) (- (current-column) term-width)) (point)))) (goto-char pos)))) (put-text-property old-point (point) 'font-lock-face term-current-face)) (if (eq (term-current-column) term-width) (progn (term-move-columns -1) (setq term-do-line-wrapping (point)))) (setq term-current-column nil) (setq i funny)) (if (> funny i) (progn (if term-do-line-wrapping (progn (term-down 1 t) (term-move-to-column 0) (setq term-do-line-wrapping nil))) (setq decoded-substring (decode-coding-string (substring str i funny) locale-coding-system t)) (if (= funny str-length) (progn (let ((partial 0) (count (length decoded-substring))) (while (eq (char-charset (aref decoded-substring (- count 1 partial))) 'eight-bit) (setq partial (1+ partial))) (if (> partial 0) (progn (setq term-terminal-undecoded-bytes (substring decoded-substring (- partial))) (setq decoded-substring (substring decoded-substring 0 (- partial))) (setq str-length (- str-length partial)) (setq funny (- funny partial))))))) (let ((old-column (term-horizontal-column)) (old-point (point)) columns) (if term-suppress-hard-newline nil (while (> (+ (length decoded-substring) old-column) term-width) (insert (substring decoded-substring 0 (- term-width old-column))) (delete-region (point) (line-end-position)) (term-down 1 t) (term-move-columns (- (term-current-column))) (add-text-properties (1- (point)) (point) '(term-line-wrap t rear-nonsticky t)) (setq decoded-substring (substring decoded-substring (- term-width old-column))) (setq old-column 0))) (insert decoded-substring) (setq term-current-column (current-column) columns (- term-current-column old-column)) (if (not (or (eobp) term-insert-mode)) (progn (let ((pos (point))) (term-move-columns columns) (delete-region pos (point)) (setq term-current-column nil)))) (if term-insert-mode (progn (let ((pos (point))) (end-of-line) (if (> (current-column) term-width) (progn (delete-region (- (point) (- (current-column) term-width)) (point)))) (goto-char pos)))) (put-text-property old-point (point) 'font-lock-face term-current-face)) (if (eq (term-current-column) term-width) (progn (term-move-columns -1) (setq term-do-line-wrapping (point)))) (setq term-current-column nil) (setq i funny))) (let ((ctl-params (and funny (match-string 1 str))) (ctl-params-end (and funny (match-end 1))) (ctl-end (if funny (match-end 0) (setq funny (string-match term-control-seq-prefix-regexp str i)) (if funny (setq term-terminal-undecoded-bytes (substring str funny)) (setq funny str-length)) (1+ str-length)))) (if (> funny i) (progn (if term-do-line-wrapping (progn (term-down 1 t) (term-move-to-column 0) (setq term-do-line-wrapping nil))) (setq decoded-substring (decode-coding-string (substring str i funny) locale-coding-system t)) (if (= funny str-length) (progn (let ((partial 0) (count (length decoded-substring))) (while (eq (char-charset (aref decoded-substring (- count 1 partial))) 'eight-bit) (setq partial (1+ partial))) (if (> partial 0) (progn (setq term-terminal-undecoded-bytes (substring decoded-substring (- partial))) (setq decoded-substring (substring decoded-substring 0 (- partial))) (setq str-length (- str-length partial)) (setq funny (- funny partial))))))) (let ((old-column (term-horizontal-column)) (old-point (point)) columns) (if term-suppress-hard-newline nil (while (> (+ (length decoded-substring) old-column) term-width) (insert (substring decoded-substring 0 (- term-width old-column))) (delete-region (point) (line-end-position)) (term-down 1 t) (term-move-columns (- (term-current-column))) (add-text-properties (1- (point)) (point) '(term-line-wrap t rear-nonsticky t)) (setq decoded-substring (substring decoded-substring (- term-width old-column))) (setq old-column 0))) (insert decoded-substring) (setq term-current-column (current-column) columns (- term-current-column old-column)) (if (not (or (eobp) term-insert-mode)) (progn (let ((pos (point))) (term-move-columns columns) (delete-region pos (point)) (setq term-current-column nil)))) (if term-insert-mode (progn (let ((pos (point))) (end-of-line) (if (> (current-column) term-width) (progn (delete-region (- (point) (- (current-column) term-width)) (point)))) (goto-char pos)))) (put-text-property old-point (point) 'font-lock-face term-current-face)) (if (eq (term-current-column) term-width) (progn (term-move-columns -1) (setq term-do-line-wrapping (point)))) (setq term-current-column nil) (setq i funny))) (let* ((val (and (<= ctl-end str-length) (aref str i)))) (cond ((eql val 9) (let ((col (term-current-column))) (term-move-to-column (min (1- term-width) (+ col 8 (- (mod col 8))))))) ((eql val 13) (funcall term-vertical-motion 0) (setq term-current-column term-start-line-column)) ((eql val 10) (if (and term-kill-echo-list (term-check-kill-echo-list)) nil (term-down 1 t))) ((eql val 8) (term-move-columns -1)) ((eql val 7) (beep t)) ((eql val 26) (funcall term-command-function (decode-coding-string (substring str (1+ i) (- ctl-end (if (eq (aref str (- ctl-end 2)) 13) 2 1))) locale-coding-system t))) ((eql val 27) (let* ((val (aref str (1+ i)))) (cond ((eql val 91) (if (eq ctl-params-end (1- ctl-end)) (progn (term-handle-ansi-escape proc (mapcar #'string-to-number (split-string ctl-params ";")) (aref str (1- ctl-end)))))) ((eql val 68) (term-handle-deferred-scroll) (term-down 1 t)) ((eql val 77) (if (or (< (term-current-row) term-scroll-start) (>= (1- (term-current-row)) term-scroll-start)) (term-down -1) (term-down -1 t))) ((eql val 55) (term-handle-deferred-scroll) (setq term-saved-cursor (list (term-current-row) (term-horizontal-column) term-ansi-current-bg-color term-ansi-current-bold term-ansi-current-color term-ansi-current-invisible term-ansi-current-reverse term-ansi-current-underline term-current-face))) ((eql val 56) (if term-saved-cursor (progn (term-goto (nth 0 term-saved-cursor) (nth 1 term-saved-cursor)) (setq term-ansi-current-bg-color (nth 2 term-saved-cursor) term-ansi-current-bold (nth 3 term-saved-cursor) term-ansi-current-color (nth 4 term-saved-cursor) term-ansi-current-invisible (nth 5 term-saved-cursor) term-ansi-current-reverse (nth 6 term-saved-cursor) term-ansi-current-underline (nth 7 term-saved-cursor) term-current-face (nth 8 term-saved-cursor))))) ((eql val 99) (term-reset-terminal)) ((eql val 65) (term-handle-ansi-terminal-messages (substring str i ctl-end))) (t nil)))) ((memql val '(nil 15 14 0)) nil) (t (let ((x37 val)) (error "No clause matching `%S'" x37))))) (if (eq term-do-line-wrapping (point)) nil (setq term-do-line-wrapping nil)) (if term-pager-old-local-map (progn (if (> (% (current-column) term-width) 0) (setq term-terminal-undecoded-bytes (substring str i)) (if (= 0 i) (setq term-terminal-undecoded-bytes (concat "\15" (substring str i))) (setq term-terminal-undecoded-bytes (substring str (1- i))) (aset term-terminal-undecoded-bytes 0 13)) (goto-char (point-max))) (make-local-variable 'term-pager-old-filter) (setq term-pager-old-filter (process-filter proc)) (set-process-filter proc term-pager-filter) (setq i str-length)) (setq i ctl-end))) (while (< i str-length) (setq funny (string-match term-control-seq-regexp str i)) (let ((ctl-params (and funny (match-string 1 str))) (ctl-params-end (and funny (match-end 1))) (ctl-end (if funny (match-end 0) (setq funny (string-match term-control-seq-prefix-regexp str i)) (if funny (setq term-terminal-undecoded-bytes (substring str funny)) (setq funny str-length)) (1+ str-length)))) (if (> funny i) (progn (if term-do-line-wrapping (progn (term-down 1 t) (term-move-to-column 0) (setq term-do-line-wrapping nil))) (setq decoded-substring (decode-coding-string (substring str i funny) locale-coding-system t)) (if (= funny str-length) (progn (let ((partial 0) (count (length decoded-substring))) (while (eq (char-charset (aref decoded-substring (- count 1 partial))) 'eight-bit) (setq partial (1+ partial))) (if (> partial 0) (progn (setq term-terminal-undecoded-bytes (substring decoded-substring (- partial))) (setq decoded-substring (substring decoded-substring 0 (- partial))) (setq str-length (- str-length partial)) (setq funny (- funny partial))))))) (let ((old-column (term-horizontal-column)) (old-point (point)) columns) (if term-suppress-hard-newline nil (while (> (+ (length decoded-substring) old-column) term-width) (insert (substring decoded-substring 0 (- term-width old-column))) (delete-region (point) (line-end-position)) (term-down 1 t) (term-move-columns (- (term-current-column))) (add-text-properties (1- (point)) (point) '(term-line-wrap t rear-nonsticky t)) (setq decoded-substring (substring decoded-substring (- term-width old-column))) (setq old-column 0))) (insert decoded-substring) (setq term-current-column (current-column) columns (- term-current-column old-column)) (if (not (or (eobp) term-insert-mode)) (progn (let ((pos (point))) (term-move-columns columns) (delete-region pos (point)) (setq term-current-column nil)))) (if term-insert-mode (progn (let ((pos (point))) (end-of-line) (if (> (current-column) term-width) (progn (delete-region (- (point) (- (current-column) term-width)) (point)))) (goto-char pos)))) (put-text-property old-point (point) 'font-lock-face term-current-face)) (if (eq (term-current-column) term-width) (progn (term-move-columns -1) (setq term-do-line-wrapping (point)))) (setq term-current-column nil) (setq i funny))) (let* ((val (and (<= ctl-end str-length) (aref str i)))) (cond ((eql val 9) (let ((col (term-current-column))) (term-move-to-column (min (1- term-width) (+ col 8 (- (mod col 8))))))) ((eql val 13) (funcall term-vertical-motion 0) (setq term-current-column term-start-line-column)) ((eql val 10) (if (and term-kill-echo-list (term-check-kill-echo-list)) nil (term-down 1 t))) ((eql val 8) (term-move-columns -1)) ((eql val 7) (beep t)) ((eql val 26) (funcall term-command-function (decode-coding-string (substring str (1+ i) (- ctl-end (if (eq (aref str (- ctl-end 2)) 13) 2 1))) locale-coding-system t))) ((eql val 27) (let* ((val (aref str (1+ i)))) (cond ((eql val 91) (if (eq ctl-params-end (1- ctl-end)) (progn (term-handle-ansi-escape proc (mapcar #'string-to-number (split-string ctl-params ";")) (aref str (1- ctl-end)))))) ((eql val 68) (term-handle-deferred-scroll) (term-down 1 t)) ((eql val 77) (if (or (< (term-current-row) term-scroll-start) (>= (1- (term-current-row)) term-scroll-start)) (term-down -1) (term-down -1 t))) ((eql val 55) (term-handle-deferred-scroll) (setq term-saved-cursor (list (term-current-row) (term-horizontal-column) term-ansi-current-bg-color term-ansi-current-bold term-ansi-current-color term-ansi-current-invisible term-ansi-current-reverse term-ansi-current-underline term-current-face))) ((eql val 56) (if term-saved-cursor (progn (term-goto (nth 0 term-saved-cursor) (nth 1 term-saved-cursor)) (setq term-ansi-current-bg-color (nth 2 term-saved-cursor) term-ansi-current-bold (nth 3 term-saved-cursor) term-ansi-current-color (nth 4 term-saved-cursor) term-ansi-current-invisible (nth 5 term-saved-cursor) term-ansi-current-reverse (nth 6 term-saved-cursor) term-ansi-current-underline (nth 7 term-saved-cursor) term-current-face (nth 8 term-saved-cursor))))) ((eql val 99) (term-reset-terminal)) ((eql val 65) (term-handle-ansi-terminal-messages (substring str i ctl-end))) (t nil)))) ((memql val '(nil 15 14 0)) nil) (t (let ((x37 val)) (error "No clause matching `%S'" x37))))) (if (eq term-do-line-wrapping (point)) nil (setq term-do-line-wrapping nil)) (if term-pager-old-local-map (progn (if (> (% (current-column) term-width) 0) (setq term-terminal-undecoded-bytes (substring str i)) (if (= 0 i) (setq term-terminal-undecoded-bytes (concat "\15" (substring str i))) (setq term-terminal-undecoded-bytes (substring str (1- i))) (aset term-terminal-undecoded-bytes 0 13)) (goto-char (point-max))) (make-local-variable 'term-pager-old-filter) (setq term-pager-old-filter (process-filter proc)) (set-process-filter proc term-pager-filter) (setq i str-length)) (setq i ctl-end)))) (save-restriction (if (and (> (point-max) (process-mark proc)) (not (eq (current-local-map) term-raw-map))) (progn (narrow-to-region (point-min) (process-mark proc)))) (if term-log-buffer (progn (princ str term-log-buffer))) (if term-terminal-undecoded-bytes (progn (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil))) (while (< i str-length) (setq funny (string-match term-control-seq-regexp str i)) (let ((ctl-params (and funny (match-string 1 str))) (ctl-params-end (and funny (match-end 1))) (ctl-end (if funny (match-end 0) (setq funny (string-match term-control-seq-prefix-regexp str i)) (if funny (setq term-terminal-undecoded-bytes (substring str funny)) (setq funny str-length)) (1+ str-length)))) (if (> funny i) (progn (if term-do-line-wrapping (progn (term-down 1 t) (term-move-to-column 0) (setq term-do-line-wrapping nil))) (setq decoded-substring (decode-coding-string (substring str i funny) locale-coding-system t)) (if (= funny str-length) (progn (let ((partial 0) (count (length decoded-substring))) (while (eq (char-charset (aref decoded-substring (- count 1 partial))) 'eight-bit) (setq partial (1+ partial))) (if (> partial 0) (progn (setq term-terminal-undecoded-bytes (substring decoded-substring (- partial))) (setq decoded-substring (substring decoded-substring 0 (- partial))) (setq str-length (- str-length partial)) (setq funny (- funny partial))))))) (let ((old-column (term-horizontal-column)) (old-point (point)) columns) (if term-suppress-hard-newline nil (while (> (+ (length decoded-substring) old-column) term-width) (insert (substring decoded-substring 0 (- term-width old-column))) (delete-region (point) (line-end-position)) (term-down 1 t) (term-move-columns (- (term-current-column))) (add-text-properties (1- (point)) (point) '(term-line-wrap t rear-nonsticky t)) (setq decoded-substring (substring decoded-substring (- term-width old-column))) (setq old-column 0))) (insert decoded-substring) (setq term-current-column (current-column) columns (- term-current-column old-column)) (if (not (or (eobp) term-insert-mode)) (progn (let ((pos (point))) (term-move-columns columns) (delete-region pos (point)) (setq term-current-column nil)))) (if term-insert-mode (progn (let ((pos (point))) (end-of-line) (if (> (current-column) term-width) (progn (delete-region (- (point) (- (current-column) term-width)) (point)))) (goto-char pos)))) (put-text-property old-point (point) 'font-lock-face term-current-face)) (if (eq (term-current-column) term-width) (progn (term-move-columns -1) (setq term-do-line-wrapping (point)))) (setq term-current-column nil) (setq i funny))) (let* ((val (and (<= ctl-end str-length) (aref str i)))) (cond ((eql val 9) (let ((col (term-current-column))) (term-move-to-column (min (1- term-width) (+ col 8 (- (mod col 8))))))) ((eql val 13) (funcall term-vertical-motion 0) (setq term-current-column term-start-line-column)) ((eql val 10) (if (and term-kill-echo-list (term-check-kill-echo-list)) nil (term-down 1 t))) ((eql val 8) (term-move-columns -1)) ((eql val 7) (beep t)) ((eql val 26) (funcall term-command-function (decode-coding-string (substring str (1+ i) (- ctl-end (if (eq (aref str (- ctl-end 2)) 13) 2 1))) locale-coding-system t))) ((eql val 27) (let* ((val (aref str (1+ i)))) (cond ((eql val 91) (if (eq ctl-params-end (1- ctl-end)) (progn (term-handle-ansi-escape proc (mapcar #'string-to-number (split-string ctl-params ";")) (aref str (1- ctl-end)))))) ((eql val 68) (term-handle-deferred-scroll) (term-down 1 t)) ((eql val 77) (if (or (< (term-current-row) term-scroll-start) (>= (1- (term-current-row)) term-scroll-start)) (term-down -1) (term-down -1 t))) ((eql val 55) (term-handle-deferred-scroll) (setq term-saved-cursor (list (term-current-row) (term-horizontal-column) term-ansi-current-bg-color term-ansi-current-bold term-ansi-current-color term-ansi-current-invisible term-ansi-current-reverse term-ansi-current-underline term-current-face))) ((eql val 56) (if term-saved-cursor (progn (term-goto (nth 0 term-saved-cursor) (nth 1 term-saved-cursor)) (setq term-ansi-current-bg-color (nth 2 term-saved-cursor) term-ansi-current-bold (nth 3 term-saved-cursor) term-ansi-current-color (nth 4 term-saved-cursor) term-ansi-current-invisible (nth 5 term-saved-cursor) term-ansi-current-reverse (nth 6 term-saved-cursor) term-ansi-current-underline (nth 7 term-saved-cursor) term-current-face (nth 8 term-saved-cursor))))) ((eql val 99) (term-reset-terminal)) ((eql val 65) (term-handle-ansi-terminal-messages (substring str i ctl-end))) (t nil)))) ((memql val '(nil 15 14 0)) nil) (t (let ((x37 val)) (error "No clause matching `%S'" x37))))) (if (eq term-do-line-wrapping (point)) nil (setq term-do-line-wrapping nil)) (if term-pager-old-local-map (progn (if (> (% (current-column) term-width) 0) (setq term-terminal-undecoded-bytes (substring str i)) (if (= 0 i) (setq term-terminal-undecoded-bytes (concat "\15" (substring str i))) (setq term-terminal-undecoded-bytes (substring str (1- i))) (aset term-terminal-undecoded-bytes 0 13)) (goto-char (point-max))) (make-local-variable 'term-pager-old-filter) (setq term-pager-old-filter (process-filter proc)) (set-process-filter proc term-pager-filter) (setq i str-length)) (setq i ctl-end))))) (progn (if (marker-buffer term-pending-delete-marker) (progn (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil))) (if (/= (point) (process-mark proc)) (progn (setq save-point (point-marker)))) (setq term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (if (and (> (point-max) (process-mark proc)) (not (eq (current-local-map) term-raw-map))) (progn (narrow-to-region (point-min) (process-mark proc)))) (if term-log-buffer (progn (princ str term-log-buffer))) (if term-terminal-undecoded-bytes (progn (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil))) (while (< i str-length) (setq funny (string-match term-control-seq-regexp str i)) (let ((ctl-params (and funny (match-string 1 str))) (ctl-params-end (and funny (match-end 1))) (ctl-end (if funny (match-end 0) (setq funny (string-match term-control-seq-prefix-regexp str i)) (if funny (setq term-terminal-undecoded-bytes (substring str funny)) (setq funny str-length)) (1+ str-length)))) (if (> funny i) (progn (if term-do-line-wrapping (progn (term-down 1 t) (term-move-to-column 0) (setq term-do-line-wrapping nil))) (setq decoded-substring (decode-coding-string (substring str i funny) locale-coding-system t)) (if (= funny str-length) (progn (let ((partial 0) (count (length decoded-substring))) (while (eq (char-charset (aref decoded-substring (- count 1 partial))) 'eight-bit) (setq partial (1+ partial))) (if (> partial 0) (progn (setq term-terminal-undecoded-bytes (substring decoded-substring (- partial))) (setq decoded-substring (substring decoded-substring 0 (- partial))) (setq str-length (- str-length partial)) (setq funny (- funny partial))))))) (let ((old-column (term-horizontal-column)) (old-point (point)) columns) (if term-suppress-hard-newline nil (while (> (+ (length decoded-substring) old-column) term-width) (insert (substring decoded-substring 0 (- term-width old-column))) (delete-region (point) (line-end-position)) (term-down 1 t) (term-move-columns (- (term-current-column))) (add-text-properties (1- (point)) (point) '(term-line-wrap t rear-nonsticky t)) (setq decoded-substring (substring decoded-substring (- term-width old-column))) (setq old-column 0))) (insert decoded-substring) (setq term-current-column (current-column) columns (- term-current-column old-column)) (if (not (or (eobp) term-insert-mode)) (progn (let ((pos (point))) (term-move-columns columns) (delete-region pos (point)) (setq term-current-column nil)))) (if term-insert-mode (progn (let ((pos (point))) (end-of-line) (if (> (current-column) term-width) (progn (delete-region (- (point) (- (current-column) term-width)) (point)))) (goto-char pos)))) (put-text-property old-point (point) 'font-lock-face term-current-face)) (if (eq (term-current-column) term-width) (progn (term-move-columns -1) (setq term-do-line-wrapping (point)))) (setq term-current-column nil) (setq i funny))) (let* ((val (and (<= ctl-end str-length) (aref str i)))) (cond ((eql val 9) (let ((col (term-current-column))) (term-move-to-column (min (1- term-width) (+ col 8 (- (mod col 8))))))) ((eql val 13) (funcall term-vertical-motion 0) (setq term-current-column term-start-line-column)) ((eql val 10) (if (and term-kill-echo-list (term-check-kill-echo-list)) nil (term-down 1 t))) ((eql val 8) (term-move-columns -1)) ((eql val 7) (beep t)) ((eql val 26) (funcall term-command-function (decode-coding-string (substring str (1+ i) (- ctl-end (if (eq (aref str (- ctl-end 2)) 13) 2 1))) locale-coding-system t))) ((eql val 27) (let* ((val (aref str (1+ i)))) (cond ((eql val 91) (if (eq ctl-params-end (1- ctl-end)) (progn (term-handle-ansi-escape proc (mapcar #'string-to-number (split-string ctl-params ";")) (aref str (1- ctl-end)))))) ((eql val 68) (term-handle-deferred-scroll) (term-down 1 t)) ((eql val 77) (if (or (< (term-current-row) term-scroll-start) (>= (1- (term-current-row)) term-scroll-start)) (term-down -1) (term-down -1 t))) ((eql val 55) (term-handle-deferred-scroll) (setq term-saved-cursor (list (term-current-row) (term-horizontal-column) term-ansi-current-bg-color term-ansi-current-bold term-ansi-current-color term-ansi-current-invisible term-ansi-current-reverse term-ansi-current-underline term-current-face))) ((eql val 56) (if term-saved-cursor (progn (term-goto (nth 0 term-saved-cursor) (nth 1 term-saved-cursor)) (setq term-ansi-current-bg-color (nth 2 term-saved-cursor) term-ansi-current-bold (nth 3 term-saved-cursor) term-ansi-current-color (nth 4 term-saved-cursor) term-ansi-current-invisible (nth 5 term-saved-cursor) term-ansi-current-reverse (nth 6 term-saved-cursor) term-ansi-current-underline (nth 7 term-saved-cursor) term-current-face (nth 8 term-saved-cursor))))) ((eql val 99) (term-reset-terminal)) ((eql val 65) (term-handle-ansi-terminal-messages (substring str i ctl-end))) (t nil)))) ((memql val '(nil 15 14 0)) nil) (t (let ((x37 val)) (error "No clause matching `%S'" x37))))) (if (eq term-do-line-wrapping (point)) nil (setq term-do-line-wrapping nil)) (if term-pager-old-local-map (progn (if (> (% (current-column) term-width) 0) (setq term-terminal-undecoded-bytes (substring str i)) (if (= 0 i) (setq term-terminal-undecoded-bytes (concat "\15" (substring str i))) (setq term-terminal-undecoded-bytes (substring str (1- i))) (aset term-terminal-undecoded-bytes 0 13)) (goto-char (point-max))) (make-local-variable 'term-pager-old-filter) (setq term-pager-old-filter (process-filter proc)) (set-process-filter proc term-pager-filter) (setq i str-length)) (setq i ctl-end))))) (if (>= (term-current-row) term-height) (progn (term-handle-deferred-scroll))) (set-marker (process-mark proc) (point)) (if (stringp decoded-substring) (progn (term-watch-for-password-prompt decoded-substring))) (if save-point (progn (goto-char save-point) (set-marker save-point nil))) (if (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (progn (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil))) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (if (eq (window-buffer win) (process-buffer proc)) (progn (let ((scroll term-scroll-to-bottom-on-output)) (select-window win) (if (or (= (point) save-marker) (eq scroll t) (eq scroll 'all) (and (eq selected win) (or (eq scroll 'this) (not save-point))) (and (eq scroll 'others) (not (eq selected win)))) (progn (goto-char term-home-marker) (recenter 0) (goto-char (process-mark proc)) (if (not (pos-visible-in-window-p (point) win)) (recenter -1)))) (if (and term-scroll-show-maximum-output (>= (point) (process-mark proc))) (progn (save-excursion (goto-char (point-max)) (recenter -1))))))) (not (eq win last-win)))) (if (> term-buffer-maximum-size 0) (progn (save-excursion (goto-char (process-mark (get-buffer-process (current-buffer)))) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point))))) (set-marker save-marker nil)) (unwind-protect (progn (if (marker-buffer term-pending-delete-marker) (progn (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil))) (if (/= (point) (process-mark proc)) (progn (setq save-point (point-marker)))) (setq term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (if (and (> (point-max) (process-mark proc)) (not (eq (current-local-map) term-raw-map))) (progn (narrow-to-region (point-min) (process-mark proc)))) (if term-log-buffer (progn (princ str term-log-buffer))) (if term-terminal-undecoded-bytes (progn (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil))) (while (< i str-length) (setq funny (string-match term-control-seq-regexp str i)) (let ((ctl-params (and funny (match-string 1 str))) (ctl-params-end (and funny (match-end 1))) (ctl-end (if funny (match-end 0) (setq funny (string-match term-control-seq-prefix-regexp str i)) (if funny (setq term-terminal-undecoded-bytes (substring str funny)) (setq funny str-length)) (1+ str-length)))) (if (> funny i) (progn (if term-do-line-wrapping (progn (term-down 1 t) (term-move-to-column 0) (setq term-do-line-wrapping nil))) (setq decoded-substring (decode-coding-string (substring str i funny) locale-coding-system t)) (if (= funny str-length) (progn (let ((partial 0) (count (length decoded-substring))) (while (eq (char-charset (aref decoded-substring (- count 1 partial))) 'eight-bit) (setq partial (1+ partial))) (if (> partial 0) (progn (setq term-terminal-undecoded-bytes (substring decoded-substring (- partial))) (setq decoded-substring (substring decoded-substring 0 (- partial))) (setq str-length (- str-length partial)) (setq funny (- funny partial))))))) (let ((old-column (term-horizontal-column)) (old-point (point)) columns) (if term-suppress-hard-newline nil (while (> (+ (length decoded-substring) old-column) term-width) (insert (substring decoded-substring 0 (- term-width old-column))) (delete-region (point) (line-end-position)) (term-down 1 t) (term-move-columns (- (term-current-column))) (add-text-properties (1- (point)) (point) '(term-line-wrap t rear-nonsticky t)) (setq decoded-substring (substring decoded-substring (- term-width old-column))) (setq old-column 0))) (insert decoded-substring) (setq term-current-column (current-column) columns (- term-current-column old-column)) (if (not (or (eobp) term-insert-mode)) (progn (let ((pos (point))) (term-move-columns columns) (delete-region pos (point)) (setq term-current-column nil)))) (if term-insert-mode (progn (let ((pos (point))) (end-of-line) (if (> (current-column) term-width) (progn (delete-region (- (point) (- (current-column) term-width)) (point)))) (goto-char pos)))) (put-text-property old-point (point) 'font-lock-face term-current-face)) (if (eq (term-current-column) term-width) (progn (term-move-columns -1) (setq term-do-line-wrapping (point)))) (setq term-current-column nil) (setq i funny))) (let* ((val (and (<= ctl-end str-length) (aref str i)))) (cond ((eql val 9) (let ((col (term-current-column))) (term-move-to-column (min (1- term-width) (+ col 8 (- (mod col 8))))))) ((eql val 13) (funcall term-vertical-motion 0) (setq term-current-column term-start-line-column)) ((eql val 10) (if (and term-kill-echo-list (term-check-kill-echo-list)) nil (term-down 1 t))) ((eql val 8) (term-move-columns -1)) ((eql val 7) (beep t)) ((eql val 26) (funcall term-command-function (decode-coding-string (substring str (1+ i) (- ctl-end (if (eq (aref str (- ctl-end 2)) 13) 2 1))) locale-coding-system t))) ((eql val 27) (let* ((val (aref str (1+ i)))) (cond ((eql val 91) (if (eq ctl-params-end (1- ctl-end)) (progn (term-handle-ansi-escape proc (mapcar #'string-to-number (split-string ctl-params ";")) (aref str (1- ctl-end)))))) ((eql val 68) (term-handle-deferred-scroll) (term-down 1 t)) ((eql val 77) (if (or (< (term-current-row) term-scroll-start) (>= (1- (term-current-row)) term-scroll-start)) (term-down -1) (term-down -1 t))) ((eql val 55) (term-handle-deferred-scroll) (setq term-saved-cursor (list (term-current-row) (term-horizontal-column) term-ansi-current-bg-color term-ansi-current-bold term-ansi-current-color term-ansi-current-invisible term-ansi-current-reverse term-ansi-current-underline term-current-face))) ((eql val 56) (if term-saved-cursor (progn (term-goto (nth 0 term-saved-cursor) (nth 1 term-saved-cursor)) (setq term-ansi-current-bg-color (nth 2 term-saved-cursor) term-ansi-current-bold (nth 3 term-saved-cursor) term-ansi-current-color (nth 4 term-saved-cursor) term-ansi-current-invisible (nth 5 term-saved-cursor) term-ansi-current-reverse (nth 6 term-saved-cursor) term-ansi-current-underline (nth 7 term-saved-cursor) term-current-face (nth 8 term-saved-cursor))))) ((eql val 99) (term-reset-terminal)) ((eql val 65) (term-handle-ansi-terminal-messages (substring str i ctl-end))) (t nil)))) ((memql val '(nil 15 14 0)) nil) (t (let ((x37 val)) (error "No clause matching `%S'" x37))))) (if (eq term-do-line-wrapping (point)) nil (setq term-do-line-wrapping nil)) (if term-pager-old-local-map (progn (if (> (% (current-column) term-width) 0) (setq term-terminal-undecoded-bytes (substring str i)) (if (= 0 i) (setq term-terminal-undecoded-bytes (concat "\15" (substring str i))) (setq term-terminal-undecoded-bytes (substring str (1- i))) (aset term-terminal-undecoded-bytes 0 13)) (goto-char (point-max))) (make-local-variable 'term-pager-old-filter) (setq term-pager-old-filter (process-filter proc)) (set-process-filter proc term-pager-filter) (setq i str-length)) (setq i ctl-end))))) (if (>= (term-current-row) term-height) (progn (term-handle-deferred-scroll))) (set-marker (process-mark proc) (point)) (if (stringp decoded-substring) (progn (term-watch-for-password-prompt decoded-substring))) (if save-point (progn (goto-char save-point) (set-marker save-point nil))) (if (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (progn (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil))) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (if (eq (window-buffer win) (process-buffer proc)) (progn (let ((scroll term-scroll-to-bottom-on-output)) (select-window win) (if (or (= (point) save-marker) (eq scroll t) (eq scroll 'all) (and (eq selected win) (or (eq scroll 'this) (not save-point))) (and (eq scroll 'others) (not (eq selected win)))) (progn (goto-char term-home-marker) (recenter 0) (goto-char (process-mark proc)) (if (not (pos-visible-in-window-p (point) win)) (recenter -1)))) (if (and term-scroll-show-maximum-output (>= (point) (process-mark proc))) (progn (save-excursion (goto-char (point-max)) (recenter -1))))))) (not (eq win last-win)))) (if (> term-buffer-maximum-size 0) (progn (save-excursion (goto-char (process-mark (get-buffer-process (current-buffer)))) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point))))) (set-marker save-marker nil)) (internal--after-save-selected-window save-selected-window--state)) (save-current-buffer (unwind-protect (progn (if (marker-buffer term-pending-delete-marker) (progn (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil))) (if (/= (point) (process-mark proc)) (progn (setq save-point (point-marker)))) (setq term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (if (and (> (point-max) (process-mark proc)) (not (eq (current-local-map) term-raw-map))) (progn (narrow-to-region (point-min) (process-mark proc)))) (if term-log-buffer (progn (princ str term-log-buffer))) (if term-terminal-undecoded-bytes (progn (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil))) (while (< i str-length) (setq funny (string-match term-control-seq-regexp str i)) (let ((ctl-params (and funny (match-string 1 str))) (ctl-params-end (and funny (match-end 1))) (ctl-end (if funny (match-end 0) (setq funny (string-match term-control-seq-prefix-regexp str i)) (if funny (setq term-terminal-undecoded-bytes (substring str funny)) (setq funny str-length)) (1+ str-length)))) (if (> funny i) (progn (if term-do-line-wrapping (progn (term-down 1 t) (term-move-to-column 0) (setq term-do-line-wrapping nil))) (setq decoded-substring (decode-coding-string (substring str i funny) locale-coding-system t)) (if (= funny str-length) (progn (let ((partial 0) (count (length decoded-substring))) (while (eq (char-charset (aref decoded-substring (- count 1 partial))) 'eight-bit) (setq partial (1+ partial))) (if (> partial 0) (progn (setq term-terminal-undecoded-bytes (substring decoded-substring (- partial))) (setq decoded-substring (substring decoded-substring 0 (- partial))) (setq str-length (- str-length partial)) (setq funny (- funny partial))))))) (let ((old-column (term-horizontal-column)) (old-point (point)) columns) (if term-suppress-hard-newline nil (while (> (+ (length decoded-substring) old-column) term-width) (insert (substring decoded-substring 0 (- term-width old-column))) (delete-region (point) (line-end-position)) (term-down 1 t) (term-move-columns (- (term-current-column))) (add-text-properties (1- (point)) (point) '(term-line-wrap t rear-nonsticky t)) (setq decoded-substring (substring decoded-substring (- term-width old-column))) (setq old-column 0))) (insert decoded-substring) (setq term-current-column (current-column) columns (- term-current-column old-column)) (if (not (or (eobp) term-insert-mode)) (progn (let ((pos (point))) (term-move-columns columns) (delete-region pos (point)) (setq term-current-column nil)))) (if term-insert-mode (progn (let ((pos (point))) (end-of-line) (if (> (current-column) term-width) (progn (delete-region (- (point) (- (current-column) term-width)) (point)))) (goto-char pos)))) (put-text-property old-point (point) 'font-lock-face term-current-face)) (if (eq (term-current-column) term-width) (progn (term-move-columns -1) (setq term-do-line-wrapping (point)))) (setq term-current-column nil) (setq i funny))) (let* ((val (and (<= ctl-end str-length) (aref str i)))) (cond ((eql val 9) (let ((col (term-current-column))) (term-move-to-column (min (1- term-width) (+ col 8 (- (mod col 8))))))) ((eql val 13) (funcall term-vertical-motion 0) (setq term-current-column term-start-line-column)) ((eql val 10) (if (and term-kill-echo-list (term-check-kill-echo-list)) nil (term-down 1 t))) ((eql val 8) (term-move-columns -1)) ((eql val 7) (beep t)) ((eql val 26) (funcall term-command-function (decode-coding-string (substring str (1+ i) (- ctl-end (if (eq (aref str (- ctl-end 2)) 13) 2 1))) locale-coding-system t))) ((eql val 27) (let* ((val (aref str (1+ i)))) (cond ((eql val 91) (if (eq ctl-params-end (1- ctl-end)) (progn (term-handle-ansi-escape proc (mapcar #'string-to-number (split-string ctl-params ";")) (aref str (1- ctl-end)))))) ((eql val 68) (term-handle-deferred-scroll) (term-down 1 t)) ((eql val 77) (if (or (< (term-current-row) term-scroll-start) (>= (1- (term-current-row)) term-scroll-start)) (term-down -1) (term-down -1 t))) ((eql val 55) (term-handle-deferred-scroll) (setq term-saved-cursor (list (term-current-row) (term-horizontal-column) term-ansi-current-bg-color term-ansi-current-bold term-ansi-current-color term-ansi-current-invisible term-ansi-current-reverse term-ansi-current-underline term-current-face))) ((eql val 56) (if term-saved-cursor (progn (term-goto (nth 0 term-saved-cursor) (nth 1 term-saved-cursor)) (setq term-ansi-current-bg-color (nth 2 term-saved-cursor) term-ansi-current-bold (nth 3 term-saved-cursor) term-ansi-current-color (nth 4 term-saved-cursor) term-ansi-current-invisible (nth 5 term-saved-cursor) term-ansi-current-reverse (nth 6 term-saved-cursor) term-ansi-current-underline (nth 7 term-saved-cursor) term-current-face (nth 8 term-saved-cursor))))) ((eql val 99) (term-reset-terminal)) ((eql val 65) (term-handle-ansi-terminal-messages (substring str i ctl-end))) (t nil)))) ((memql val '(nil 15 14 0)) nil) (t (let ((x37 val)) (error "No clause matching `%S'" x37))))) (if (eq term-do-line-wrapping (point)) nil (setq term-do-line-wrapping nil)) (if term-pager-old-local-map (progn (if (> (% (current-column) term-width) 0) (setq term-terminal-undecoded-bytes (substring str i)) (if (= 0 i) (setq term-terminal-undecoded-bytes (concat "\15" (substring str i))) (setq term-terminal-undecoded-bytes (substring str (1- i))) (aset term-terminal-undecoded-bytes 0 13)) (goto-char (point-max))) (make-local-variable 'term-pager-old-filter) (setq term-pager-old-filter (process-filter proc)) (set-process-filter proc term-pager-filter) (setq i str-length)) (setq i ctl-end))))) (if (>= (term-current-row) term-height) (progn (term-handle-deferred-scroll))) (set-marker (process-mark proc) (point)) (if (stringp decoded-substring) (progn (term-watch-for-password-prompt decoded-substring))) (if save-point (progn (goto-char save-point) (set-marker save-point nil))) (if (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (progn (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil))) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (if (eq (window-buffer win) (process-buffer proc)) (progn (let ((scroll term-scroll-to-bottom-on-output)) (select-window win) (if (or (= (point) save-marker) (eq scroll t) (eq scroll 'all) (and (eq selected win) (or (eq scroll 'this) (not save-point))) (and (eq scroll 'others) (not (eq selected win)))) (progn (goto-char term-home-marker) (recenter 0) (goto-char (process-mark proc)) (if (not (pos-visible-in-window-p (point) win)) (recenter -1)))) (if (and term-scroll-show-maximum-output (>= (point) (process-mark proc))) (progn (save-excursion (goto-char (point-max)) (recenter -1))))))) (not (eq win last-win)))) (if (> term-buffer-maximum-size 0) (progn (save-excursion (goto-char (process-mark (get-buffer-process (current-buffer)))) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point))))) (set-marker save-marker nil)) (internal--after-save-selected-window save-selected-window--state))) (let ((save-selected-window--state (internal--before-save-selected-window))) (save-current-buffer (unwind-protect (progn (if (marker-buffer term-pending-delete-marker) (progn (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil))) (if (/= (point) (process-mark proc)) (progn (setq save-point (point-marker)))) (setq term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (if (and (> (point-max) (process-mark proc)) (not (eq (current-local-map) term-raw-map))) (progn (narrow-to-region (point-min) (process-mark proc)))) (if term-log-buffer (progn (princ str term-log-buffer))) (if term-terminal-undecoded-bytes (progn (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil))) (while (< i str-length) (setq funny (string-match term-control-seq-regexp str i)) (let ((ctl-params (and funny (match-string 1 str))) (ctl-params-end (and funny (match-end 1))) (ctl-end (if funny (match-end 0) (setq funny (string-match term-control-seq-prefix-regexp str i)) (if funny (setq term-terminal-undecoded-bytes (substring str funny)) (setq funny str-length)) (1+ str-length)))) (if (> funny i) (progn (if term-do-line-wrapping (progn (term-down 1 t) (term-move-to-column 0) (setq term-do-line-wrapping nil))) (setq decoded-substring (decode-coding-string (substring str i funny) locale-coding-system t)) (if (= funny str-length) (progn (let ((partial 0) (count (length decoded-substring))) (while (eq (char-charset (aref decoded-substring (- count 1 partial))) 'eight-bit) (setq partial (1+ partial))) (if (> partial 0) (progn (setq term-terminal-undecoded-bytes (substring decoded-substring (- partial))) (setq decoded-substring (substring decoded-substring 0 (- partial))) (setq str-length (- str-length partial)) (setq funny (- funny partial))))))) (let ((old-column (term-horizontal-column)) (old-point (point)) columns) (if term-suppress-hard-newline nil (while (> (+ (length decoded-substring) old-column) term-width) (insert (substring decoded-substring 0 (- term-width old-column))) (delete-region (point) (line-end-position)) (term-down 1 t) (term-move-columns (- (term-current-column))) (add-text-properties (1- (point)) (point) '(term-line-wrap t rear-nonsticky t)) (setq decoded-substring (substring decoded-substring (- term-width old-column))) (setq old-column 0))) (insert decoded-substring) (setq term-current-column (current-column) columns (- term-current-column old-column)) (if (not (or (eobp) term-insert-mode)) (progn (let ((pos (point))) (term-move-columns columns) (delete-region pos (point)) (setq term-current-column nil)))) (if term-insert-mode (progn (let ((pos (point))) (end-of-line) (if (> (current-column) term-width) (progn (delete-region (- (point) (- (current-column) term-width)) (point)))) (goto-char pos)))) (put-text-property old-point (point) 'font-lock-face term-current-face)) (if (eq (term-current-column) term-width) (progn (term-move-columns -1) (setq term-do-line-wrapping (point)))) (setq term-current-column nil) (setq i funny))) (let* ((val (and (<= ctl-end str-length) (aref str i)))) (cond ((eql val 9) (let ((col (term-current-column))) (term-move-to-column (min (1- term-width) (+ col 8 (- (mod col 8))))))) ((eql val 13) (funcall term-vertical-motion 0) (setq term-current-column term-start-line-column)) ((eql val 10) (if (and term-kill-echo-list (term-check-kill-echo-list)) nil (term-down 1 t))) ((eql val 8) (term-move-columns -1)) ((eql val 7) (beep t)) ((eql val 26) (funcall term-command-function (decode-coding-string (substring str (1+ i) (- ctl-end (if (eq (aref str (- ctl-end 2)) 13) 2 1))) locale-coding-system t))) ((eql val 27) (let* ((val (aref str (1+ i)))) (cond ((eql val 91) (if (eq ctl-params-end (1- ctl-end)) (progn (term-handle-ansi-escape proc (mapcar #'string-to-number (split-string ctl-params ";")) (aref str (1- ctl-end)))))) ((eql val 68) (term-handle-deferred-scroll) (term-down 1 t)) ((eql val 77) (if (or (< (term-current-row) term-scroll-start) (>= (1- (term-current-row)) term-scroll-start)) (term-down -1) (term-down -1 t))) ((eql val 55) (term-handle-deferred-scroll) (setq term-saved-cursor (list (term-current-row) (term-horizontal-column) term-ansi-current-bg-color term-ansi-current-bold term-ansi-current-color term-ansi-current-invisible term-ansi-current-reverse term-ansi-current-underline term-current-face))) ((eql val 56) (if term-saved-cursor (progn (term-goto (nth 0 term-saved-cursor) (nth 1 term-saved-cursor)) (setq term-ansi-current-bg-color (nth 2 term-saved-cursor) term-ansi-current-bold (nth 3 term-saved-cursor) term-ansi-current-color (nth 4 term-saved-cursor) term-ansi-current-invisible (nth 5 term-saved-cursor) term-ansi-current-reverse (nth 6 term-saved-cursor) term-ansi-current-underline (nth 7 term-saved-cursor) term-current-face (nth 8 term-saved-cursor))))) ((eql val 99) (term-reset-terminal)) ((eql val 65) (term-handle-ansi-terminal-messages (substring str i ctl-end))) (t nil)))) ((memql val '(nil 15 14 0)) nil) (t (let ((x37 val)) (error "No clause matching `%S'" x37))))) (if (eq term-do-line-wrapping (point)) nil (setq term-do-line-wrapping nil)) (if term-pager-old-local-map (progn (if (> (% (current-column) term-width) 0) (setq term-terminal-undecoded-bytes (substring str i)) (if (= 0 i) (setq term-terminal-undecoded-bytes (concat "\15" (substring str i))) (setq term-terminal-undecoded-bytes (substring str (1- i))) (aset term-terminal-undecoded-bytes 0 13)) (goto-char (point-max))) (make-local-variable 'term-pager-old-filter) (setq term-pager-old-filter (process-filter proc)) (set-process-filter proc term-pager-filter) (setq i str-length)) (setq i ctl-end))))) (if (>= (term-current-row) term-height) (progn (term-handle-deferred-scroll))) (set-marker (process-mark proc) (point)) (if (stringp decoded-substring) (progn (term-watch-for-password-prompt decoded-substring))) (if save-point (progn (goto-char save-point) (set-marker save-point nil))) (if (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (progn (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil))) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (if (eq (window-buffer win) (process-buffer proc)) (progn (let ((scroll term-scroll-to-bottom-on-output)) (select-window win) (if (or (= (point) save-marker) (eq scroll t) (eq scroll 'all) (and (eq selected win) (or (eq scroll 'this) (not save-point))) (and (eq scroll 'others) (not (eq selected win)))) (progn (goto-char term-home-marker) (recenter 0) (goto-char (process-mark proc)) (if (not (pos-visible-in-window-p (point) win)) (recenter -1)))) (if (and term-scroll-show-maximum-output (>= (point) (process-mark proc))) (progn (save-excursion (goto-char (point-max)) (recenter -1))))))) (not (eq win last-win)))) (if (> term-buffer-maximum-size 0) (progn (save-excursion (goto-char (process-mark (get-buffer-process (current-buffer)))) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point))))) (set-marker save-marker nil)) (internal--after-save-selected-window save-selected-window--state)))) (let* ((i 0) funny decoded-substring save-point save-marker win (inhibit-read-only t) (buffer-undo-list t) (selected (selected-window)) last-win (str-length (length str))) (let ((save-selected-window--state (internal--before-save-selected-window))) (save-current-buffer (unwind-protect (progn (if (marker-buffer term-pending-delete-marker) (progn (delete-region term-pending-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker nil))) (if (/= (point) (process-mark proc)) (progn (setq save-point (point-marker)))) (setq term-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (if (and (> (point-max) (process-mark proc)) (not (eq (current-local-map) term-raw-map))) (progn (narrow-to-region (point-min) (process-mark proc)))) (if term-log-buffer (progn (princ str term-log-buffer))) (if term-terminal-undecoded-bytes (progn (setq str (concat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-bytes nil))) (while (< i str-length) (setq funny (string-match term-control-seq-regexp str i)) (let ((ctl-params (and funny (match-string 1 str))) (ctl-params-end (and funny (match-end 1))) (ctl-end (if funny (match-end 0) (setq funny (string-match term-control-seq-prefix-regexp str i)) (if funny (setq term-terminal-undecoded-bytes (substring str funny)) (setq funny str-length)) (1+ str-length)))) (if (> funny i) (progn (if term-do-line-wrapping (progn (term-down 1 t) (term-move-to-column 0) (setq term-do-line-wrapping nil))) (setq decoded-substring (decode-coding-string (substring str i funny) locale-coding-system t)) (if (= funny str-length) (progn (let ((partial 0) (count (length decoded-substring))) (while (eq (char-charset (aref decoded-substring (- count 1 partial))) 'eight-bit) (setq partial (1+ partial))) (if (> partial 0) (progn (setq term-terminal-undecoded-bytes (substring decoded-substring (- partial))) (setq decoded-substring (substring decoded-substring 0 (- partial))) (setq str-length (- str-length partial)) (setq funny (- funny partial))))))) (let ((old-column (term-horizontal-column)) (old-point (point)) columns) (if term-suppress-hard-newline nil (while (> (+ (length decoded-substring) old-column) term-width) (insert (substring decoded-substring 0 (- term-width old-column))) (delete-region (point) (line-end-position)) (term-down 1 t) (term-move-columns (- (term-current-column))) (add-text-properties (1- (point)) (point) '(term-line-wrap t rear-nonsticky t)) (setq decoded-substring (substring decoded-substring (- term-width old-column))) (setq old-column 0))) (insert decoded-substring) (setq term-current-column (current-column) columns (- term-current-column old-column)) (if (not (or (eobp) term-insert-mode)) (progn (let ((pos (point))) (term-move-columns columns) (delete-region pos (point)) (setq term-current-column nil)))) (if term-insert-mode (progn (let ((pos (point))) (end-of-line) (if (> (current-column) term-width) (progn (delete-region (- (point) (- (current-column) term-width)) (point)))) (goto-char pos)))) (put-text-property old-point (point) 'font-lock-face term-current-face)) (if (eq (term-current-column) term-width) (progn (term-move-columns -1) (setq term-do-line-wrapping (point)))) (setq term-current-column nil) (setq i funny))) (let* ((val (and (<= ctl-end str-length) (aref str i)))) (cond ((eql val 9) (let ((col (term-current-column))) (term-move-to-column (min (1- term-width) (+ col 8 (- (mod col 8))))))) ((eql val 13) (funcall term-vertical-motion 0) (setq term-current-column term-start-line-column)) ((eql val 10) (if (and term-kill-echo-list (term-check-kill-echo-list)) nil (term-down 1 t))) ((eql val 8) (term-move-columns -1)) ((eql val 7) (beep t)) ((eql val 26) (funcall term-command-function (decode-coding-string (substring str (1+ i) (- ctl-end (if (eq (aref str (- ctl-end 2)) 13) 2 1))) locale-coding-system t))) ((eql val 27) (let* ((val (aref str (1+ i)))) (cond ((eql val 91) (if (eq ctl-params-end (1- ctl-end)) (progn (term-handle-ansi-escape proc (mapcar #'string-to-number (split-string ctl-params ";")) (aref str (1- ctl-end)))))) ((eql val 68) (term-handle-deferred-scroll) (term-down 1 t)) ((eql val 77) (if (or (< (term-current-row) term-scroll-start) (>= (1- (term-current-row)) term-scroll-start)) (term-down -1) (term-down -1 t))) ((eql val 55) (term-handle-deferred-scroll) (setq term-saved-cursor (list (term-current-row) (term-horizontal-column) term-ansi-current-bg-color term-ansi-current-bold term-ansi-current-color term-ansi-current-invisible term-ansi-current-reverse term-ansi-current-underline term-current-face))) ((eql val 56) (if term-saved-cursor (progn (term-goto (nth 0 term-saved-cursor) (nth 1 term-saved-cursor)) (setq term-ansi-current-bg-color (nth 2 term-saved-cursor) term-ansi-current-bold (nth 3 term-saved-cursor) term-ansi-current-color (nth 4 term-saved-cursor) term-ansi-current-invisible (nth 5 term-saved-cursor) term-ansi-current-reverse (nth 6 term-saved-cursor) term-ansi-current-underline (nth 7 term-saved-cursor) term-current-face (nth 8 term-saved-cursor))))) ((eql val 99) (term-reset-terminal)) ((eql val 65) (term-handle-ansi-terminal-messages (substring str i ctl-end))) (t nil)))) ((memql val '(nil 15 14 0)) nil) (t (let ((x37 val)) (error "No clause matching `%S'" x37))))) (if (eq term-do-line-wrapping (point)) nil (setq term-do-line-wrapping nil)) (if term-pager-old-local-map (progn (if (> (% (current-column) term-width) 0) (setq term-terminal-undecoded-bytes (substring str i)) (if (= 0 i) (setq term-terminal-undecoded-bytes (concat "\15" (substring str i))) (setq term-terminal-undecoded-bytes (substring str (1- i))) (aset term-terminal-undecoded-bytes 0 13)) (goto-char (point-max))) (make-local-variable 'term-pager-old-filter) (setq term-pager-old-filter (process-filter proc)) (set-process-filter proc term-pager-filter) (setq i str-length)) (setq i ctl-end))))) (if (>= (term-current-row) term-height) (progn (term-handle-deferred-scroll))) (set-marker (process-mark proc) (point)) (if (stringp decoded-substring) (progn (term-watch-for-password-prompt decoded-substring))) (if save-point (progn (goto-char save-point) (set-marker save-point nil))) (if (and term-pending-frame (eq (window-buffer selected) (current-buffer))) (progn (term-display-line (car term-pending-frame) (cdr term-pending-frame)) (setq term-pending-frame nil))) (setq win selected) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (while (progn (setq win (next-window win nil t)) (if (eq (window-buffer win) (process-buffer proc)) (progn (let ((scroll term-scroll-to-bottom-on-output)) (select-window win) (if (or (= (point) save-marker) (eq scroll t) (eq scroll 'all) (and (eq selected win) (or (eq scroll 'this) (not save-point))) (and (eq scroll 'others) (not (eq selected win)))) (progn (goto-char term-home-marker) (recenter 0) (goto-char (process-mark proc)) (if (not (pos-visible-in-window-p (point) win)) (recenter -1)))) (if (and term-scroll-show-maximum-output (>= (point) (process-mark proc))) (progn (save-excursion (goto-char (point-max)) (recenter -1))))))) (not (eq win last-win)))) (if (> term-buffer-maximum-size 0) (progn (save-excursion (goto-char (process-mark (get-buffer-process (current-buffer)))) (forward-line (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-min) (point))))) (set-marker save-marker nil)) (internal--after-save-selected-window save-selected-window--state))))) (save-current-buffer (set-buffer (process-buffer proc)) (let* ((i 0) funny decoded-substring save-point save-marker win (inhibit-read-only t) (buffer-undo-list t) (selected (selected-window)) last-win (str-length (length str))) (let ((save-selected-window--state (internal--before-save-selected-window))) (save-current-buffer (unwind-protect (progn (if (marker-buffer term-pending-delete-marker) (progn ... ...)) (if (/= ... ...) (progn ...)) (setq term-vertical-motion (if ... ... ...)) (setq save-marker (copy-marker ...)) (goto-char (process-mark proc)) (save-restriction (if ... ...) (if term-log-buffer ...) (if term-terminal-undecoded-bytes ...) (while ... ... ...)) (if (>= ... term-height) (progn ...)) (set-marker (process-mark proc) (point)) (if (stringp decoded-substring) (progn ...)) (if save-point (progn ... ...)) (if (and term-pending-frame ...) (progn ... ...)) (setq win selected) (while (window-minibuffer-p win) (setq win ...)) (setq last-win win) (while (progn ... ... ...)) (if (> term-buffer-maximum-size 0) (progn ...)) (set-marker save-marker nil)) (internal--after-save-selected-window save-selected-window--state))))) (if (get-buffer-window (current-buffer)) (progn (redisplay)))) term-emulate-terminal(# "\376\374\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376\364\376")