From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 31 15:57:45 2017 Received: (at submit) by debbugs.gnu.org; 31 Dec 2017 20:57:45 +0000 Received: from localhost ([127.0.0.1]:59056 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eVkfx-0003Im-Iz for submit@debbugs.gnu.org; Sun, 31 Dec 2017 15:57:45 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60369) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eVkfv-0003Ia-Ua for submit@debbugs.gnu.org; Sun, 31 Dec 2017 15:57:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eVkfp-0003nX-Er for submit@debbugs.gnu.org; Sun, 31 Dec 2017 15:57:38 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:56280) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eVkfp-0003nL-BI for submit@debbugs.gnu.org; Sun, 31 Dec 2017 15:57:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51309) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eVkfl-0001rN-Ou for bug-gnu-emacs@gnu.org; Sun, 31 Dec 2017 15:57:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eVkfi-0003i9-Jd for bug-gnu-emacs@gnu.org; Sun, 31 Dec 2017 15:57:33 -0500 Received: from aibo.runbox.com ([91.220.196.211]:35552) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eVkfi-0003gM-97 for bug-gnu-emacs@gnu.org; Sun, 31 Dec 2017 15:57:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; s=rbselector1; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From; bh=Phbo2I6zisXKcwL8QiPLoIKmSVLflIgwSVuSi2TKmrc=; b=SxOBd/vxJdC9o1wxF+gPAn2up sB0FFld0MPwHpao5M7/Sr4VvTUu/lZrTPLx5lgON6X3/e92PXFSIDsLWzSjNZTWOg0BXmqUrd2QtL 27hiVrjZU3D1gTgF4/fseRh7bP9RE9uvniZKPE1JqzQGgPXno9aGJAGcO5Dd+6kTni2ioK4VNEHaZ j6ZlfYLFNq/z1MTTenj664e2WayOoMs5DsJYG1TW7m3aD+aF3Ed+RjGhVZbzCdQhC51ZGOdVnkT0e PVD0bCMfjoQEtdbZbOPpEH8Nqb0S36aEww+SF8wRi8VTz9cA9hWACmmqvzfxvOzVL6+0Xyjnu4B12 llGM1FWeA==; Received: from [10.9.9.210] (helo=mailfront10.runbox.com) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1eVkfg-0005Jg-C0 for bug-gnu-emacs@gnu.org; Sun, 31 Dec 2017 21:57:28 +0100 Received: from c-24-22-244-161.hsd1.wa.comcast.net ([24.22.244.161] helo=chinook) by mailfront10.runbox.com with esmtpsa (uid:179284 ) (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) id 1eVkfZ-0007DD-RE for bug-gnu-emacs@gnu.org; Sun, 31 Dec 2017 21:57:22 +0100 From: Gemini Lasswell To: bug-gnu-emacs@gnu.org Subject: 26.0.90; serial-term error in process filter Date: Sun, 31 Dec 2017 12:57:19 -0800 Message-ID: <87y3liwr80.fsf@runbox.com> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) When a serial-term buffer is connected to a device with bad wiring or hardware problems, it spams the minibuffer with messages like this: error in process filter: Args out of range: "\361", -1 [2 times] error in process filter: Args out of range: "\377\375", -1 [2 times] error in process filter: Args out of range: "\370\340\374\374", -1 [2 times] error in process filter: Args out of range: "\376\340\360\370", -1 [2 times] error in process filter: Args out of range: "\377\377\374\376\371\376\301\377", -1 [2 times] error in process filter: Args out of range: "\376", -1 [2 times] Emacs 25.3 is silent under the same conditions. I'm using an FTDI USB to serial converter and a Raspberry pi. I discovered the bug after I had wired things up with a flaky breadboard, but it's quick to reproduce by disconnecting ground. With emacs -Q: Connect USB from your Emacs machine to the FTDI device. Connect GND, TX and RX from the FTDI to the Raspberry Pi. Turn on the Pi. M-x serial-term RET /dev/your-device-name-here RET 115200 RET Now disconnect GND. Result: The serial-term buffer starts to fill with gibberish, which is expected and also happens in 25.3, and the process filter errors start showing up at irregular intervals. In GNU Emacs 26.0.90 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.21) of 2017-12-31 built on chinook Repository revision: 312c5655669a882186884626f0cf361de70e679d Windowing system distributor 'The X.Org Foundation', version 11.0.11905000 Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Configured using: 'configure --prefix=/home/gem/src/emacs/emacs-26/bin --with-modules --with-x-toolkit=gtk3 --with-xft --config-cache' Configured features: XPM JPEG TIFF GIF PNG RSVG SOUND DBUS GSETTINGS NOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 MODULES Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort map mail-extr emacsbug message rmc puny seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib dired dired-loaddefs format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils elec-pair time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 95859 7544) (symbols 48 20453 1) (miscs 40 44 104) (strings 32 28532 1259) (string-bytes 1 795727) (vectors 16 14820) (vector-slots 8 502732 10570) (floats 8 49 68) (intervals 56 205 0) (buffers 992 11)) From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 14 13:52:56 2019 Received: (at 29918) by debbugs.gnu.org; 14 Jul 2019 17:52:56 +0000 Received: from localhost ([127.0.0.1]:45849 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmigC-0004Nd-Ab for submit@debbugs.gnu.org; Sun, 14 Jul 2019 13:52:56 -0400 Received: from quimby.gnus.org ([80.91.231.51]:55984) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmigA-0004NT-L3 for 29918@debbugs.gnu.org; Sun, 14 Jul 2019 13:52:55 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hmig6-0004W3-V8; Sun, 14 Jul 2019 19:52:53 +0200 From: Lars Ingebrigtsen To: Gemini Lasswell Subject: Re: bug#29918: 26.0.90; serial-term error in process filter References: <87y3liwr80.fsf@runbox.com> Date: Sun, 14 Jul 2019 19:52:50 +0200 In-Reply-To: <87y3liwr80.fsf@runbox.com> (Gemini Lasswell's message of "Sun, 31 Dec 2017 12:57:19 -0800") Message-ID: <87d0icy03x.fsf@mouse.gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Gemini Lasswell writes: > When a serial-term buffer is connected to a device with bad wiring or > hardware problems, it spams the minibuffer with messages like this: > > error in process filter: Args out of range: "\361", -1 [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 29918 Cc: 29918@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Gemini Lasswell writes: > When a serial-term buffer is connected to a device with bad wiring or > hardware problems, it spams the minibuffer with messages like this: > > error in process filter: Args out of range: "\361", -1 [2 times] > error in process filter: Args out of range: "\377\375", -1 [2 times] > error in process filter: Args out of range: "\370\340\374\374", -1 [2 times] > error in process filter: Args out of range: "\376\340\360\370", -1 [2 times] > error in process filter: Args out of range: "\377\377\374\376\371\376\301\377", -1 [2 times] > error in process filter: Args out of range: "\376", -1 [2 times] > > Emacs 25.3 is silent under the same conditions. Does setting (setq debug-on-error t) give you a backtrace for these errors? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 15 17:46:22 2019 Received: (at 29918) by debbugs.gnu.org; 15 Jul 2019 21:46:22 +0000 Received: from localhost ([127.0.0.1]:49312 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hn8nb-0005iC-P2 for submit@debbugs.gnu.org; Mon, 15 Jul 2019 17:46:21 -0400 Received: from aibo.runbox.com ([91.220.196.211]:58572) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hn8nU-0005hw-8e for 29918@debbugs.gnu.org; Mon, 15 Jul 2019 17:46:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; s=rbselector1; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From; bh=8CdOu2C6LHTgK+6Yo96ryxv5MI8trKHKDPI1acolvP0=; b=FhQtSR/cECtrYboOJByM7/jV4+ S9JhzKVb1lzQrVOGncvz5dyO746ckFy2MZDA/BNN4vOMb/NdruBNKo1XPqS5avGFRuPXTb/FW32BX AUdif2dFfPly+ycRITaBi5jotln9DDWammWeI4ugy2SFhFMZyxUp6lPSWjizHqHmwcLz6IfeFVPkT iB1CE8EU6lIQPOJWr/FUhO6WQyNAtz25ds5S2OWXIclIxMysWxTikCIRxiW3iZaHvH9E9krcuqWnp RfCLlAVdPbnRyjrkI8qb89nP/HqPWRj0Eax+rAK71vD39AXykALK92lBVUCkZtGi1+25ljoWviuq0 XaA5Fixw==; Received: from [10.9.9.202] (helo=mailfront20.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1hn8nS-0000h9-DQ; Mon, 15 Jul 2019 23:46:10 +0200 Received: by mailfront20.runbox with esmtpsa (uid:179284 ) (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) id 1hn8nG-0002KS-89; Mon, 15 Jul 2019 23:46:01 +0200 From: Gemini Lasswell To: Lars Ingebrigtsen Subject: Re: bug#29918: 26.0.90; serial-term error in process filter In-Reply-To: <87d0icy03x.fsf@mouse.gnus.org> (Lars Ingebrigtsen's message of "Sun, 14 Jul 2019 19:52:50 +0200") References: <87y3liwr80.fsf@runbox.com> <87d0icy03x.fsf@mouse.gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2.90 (gnu/linux) Date: Mon, 15 Jul 2019 14:45:50 -0700 Message-ID: <87sgr7ottd.fsf@runbox.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 29918 Cc: 29918@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Lars Ingebrigtsen writes: > Does setting (setq debug-on-error t) give you a backtrace for these > errors? No, but I just made one happen by removing the internal_condition_case_1 wrapper on the read_process_output_call in read_and_dispose_of_process_output. Then after I got the first backtrace showing that the error was in term-emulate-terminal I eval-defun'd it to make a more useful backtrace: --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=term-emulate-terminal.txt Content-Transfer-Encoding: quoted-printable 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\37= 6\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-bi= t) (while (eq (char-charset (aref decoded-substring (- count 1 partial))) 'e= ight-bit) (setq partial (1+ partial))) (let ((partial 0) (count (length decoded-substring))) (while (eq (char-ch= arset (aref decoded-substring (- count 1 partial))) 'eight-bit) (setq parti= al (1+ partial))) (if (> partial 0) (progn (setq term-terminal-undecoded-by= tes (substring decoded-substring (- partial))) (setq decoded-substring (sub= string decoded-substring 0 (- partial))) (setq str-length (- str-length par= tial)) (setq funny (- funny partial))))) proc =3D # str =3D "\376\374\376\364\376\364\376\364\376\364\376\364\376\364\376\3= 64\376\364\376\364\376\364\376\364\376" i =3D 0 funny =3D 25 decoded-substring =3D "\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 =3D # save-marker =3D # win =3D nil selected =3D # last-win =3D nil str-length =3D 25 save-selected-window--state =3D (# (# . #)) ctl-params =3D nil ctl-params-end =3D nil ctl-end =3D 26 partial =3D 25 count =3D 25 (progn (let ((partial 0) (count (length decoded-substring))) (while (eq (= char-charset (aref decoded-substring (- count 1 partial))) 'eight-bit) (set= q partial (1+ partial))) (if (> partial 0) (progn (setq term-terminal-undec= oded-bytes (substring decoded-substring (- partial))) (setq decoded-substri= ng (substring decoded-substring 0 (- partial))) (setq str-length (- str-len= gth partial)) (setq funny (- funny partial)))))) (if (=3D funny str-length) (progn (let ((partial 0) (count (length decode= d-substring))) (while (eq (char-charset (aref decoded-substring (- count 1 = partial))) 'eight-bit) (setq partial (1+ partial))) (if (> partial 0) (prog= n (setq term-terminal-undecoded-bytes (substring decoded-substring (- parti= al))) (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-col= umn 0) (setq term-do-line-wrapping nil))) (setq decoded-substring (decode-c= oding-string (substring str i funny) locale-coding-system t)) (if (=3D funn= y str-length) (progn (let ((partial 0) (count (length decoded-substring))) = (while (eq (char-charset (aref decoded-substring (- count 1 partial))) 'eig= ht-bit) (setq partial (1+ partial))) (if (> partial 0) (progn (setq term-te= rminal-undecoded-bytes (substring decoded-substring (- partial))) (setq dec= oded-substring (substring decoded-substring 0 (- partial))) (setq str-lengt= h (- str-length partial)) (setq funny (- funny partial))))))) (let ((old-co= lumn (term-horizontal-column)) (old-point (point)) columns) (if term-suppre= ss-hard-newline nil (while (> (+ (length decoded-substring) old-column) ter= m-width) (insert (substring decoded-substring 0 (- term-width old-column)))= (delete-region (point) (line-end-position)) (term-down 1 t) (term-move-col= umns (- (term-current-column))) (add-text-properties (1- (point)) (point) '= (term-line-wrap t rear-nonsticky t)) (setq decoded-substring (substring dec= oded-substring (- term-width old-column))) (setq old-column 0))) (insert de= coded-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 po= s)))) (put-text-property old-point (point) 'font-lock-face term-current-fac= e)) (if (eq (term-current-column) term-width) (progn (term-move-columns -1)= (setq term-do-line-wrapping (point)))) (setq term-current-column nil) (set= q 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-sub= string (decode-coding-string (substring str i funny) locale-coding-system t= )) (if (=3D funny str-length) (progn (let ((partial 0) (count (length decod= ed-substring))) (while (eq (char-charset (aref decoded-substring (- count 1= partial))) 'eight-bit) (setq partial (1+ partial))) (if (> partial 0) (pro= gn (setq term-terminal-undecoded-bytes (substring decoded-substring (- part= ial))) (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-wid= th old-column))) (delete-region (point) (line-end-position)) (term-down 1 t= ) (term-move-columns (- (term-current-column))) (add-text-properties (1- (p= oint)) (point) '(term-line-wrap t rear-nonsticky t)) (setq decoded-substrin= g (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-inser= t-mode)) (progn (let ((pos (point))) (term-move-columns columns) (delete-re= gion pos (point)) (setq term-current-column nil)))) (if term-insert-mode (p= rogn (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-len= gth)))) (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 decod= ed-substring (decode-coding-string (substring str i funny) locale-coding-sy= stem t)) (if (=3D funny str-length) (progn (let ((partial 0) (count (length= decoded-substring))) (while (eq (char-charset (aref decoded-substring (- c= ount 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 (- part= ial))) (setq str-length (- str-length partial)) (setq funny (- funny partia= l))))))) (let ((old-column (term-horizontal-column)) (old-point (point)) co= lumns) (if term-suppress-hard-newline nil (while (> (+ (length decoded-subs= tring) old-column) term-width) (insert (substring decoded-substring 0 (- te= rm-width old-column))) (delete-region (point) (line-end-position)) (term-do= wn 1 t) (term-move-columns (- (term-current-column))) (add-text-properties = (1- (point)) (point) '(term-line-wrap t rear-nonsticky t)) (setq decoded-su= bstring (substring decoded-substring (- term-width old-column))) (setq old-= column 0))) (insert decoded-substring) (setq term-current-column (current-c= olumn) columns (- term-current-column old-column)) (if (not (or (eobp) term= -insert-mode)) (progn (let ((pos (point))) (term-move-columns columns) (del= ete-region pos (point)) (setq term-current-column nil)))) (if term-insert-m= ode (progn (let ((pos (point))) (end-of-line) (if (> (current-column) term-= width) (progn (delete-region (- (point) (- (current-column) term-width)) (p= oint)))) (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-cu= rrent-column nil) (setq i funny))) (let* ((val (and (<=3D ctl-end str-lengt= h) (aref str i)))) (cond ((eql val 9) (let ((col (term-current-column))) (t= erm-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-st= art-line-column)) ((eql val 10) (if (and term-kill-echo-list (term-check-ki= ll-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 s= tr (1+ i)))) (cond ((eql val 91) (if (eq ctl-params-end (1- ctl-end)) (prog= n (term-handle-ansi-escape proc (mapcar #'string-to-number (split-string ct= l-params ";")) (aref str (1- ctl-end)))))) ((eql val 68) (term-handle-defer= red-scroll) (term-down 1 t)) ((eql val 77) (if (or (< (term-current-row) te= rm-scroll-start) (>=3D (1- (term-current-row)) term-scroll-start)) (term-do= wn -1) (term-down -1 t))) ((eql val 55) (term-handle-deferred-scroll) (setq= term-saved-cursor (list (term-current-row) (term-horizontal-column) term-a= nsi-current-bg-color term-ansi-current-bold term-ansi-current-color term-an= si-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-curren= t-bg-color (nth 2 term-saved-cursor) term-ansi-current-bold (nth 3 term-sav= ed-cursor) term-ansi-current-color (nth 4 term-saved-cursor) term-ansi-curr= ent-invisible (nth 5 term-saved-cursor) term-ansi-current-reverse (nth 6 te= rm-saved-cursor) term-ansi-current-underline (nth 7 term-saved-cursor) term= -current-face (nth 8 term-saved-cursor))))) ((eql val 99) (term-reset-termi= nal)) ((eql val 65) (term-handle-ansi-terminal-messages (substring str i ct= l-end))) (t nil)))) ((memql val '(nil 15 14 0)) nil) (t (let ((x37 val)) (e= rror "No clause matching `%S'" x37))))) (if (eq term-do-line-wrapping (poin= t)) nil (setq term-do-line-wrapping nil)) (if term-pager-old-local-map (pro= gn (if (> (% (current-column) term-width) 0) (setq term-terminal-undecoded-= bytes (substring str i)) (if (=3D 0 i) (setq term-terminal-undecoded-bytes = (concat "\15" (substring str i))) (setq term-terminal-undecoded-bytes (subs= tring str (1- i))) (aset term-terminal-undecoded-bytes 0 13)) (goto-char (p= oint-max))) (make-local-variable 'term-pager-old-filter) (setq term-pager-o= ld-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-en= d (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-te= rminal-undecoded-bytes (substring str funny)) (setq funny str-length)) (1+ = str-length)))) (if (> funny i) (progn (if term-do-line-wrapping (progn (ter= m-down 1 t) (term-move-to-column 0) (setq term-do-line-wrapping nil))) (set= q decoded-substring (decode-coding-string (substring str i funny) locale-co= ding-system t)) (if (=3D funny str-length) (progn (let ((partial 0) (count = (length decoded-substring))) (while (eq (char-charset (aref decoded-substri= ng (- count 1 partial))) 'eight-bit) (setq partial (1+ partial))) (if (> pa= rtial 0) (progn (setq term-terminal-undecoded-bytes (substring decoded-subs= tring (- 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 (poi= nt)) columns) (if term-suppress-hard-newline nil (while (> (+ (length decod= ed-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-prop= erties (1- (point)) (point) '(term-line-wrap t rear-nonsticky t)) (setq dec= oded-substring (substring decoded-substring (- term-width old-column))) (se= tq old-column 0))) (insert decoded-substring) (setq term-current-column (cu= rrent-column) columns (- term-current-column old-column)) (if (not (or (eob= p) term-insert-mode)) (progn (let ((pos (point))) (term-move-columns column= s) (delete-region pos (point)) (setq term-current-column nil)))) (if term-i= nsert-mode (progn (let ((pos (point))) (end-of-line) (if (> (current-column= ) term-width) (progn (delete-region (- (point) (- (current-column) term-wid= th)) (point)))) (goto-char pos)))) (put-text-property old-point (point) 'fo= nt-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 (<=3D ctl-end st= r-length) (aref str i)))) (cond ((eql val 9) (let ((col (term-current-colum= n))) (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-c= heck-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-st= ring ctl-params ";")) (aref str (1- ctl-end)))))) ((eql val 68) (term-handl= e-deferred-scroll) (term-down 1 t)) ((eql val 77) (if (or (< (term-current-= row) term-scroll-start) (>=3D (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-und= erline term-current-face))) ((eql val 56) (if term-saved-cursor (progn (ter= m-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 t= erm-saved-cursor) term-ansi-current-color (nth 4 term-saved-cursor) term-an= si-current-invisible (nth 5 term-saved-cursor) term-ansi-current-reverse (n= th 6 term-saved-cursor) term-ansi-current-underline (nth 7 term-saved-curso= r) term-current-face (nth 8 term-saved-cursor))))) ((eql val 99) (term-rese= t-terminal)) ((eql val 65) (term-handle-ansi-terminal-messages (substring s= tr i ctl-end))) (t nil)))) ((memql val '(nil 15 14 0)) nil) (t (let ((x37 v= al)) (error "No clause matching `%S'" x37))))) (if (eq term-do-line-wrappin= g (point)) nil (setq term-do-line-wrapping nil)) (if term-pager-old-local-m= ap (progn (if (> (% (current-column) term-width) 0) (setq term-terminal-und= ecoded-bytes (substring str i)) (if (=3D 0 i) (setq term-terminal-undecoded= -bytes (concat "\15" (substring str i))) (setq term-terminal-undecoded-byte= s (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) (pr= ocess-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-un= decoded-bytes nil))) (while (< i str-length) (setq funny (string-match term= -control-seq-regexp str i)) (let ((ctl-params (and funny (match-string 1 st= r))) (ctl-params-end (and funny (match-end 1))) (ctl-end (if funny (match-e= nd 0) (setq funny (string-match term-control-seq-prefix-regexp str i)) (if = funny (setq term-terminal-undecoded-bytes (substring str funny)) (setq funn= y str-length)) (1+ str-length)))) (if (> funny i) (progn (if term-do-line-w= rapping (progn (term-down 1 t) (term-move-to-column 0) (setq term-do-line-w= rapping nil))) (setq decoded-substring (decode-coding-string (substring str= i funny) locale-coding-system t)) (if (=3D funny str-length) (progn (let (= (partial 0) (count (length decoded-substring))) (while (eq (char-charset (a= ref decoded-substring (- count 1 partial))) 'eight-bit) (setq partial (1+ p= artial))) (if (> partial 0) (progn (setq term-terminal-undecoded-bytes (sub= string decoded-substring (- partial))) (setq decoded-substring (substring d= ecoded-substring 0 (- partial))) (setq str-length (- str-length partial)) (= setq funny (- funny partial))))))) (let ((old-column (term-horizontal-colum= n)) (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) (li= ne-end-position)) (term-down 1 t) (term-move-columns (- (term-current-colum= n))) (add-text-properties (1- (point)) (point) '(term-line-wrap t rear-nons= ticky t)) (setq decoded-substring (substring decoded-substring (- term-widt= h 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) (- (curre= nt-column) term-width)) (point)))) (goto-char pos)))) (put-text-property ol= d-point (point) 'font-lock-face term-current-face)) (if (eq (term-current-c= olumn) term-width) (progn (term-move-columns -1) (setq term-do-line-wrappin= g (point)))) (setq term-current-column nil) (setq i funny))) (let* ((val (a= nd (<=3D 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 t= erm-current-column term-start-line-column)) ((eql val 10) (if (and term-kil= l-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 (i= f (eq (aref str (- ctl-end 2)) 13) 2 1))) locale-coding-system t))) ((eql v= al 27) (let* ((val (aref str (1+ i)))) (cond ((eql val 91) (if (eq ctl-para= ms-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 (o= r (< (term-current-row) term-scroll-start) (>=3D (1- (term-current-row)) te= rm-scroll-start)) (term-down -1) (term-down -1 t))) ((eql val 55) (term-han= dle-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 te= rm-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-curso= r)) (setq term-ansi-current-bg-color (nth 2 term-saved-cursor) term-ansi-cu= rrent-bold (nth 3 term-saved-cursor) term-ansi-current-color (nth 4 term-sa= ved-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-me= ssages (substring str i ctl-end))) (t nil)))) ((memql val '(nil 15 14 0)) n= il) (t (let ((x37 val)) (error "No clause matching `%S'" x37))))) (if (eq t= erm-do-line-wrapping (point)) nil (setq term-do-line-wrapping nil)) (if ter= m-pager-old-local-map (progn (if (> (% (current-column) term-width) 0) (set= q term-terminal-undecoded-bytes (substring str i)) (if (=3D 0 i) (setq term= -terminal-undecoded-bytes (concat "\15" (substring str i))) (setq term-term= inal-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-fil= ter proc term-pager-filter) (setq i str-length)) (setq i ctl-end))))) (progn (if (marker-buffer term-pending-delete-marker) (progn (delete-regi= on term-pending-delete-marker (process-mark proc)) (set-marker term-pending= -delete-marker nil))) (if (/=3D (point) (process-mark proc)) (progn (setq s= ave-point (point-marker)))) (setq term-vertical-motion (if (eq (window-buff= er) (current-buffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq= save-marker (copy-marker (process-mark proc))) (goto-char (process-mark pr= oc)) (save-restriction (if (and (> (point-max) (process-mark proc)) (not (e= q (current-local-map) term-raw-map))) (progn (narrow-to-region (point-min) = (process-mark proc)))) (if term-log-buffer (progn (princ str term-log-buffe= r))) (if term-terminal-undecoded-bytes (progn (setq str (concat term-termin= al-undecoded-bytes str)) (setq str-length (length str)) (setq term-terminal= -undecoded-bytes nil))) (while (< i str-length) (setq funny (string-match t= erm-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 (matc= h-end 0) (setq funny (string-match term-control-seq-prefix-regexp str i)) (= if funny (setq term-terminal-undecoded-bytes (substring str funny)) (setq f= unny str-length)) (1+ str-length)))) (if (> funny i) (progn (if term-do-lin= e-wrapping (progn (term-down 1 t) (term-move-to-column 0) (setq term-do-lin= e-wrapping nil))) (setq decoded-substring (decode-coding-string (substring = str i funny) locale-coding-system t)) (if (=3D funny str-length) (progn (le= t ((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 (substrin= g decoded-substring 0 (- partial))) (setq str-length (- str-length partial)= ) (setq funny (- funny partial))))))) (let ((old-column (term-horizontal-co= lumn)) (old-point (point)) columns) (if term-suppress-hard-newline nil (whi= le (> (+ (length decoded-substring) old-column) term-width) (insert (substr= ing decoded-substring 0 (- term-width old-column))) (delete-region (point) = (line-end-position)) (term-down 1 t) (term-move-columns (- (term-current-co= lumn))) (add-text-properties (1- (point)) (point) '(term-line-wrap t rear-n= onsticky t)) (setq decoded-substring (substring decoded-substring (- term-w= idth old-column))) (setq old-column 0))) (insert decoded-substring) (setq t= erm-current-column (current-column) columns (- term-current-column old-colu= mn)) (if (not (or (eobp) term-insert-mode)) (progn (let ((pos (point))) (te= rm-move-columns columns) (delete-region pos (point)) (setq term-current-col= umn nil)))) (if term-insert-mode (progn (let ((pos (point))) (end-of-line) = (if (> (current-column) term-width) (progn (delete-region (- (point) (- (cu= rrent-column) term-width)) (point)))) (goto-char pos)))) (put-text-property= old-point (point) 'font-lock-face term-current-face)) (if (eq (term-curren= t-column) term-width) (progn (term-move-columns -1) (setq term-do-line-wrap= ping (point)))) (setq term-current-column nil) (setq i funny))) (let* ((val= (and (<=3D ctl-end str-length) (aref str i)))) (cond ((eql val 9) (let ((c= ol (term-current-column))) (term-move-to-column (min (1- term-width) (+ col= 8 (- (mod col 8))))))) ((eql val 13) (funcall term-vertical-motion 0) (set= q 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 t= erm-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))) ((eq= l val 27) (let* ((val (aref str (1+ i)))) (cond ((eql val 91) (if (eq ctl-p= arams-end (1- ctl-end)) (progn (term-handle-ansi-escape proc (mapcar #'stri= ng-to-number (split-string ctl-params ";")) (aref str (1- ctl-end)))))) ((e= ql val 68) (term-handle-deferred-scroll) (term-down 1 t)) ((eql val 77) (if= (or (< (term-current-row) term-scroll-start) (>=3D (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) (t= erm-horizontal-column) term-ansi-current-bg-color term-ansi-current-bold te= rm-ansi-current-color term-ansi-current-invisible term-ansi-current-reverse= term-ansi-current-underline term-current-face))) ((eql val 56) (if term-sa= ved-cursor (progn (term-goto (nth 0 term-saved-cursor) (nth 1 term-saved-cu= rsor)) (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-a= nsi-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 (e= q 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 (=3D 0 i) (setq t= erm-terminal-undecoded-bytes (concat "\15" (substring str i))) (setq term-t= erminal-undecoded-bytes (substring str (1- i))) (aset term-terminal-undecod= ed-bytes 0 13)) (goto-char (point-max))) (make-local-variable 'term-pager-o= ld-filter) (setq term-pager-old-filter (process-filter proc)) (set-process-= filter proc term-pager-filter) (setq i str-length)) (setq i ctl-end))))) (i= f (>=3D (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-poin= t (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 p= roc)) (progn (let ((scroll term-scroll-to-bottom-on-output)) (select-window= win) (if (or (=3D (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) (re= center 0) (goto-char (process-mark proc)) (if (not (pos-visible-in-window-p= (point) win)) (recenter -1)))) (if (and term-scroll-show-maximum-output (>= =3D (point) (process-mark proc))) (progn (save-excursion (goto-char (point-= max)) (recenter -1))))))) (not (eq win last-win)))) (if (> term-buffer-maxi= mum-size 0) (progn (save-excursion (goto-char (process-mark (get-buffer-pro= cess (current-buffer)))) (forward-line (- term-buffer-maximum-size)) (begin= ning-of-line) (delete-region (point-min) (point))))) (set-marker save-marke= r nil)) (unwind-protect (progn (if (marker-buffer term-pending-delete-marker) (pr= ogn (delete-region term-pending-delete-marker (process-mark proc)) (set-mar= ker term-pending-delete-marker nil))) (if (/=3D (point) (process-mark proc)= ) (progn (setq save-point (point-marker)))) (setq term-vertical-motion (if = (eq (window-buffer) (current-buffer)) 'vertical-motion 'term-buffer-vertica= l-motion)) (setq save-marker (copy-marker (process-mark proc))) (goto-char = (process-mark proc)) (save-restriction (if (and (> (point-max) (process-mar= k proc)) (not (eq (current-local-map) term-raw-map))) (progn (narrow-to-reg= ion (point-min) (process-mark proc)))) (if term-log-buffer (progn (princ st= r term-log-buffer))) (if term-terminal-undecoded-bytes (progn (setq str (co= ncat term-terminal-undecoded-bytes str)) (setq str-length (length str)) (se= tq 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-st= ring (substring str i funny) locale-coding-system t)) (if (=3D funny str-le= ngth) (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-u= ndecoded-bytes (substring decoded-substring (- partial))) (setq decoded-sub= string (substring decoded-substring 0 (- partial))) (setq str-length (- str= -length partial)) (setq funny (- funny partial))))))) (let ((old-column (te= rm-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-li= ne-wrap t rear-nonsticky t)) (setq decoded-substring (substring decoded-sub= string (- term-width old-column))) (setq old-column 0))) (insert decoded-su= bstring) (setq term-current-column (current-column) columns (- term-current= -column old-column)) (if (not (or (eobp) term-insert-mode)) (progn (let ((p= os (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)))) (p= ut-text-property old-point (point) 'font-lock-face term-current-face)) (if = (eq (term-current-column) term-width) (progn (term-move-columns -1) (setq t= erm-do-line-wrapping (point)))) (setq term-current-column nil) (setq i funn= y))) (let* ((val (and (<=3D ctl-end str-length) (aref str i)))) (cond ((eql= val 9) (let ((col (term-current-column))) (term-move-to-column (min (1- te= rm-width) (+ col 8 (- (mod col 8))))))) ((eql val 13) (funcall term-vertica= l-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 va= l 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 9= 1) (if (eq ctl-params-end (1- ctl-end)) (progn (term-handle-ansi-escape pro= c (mapcar #'string-to-number (split-string ctl-params ";")) (aref str (1- c= tl-end)))))) ((eql val 68) (term-handle-deferred-scroll) (term-down 1 t)) (= (eql val 77) (if (or (< (term-current-row) term-scroll-start) (>=3D (1- (te= rm-current-row)) term-scroll-start)) (term-down -1) (term-down -1 t))) ((eq= l 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-c= ursor) term-ansi-current-bold (nth 3 term-saved-cursor) term-ansi-current-c= olor (nth 4 term-saved-cursor) term-ansi-current-invisible (nth 5 term-save= d-cursor) term-ansi-current-reverse (nth 6 term-saved-cursor) term-ansi-cur= rent-underline (nth 7 term-saved-cursor) term-current-face (nth 8 term-save= d-cursor))))) ((eql val 99) (term-reset-terminal)) ((eql val 65) (term-hand= le-ansi-terminal-messages (substring str i ctl-end))) (t nil)))) ((memql va= l '(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-wra= pping nil)) (if term-pager-old-local-map (progn (if (> (% (current-column) = term-width) 0) (setq term-terminal-undecoded-bytes (substring str i)) (if (= =3D 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-variab= le '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 (>=3D (term-current-row) term-height) (progn (term-handle= -deferred-scroll))) (set-marker (process-mark proc) (point)) (if (stringp d= ecoded-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-fr= ame)) (setq term-pending-frame nil))) (setq win selected) (while (window-mi= nibuffer-p win) (setq win (next-window win nil t))) (setq last-win win) (wh= ile (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 (=3D (point) save-marker) (eq scroll t) (eq s= croll '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-vis= ible-in-window-p (point) win)) (recenter -1)))) (if (and term-scroll-show-m= aximum-output (>=3D (point) (process-mark proc))) (progn (save-excursion (g= oto-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-maxim= um-size)) (beginning-of-line) (delete-region (point-min) (point))))) (set-m= arker save-marker nil)) (internal--after-save-selected-window save-selected= -window--state)) (save-current-buffer (unwind-protect (progn (if (marker-buffer term-pendi= ng-delete-marker) (progn (delete-region term-pending-delete-marker (process= -mark proc)) (set-marker term-pending-delete-marker nil))) (if (/=3D (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-mar= k proc))) (goto-char (process-mark proc)) (save-restriction (if (and (> (po= int-max) (process-mark proc)) (not (eq (current-local-map) term-raw-map))) = (progn (narrow-to-region (point-min) (process-mark proc)))) (if term-log-bu= ffer (progn (princ str term-log-buffer))) (if term-terminal-undecoded-bytes= (progn (setq str (concat term-terminal-undecoded-bytes str)) (setq str-len= gth (length str)) (setq term-terminal-undecoded-bytes nil))) (while (< i st= r-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 (ma= tch-end 1))) (ctl-end (if funny (match-end 0) (setq funny (string-match ter= m-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) (ter= m-move-to-column 0) (setq term-do-line-wrapping nil))) (setq decoded-substr= ing (decode-coding-string (substring str i funny) locale-coding-system t)) = (if (=3D funny str-length) (progn (let ((partial 0) (count (length decoded-= substring))) (while (eq (char-charset (aref decoded-substring (- count 1 pa= rtial))) '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))) (s= etq str-length (- str-length partial)) (setq funny (- funny partial))))))) = (let ((old-column (term-horizontal-column)) (old-point (point)) columns) (i= f term-suppress-hard-newline nil (while (> (+ (length decoded-substring) ol= d-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- (poin= t)) (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) co= lumns (- term-current-column old-column)) (if (not (or (eobp) term-insert-m= ode)) (progn (let ((pos (point))) (term-move-columns columns) (delete-regio= n pos (point)) (setq term-current-column nil)))) (if term-insert-mode (prog= n (let ((pos (point))) (end-of-line) (if (> (current-column) term-width) (p= rogn (delete-region (- (point) (- (current-column) term-width)) (point)))) = (goto-char pos)))) (put-text-property old-point (point) 'font-lock-face ter= m-current-face)) (if (eq (term-current-column) term-width) (progn (term-mov= e-columns -1) (setq term-do-line-wrapping (point)))) (setq term-current-col= umn nil) (setq i funny))) (let* ((val (and (<=3D 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-l= ist)) 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-st= ring (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-h= andle-ansi-escape proc (mapcar #'string-to-number (split-string ctl-params = ";")) (aref str (1- ctl-end)))))) ((eql val 68) (term-handle-deferred-scrol= l) (term-down 1 t)) ((eql val 77) (if (or (< (term-current-row) term-scroll= -start) (>=3D (1- (term-current-row)) term-scroll-start)) (term-down -1) (t= erm-down -1 t))) ((eql val 55) (term-handle-deferred-scroll) (setq term-sav= ed-cursor (list (term-current-row) (term-horizontal-column) term-ansi-curre= nt-bg-color term-ansi-current-bold term-ansi-current-color term-ansi-curren= t-invisible term-ansi-current-reverse term-ansi-current-underline term-curr= ent-face))) ((eql val 56) (if term-saved-cursor (progn (term-goto (nth 0 te= rm-saved-cursor) (nth 1 term-saved-cursor)) (setq term-ansi-current-bg-colo= r (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-invis= ible (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)) ((e= ql 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 (su= bstring str i)) (if (=3D 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 (>=3D (term-current-row) term-height= ) (progn (term-handle-deferred-scroll))) (set-marker (process-mark proc) (p= oint)) (if (stringp decoded-substring) (progn (term-watch-for-password-prom= pt decoded-substring))) (if save-point (progn (goto-char save-point) (set-m= arker save-point nil))) (if (and term-pending-frame (eq (window-buffer sele= cted) (current-buffer))) (progn (term-display-line (car term-pending-frame)= (cdr term-pending-frame)) (setq term-pending-frame nil))) (setq win select= ed) (while (window-minibuffer-p win) (setq win (next-window win nil t))) (s= etq 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 (=3D (point) save-marker= ) (eq scroll t) (eq scroll 'all) (and (eq selected win) (or (eq scroll 'thi= s) (not save-point))) (and (eq scroll 'others) (not (eq selected win)))) (p= rogn (goto-char term-home-marker) (recenter 0) (goto-char (process-mark pro= c)) (if (not (pos-visible-in-window-p (point) win)) (recenter -1)))) (if (a= nd term-scroll-show-maximum-output (>=3D (point) (process-mark proc))) (pro= gn (save-excursion (goto-char (point-max)) (recenter -1))))))) (not (eq win= last-win)))) (if (> term-buffer-maximum-size 0) (progn (save-excursion (go= to-char (process-mark (get-buffer-process (current-buffer)))) (forward-line= (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-mi= n) (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-pen= ding-delete-marker) (progn (delete-region term-pending-delete-marker (proce= ss-mark proc)) (set-marker term-pending-delete-marker nil))) (if (/=3D (poi= nt) (process-mark proc)) (progn (setq save-point (point-marker)))) (setq te= rm-vertical-motion (if (eq (window-buffer) (current-buffer)) 'vertical-moti= on 'term-buffer-vertical-motion)) (setq save-marker (copy-marker (process-m= ark 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-byt= es (progn (setq str (concat term-terminal-undecoded-bytes str)) (setq str-l= ength (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 t= erm-control-seq-prefix-regexp str i)) (if funny (setq term-terminal-undecod= ed-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) (t= erm-move-to-column 0) (setq term-do-line-wrapping nil))) (setq decoded-subs= tring (decode-coding-string (substring str i funny) locale-coding-system t)= ) (if (=3D funny str-length) (progn (let ((partial 0) (count (length decode= d-substring))) (while (eq (char-charset (aref decoded-substring (- count 1 = partial))) 'eight-bit) (setq partial (1+ partial))) (if (> partial 0) (prog= n (setq term-terminal-undecoded-bytes (substring decoded-substring (- parti= al))) (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-widt= h old-column))) (delete-region (point) (line-end-position)) (term-down 1 t)= (term-move-columns (- (term-current-column))) (add-text-properties (1- (po= int)) (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-reg= ion pos (point)) (setq term-current-column nil)))) (if term-insert-mode (pr= ogn (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 t= erm-current-face)) (if (eq (term-current-column) term-width) (progn (term-m= ove-columns -1) (setq term-do-line-wrapping (point)))) (setq term-current-c= olumn nil) (setq i funny))) (let* ((val (and (<=3D ctl-end str-length) (are= f str i)))) (cond ((eql val 9) (let ((col (term-current-column))) (term-mov= e-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-lin= e-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 va= l 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-param= s ";")) (aref str (1- ctl-end)))))) ((eql val 68) (term-handle-deferred-scr= oll) (term-down 1 t)) ((eql val 77) (if (or (< (term-current-row) term-scro= ll-start) (>=3D (1- (term-current-row)) term-scroll-start)) (term-down -1) = (term-down -1 t))) ((eql val 55) (term-handle-deferred-scroll) (setq term-s= aved-cursor (list (term-current-row) (term-horizontal-column) term-ansi-cur= rent-bg-color term-ansi-current-bold term-ansi-current-color term-ansi-curr= ent-invisible term-ansi-current-reverse term-ansi-current-underline term-cu= rrent-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-co= lor (nth 2 term-saved-cursor) term-ansi-current-bold (nth 3 term-saved-curs= or) term-ansi-current-color (nth 4 term-saved-cursor) term-ansi-current-inv= isible (nth 5 term-saved-cursor) term-ansi-current-reverse (nth 6 term-save= d-cursor) term-ansi-current-underline (nth 7 term-saved-cursor) term-curren= t-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 "N= o 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 (=3D 0 i) (setq term-terminal-undecoded-bytes (concat= "\15" (substring str i))) (setq term-terminal-undecoded-bytes (substring s= tr (1- i))) (aset term-terminal-undecoded-bytes 0 13)) (goto-char (point-ma= x))) (make-local-variable 'term-pager-old-filter) (setq term-pager-old-filt= er (process-filter proc)) (set-process-filter proc term-pager-filter) (setq= i str-length)) (setq i ctl-end))))) (if (>=3D (term-current-row) term-heig= ht) (progn (term-handle-deferred-scroll))) (set-marker (process-mark proc) = (point)) (if (stringp decoded-substring) (progn (term-watch-for-password-pr= ompt decoded-substring))) (if save-point (progn (goto-char save-point) (set= -marker save-point nil))) (if (and term-pending-frame (eq (window-buffer se= lected) (current-buffer))) (progn (term-display-line (car term-pending-fram= e) (cdr term-pending-frame)) (setq term-pending-frame nil))) (setq win sele= cted) (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 (e= q (window-buffer win) (process-buffer proc)) (progn (let ((scroll term-scro= ll-to-bottom-on-output)) (select-window win) (if (or (=3D (point) save-mark= er) (eq scroll t) (eq scroll 'all) (and (eq selected win) (or (eq scroll 't= his) (not save-point))) (and (eq scroll 'others) (not (eq selected win)))) = (progn (goto-char term-home-marker) (recenter 0) (goto-char (process-mark p= roc)) (if (not (pos-visible-in-window-p (point) win)) (recenter -1)))) (if = (and term-scroll-show-maximum-output (>=3D (point) (process-mark proc))) (p= rogn (save-excursion (goto-char (point-max)) (recenter -1))))))) (not (eq w= in last-win)))) (if (> term-buffer-maximum-size 0) (progn (save-excursion (= goto-char (process-mark (get-buffer-process (current-buffer)))) (forward-li= ne (- term-buffer-maximum-size)) (beginning-of-line) (delete-region (point-= min) (point))))) (set-marker save-marker nil)) (internal--after-save-select= ed-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 (st= r-length (length str))) (let ((save-selected-window--state (internal--befor= e-save-selected-window))) (save-current-buffer (unwind-protect (progn (if (= marker-buffer term-pending-delete-marker) (progn (delete-region term-pendin= g-delete-marker (process-mark proc)) (set-marker term-pending-delete-marker= nil))) (if (/=3D (point) (process-mark proc)) (progn (setq save-point (poi= nt-marker)))) (setq term-vertical-motion (if (eq (window-buffer) (current-b= uffer)) 'vertical-motion 'term-buffer-vertical-motion)) (setq save-marker (= copy-marker (process-mark proc))) (goto-char (process-mark proc)) (save-res= triction (if (and (> (point-max) (process-mark proc)) (not (eq (current-loc= al-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-b= ytes str)) (setq str-length (length str)) (setq term-terminal-undecoded-byt= es nil))) (while (< i str-length) (setq funny (string-match term-control-se= q-regexp str i)) (let ((ctl-params (and funny (match-string 1 str))) (ctl-p= arams-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-lengt= h)) (1+ str-length)))) (if (> funny i) (progn (if term-do-line-wrapping (pr= ogn (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) l= ocale-coding-system t)) (if (=3D 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 deco= ded-substring (- partial))) (setq decoded-substring (substring decoded-subs= tring 0 (- partial))) (setq str-length (- str-length partial)) (setq funny = (- funny partial))))))) (let ((old-column (term-horizontal-column)) (old-po= int (point)) columns) (if term-suppress-hard-newline nil (while (> (+ (leng= th decoded-substring) old-column) term-width) (insert (substring decoded-su= bstring 0 (- term-width old-column))) (delete-region (point) (line-end-posi= tion)) (term-down 1 t) (term-move-columns (- (term-current-column))) (add-t= ext-properties (1- (point)) (point) '(term-line-wrap t rear-nonsticky t)) (= setq decoded-substring (substring decoded-substring (- term-width old-colum= n))) (setq old-column 0))) (insert decoded-substring) (setq term-current-co= lumn (current-column) columns (- term-current-column old-column)) (if (not = (or (eobp) term-insert-mode)) (progn (let ((pos (point))) (term-move-column= s columns) (delete-region pos (point)) (setq term-current-column nil)))) (i= f term-insert-mode (progn (let ((pos (point))) (end-of-line) (if (> (curren= t-column) term-width) (progn (delete-region (- (point) (- (current-column) = term-width)) (point)))) (goto-char pos)))) (put-text-property old-point (po= int) '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 (<=3D ct= l-end str-length) (aref str i)))) (cond ((eql val 9) (let ((col (term-curre= nt-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-fu= nction (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) (te= rm-handle-deferred-scroll) (term-down 1 t)) ((eql val 77) (if (or (< (term-= current-row) term-scroll-start) (>=3D (1- (term-current-row)) term-scroll-s= tart)) (term-down -1) (term-down -1 t))) ((eql val 55) (term-handle-deferre= d-scroll) (setq term-saved-cursor (list (term-current-row) (term-horizontal= -column) term-ansi-current-bg-color term-ansi-current-bold term-ansi-curren= t-color term-ansi-current-invisible term-ansi-current-reverse term-ansi-cur= rent-underline term-current-face))) ((eql val 56) (if term-saved-cursor (pr= ogn (term-goto (nth 0 term-saved-cursor) (nth 1 term-saved-cursor)) (setq t= erm-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-re= verse (nth 6 term-saved-cursor) term-ansi-current-underline (nth 7 term-sav= ed-cursor) term-current-face (nth 8 term-saved-cursor))))) ((eql val 99) (t= erm-reset-terminal)) ((eql val 65) (term-handle-ansi-terminal-messages (sub= string 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-term= inal-undecoded-bytes (substring str i)) (if (=3D 0 i) (setq term-terminal-u= ndecoded-bytes (concat "\15" (substring str i))) (setq term-terminal-undeco= ded-bytes (substring str (1- i))) (aset term-terminal-undecoded-bytes 0 13)= ) (goto-char (point-max))) (make-local-variable 'term-pager-old-filter) (se= tq term-pager-old-filter (process-filter proc)) (set-process-filter proc te= rm-pager-filter) (setq i str-length)) (setq i ctl-end))))) (if (>=3D (term-= current-row) term-height) (progn (term-handle-deferred-scroll))) (set-marke= r (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 (nex= t-window win nil t))) (setq last-win win) (while (progn (setq win (next-win= dow 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 = (=3D (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) (got= o-char (process-mark proc)) (if (not (pos-visible-in-window-p (point) win))= (recenter -1)))) (if (and term-scroll-show-maximum-output (>=3D (point) (p= rocess-mark proc))) (progn (save-excursion (goto-char (point-max)) (recente= r -1))))))) (not (eq win last-win)))) (if (> term-buffer-maximum-size 0) (p= rogn (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)) (inter= nal--after-save-selected-window save-selected-window--state))))) (save-current-buffer (set-buffer (process-buffer proc)) (let* ((i 0) funn= y decoded-substring save-point save-marker win (inhibit-read-only t) (buffe= r-undo-list t) (selected (selected-window)) last-win (str-length (length st= r))) (let ((save-selected-window--state (internal--before-save-selected-win= dow))) (save-current-buffer (unwind-protect (progn (if (marker-buffer term-= pending-delete-marker) (progn ... ...)) (if (/=3D ... ...) (progn ...)) (se= tq 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 (>=3D ... 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 selec= ted) (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-se= lected-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") --=-=-= Content-Type: text/plain This is from master. Thanks for taking a look at this. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 17 06:59:01 2019 Received: (at 29918) by debbugs.gnu.org; 17 Jul 2019 10:59:01 +0000 Received: from localhost ([127.0.0.1]:51594 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hnheG-0001SY-QI for submit@debbugs.gnu.org; Wed, 17 Jul 2019 06:59:01 -0400 Received: from quimby.gnus.org ([80.91.231.51]:46558) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hnheE-0001SK-Ui for 29918@debbugs.gnu.org; Wed, 17 Jul 2019 06:58:59 -0400 Received: from [80.169.244.84] (helo=sandy) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hnhe8-0002Bg-NV; Wed, 17 Jul 2019 12:58:56 +0200 From: Lars Ingebrigtsen To: Gemini Lasswell Subject: Re: bug#29918: 26.0.90; serial-term error in process filter References: <87y3liwr80.fsf@runbox.com> <87d0icy03x.fsf@mouse.gnus.org> <87sgr7ottd.fsf@runbox.com> Date: Wed, 17 Jul 2019 12:58:51 +0200 In-Reply-To: <87sgr7ottd.fsf@runbox.com> (Gemini Lasswell's message of "Mon, 15 Jul 2019 14:45:50 -0700") Message-ID: <87ims19bbo.fsf@mouse.gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Gemini Lasswell writes: > Lars Ingebrigtsen writes: > >> Does setting (setq debug-on-error t) give you a backtrace for these >> errors? > > No, but I just made one happen by removing the internal_condition_c [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 29918 Cc: 29918@debbugs.gnu.org, Noam Postavsky X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Gemini Lasswell writes: > Lars Ingebrigtsen writes: > >> Does setting (setq debug-on-error t) give you a backtrace for these >> errors? > > No, but I just made one happen by removing the internal_condition_case_1 > wrapper on the read_process_output_call in read_and_dispose_of_process_output. > Then after I got the first backtrace showing that the error was in > term-emulate-terminal I eval-defun'd it to make a more useful backtrace: > > 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))) I'm guessing this bug was introduced by: commit 47019a521f774fbd13441e178a6a82c9989b9912 Author: Noam Postavsky Date: Thu Jan 18 08:22:47 2018 -0500 Switch term.el to lexical binding, and clean up code a bit It's a huge patch, though, and it's difficult to follow the changes in logic. The old code had: - (setq count (length decoded-substring)) - ;; Check for multibyte characters that ends - ;; before end of string, and save it for - ;; next time. - (when (= funny str-length) - (let ((partial 0)) - (while (eq (char-charset (aref decoded-substring - (- count 1 partial))) - 'eight-bit) - (cl-incf partial)) (And it's that aref that's failing with (- count 1 partial) being -1, and the new one is + (when (= funny str-length) + (let ((partial 0) + (count (length decoded-substring))) + (while (eq (char-charset (aref decoded-substring + (- count 1 partial))) + 'eight-bit) + (cl-incf partial)) with that length being recalculated that way... Noam? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 17 07:36:44 2019 Received: (at 29918) by debbugs.gnu.org; 17 Jul 2019 11:36:44 +0000 Received: from localhost ([127.0.0.1]:51630 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hniEm-0006lB-B3 for submit@debbugs.gnu.org; Wed, 17 Jul 2019 07:36:44 -0400 Received: from mail-io1-f45.google.com ([209.85.166.45]:41276) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hniEk-0006kz-SB for 29918@debbugs.gnu.org; Wed, 17 Jul 2019 07:36:43 -0400 Received: by mail-io1-f45.google.com with SMTP id j5so40971558ioj.8 for <29918@debbugs.gnu.org>; Wed, 17 Jul 2019 04:36:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=RvnhlT7U9dtnH8QG66qiTuZYW9MLdqBe+ajhIIJ9gJg=; b=b5r7MVHdtgtSPSxKO/N7h6I41qOjG37cVw/Z8nHnlOoCtbRUNiZBokQ2sJV3cu49ye NUgwJ7M5UkynU0Ez57ZcekxXJhWPtIYam75iDX4604SeNVhV8m2iKISrEMh2VmSrxod7 dzpsy3CNNb+l8bxp0PNZzippcFU5QheLrHwh0WEDU6wJ+uHgnq0TVCTiWQGB5Dco6wEq 9mziL0xh0J0LM4qflOMmIkz18QBDiqshy85bAPX94JFu8HA0pZ46QbcPkl+ai9lNm1WJ Pg57Vs7bnHme2YkCc8MBpO99LxFMIlUU87W4EY+X7A6QO0h/mYt/clVF9XBzxY+imS3O DZ8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=RvnhlT7U9dtnH8QG66qiTuZYW9MLdqBe+ajhIIJ9gJg=; b=WLS/iWT64FVLQG7JmvSrI/dNSRSYA3cjrrfY8b9tKnf3VSuf6vJ5Ub556NSEM3hvr0 Gb+a2RrQibkW4chpiRSoVPXC+KkBLFsXIWF/6VeGoX22Lj6ChVMPtW7yVyBYQWWFpxdj 3KNktQCRlsSelpm7i/ZkH2XCBQrcMJbdbrxnkOvzqMb61k14brZmDLcDJpt3uhueXMs/ HdtLjnr0L2LHXq0kFvZwoaKIuan+tpfKsTfH8bsZqdQmyEBxZbro/J8kqiAAwoYIe2Sh N/AA5Ozy1PFLsuccEHHknPY48lVF05YaePn6dmHXqu8H8wA+uAPhIkeKn+3Y5fW8Arr1 gqIQ== X-Gm-Message-State: APjAAAXI6FtGrh3RBmpNHPbXfrk852w5V7eQP6UBCGkrFn3/NMmwVvN4 fE9yZ25LiFmkiqjM1UlHhXIdwIkK X-Google-Smtp-Source: APXvYqwaAh9+XxoGWraRkvAiq60SIdBMJD0LF06x0NxBDkNBPIB9vMtJ/vwcfDMphLEHuX01zm9D+Q== X-Received: by 2002:a02:c65a:: with SMTP id k26mr41061000jan.18.1563363396682; Wed, 17 Jul 2019 04:36:36 -0700 (PDT) Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.gmail.com with ESMTPSA id p3sm20153846iog.70.2019.07.17.04.36.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jul 2019 04:36:35 -0700 (PDT) From: Noam Postavsky To: Lars Ingebrigtsen Subject: Re: bug#29918: 26.0.90; serial-term error in process filter References: <87y3liwr80.fsf@runbox.com> <87d0icy03x.fsf@mouse.gnus.org> <87sgr7ottd.fsf@runbox.com> <87ims19bbo.fsf@mouse.gnus.org> Date: Wed, 17 Jul 2019 07:36:34 -0400 In-Reply-To: <87ims19bbo.fsf@mouse.gnus.org> (Lars Ingebrigtsen's message of "Wed, 17 Jul 2019 12:58:51 +0200") Message-ID: <87a7dczyd9.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2.90 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 29918 Cc: 29918@debbugs.gnu.org, Gemini Lasswell X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Lars Ingebrigtsen writes: > Gemini Lasswell writes: > >> Lars Ingebrigtsen writes: >> >>> Does setting (setq debug-on-error t) give you a backtrace for these >>> errors? >> >> No, but I just made one happen by removing the internal_condition_case_1 >> wrapper on the read_process_output_call in read_and_dispose_of_process_output. >> Then after I got the first backtrace showing that the error was in >> term-emulate-terminal I eval-defun'd it to make a more useful backtrace: >> >> 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))) > > I'm guessing this bug was introduced by: > > commit 47019a521f774fbd13441e178a6a82c9989b9912 > Author: Noam Postavsky > Date: Thu Jan 18 08:22:47 2018 -0500 > > Switch term.el to lexical binding, and clean up code a bit It can't be that patch, because it's only in master, not emacs-26. I think it's rather [1: 134e86b360] (also mine). [1: 134e86b360]: 2017-01-03 08:58:40 -0500 Handle multibyte chars spanning chunks in term.el https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=134e86b360cab0d0a5cb634b71a4b06ec26c5f1f If I understand the backtrace correctly, then the problem is that I didn't think of the case where the whole string fails to decode. I think the patch below should fix it; there is a possibility it prevents correct decoding in case the terminal receives a utf-8 character in single byte chunks (though I'm not sure if it's even valid for a program to emit single bytes like that). --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Handle-completely-undecoded-input-in-term-Bug-29918.patch Content-Description: patch >From 3e2663f8366ea82f52f47019b63fca243e3f88d9 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Wed, 17 Jul 2019 07:20:20 -0400 Subject: [PATCH] Handle completely undecoded input in term (Bug#29918) * lisp/term.el (term-emulate-terminal): Avoid errors if the whole decoded string is eight-bit characters. --- lisp/term.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lisp/term.el b/lisp/term.el index cbef68dc0a..9785ce3024 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -2900,11 +2900,12 @@ term-emulate-terminal ;; next time. (when (= funny str-length) (let ((partial 0)) - (while (eq (char-charset (aref decoded-substring - (- count 1 partial))) - 'eight-bit) + (while (and (< partial count) + (eq (char-charset (aref decoded-substring + (- count 1 partial))) + 'eight-bit)) (cl-incf partial)) - (when (> partial 0) + (when (> count partial 0) (setq term-terminal-undecoded-bytes (substring decoded-substring (- partial))) (setq decoded-substring -- 2.11.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 18 04:45:46 2019 Received: (at 29918) by debbugs.gnu.org; 18 Jul 2019 08:45:46 +0000 Received: from localhost ([127.0.0.1]:53365 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ho22s-0003hQ-Ee for submit@debbugs.gnu.org; Thu, 18 Jul 2019 04:45:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45011) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ho22p-0003hC-Tk for 29918@debbugs.gnu.org; Thu, 18 Jul 2019 04:45:44 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50374) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ho22k-00027t-8y; Thu, 18 Jul 2019 04:45:38 -0400 Received: from [176.228.60.248] (port=1682 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ho22j-0006q2-J0; Thu, 18 Jul 2019 04:45:38 -0400 Date: Thu, 18 Jul 2019 11:45:28 +0300 Message-Id: <83pnm7ybmf.fsf@gnu.org> From: Eli Zaretskii To: Noam Postavsky In-reply-to: <87a7dczyd9.fsf@gmail.com> (message from Noam Postavsky on Wed, 17 Jul 2019 07:36:34 -0400) Subject: Re: bug#29918: 26.0.90; serial-term error in process filter References: <87y3liwr80.fsf@runbox.com> <87d0icy03x.fsf@mouse.gnus.org> <87sgr7ottd.fsf@runbox.com> <87ims19bbo.fsf@mouse.gnus.org> <87a7dczyd9.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 29918 Cc: 29918@debbugs.gnu.org, gazally@runbox.com, larsi@gnus.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Noam Postavsky > Date: Wed, 17 Jul 2019 07:36:34 -0400 > Cc: 29918@debbugs.gnu.org, Gemini Lasswell > > If I understand the backtrace correctly, then the problem is that I > didn't think of the case where the whole string fails to decode. I > think the patch below should fix it Yes, I think you are right. > there is a possibility it prevents correct decoding in case the > terminal receives a utf-8 character in single byte chunks (though > I'm not sure if it's even valid for a program to emit single bytes > like that). I agree. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 18 07:22:23 2019 Received: (at 29918) by debbugs.gnu.org; 18 Jul 2019 11:22:23 +0000 Received: from localhost ([127.0.0.1]:53507 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ho4UP-0001e2-Q7 for submit@debbugs.gnu.org; Thu, 18 Jul 2019 07:22:22 -0400 Received: from mail-io1-f53.google.com ([209.85.166.53]:33483) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ho4UN-0001do-3Y for 29918@debbugs.gnu.org; Thu, 18 Jul 2019 07:22:20 -0400 Received: by mail-io1-f53.google.com with SMTP id z3so50874312iog.0 for <29918@debbugs.gnu.org>; Thu, 18 Jul 2019 04:22:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=1cfoe2LPvob/yv3Y0hMH7vQ0xtOjEqdIo+zIc+Ngo24=; b=nuKLA6y9QHeQyZAazbjYOXsE1n251/LRHc1ctd2oEkLMKUDVFPJr0c8skejhuoBpS3 6Pm/iMAEfwe67kEPdqALoZBpLmu01Tj3P2Nebwx4yqNNLMNz2NFTHJeLNQw9bJHSVwdC 53Eqe6kmdQKSZPquf8z3dAmXA8NYcvPZl/IJ+ZjPVQbyvNMb03vXMolvEzFaMWy/yFzg XrNbDewS5avKkM71TwZ7gd6YlunMPISs4T0o6Dx9zRfpTq7oI5zd6VnvNzM6e8hlDtav l4k3afxr3oByOjs3YCC3C3wciARNuE9ZGOWljimn0q50i23+3kVLc+M3UivavpHo3V7z jFvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=1cfoe2LPvob/yv3Y0hMH7vQ0xtOjEqdIo+zIc+Ngo24=; b=g5RMCpdTF7oQRVsYly5mT1F66VAqHE/YBumLSgGX/81+PWHv4minZKkwPMcAivlE4V tbsjs7U0tFrWEghOvFEJHEy184nASVjyqAlweGGXQM9j1r2MXqZZYoIbxtHNGLQr5mzA nBWCX0xGQNoS+P6vhO2rjdGUZR4QDELQhOyJ5ykNh8D1uxnoVa/XuSjSGb1rBbsxyXen G0ZTrWkVddBYpN1Cp5Bb5YR3SlRi5jYI7DLO1fFX1o/wrYoSQAVTVcuU9wUJ50N4BZJe 4gkhw2qGj8+K/OSuI+kLMh9MiZDXL0NesaPTKLOLQ/eNuCP6zE9ts/iXoAihO+FG9FaO 3Ekw== X-Gm-Message-State: APjAAAUqt2YO/30IbPSl6qVvlxYvJ0hgQKzWpiQJ8AvtyQebepvb2l86 NSha9mkOexZvr2gBaw+0gts= X-Google-Smtp-Source: APXvYqxyKiDx3IB9I+4N9HgpDaqbLV8ImWHQUnIbHq2htm2Z2TlNcUew+Z8pJFdYKeoe9ATxfe1IYw== X-Received: by 2002:a6b:3102:: with SMTP id j2mr30878302ioa.5.1563448933462; Thu, 18 Jul 2019 04:22:13 -0700 (PDT) Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.gmail.com with ESMTPSA id m10sm45167803ioj.75.2019.07.18.04.22.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Jul 2019 04:22:12 -0700 (PDT) From: Noam Postavsky To: Eli Zaretskii Subject: Re: bug#29918: 26.0.90; serial-term error in process filter References: <87y3liwr80.fsf@runbox.com> <87d0icy03x.fsf@mouse.gnus.org> <87sgr7ottd.fsf@runbox.com> <87ims19bbo.fsf@mouse.gnus.org> <87a7dczyd9.fsf@gmail.com> <83pnm7ybmf.fsf@gnu.org> Date: Thu, 18 Jul 2019 07:22:10 -0400 In-Reply-To: <83pnm7ybmf.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 18 Jul 2019 11:45:28 +0300") Message-ID: <874l3jzixp.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2.90 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 29918 Cc: 29918@debbugs.gnu.org, gazally@runbox.com, larsi@gnus.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> there is a possibility it prevents correct decoding in case the >> terminal receives a utf-8 character in single byte chunks (though >> I'm not sure if it's even valid for a program to emit single bytes >> like that). > > I agree. I thought of limiting partial to 4, to avoid this possibility, since utf-8 characters can be 4 bytes at most (not sure about other encodings though). --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=0001-Handle-completely-undecoded-input-in-term-Bug-29918.patch Content-Description: patch >From bad839ca47ac58bd4967b95f447a596940e832f1 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Wed, 17 Jul 2019 07:20:20 -0400 Subject: [PATCH] Handle completely undecoded input in term (Bug#29918) * lisp/term.el (term-emulate-terminal): Avoid errors if the whole decoded string is eight-bit characters. Accumulate at most 4 undecoded bytes. --- lisp/term.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/term.el b/lisp/term.el index cbef68dc0a..2fdd3253ec 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -2900,9 +2900,11 @@ term-emulate-terminal ;; next time. (when (= funny str-length) (let ((partial 0)) - (while (eq (char-charset (aref decoded-substring - (- count 1 partial))) - 'eight-bit) + (while (and (< partial count) + (< partial 4) + (eq (char-charset (aref decoded-substring + (- count 1 partial))) + 'eight-bit)) (cl-incf partial)) (when (> partial 0) (setq term-terminal-undecoded-bytes -- 2.11.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 18 07:34:20 2019 Received: (at 29918) by debbugs.gnu.org; 18 Jul 2019 11:34:20 +0000 Received: from localhost ([127.0.0.1]:53515 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ho4fz-00044Y-O4 for submit@debbugs.gnu.org; Thu, 18 Jul 2019 07:34:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40062) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ho4fx-00044L-Gg for 29918@debbugs.gnu.org; Thu, 18 Jul 2019 07:34:18 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52958) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ho4fl-00037j-FS; Thu, 18 Jul 2019 07:34:07 -0400 Received: from [176.228.60.248] (port=4056 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ho4fk-0004yJ-QB; Thu, 18 Jul 2019 07:34:05 -0400 Date: Thu, 18 Jul 2019 14:33:57 +0300 Message-Id: <83d0i7y3tm.fsf@gnu.org> From: Eli Zaretskii To: Noam Postavsky In-reply-to: <874l3jzixp.fsf@gmail.com> (message from Noam Postavsky on Thu, 18 Jul 2019 07:22:10 -0400) Subject: Re: bug#29918: 26.0.90; serial-term error in process filter References: <87y3liwr80.fsf@runbox.com> <87d0icy03x.fsf@mouse.gnus.org> <87sgr7ottd.fsf@runbox.com> <87ims19bbo.fsf@mouse.gnus.org> <87a7dczyd9.fsf@gmail.com> <83pnm7ybmf.fsf@gnu.org> <874l3jzixp.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 29918 Cc: 29918@debbugs.gnu.org, gazally@runbox.com, larsi@gnus.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Noam Postavsky > Cc: 29918@debbugs.gnu.org, gazally@runbox.com, larsi@gnus.org > Date: Thu, 18 Jul 2019 07:22:10 -0400 > > >> there is a possibility it prevents correct decoding in case the > >> terminal receives a utf-8 character in single byte chunks (though > >> I'm not sure if it's even valid for a program to emit single bytes > >> like that). > > > > I agree. > > I thought of limiting partial to 4, to avoid this possibility, since > utf-8 characters can be 4 bytes at most (not sure about other encodings > though). I don't understand why limit, if we assume that no program will write UTF-8 encoded sequences byte-byte. What am I missing? In general, I'd prefer the simplest fix, as this is going to be pushed to the release branch, yes? From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 18 20:16:06 2019 Received: (at 29918) by debbugs.gnu.org; 19 Jul 2019 00:16:06 +0000 Received: from localhost ([127.0.0.1]:54890 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hoGZC-0006Sl-BK for submit@debbugs.gnu.org; Thu, 18 Jul 2019 20:16:06 -0400 Received: from mail-io1-f45.google.com ([209.85.166.45]:36520) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hoGZB-0006Lw-7Q for 29918@debbugs.gnu.org; Thu, 18 Jul 2019 20:16:05 -0400 Received: by mail-io1-f45.google.com with SMTP id o9so54871676iom.3 for <29918@debbugs.gnu.org>; Thu, 18 Jul 2019 17:16:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Stnpwkxrd0dtnkuKU3eMAMYhkQS1wpDdiMImvyozZSw=; b=RiX+18Sfsu8TJS0Xi2AvTNJaARazyvllIJ3xCFJP2xVkI3zS+29n1rW8ggf/eJas5b iiD87+0MIaVLZMEe0PH2nf2l18k/l8hnuLL0j9OMYYVqnnWrmGWZS5XqUMNYFIR1yGUB 11J6aCSzlaBRN4612Tk1wgGBEOg9b48B0xtYC7nxGPB+NQgtRnpI7ysGQDuXEka6CMQC U5lgpjzIt3bYFiA96ZMcJWx9lRREgRtub29i8aCUEF4ha+KhovEo6b7MFMojAHhJ4u2t rA8pJP8+NYXcfWi0TSDnPVpOoRk6c8dPYq4hqFec1+HRlN3r/Uz+vQSqOJLKva+CLFL7 +eWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=Stnpwkxrd0dtnkuKU3eMAMYhkQS1wpDdiMImvyozZSw=; b=dgoCK2Zu1SbKO5Y/WG6RIdHiN5bruV8KEZPNhlo4iY2BZMc+1XelWg4YCikfJVRZdd wmrel+L9AJ6navLCc2RP4q/8XFHs8ksLANCiH6yCSW0Q05asG8dObdOTA78r+STysoqP 2JJO/CfIXRhrciELhdJmyxalNwiSL5XOjGnpEI7BfKN6b/g7ef/uPfr7rwj/IiJF8IA9 gKCqpSXV2mr8YDelyPv/F54stZfq9O64jbqyk4w4cZCHEItqb3CtGgSQoYJdidLzKLxT TPB1APGZE6aYMRld//bStFdkNPf2qGRN9zZXf6dUzFHQNk50z5hn950gEeCbcG19mzab 0pVQ== X-Gm-Message-State: APjAAAVr55fztewIL/WZh0swqtEV//3hIalP3A83j2G1K3nYlsFMgJuw pr3e56eIi3d+7zYP1z1tKKE= X-Google-Smtp-Source: APXvYqw7LQdyUZeVb1Xt9KNWoRqiaOLKU2LBPGcKX+oUk3tPNs59Kp4den6fzAyn6DO5QhH8qmWwiw== X-Received: by 2002:a02:cc8f:: with SMTP id s15mr50686946jap.94.1563495359703; Thu, 18 Jul 2019 17:15:59 -0700 (PDT) Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.gmail.com with ESMTPSA id l5sm53583014ioq.83.2019.07.18.17.15.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Jul 2019 17:15:59 -0700 (PDT) From: Noam Postavsky To: Eli Zaretskii Subject: Re: bug#29918: 26.0.90; serial-term error in process filter References: <87y3liwr80.fsf@runbox.com> <87d0icy03x.fsf@mouse.gnus.org> <87sgr7ottd.fsf@runbox.com> <87ims19bbo.fsf@mouse.gnus.org> <87a7dczyd9.fsf@gmail.com> <83pnm7ybmf.fsf@gnu.org> <874l3jzixp.fsf@gmail.com> <83d0i7y3tm.fsf@gnu.org> Date: Thu, 18 Jul 2019 20:15:58 -0400 In-Reply-To: <83d0i7y3tm.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 18 Jul 2019 14:33:57 +0300") Message-ID: <87o91qyj41.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 29918 Cc: 29918@debbugs.gnu.org, gazally@runbox.com, larsi@gnus.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: > I don't understand why limit, if we assume that no program will write > UTF-8 encoded sequences byte-byte. What am I missing? I wasn't assuming that, I was wondering whether it was true or not. > In general, I'd prefer the simplest fix, as this is going to be pushed > to the release branch, yes? I wasn't sure about pushing to the release branch either, but yes, I think my first patch is safer for the release branch (since it only affects cases where we are currently signaling an error). Gemini, could you try it and confirm that it fixes your problem please? From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 20 08:49:48 2019 Received: (at 29918) by debbugs.gnu.org; 20 Jul 2019 12:49:48 +0000 Received: from localhost ([127.0.0.1]:56918 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hooo8-0002DJ-Dj for submit@debbugs.gnu.org; Sat, 20 Jul 2019 08:49:48 -0400 Received: from aibo.runbox.com ([91.220.196.211]:52866) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hooo6-0002DB-DI for 29918@debbugs.gnu.org; Sat, 20 Jul 2019 08:49:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; s=rbselector1; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From; bh=7/iBJ1y9x9wVz16PwIaNTr8npfLVXlePaSQFaTJ9kWw=; b=RP2phZU63nRrrpI+GGrfJnvi+V x0/mY2V6xM+hI4zdXHBUQVPQGxXT85xAfomKvM/5DrxEQG1wl8lcO11FIb8XTGSnttXHWDnJQyhC+ ZwKAXNwrXZiBq0wjz0+srjdf3hasomvtbIab6pORGoxBNKlkluPGfjP1h81v7cUOfzA9eM/hRRY9/ XO59PCmSAr4X7dD0llXWKa+TpG6Zp3cN4RHI8O9eieC8kSjMVW/v8IMnilHGbWo92IVvM8TA16Cyq A2Rijnq+coP18MSL37OWSUfobwWTng1+Sg+fSEMLJuG5SupE71FY1C9t/KDsiNTGNnfYS6qED4U5z iW/z378Q==; Received: from [10.9.9.203] (helo=mailfront21.runbox) by mailtransmit02.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1hooo4-0006dx-Fq; Sat, 20 Jul 2019 14:49:44 +0200 Received: by mailfront21.runbox with esmtpsa (uid:179284 ) (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) id 1hoonr-0007SE-K7; Sat, 20 Jul 2019 14:49:32 +0200 From: Gemini Lasswell To: Noam Postavsky Subject: Re: bug#29918: 26.0.90; serial-term error in process filter References: <87y3liwr80.fsf@runbox.com> <87d0icy03x.fsf@mouse.gnus.org> <87sgr7ottd.fsf@runbox.com> <87ims19bbo.fsf@mouse.gnus.org> <87a7dczyd9.fsf@gmail.com> <83pnm7ybmf.fsf@gnu.org> <874l3jzixp.fsf@gmail.com> <83d0i7y3tm.fsf@gnu.org> <87o91qyj41.fsf@gmail.com> Date: Sat, 20 Jul 2019 05:49:28 -0700 In-Reply-To: <87o91qyj41.fsf@gmail.com> (Noam Postavsky's message of "Thu, 18 Jul 2019 20:15:58 -0400") Message-ID: <87zhl898h3.fsf@runbox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 29918 Cc: 29918@debbugs.gnu.org, Eli Zaretskii , larsi@gnus.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Noam Postavsky writes: > Gemini, could you try it and confirm that it fixes your problem please? I tried both patches and both solve the problem. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 20 22:32:12 2019 Received: (at 29918) by debbugs.gnu.org; 21 Jul 2019 02:32:12 +0000 Received: from localhost ([127.0.0.1]:58044 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hp1e0-0004TV-7e for submit@debbugs.gnu.org; Sat, 20 Jul 2019 22:32:12 -0400 Received: from mail-io1-f47.google.com ([209.85.166.47]:33901) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hp1dy-0004TD-1K; Sat, 20 Jul 2019 22:32:10 -0400 Received: by mail-io1-f47.google.com with SMTP id k8so66560133iot.1; Sat, 20 Jul 2019 19:32:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Mgvg0uKkbBHcuc5UEvrfReIEJ6ZPCFfsvnIJAgw6kaI=; b=g6FeJERD2iBclcDHxHMRdTWZwW6/1fkNaz8jmsWOcfGP1XNLkV5VQ2OvsdTel0zsYG Cg/1lEAsC2SQ1FelJbZj2772Y18iwiFxLYDhfzeIa2I9Gwt9BIF8KeP7x/HwuAiTy4tm YwJ8tGw/CAWJAk6Jaa0IxCPc3btpLPVUhToHYosI0iVY9Vrh7jjWViQREpm4BOgelUbr EbhvEsExdo7v1oQQ1PVXRy3fet26P8djA7cz5lFiUvWpDeYkO+pECmDC66ZzRdSHOukj cWwSKrJ4GL4sE3bBIcY6UxhHSMjQcpcZNKr9Qgv3bjWH0D/rw7GtmVWPBHq3+k2k0ia4 Le/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=Mgvg0uKkbBHcuc5UEvrfReIEJ6ZPCFfsvnIJAgw6kaI=; b=mOkJ+f7XNDH4VJVuNmU2BooZ1U4GYnz/Q1C0lyaAkQ2T08ZV9mjM3szL6gTqsAEO+e Apgmw5gmtwB9JR0yQnnZRXHR0qcYON4HEUJxPyPNIBF2zK2NPbz5vtpUFDIUGorMozr5 U6lT6Ao2Lu1EubRv6ZVBInRopJjAhqLRC8omChIiVo3vLKRgwp9ri8OjXSWK3kW9RDEs ySd63RgU8ogdQBDHJX2JSz3HHOIo+K6r6slMESoMXAsTQQUuzQu2JpAmGd8hLgSSE6q8 Zs8PakbudRnV9bCFbrYYb0nQxOVcwQCTMbtJaQtWs8Up9E23JxFlgTJxMnqAxdLJhgR/ 5r5g== X-Gm-Message-State: APjAAAXDZ5T1M/XBjC7DKQAxya4tKgb6/U6SwWqYIHC+vPNBhoqNfLjZ UDG6qmoDHmD9eCSFAiGhcrFzOtR+ X-Google-Smtp-Source: APXvYqxwMsxSdSJsFDrEUu2j6JkKXJfEyDKkhbfAuRU94dhEbUVE+rWBF5fgXjMTAh5jW7Aao3j+tg== X-Received: by 2002:a5e:8e42:: with SMTP id r2mr54780750ioo.305.1563676323980; Sat, 20 Jul 2019 19:32:03 -0700 (PDT) Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.gmail.com with ESMTPSA id i23sm25705565ioj.24.2019.07.20.19.32.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 20 Jul 2019 19:32:03 -0700 (PDT) From: Noam Postavsky To: Gemini Lasswell Subject: Re: bug#29918: 26.0.90; serial-term error in process filter References: <87y3liwr80.fsf@runbox.com> <87d0icy03x.fsf@mouse.gnus.org> <87sgr7ottd.fsf@runbox.com> <87ims19bbo.fsf@mouse.gnus.org> <87a7dczyd9.fsf@gmail.com> <83pnm7ybmf.fsf@gnu.org> <874l3jzixp.fsf@gmail.com> <83d0i7y3tm.fsf@gnu.org> <87o91qyj41.fsf@gmail.com> <87zhl898h3.fsf@runbox.com> Date: Sat, 20 Jul 2019 22:32:02 -0400 In-Reply-To: <87zhl898h3.fsf@runbox.com> (Gemini Lasswell's message of "Sat, 20 Jul 2019 05:49:28 -0700") Message-ID: <87blxoxgm5.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 29918 Cc: 29918@debbugs.gnu.org, Eli Zaretskii , larsi@gnus.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 29918 fixed close 29918 26.3 quit Gemini Lasswell writes: > Noam Postavsky writes: > >> Gemini, could you try it and confirm that it fixes your problem please? > > I tried both patches and both solve the problem. Thanks, I added a test and pushed the first patch to emacs-26. 150bdfe43a 2019-07-20T21:35:21-04:00 "Handle completely undecoded input in term (Bug#29918)" https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=150bdfe43acde8423612cbff4eafbbb88878b497 From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 21 09:49:25 2019 Received: (at 29918) by debbugs.gnu.org; 21 Jul 2019 13:49:25 +0000 Received: from localhost ([127.0.0.1]:58248 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hpCDM-0006Az-7b for submit@debbugs.gnu.org; Sun, 21 Jul 2019 09:49:24 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:34524) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hpCDK-0006Am-6L for 29918@debbugs.gnu.org; Sun, 21 Jul 2019 09:49:22 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 807644451CF; Sun, 21 Jul 2019 09:49:16 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 60C4F4451CA; Sun, 21 Jul 2019 09:49:15 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1563716955; bh=QOTMHBUAozjwfaaGxGqfeHLLl33usT7EVIP2HQIxPn0=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=PnuvB905BYj8tzwzMdkldvcG7QlOu65a3cIYHFfQu6rXBX7xXSOXfWkTjsCZTZ42J NC1IvMzXeGZxPTzX89DSTygOcw2kQMSv7Hw5ken/qehkAOAasNSQC1y+kkJXvtDiJh jOfPqfuIhKM74ZeGaDfKEAP61v3aUETjR+buez39oXY4eov2E7+pZhoijBrtWrYxlm 3nVAG+xC08vWcrNkjg7qnzvikwmnc9vTFjad3PMWPOzVuxbqaGIwkv17rzfFWDi14T pS0OgzU46G47QEbpHWwq9E8Ya1MDjTvu9hfJcjwmxW9efriRgT983NdhboYTn5uBq6 PPxoGnU4/d0qQ== Received: from pastel (unknown [216.154.19.233]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 83E52121498; Sun, 21 Jul 2019 09:49:13 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#29918: 26.0.90; serial-term error in process filter Message-ID: References: <87y3liwr80.fsf@runbox.com> <87d0icy03x.fsf@mouse.gnus.org> <87sgr7ottd.fsf@runbox.com> <87ims19bbo.fsf@mouse.gnus.org> <87a7dczyd9.fsf@gmail.com> <83pnm7ybmf.fsf@gnu.org> <874l3jzixp.fsf@gmail.com> <83d0i7y3tm.fsf@gnu.org> Date: Sun, 21 Jul 2019 09:49:02 -0400 In-Reply-To: <83d0i7y3tm.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 18 Jul 2019 14:33:57 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.124 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 29918 Cc: 29918@debbugs.gnu.org, gazally@runbox.com, larsi@gnus.org, Noam Postavsky X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > I don't understand why limit, if we assume that no program will write > UTF-8 encoded sequences byte-byte. I don't think we can assume that, in general. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 21 09:53:02 2019 Received: (at 29918) by debbugs.gnu.org; 21 Jul 2019 13:53:02 +0000 Received: from localhost ([127.0.0.1]:58253 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hpCGs-0006G4-54 for submit@debbugs.gnu.org; Sun, 21 Jul 2019 09:53:02 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:57590) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hpCGq-0006Fa-1i for 29918@debbugs.gnu.org; Sun, 21 Jul 2019 09:53:00 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id F0714100966; Sun, 21 Jul 2019 09:52:52 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 5F385100543; Sun, 21 Jul 2019 09:52:49 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1563717169; bh=wMvzSQGqIZDySMPYbHAyEiL7oLh8Juytxxn/d4i2aTA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=f423ZlAN6p3fIb4eFjbBeg/OvSiPbOpbxB3hEBBC+tfuWV4ACJvWOvWTU7X14BD7h Bafa3MiIW8si3rh7lHdnnSISYGFURju8lIck7J1T7Fs3nBv2GEhku5JOmBNmq7NG53 zqwdEdYp+JaswavJWTe4xTTp/XZtYCxlzxAZ8CQ7Lrs9V5xPoPnOtd5r/GlzCUQu+n XSehdO2NBnbbGhS6BKGsNZzm9dTC8Dj9g0XnihLSMWfIsRc5VlT92178pJxvbZjYWT anYQ4iiSzu4/jOkA3eMH+zGkPSunFZJ9lJrGqWCByswq7cNQ61nQ84e/CnZeCoEHX7 oazvdzzDFb/9Q== Received: from pastel (unknown [216.154.19.233]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 2F8AA121481; Sun, 21 Jul 2019 09:52:48 -0400 (EDT) From: Stefan Monnier To: Noam Postavsky Subject: Re: bug#29918: 26.0.90; serial-term error in process filter In-Reply-To: <874l3jzixp.fsf@gmail.com> (Noam Postavsky's message of "Thu, 18 Jul 2019 07:22:10 -0400") Message-ID: References: <87y3liwr80.fsf@runbox.com> <87d0icy03x.fsf@mouse.gnus.org> <87sgr7ottd.fsf@runbox.com> <87ims19bbo.fsf@mouse.gnus.org> <87a7dczyd9.fsf@gmail.com> <83pnm7ybmf.fsf@gnu.org> <874l3jzixp.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Date: Sun, 21 Jul 2019 09:52:39 -0400 MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.010 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 29918 Cc: 29918@debbugs.gnu.org, gazally@runbox.com, Eli Zaretskii , larsi@gnus.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>> there is a possibility it prevents correct decoding in case the >>> terminal receives a utf-8 character in single byte chunks (though >>> I'm not sure if it's even valid for a program to emit single bytes >>> like that). >> I agree. > I thought of limiting partial to 4, to avoid this possibility, since > utf-8 characters can be 4 bytes at most (not sure about other encodings > though). That sounds like a good idea. Just a side note to mention that there are other multibyte encodings than utf-8 and I have no reason to believe that they're never used for terminals, so we should look for the maximum over all coding-systems rather than only utf-8. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 21 10:38:53 2019 Received: (at 29918) by debbugs.gnu.org; 21 Jul 2019 14:38:54 +0000 Received: from localhost ([127.0.0.1]:59260 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hpCzF-0001KT-KS for submit@debbugs.gnu.org; Sun, 21 Jul 2019 10:38:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50934) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hpCzD-0001KG-Sp for 29918@debbugs.gnu.org; Sun, 21 Jul 2019 10:38:52 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:39620) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hpCz7-0007ht-Ap; Sun, 21 Jul 2019 10:38:45 -0400 Received: from [176.228.60.248] (port=1593 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hpCz6-0000z3-SY; Sun, 21 Jul 2019 10:38:45 -0400 Date: Sun, 21 Jul 2019 17:38:29 +0300 Message-Id: <83zhl7qwpm.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-reply-to: (message from Stefan Monnier on Sun, 21 Jul 2019 09:49:02 -0400) Subject: Re: bug#29918: 26.0.90; serial-term error in process filter References: <87y3liwr80.fsf@runbox.com> <87d0icy03x.fsf@mouse.gnus.org> <87sgr7ottd.fsf@runbox.com> <87ims19bbo.fsf@mouse.gnus.org> <87a7dczyd9.fsf@gmail.com> <83pnm7ybmf.fsf@gnu.org> <874l3jzixp.fsf@gmail.com> <83d0i7y3tm.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 29918 Cc: 29918@debbugs.gnu.org, gazally@runbox.com, larsi@gnus.org, npostavs@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Monnier > Cc: Noam Postavsky , 29918@debbugs.gnu.org, > gazally@runbox.com, larsi@gnus.org > Date: Sun, 21 Jul 2019 09:49:02 -0400 > > > I don't understand why limit, if we assume that no program will write > > UTF-8 encoded sequences byte-byte. > > I don't think we can assume that, in general. What would be a situation where it is false? From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 21 10:45:46 2019 Received: (at 29918) by debbugs.gnu.org; 21 Jul 2019 14:45:46 +0000 Received: from localhost ([127.0.0.1]:59275 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hpD5q-0002Bv-Jr for submit@debbugs.gnu.org; Sun, 21 Jul 2019 10:45:46 -0400 Received: from quimby.gnus.org ([80.91.231.51]:58906) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hpD5o-00029Z-RK for 29918@debbugs.gnu.org; Sun, 21 Jul 2019 10:45:41 -0400 Received: from [80.169.244.84] (helo=sandy) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hpD5h-0004io-TB; Sun, 21 Jul 2019 16:45:37 +0200 From: Lars Ingebrigtsen To: Eli Zaretskii Subject: Re: bug#29918: 26.0.90; serial-term error in process filter References: <87y3liwr80.fsf@runbox.com> <87d0icy03x.fsf@mouse.gnus.org> <87sgr7ottd.fsf@runbox.com> <87ims19bbo.fsf@mouse.gnus.org> <87a7dczyd9.fsf@gmail.com> <83pnm7ybmf.fsf@gnu.org> <874l3jzixp.fsf@gmail.com> <83d0i7y3tm.fsf@gnu.org> <83zhl7qwpm.fsf@gnu.org> Date: Sun, 21 Jul 2019 16:45:33 +0200 In-Reply-To: <83zhl7qwpm.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 21 Jul 2019 17:38:29 +0300") Message-ID: <87imrv5tv6.fsf@mouse.gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Eli Zaretskii writes: >> From: Stefan Monnier >> Cc: Noam Postavsky , 29918@debbugs.gnu.org, >> gazally@runbox.com, larsi@gnus.org >> Date: Sun, 21 Jul 2019 09:49:02 -0400 >> [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 29918 Cc: 29918@debbugs.gnu.org, gazally@runbox.com, Stefan Monnier , npostavs@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> From: Stefan Monnier >> Cc: Noam Postavsky , 29918@debbugs.gnu.org, >> gazally@runbox.com, larsi@gnus.org >> Date: Sun, 21 Jul 2019 09:49:02 -0400 >> >> > I don't understand why limit, if we assume that no program will write >> > UTF-8 encoded sequences byte-byte. >> >> I don't think we can assume that, in general. > > What would be a situation where it is false? Isn't sending bytes one-by-one a pretty common thing for (primitive) programs to do? I'd assume so, especially for serial communication programs. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 21 10:48:15 2019 Received: (at 29918) by debbugs.gnu.org; 21 Jul 2019 14:48:15 +0000 Received: from localhost ([127.0.0.1]:59279 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hpD8I-0003ju-Sw for submit@debbugs.gnu.org; Sun, 21 Jul 2019 10:48:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53188) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hpD8G-0003je-Rm for 29918@debbugs.gnu.org; Sun, 21 Jul 2019 10:48:13 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:39706) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hpD8B-0003b5-7k; Sun, 21 Jul 2019 10:48:07 -0400 Received: from [176.228.60.248] (port=2174 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hpD8A-0001gz-95; Sun, 21 Jul 2019 10:48:06 -0400 Date: Sun, 21 Jul 2019 17:47:50 +0300 Message-Id: <83y30rqwa1.fsf@gnu.org> From: Eli Zaretskii To: Lars Ingebrigtsen In-reply-to: <87imrv5tv6.fsf@mouse.gnus.org> (message from Lars Ingebrigtsen on Sun, 21 Jul 2019 16:45:33 +0200) Subject: Re: bug#29918: 26.0.90; serial-term error in process filter References: <87y3liwr80.fsf@runbox.com> <87d0icy03x.fsf@mouse.gnus.org> <87sgr7ottd.fsf@runbox.com> <87ims19bbo.fsf@mouse.gnus.org> <87a7dczyd9.fsf@gmail.com> <83pnm7ybmf.fsf@gnu.org> <874l3jzixp.fsf@gmail.com> <83d0i7y3tm.fsf@gnu.org> <83zhl7qwpm.fsf@gnu.org> <87imrv5tv6.fsf@mouse.gnus.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 29918 Cc: 29918@debbugs.gnu.org, gazally@runbox.com, monnier@iro.umontreal.ca, npostavs@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Lars Ingebrigtsen > Cc: Stefan Monnier , npostavs@gmail.com, > 29918@debbugs.gnu.org, gazally@runbox.com > Date: Sun, 21 Jul 2019 16:45:33 +0200 > > >> > I don't understand why limit, if we assume that no program will write > >> > UTF-8 encoded sequences byte-byte. > >> > >> I don't think we can assume that, in general. > > > > What would be a situation where it is false? > > Isn't sending bytes one-by-one a pretty common thing for (primitive) > programs to do? I'd assume so, especially for serial communication > programs. We are talking about term.el, don't we? So the programs relevant here are those which run in a terminal, whether serial or not, and they are generally expected to talk in characters, not bytes. From unknown Mon Aug 18 06:57:15 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 19 Aug 2019 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator