From: Christopher Howard <christopher@librehacker.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: larsi@gnus.org, 51877@debbugs.gnu.org
Subject: bug#51877: 27.2; term: error in process filter
Date: Thu, 20 Jan 2022 13:01:12 -0900 [thread overview]
Message-ID: <YenbqPJEKwcmnrHy@theoden> (raw)
In-Reply-To: <83lezap459.fsf@gnu.org>
On Thu, Jan 20, 2022 at 10:02:10PM +0200, Eli Zaretskii wrote:
> I don't think this would help. Can you manually modify the function
> term-emulate-terminal to use 'raw-text instead of
> locale-coding-system, and then re-run the scenario in which you get
> these problems?
This seems to generate the same result, except with more elaborate debugger output:
```
Debugger entered--Lisp error: (args-out-of-range "l \3\220\0332Nn\f\217" 0 -48)
substring("l \3\220\0332Nn\f\217" 0 -48)
(insert (substring decoded-substring 0 (- term-width old-column)))
(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))
(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)))
(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)))) (goto-char pos)))) (put-text-property old-point (point) 'font-lock-face term-current-face))
(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) 'raw-text t)) (if (= funny str-length) (progn (let ((partial 0) (count (length decoded-substring))) (while (and (< partial count) (eq (char-charset ...) 'eight-bit)) (setq partial (1+ partial))) (if (> count partial 0) (progn (setq term-terminal-undecoded-bytes (substring decoded-substring ...)) (setq decoded-substring (substring decoded-substring 0 ...)) (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 ... ...))) (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) 'raw-text t)) (if (= funny str-length) (progn (let ((partial 0) (count (length decoded-substring))) (while (and (< partial count) (eq ... ...)) (setq partial (1+ partial))) (if (> count partial 0) (progn (setq term-terminal-undecoded-bytes ...) (setq decoded-substring ...) (setq str-length ...) (setq funny ...)))))) (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 ...)) (term-move-columns columns) (delete-region pos (point)) (setq term-current-column nil)))) (if term-insert-mode (progn (let ((pos ...)) (end-of-line) (if (> ... term-width) (progn ...)) (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) 'raw-text t)) (if (= funny str-length) (progn (let ((partial 0) (count ...)) (while (and ... ...) (setq partial ...)) (if (> count partial 0) (progn ... ... ... ...))))) (let ((old-column (term-horizontal-column)) (old-point (point)) columns) (if term-suppress-hard-newline nil (while (> (+ ... old-column) term-width) (insert (substring decoded-substring 0 ...)) (delete-region (point) (line-end-position)) (term-down 1 t) (term-move-columns (- ...)) (add-text-properties (1- ...) (point) '...) (setq decoded-substring (substring decoded-substring ...)) (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 (...) (term-move-columns columns) (delete-region pos ...) (setq term-current-column nil)))) (if term-insert-mode (progn (let (...) (end-of-line) (if ... ...) (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 ...))))) ((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 ...)) locale-coding-system t))) ((eql val 27) (let* ((val (aref str ...))) (cond ((eql val 91) (if ... ...)) ((eql val 68) (term-handle-deferred-scroll) (term-down 1 t)) ((eql val 77) (if ... ... ...)) ((eql val 55) (term-handle-deferred-scroll) (setq term-saved-cursor ...)) ((eql val 56) (if term-saved-cursor ...)) ((eql val 99) (term-reset-terminal)) ((eql val 65) (term-handle-ansi-terminal-messages ...)) (t nil)))) ((memql val '(nil 15 14 0)) nil) (t (let ((x0 val)) (error "No clause matching `%S'" x0))))) (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) 'raw-text t)) (if (= funny str-length) (progn (let (... ...) (while ... ...) (if ... ...)))) (let ((old-column (term-horizontal-column)) (old-point (point)) columns) (if term-suppress-hard-newline nil (while (> ... term-width) (insert ...) (delete-region ... ...) (term-down 1 t) (term-move-columns ...) (add-text-properties ... ... ...) (setq decoded-substring ...) (setq old-column 0))) (insert decoded-substring) (setq term-current-column (current-column) columns (- term-current-column old-column)) (if (not (or ... term-insert-mode)) (progn (let ... ... ... ...))) (if term-insert-mode (progn (let ... ... ... ...))) (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-move-to-column (min ... ...)))) ((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 ... ...) locale-coding-system t))) ((eql val 27) (let* ((val ...)) (cond (... ...) (... ... ...) (... ...) (... ... ...) (... ...) (... ...) (... ...) (t nil)))) ((memql val '(nil 15 14 0)) nil) (t (let ((x0 val)) (error "No clause matching `%S'" x0))))) (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" ...)) (setq term-terminal-undecoded-bytes (substring str ...)) (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 ...) (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) 'raw-text t)) (if (= funny str-length) (progn (let ... ... ...))) (let ((old-column ...) (old-point ...) columns) (if term-suppress-hard-newline nil (while ... ... ... ... ... ... ... ...)) (insert decoded-substring) (setq term-current-column (current-column) columns (- term-current-column old-column)) (if (not ...) (progn ...)) (if term-insert-mode (progn ...)) (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 ...))) (setq term-current-column nil) (setq i funny))) (let* ((val (and (<= ctl-end str-length) (aref str i)))) (cond ((eql val 9) (let (...) (term-move-to-column ...))) ((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 ...) 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 ... locale-coding-system t))) ((eql val 27) (let* (...) (cond ... ... ... ... ... ... ... ...))) ((memql val '...) nil) (t (let (...) (error "No clause matching `%S'" x0))))) (if (eq term-do-line-wrapping (point)) nil (setq term-do-line-wrapping nil)) (if term-pager-old-local-map (progn (if (> (% ... term-width) 0) (setq term-terminal-undecoded-bytes (substring str i)) (if (= 0 i) (setq term-terminal-undecoded-bytes ...) (setq term-terminal-undecoded-bytes ...) (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 ...) (if funny ... ...) (1+ str-length)))) (if (> funny i) (progn (if term-do-line-wrapping (progn ... ... ...)) (setq decoded-substring (decode-coding-string ... ... t)) (if (= funny str-length) (progn ...)) (let (... ... columns) (if term-suppress-hard-newline nil ...) (insert decoded-substring) (setq term-current-column ... columns ...) (if ... ...) (if term-insert-mode ...) (put-text-property old-point ... ... term-current-face)) (if (eq ... term-width) (progn ... ...)) (setq term-current-column nil) (setq i funny))) (let* ((val (and ... ...))) (cond ((eql val 9) (let ... ...)) ((eql val 13) (funcall term-vertical-motion 0) (setq term-current-column term-start-line-column)) ((eql val 10) (if ... nil ...)) ((eql val 8) (term-move-columns -1)) ((eql val 7) (beep t)) ((eql val 26) (funcall term-command-function ...)) ((eql val 27) (let* ... ...)) ((memql val ...) nil) (t (let ... ...)))) (if (eq term-do-line-wrapping (point)) nil (setq term-do-line-wrapping nil)) (if term-pager-old-local-map (progn (if (> ... 0) (setq term-terminal-undecoded-bytes ...) (if ... ... ... ...) (goto-char ...)) (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 ... ... ... ... ...) (progn ... ... ... ...)) (if (and term-scroll-show-maximum-output ...) (progn ...))))) (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 ...)) (ctl-params-end (and funny ...)) (ctl-end (if funny ... ... ... ...))) (if (> funny i) (progn (if term-do-line-wrapping ...) (setq decoded-substring ...) (if ... ...) (let ... ... ... ... ... ... ...) (if ... ...) (setq term-current-column nil) (setq i funny))) (let* ((val ...)) (cond (... ...) (... ... ...) (... ...) (... ...) (... ...) (... ...) (... ...) (... nil) (t ...))) (if (eq term-do-line-wrapping (point)) nil (setq term-do-line-wrapping nil)) (if term-pager-old-local-map (progn (if ... ... ... ...) (make-local-variable ...) (setq term-pager-old-filter ...) (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 (...) (select-window win) (if ... ...) (if ... ...)))) (not (eq win last-win)))) (if (> term-buffer-maximum-size 0) (progn (save-excursion (goto-char (process-mark (get-buffer-process ...))) (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 ... 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 ...) (ctl-params-end ...) (ctl-end ...)) (if (> funny i) (progn ... ... ... ... ... ... ...)) (let* (...) (cond ... ... ... ... ... ... ... ... ...)) (if (eq term-do-line-wrapping ...) nil (setq term-do-line-wrapping nil)) (if term-pager-old-local-map (progn ... ... ... ... ...) (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 ... ... ... ...))) (not (eq win last-win)))) (if (> term-buffer-maximum-size 0) (progn (save-excursion (goto-char (process-mark ...)) (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 (> ... ...) (not ...)) (progn (narrow-to-region ... ...))) (if term-log-buffer (progn (princ str term-log-buffer))) (if term-terminal-undecoded-bytes (progn (setq str ...) (setq str-length ...) (setq term-terminal-undecoded-bytes nil))) (while (< i str-length) (setq funny (string-match term-control-seq-regexp str i)) (let (... ... ...) (if ... ...) (let* ... ...) (if ... nil ...) (if term-pager-old-local-map ... ...)))) (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 ... ...) (progn ...)) (not (eq win last-win)))) (if (> term-buffer-maximum-size 0) (progn (save-excursion (goto-char ...) (forward-line ...) (beginning-of-line) (delete-region ... ...)))) (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 ...) (set-marker term-pending-delete-marker nil))) (if (/= (point) (process-mark proc)) (progn (setq save-point ...))) (setq term-vertical-motion (if (eq ... ...) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-restriction (if (and ... ...) (progn ...)) (if term-log-buffer (progn ...)) (if term-terminal-undecoded-bytes (progn ... ... ...)) (while (< i str-length) (setq funny ...) (let ... ... ... ... ...))) (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 ... ...)) (progn (term-display-line ... ...) (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 ...) (if ... ...) (not ...))) (if (> term-buffer-maximum-size 0) (progn (save-excursion ... ... ... ...))) (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(#<process terminal> "l\0$\334\236\217\2\214#\2\342n\4\4\f\204\4l\344\fc|\216\203\3\344\23\333r\223B\204\fc\204\373oN\276\0lNn\234\343\354\fc\34p...")
```
next prev parent reply other threads:[~2022-01-20 22:01 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-15 19:10 bug#51877: 27.2; term: error in process filter Christopher Howard
2021-11-15 19:14 ` Christopher Howard
2021-11-15 19:19 ` Eli Zaretskii
2021-11-15 19:33 ` Christopher Howard
2021-11-15 22:36 ` Christopher Howard
2021-11-16 3:23 ` Eli Zaretskii
2022-01-15 13:12 ` Lars Ingebrigtsen
2022-01-16 6:14 ` Christopher Howard
2022-01-17 19:30 ` Christopher Howard
2022-01-20 9:39 ` Lars Ingebrigtsen
2022-01-20 17:39 ` Christopher Howard
2022-01-20 17:46 ` Lars Ingebrigtsen
2022-01-20 17:54 ` Eli Zaretskii
2022-01-20 19:06 ` Christopher Howard
2022-01-20 20:02 ` Eli Zaretskii
2022-01-20 22:01 ` Christopher Howard [this message]
2022-01-21 8:04 ` Eli Zaretskii
2022-02-19 12:58 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YenbqPJEKwcmnrHy@theoden \
--to=christopher@librehacker.com \
--cc=51877@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=larsi@gnus.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.