From unknown Fri Aug 15 03:59:53 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#57727 <57727@debbugs.gnu.org> To: bug#57727 <57727@debbugs.gnu.org> Subject: Status: 29.0.50; Optimize tty display updates Reply-To: bug#57727 <57727@debbugs.gnu.org> Date: Fri, 15 Aug 2025 10:59:53 +0000 retitle 57727 29.0.50; Optimize tty display updates reassign 57727 emacs submitter 57727 Gerd M=C3=B6llmann severity 57727 wishlist thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 11 06:04:01 2022 Received: (at submit) by debbugs.gnu.org; 11 Sep 2022 10:04:01 +0000 Received: from localhost ([127.0.0.1]:40749 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXJoj-0007Db-5w for submit@debbugs.gnu.org; Sun, 11 Sep 2022 06:04:00 -0400 Received: from lists.gnu.org ([209.51.188.17]:41050) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXJoe-0007DR-6P for submit@debbugs.gnu.org; Sun, 11 Sep 2022 06:03:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48290) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXJod-00047t-Jh for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2022 06:03:51 -0400 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]:40637) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oXJob-0006Ob-C6 for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2022 06:03:51 -0400 Received: by mail-ed1-x52a.google.com with SMTP id m1so8772076edb.7 for ; Sun, 11 Sep 2022 03:03:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date; bh=2/xLPqVIQYRVwj9FUzolo4dhro2VfndkzPuXBnd/hE8=; b=ZWSMu0H3mdA5yc15lzgtP4MLXS+kUWA1+F/ZL6FUSlpTNIRMesOK+bSVS9gfS/5+XQ LB9q9OwJADOoan4bDwpgKXcX0MP24tHTWvCpLOcFiMw6glE7e40jEbmUzk3glVmMMmO1 P+nXIR4EiRl3x78ExfNorSEHQpdRpt0WtihTcxhK9+XmCpaCypLqExRbF6L9AelhmPXC VuD5qeN7OCIa01omntzekgdvuBohbuo2w2RzxfIMbSugdZiu5tdKn9jsACOzPKk0u0E8 A9wO8J8DDaO2/wt9cRZITP4qBYJjxytkeCOJnnFxXL0eEE5gIYFRNuPiQXRPyf2o/zCW fP3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date; bh=2/xLPqVIQYRVwj9FUzolo4dhro2VfndkzPuXBnd/hE8=; b=bCMeXjL1QkAP/EC0eULtqcYyJCyCrZgjOeFD0UBGvbvRCAHhmLxfPy5ahAdlQ5jwFz wcC4MDSAAoUk46auaOA/rsl7tVLqIWs9MTRFc2369KdSe9HPxWMTZlCx0HeKaTOAI5vy vLx4aTCzWvcDUbl4rYy8U/t9XJmIngCXupcjF7ZZ0W9RiJ9v0oqQV47Zj1/r/31nfct+ Ulk8AepK4dBvYqj2YQ2IzMV1NVjk8kJdFY0oGHbJMGVI+exfhoVHEef+LjSqt3e4j4Sz +AjplJh1d8QsEsQL7QzvMjw4UF8F0y4RAuvh1LlSCBWxYo6RjhUBGMrnSb1OjvWxD4RZ ep8A== X-Gm-Message-State: ACgBeo0cJ9EfNo47j1e51R4ZxOKiV70pVdIBPE4200UBtGYATjfSLCWB hWnVHsXnQBPzfvN2S2WYw8j9vRhA6hs= X-Google-Smtp-Source: AA6agR49k4aKMSiD5RkxLcqSQuU1p5NtDdAk/mLkM/tJ/kRIyNKqfSsAAzSxd8nAl4+fQVCnA3IxFg== X-Received: by 2002:a05:6402:2802:b0:43a:9098:55a0 with SMTP id h2-20020a056402280200b0043a909855a0mr18087346ede.179.1662890627020; Sun, 11 Sep 2022 03:03:47 -0700 (PDT) Received: from Mini.fritz.box (pd9e36635.dip0.t-ipconnect.de. [217.227.102.53]) by smtp.gmail.com with ESMTPSA id q10-20020a50c34a000000b0044838efb8f8sm3711221edb.25.2022.09.11.03.03.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Sep 2022 03:03:46 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: bug-gnu-emacs@gnu.org Subject: 29.0.50; Optimize tty display updates Date: Sun, 11 Sep 2022 12:03:45 +0200 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::52a; envelope-from=gerd.moellmann@gmail.com; helo=mail-ed1-x52a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) 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: -2.3 (--) --=-=-= Content-Type: text/plain This is a wishlist item for the implementation of what was discussed recently on emacs-devel, namely using a larger output buffer, and avoiding fflush as a means of improving tty display update speed. The patch below is my first take on that. It adds a low-level interface consisting of two functions tty--set-output-buffer-size and tty-output-buffer-size to change and retrieve the output buffer size of a device. A buffer size of 0 is taken to mean "do what we did since 1991, and a non-zero value is used as the buffer size set with setvbuf. Default is currently to do everything as it always was. One has to do something like (tty--set-output-buffer-size (* 64 1024)) to change to the new behavior. Feedback welcome, especially for the default, i.e. leaving everything as-is, and for the Lisp interface. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Optimize-tty-display-updates.patch Content-Description: patch for master >From 597d17f6ecc866328e3c5c3438b1d7fec3b2bbea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerd=20M=C3=B6llmann?= Date: Sun, 11 Sep 2022 11:42:18 +0200 Subject: [PATCH] Optimize tty display updates * src/dispnew.c (update_frame_1): Don'f flush if tty's output_buffer_size is non-zero. * src/sysdep.c (init_sys_modes): Setvbuf depending on the tty's output_buffer_size. * src/term.c (Ftty__set_output_buffer_size, Ftty__output_buffer_size): Low-level interface for setting and retrieving a tty's output buffer size. (syms_of_term): Defsubr the new functions. * src/termchar.h (struct tty_display_info): New member output_buffer_size. --- src/dispnew.c | 4 +++- src/sysdep.c | 5 ++++- src/term.c | 39 +++++++++++++++++++++++++++++++++++++++ src/termchar.h | 5 +++++ 4 files changed, 51 insertions(+), 2 deletions(-) diff --git a/src/dispnew.c b/src/dispnew.c index 8932f103f1..b786f0f1ba 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -4929,7 +4929,9 @@ update_frame_1 (struct frame *f, bool force_p, bool inhibit_id_p, { if (MATRIX_ROW_ENABLED_P (desired_matrix, i)) { - if (FRAME_TERMCAP_P (f)) + /* Note that output_buffer_size being 0 means that we want the + old default behavior of flushing output every now and then. */ + if (FRAME_TERMCAP_P (f) && FRAME_TTY (f)->output_buffer_size == 0) { /* Flush out every so many lines. Also flush out if likely to have more than 1k buffered diff --git a/src/sysdep.c b/src/sysdep.c index efd9638b07..abb385d138 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -1304,7 +1304,10 @@ init_sys_modes (struct tty_display_info *tty_out) } #endif /* F_GETOWN */ - setvbuf (tty_out->output, NULL, _IOFBF, BUFSIZ); + const size_t buffer_size = (tty_out->output_buffer_size + ? tty_out->output_buffer_size + : BUFSIZ); + setvbuf (tty_out->output, NULL, _IOFBF, buffer_size); if (tty_out->terminal->set_terminal_modes_hook) tty_out->terminal->set_terminal_modes_hook (tty_out->terminal); diff --git a/src/term.c b/src/term.c index 2e43d89232..8e19c96672 100644 --- a/src/term.c +++ b/src/term.c @@ -2400,6 +2400,43 @@ DEFUN ("resume-tty", Fresume_tty, Sresume_tty, 0, 1, 0, return Qnil; } +DEFUN ("tty--set-output-buffer-size", Ftty__set_output_buffer_size, + Stty__set_output_buffer_size, 1, 2, 0, doc: + /* Set the output buffer size for a TTY. + +SIZE zero means use the system's default value. If SIZE is +non-zero,this also avoids flushing the output stream. + +TTY may be a terminal object, a frame, or nil (meaning the selected +frame's terminal). + +This function temporarily suspends and resumes the terminal +device. */) + (Lisp_Object size, Lisp_Object tty) +{ + if (!TYPE_RANGED_FIXNUMP (size_t, size)) + error ("Invalid output buffer size"); + Fsuspend_tty(tty); + struct terminal *terminal = decode_tty_terminal (tty); + terminal->display_info.tty->output_buffer_size + = XFIXNUM (size) <= 0 ? 0 : XFIXNUM (size); + return Fresume_tty(tty); +} + +DEFUN ("tty--output-buffer-size", Ftty__output_buffer_size, + Stty__output_buffer_size, 0, 1, 0, doc: + /* Return the output buffer size of TTY. + +TTY may be a terminal object, a frame, or nil (meaning the selected +frame's terminal). + +A value of zero means TTY uses the system's default value. */) + (Lisp_Object tty) +{ + struct terminal *terminal = decode_tty_terminal (tty); + return make_fixnum (terminal->display_info.tty->output_buffer_size); +} + /*********************************************************************** Mouse @@ -4556,6 +4593,8 @@ syms_of_term (void) defsubr (&Stty_top_frame); defsubr (&Ssuspend_tty); defsubr (&Sresume_tty); + defsubr (&Stty__set_output_buffer_size); + defsubr (&Stty__output_buffer_size); #ifdef HAVE_GPM defsubr (&Sgpm_mouse_start); defsubr (&Sgpm_mouse_stop); diff --git a/src/termchar.h b/src/termchar.h index 49560dbc2a..0f17246411 100644 --- a/src/termchar.h +++ b/src/termchar.h @@ -53,6 +53,11 @@ #define EMACS_TERMCHAR_H FILE *output; /* The stream to be used for terminal output. NULL if the terminal is suspended. */ + /* Size of output buffer. A value of zero means use the default of + BUFIZE. If non-zero, also minimize writes to the tty by avoiding + calls to flush. */ + size_t output_buffer_size; + FILE *termscript; /* If nonzero, send all terminal output characters to this stream also. */ -- 2.37.3 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 11 06:12:27 2022 Received: (at control) by debbugs.gnu.org; 11 Sep 2022 10:12:27 +0000 Received: from localhost ([127.0.0.1]:40783 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXJww-0007S5-SA for submit@debbugs.gnu.org; Sun, 11 Sep 2022 06:12:27 -0400 Received: from mail-ed1-f53.google.com ([209.85.208.53]:42966) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXJwu-0007Rk-OI for control@debbugs.gnu.org; Sun, 11 Sep 2022 06:12:25 -0400 Received: by mail-ed1-f53.google.com with SMTP id q21so8816430edc.9 for ; Sun, 11 Sep 2022 03:12:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:subject:from:to:message-id :date:from:to:cc:subject:date; bh=Ebs9cd6qb4vqBvfZNkcbrEZWP9AphREs3UuGWnH1NwM=; b=qTQTC0s/R9MeAWVIdbYyRqnSNBjgUeTD7Uy3CwlZXSRTDzpIbqGxgTnyqjRPLvhf/W n5OmiVYGM9RtXKbwMxPmDdJytyWuO38tFBieSuSQz4JNEY9y5T9+BzjgQC0pj7+DcStc lgVGWgWMVsH5vVZHR/cw4po2SMPtmzMYlvQbaUXo5/SPJJ0+j1hp44uVbA4V45x7SrV4 KbBtkG8SxfmjzSI3/Pc53pJWqyRViLVI76aaxT9cxc9UNNKUAPQOkMAo8vuTahlncLca IOXEF8g+GoJao60vesBrb7ajY9tMQXltwqOf8a4g/9fn8erTCruGiAPCE7oxsiTP41fs S4Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:subject:from:to:message-id :date:x-gm-message-state:from:to:cc:subject:date; bh=Ebs9cd6qb4vqBvfZNkcbrEZWP9AphREs3UuGWnH1NwM=; b=lyxto48yUAnvNBYHgVUcC7m98o8CKKObYF6faVHHDAwtZhKa00uirWgJUMnwTlENvf WEQxexphaA649EGhQCLKveK7o+4Feux87m6VSkMpPZXDWlHLG0kSWZhfN7tE855M/9y2 pMD2SBIQK4stB6T+Uau+mHfBvKa/kx1GUHbfanXXfRGw34sC/meZACKIWqlOtFby8ngC qLp06ijwhdxvwBxAUgz7sYZrAoBCZCycBvM1KVBs0DmhTLgHlFclJcts1kXsQ+bdg8fH RPAj97vSjJe22gQKeVVSeMreQTsWvU0cApTfp7wiEetLMsdElst09EpAv+Zx6Eg8gfmv Y4lw== X-Gm-Message-State: ACgBeo3gQvdvCr9XQJj2IGm/okQvz6yf9As6Jb0k/G0BXebBtz20HZJ7 5+a0tyGJMk6U4OB0whjN5q/14M4fom5sdw== X-Google-Smtp-Source: AA6agR7zaBEAakUNaaM+Moa4Jc0/m9TqrJsCQWyha/c2x2k+/0kGISvobVp7h/xjvvyHkMWam9XgTg== X-Received: by 2002:a05:6402:b85:b0:44e:dad7:3e24 with SMTP id cf5-20020a0564020b8500b0044edad73e24mr18776177edb.264.1662891138787; Sun, 11 Sep 2022 03:12:18 -0700 (PDT) Received: from Mini.fritz.box (pd9e36635.dip0.t-ipconnect.de. [217.227.102.53]) by smtp.gmail.com with ESMTPSA id o18-20020a170906769200b007386a8b90c9sm2875727ejm.13.2022.09.11.03.12.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Sep 2022 03:12:18 -0700 (PDT) Date: Sun, 11 Sep 2022 12:12:17 +0200 Message-Id: To: control@debbugs.gnu.org From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Subject: control message for bug #57727 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control 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 (-) severity 57727 wishlist quit From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 11 07:18:46 2022 Received: (at 57727) by debbugs.gnu.org; 11 Sep 2022 11:18:46 +0000 Received: from localhost ([127.0.0.1]:40904 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXKz7-00037M-T4 for submit@debbugs.gnu.org; Sun, 11 Sep 2022 07:18:46 -0400 Received: from quimby.gnus.org ([95.216.78.240]:39308) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXKz5-000376-Hx for 57727@debbugs.gnu.org; Sun, 11 Sep 2022 07:18:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :Date:References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=I3Zm1QhjdUNw+KIcFuCs0wAG8t7KS9D2sbCAmruqkkY=; b=B57jJpfdwO5ldavivC8blxAbK3 O2o/wqlYFoOX2XmyT3fwH4jGJXWgmCL3DOYkFRnKF1Ep2yWzj0EDPs5VnyUXHTKydLIA34bV0v9wi RichhyQlXefFG/68SgU+6mgSw4rVr+cDLDLB9y+AeCRGpZ72e1PaOqWiznFKyjwtE8HQ=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oXKyx-0003iv-E4; Sun, 11 Sep 2022 13:18:37 +0200 From: Lars Ingebrigtsen To: Gerd =?utf-8?Q?M=C3=B6llmann?= Subject: Re: bug#57727: 29.0.50; Optimize tty display updates In-Reply-To: ("Gerd =?utf-8?Q?M=C3=B6llman?= =?utf-8?Q?n=22's?= message of "Sun, 11 Sep 2022 12:03:45 +0200") References: X-Now-Playing: Insides's _Euphoria_: "Carly Simon" Date: Sun, 11 Sep 2022 13:18:34 +0200 Message-ID: <87bkrmgnw5.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: Gerd Möllmann writes: > The patch below is my first take on that. It adds a low-level interface > consisting of two functions tty--set-output-buffer-size and > tty-output-buffer-size to change and retrieve the output buffe [...] 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: -2.3 (--) X-Debbugs-Envelope-To: 57727 Cc: 57727@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: -3.3 (---) Gerd M=C3=B6llmann writes: > The patch below is my first take on that. It adds a low-level interface > consisting of two functions tty--set-output-buffer-size and > tty-output-buffer-size to change and retrieve the output buffer size of > a device. A buffer size of 0 is taken to mean "do what we did since > 1991, and a non-zero value is used as the buffer size set with setvbuf. Makes sense to me. > Default is currently to do everything as it always was. One has to do > something like > > (tty--set-output-buffer-size (* 64 1024)) > > to change to the new behavior. > > Feedback welcome, especially for the default, i.e. leaving everything > as-is, and for the Lisp interface. Perhaps adding a defcustom for this where the :set calls `tty--set-output-buffer-size' might be a nice interface? From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 11 09:49:21 2022 Received: (at 57727) by debbugs.gnu.org; 11 Sep 2022 13:49:21 +0000 Received: from localhost ([127.0.0.1]:41145 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXNKr-0007vX-BH for submit@debbugs.gnu.org; Sun, 11 Sep 2022 09:49:21 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:23599) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXNKq-0007vB-3j for 57727@debbugs.gnu.org; Sun, 11 Sep 2022 09:49:20 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 47994440611; Sun, 11 Sep 2022 09:49:14 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id BE17C4401FE; Sun, 11 Sep 2022 09:49:12 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1662904152; bh=FMzTJTSsE/L/EgEzPWLDRWwJnrFiZcERVDXKw0JKL9w=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=WcxFJCsTO/PZk+6l2e5o0FkGaJN6wJ0acy2n+qc26Fs06N5E5N8Quk1VFnlg7tMoV TYMu4ky4oKecL2xo7jrkI8tq6ZALS3ZQCSEIdu+ihmzbuEiZaG3V9U6doN/xoHx+FC /DHHCWMI1DITEQNnNdxDrUhrnAfIBPIHjUBfBUeu0BhRY4jJdE/O5/9Abdroz+wGKj U1HbLnStEHO3mRLIwV43X0bWxUHZ/SKDTOSQUxam8NGqoDFtcUwrBhkdZFcPPTuX86 T0p0Dl3n94hA87dZsIcFgj2qtFwkiw7v7KQHWIqUoXwkodLjWwHwPHcAfwNe8kyoJU Phv0cssB0XLHA== Received: from pastel (unknown [157.52.9.190]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 70ED9120909; Sun, 11 Sep 2022 09:49:12 -0400 (EDT) From: Stefan Monnier To: Gerd =?windows-1252?Q?M=F6llmann?= Subject: Re: bug#57727: 29.0.50; Optimize tty display updates In-Reply-To: ("Gerd =?windows-1252?Q?M=F6l?= =?windows-1252?Q?lmann=22's?= message of "Sun, 11 Sep 2022 12:03:45 +0200") Message-ID: References: Date: Sun, 11 Sep 2022 09:49:11 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.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.006 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 T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57727 Cc: 57727@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: -3.3 (---) > +DEFUN ("tty--set-output-buffer-size", Ftty__set_output_buffer_size, > + Stty__set_output_buffer_size, 1, 2, 0, doc: > + /* Set the output buffer size for a TTY. > + > +SIZE zero means use the system's default value. If SIZE is > +non-zero,this also avoids flushing the output stream. ^^ SPC > +TTY may be a terminal object, a frame, or nil (meaning the selected > +frame's terminal). > + > +This function temporarily suspends and resumes the terminal > +device. */) > + (Lisp_Object size, Lisp_Object tty) > +{ > + if (!TYPE_RANGED_FIXNUMP (size_t, size)) > + error ("Invalid output buffer size"); > + Fsuspend_tty(tty); ^^ SPC > + struct terminal *terminal = decode_tty_terminal (tty); > + terminal->display_info.tty->output_buffer_size > + = XFIXNUM (size) <= 0 ? 0 : XFIXNUM (size); > + return Fresume_tty(tty); ^^ SPC That seems a bit over-engineered to me. Why not just a DEVAR_BOOL to control whether we flush or not? If someone wants to try out different buffer sizes, I suspect that recompiling is a good enough solution (or provide a DEFVAR_INT for that and let the tester(s) call `suspend/resume-tty` by hand). Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 12 02:02:11 2022 Received: (at 57727) by debbugs.gnu.org; 12 Sep 2022 06:02:11 +0000 Received: from localhost ([127.0.0.1]:43910 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXcWJ-0004iR-Dl for submit@debbugs.gnu.org; Mon, 12 Sep 2022 02:02:11 -0400 Received: from mail-ej1-f44.google.com ([209.85.218.44]:41512) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXcWH-0004iA-3z for 57727@debbugs.gnu.org; Mon, 12 Sep 2022 02:02:11 -0400 Received: by mail-ej1-f44.google.com with SMTP id gh9so17657573ejc.8 for <57727@debbugs.gnu.org>; Sun, 11 Sep 2022 23:02:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date; bh=68y0Z4rEAE4iy8O8lTRFZaoiIo02JxcJ8hU2wZrCIuI=; b=cLNFHxQTDLne1uG20EDI9QSjY79PijNdu9G03ec5GOswAHE1jieJrG4wAkH6sCF3a9 M50QhmxCy8ST/KWf0oJEkdLurO0sfWprlCy60KNypl1/n6NLrUlFW5GqJrFiA8B0fGdU NLkWoMkFnXO45PzUSbFHk7LDAivvP+66gxLO+u7l1t5YLdSL1yh/tb+r0Q13meZdmAWK 0sjcD6CVD2IkeZL0oJIWIOnEwMzygNrLxROgA8r3A/jTpTbrRSXQnW7N3R8ZApocwc+y LNJH2flELtXJ2f0I0TDToSagnj0za6WmKrMzpmG6/v/82xxh54+zJi6GLPEWsKasulsp 8+fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date; bh=68y0Z4rEAE4iy8O8lTRFZaoiIo02JxcJ8hU2wZrCIuI=; b=n+iLgfCyrlCXyHvm/uAB2kQO2T+Bwjd+hQ/oYNHVnlgFuMX9p9JWz73kBaDvYcVWIr 8hyaS93nL7vUslEBVjuCZnk2G59cqEn/GZP7S8vE41XHV9uNWlkVhcR+1DbVar5poxir A+NaEhhqOILRlAaSqE10bHo+z6cBDGEoP549EL7H7OLIGUitsWyvQnPmJ20E7yjWa0it e4a0LMONdcpdxoP8B0QWa9rvmTjke+KOnig6i89Zi6tXnHinfSUfo4kjhCydndFT9Xb3 g6uUCYn2u0vVjUPW4z5xoDAZaE2PjieVeO9LDcH+gsNTl75SEa0B7TmGp6tIgMhk3ymb G7ng== X-Gm-Message-State: ACgBeo2epc7P6370vzVqvHj5JXQxH8Gddqh3RoujZ2nYlgEBRTO+kCDA smabY3HriB/+7AMp7gEBr0iyYB8Kx3ok5g== X-Google-Smtp-Source: AA6agR7zI48fp5PIX2cvPGA0NJxMSEjZg6Ir5DPRwsvVJJg2MpM+2EK1AyagTvoc1JRVkEfJzc9ToQ== X-Received: by 2002:a17:907:6285:b0:738:e862:a1b with SMTP id nd5-20020a170907628500b00738e8620a1bmr18295691ejc.70.1662962523082; Sun, 11 Sep 2022 23:02:03 -0700 (PDT) Received: from Mini.fritz.box (pd9e36bd4.dip0.t-ipconnect.de. [217.227.107.212]) by smtp.gmail.com with ESMTPSA id m13-20020a056402510d00b004518ee90b4dsm2447254edd.1.2022.09.11.23.02.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Sep 2022 23:02:02 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Lars Ingebrigtsen Subject: Re: bug#57727: 29.0.50; Optimize tty display updates In-Reply-To: <87bkrmgnw5.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 11 Sep 2022 13:18:34 +0200") References: <87bkrmgnw5.fsf@gnus.org> Date: Mon, 12 Sep 2022 08:02:01 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 57727 Cc: 57727@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 (-) Lars Ingebrigtsen writes: > Perhaps adding a defcustom for this where the :set calls > `tty--set-output-buffer-size' might be a nice interface? ATM, this is terminal-specific, so we'd need some way of specifying for which frames, terminals or what this option applies. (I'm assuming from the code that Emacs allows opening frames on multiple ttys, which was news to me, but that doesn't mean anything of course.) From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 12 02:33:25 2022 Received: (at 57727) by debbugs.gnu.org; 12 Sep 2022 06:33:25 +0000 Received: from localhost ([127.0.0.1]:43962 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXd0X-0005UI-2s for submit@debbugs.gnu.org; Mon, 12 Sep 2022 02:33:25 -0400 Received: from mail-ej1-f42.google.com ([209.85.218.42]:38811) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXd0S-0005Ty-Cm for 57727@debbugs.gnu.org; Mon, 12 Sep 2022 02:33:23 -0400 Received: by mail-ej1-f42.google.com with SMTP id u9so17835103ejy.5 for <57727@debbugs.gnu.org>; Sun, 11 Sep 2022 23:33:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date; bh=eOq/zHnw/0kXpVHywqLxRUbaHwvZHKlp6YUxLuXcufo=; b=gTs4UTp6P/vwb/41dKd5GTdGuoCYkQby+FJKcDzdW9fgEibaqWPug2aEG+O0K1O71s Hiit2ziiQ0f6kERPHpbD/X7YW4n/ALFja5xQE59vosVcL95dtnE9sGA6x61SfJDQfbRu 005l30SUmwW6kLJRtGF2JZu/U8vuNo9TGE/qkglplitzV9TdhsSr7yB3qgsXCpssUVfv 7Y5JABQ2fu2hcvGO2qmqPFuGDs7Dnu6J6xCJYkePevTUpo1qdvCRofprRdQ+YOpUJFfD 7eyZEhcXCKxASP+H1zmlnV3X9b5fzY3CGlyXz9LqAGLGJyyIHg1CUaLz5Bq0KuT6mhl4 HuLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date; bh=eOq/zHnw/0kXpVHywqLxRUbaHwvZHKlp6YUxLuXcufo=; b=taogMDOGNBd8p3kCcJQaZ79/Eym/29gpb/pc03STuCcfIchlijdxSXTVuoJhUjd7jo gZQrOQKD027afMLS8ty1UyaTtp3Eos65qsrQG4/PEthIgfwwXSRj+dCWcF+6CnAL8qiy 6N38VCaqNXHxRm/eqrGeCMVcHfahZvKgs9TuC3EqUQ3coT+cqq+CrvV5C4t1SRs8sFku CPiqauxoCXjtGOGPUenHDup7aMfC1u11iO3MIyub6Z+Vg7yXHFmIuo7jTHxeu2roRJ61 XuTstgpZMCIKCbDLymkGsUBLJ/1dlmn8r4IoIhNvkSPfUZbDze+coF/jzY6tfw/ze4tX ivPg== X-Gm-Message-State: ACgBeo0+tasXCVFKAdBm06qRJa8oqbdg6EWxfRmKicG93WNq0y1MJUHP Djsv+Uuo5pdlIXKvLD0PFkFbDSljZc1Onw== X-Google-Smtp-Source: AA6agR5Sg8Wc5g2r6Qp31f1xDqLQ7z4xZ6w6YLhhVCkApGPPtK6MIXbKFIcD2YMVNoVJS75Qg4Mt6w== X-Received: by 2002:a17:907:3188:b0:741:4bf7:ec1a with SMTP id xe8-20020a170907318800b007414bf7ec1amr18034051ejb.448.1662964394169; Sun, 11 Sep 2022 23:33:14 -0700 (PDT) Received: from Mini.fritz.box (pd9e36bd4.dip0.t-ipconnect.de. [217.227.107.212]) by smtp.gmail.com with ESMTPSA id q10-20020a170906360a00b007309a570bacsm3949561ejb.176.2022.09.11.23.33.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Sep 2022 23:33:13 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Stefan Monnier Subject: Re: bug#57727: 29.0.50; Optimize tty display updates In-Reply-To: (Stefan Monnier's message of "Sun, 11 Sep 2022 09:49:11 -0400") References: Date: Mon, 12 Sep 2022 08:33:12 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 57727 Cc: 57727@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 (-) Stefan Monnier writes: >> + return Fresume_tty(tty); > ^^ > SPC Thanks, I'll fix these. > That seems a bit over-engineered to me. > Why not just a DEVAR_BOOL to control whether we flush or not? Ok. My thoughts went like so: 1. Multi-tty make me feel it's natural to make the behavior terminal dependent. At least I don't consider unreasonable for a user to expect being able to tailor the behavior depending on the terminal. 2. I don't believe that just avoiding fflush will be enough. THe code currently uses a buffer of size BUFSIZ, which is OS-specific. On my system, for instance, BUFSIZ = 1024. Don't know about MS-Windows today, but I remember it being 512 there at some time. At work, we had one Linux distribution that used 32K (maybe Arch, I don't remember). And so on. 3. The coupling of setting the buffer size with not flushing is a bit strange, but my reasoning would be that setting a larger buffer and still flushing is kind of nonsensical. 4. From the recent discussion of supporting images on ttys I take away that using a large buffer might help with that because of more data being sent to the terminal. (Not a reason, but I wonder if different buffer sizes might also help reduce flickering with some terminal emulators, like Alacritty. Whatever, just wanted to mention this.) > If someone wants to try out different buffer sizes, I suspect that > recompiling is a good enough solution (or provide a DEFVAR_INT for that > and let the tester(s) call `suspend/resume-tty` by hand). I didn't do that because of multi-tty. But letting users suspend/resume manually is of course an option. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 12 07:22:26 2022 Received: (at 57727) by debbugs.gnu.org; 12 Sep 2022 11:22:26 +0000 Received: from localhost ([127.0.0.1]:44347 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXhWE-0007A0-HL for submit@debbugs.gnu.org; Mon, 12 Sep 2022 07:22:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45248) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXhWB-00079m-DQ for 57727@debbugs.gnu.org; Mon, 12 Sep 2022 07:22:26 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:54164) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXhW5-0000d4-7N; Mon, 12 Sep 2022 07:22:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=v3rpePcZWMHIRqbht2LDN653lFgBmn2eYf+S/5xOPvw=; b=kUjIbD/jP5o0z/6yoP85 /XNJOaVKDKxycXJHwREwGJj5mr1Z3uYVxQgmx6LuonU2aWCpHfSDSNeCRn+dUuszN+nqwn4El5Als uJMrcIXojHYB8fck7CGJ09S7X0sfcm1R5vFYX8sg/YslKXzoW9zhk7wiSFh2rSGOslW4uIpjDqumK QrQ3RBt51HhvURJWlAH3HDdb26q7F26zZZjOHEzXHAMbLfRq+xPDkBC9MdFD19u1qa6C/S4MWRPCr CJA7lnImOXkeep/mLqS6HKJK7q+Lz4PM4wkTSPMNwcDcX/Ne2cz23ZEyP0dM6wrHF0cXSSB5awPDv yXS2neBXueYs9A==; Received: from [87.69.77.57] (port=2856 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXhW3-0005lI-H8; Mon, 12 Sep 2022 07:22:16 -0400 Date: Mon, 12 Sep 2022 14:21:59 +0300 Message-Id: <83fsgw96so.fsf@gnu.org> From: Eli Zaretskii To: Gerd =?utf-8?Q?M=C3=B6llmann?= In-Reply-To: (message from Gerd =?utf-8?Q?M=C3=B6llmann?= on Mon, 12 Sep 2022 08:02:01 +0200) Subject: Re: bug#57727: 29.0.50; Optimize tty display updates References: <87bkrmgnw5.fsf@gnus.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57727 Cc: larsi@gnus.org, 57727@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: -3.3 (---) > Cc: 57727@debbugs.gnu.org > From: Gerd Möllmann > Date: Mon, 12 Sep 2022 08:02:01 +0200 > > I'm assuming from the code that Emacs allows opening frames on multiple > ttys, which was news to me It was added in Emacs 23. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 12 07:29:41 2022 Received: (at 57727) by debbugs.gnu.org; 12 Sep 2022 11:29:41 +0000 Received: from localhost ([127.0.0.1]:44368 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXhdF-0007Le-ER for submit@debbugs.gnu.org; Mon, 12 Sep 2022 07:29:41 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56034) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXhdB-0007LQ-QF for 57727@debbugs.gnu.org; Mon, 12 Sep 2022 07:29:40 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:60766) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXhd5-0001fF-VU; Mon, 12 Sep 2022 07:29:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=JqhJbvPj2mlGWf6oOD/WhSb3K2kBiVpPXdAP2Yf+bYU=; b=fLAxVeDTO1qEDnr1VcLh to6rytyfuF/pjQEY9o0UrG3WS2O0/65wqUavG2s1YPbu6c1DtMXSBzNlOJG9XO01MzXI2GDQQCo5a W5jilwsn8BN2dQ0KNadmNtty4ZlxwiMoZtgOUL5UmRftJY9EAh7c4TwlUEQOZ4+IkA5J3N6Zs4jgb Y80IuCqye/wk1YDjpzdIID0nyy1f6u14/Cz66NoSd6as+5104LhmL89Kpe0oto6oxOtorRIkbBugO faKYfpOrGPIyEdhWfDHxEN5f1RjV/mLqnn06NVIBr/EnE2Er8Mton8NeiWNqLOfWIF3qXonXzvxkh glkNLL3N85JGdg==; Received: from [87.69.77.57] (port=3296 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXhd2-0005cn-II; Mon, 12 Sep 2022 07:29:31 -0400 Date: Mon, 12 Sep 2022 14:29:13 +0300 Message-Id: <83edwg96gm.fsf@gnu.org> From: Eli Zaretskii To: Gerd =?utf-8?Q?M=C3=B6llmann?= In-Reply-To: (message from Gerd =?utf-8?Q?M=C3=B6llmann?= on Mon, 12 Sep 2022 08:33:12 +0200) Subject: Re: bug#57727: 29.0.50; Optimize tty display updates References: MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57727 Cc: monnier@iro.umontreal.ca, 57727@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: -3.3 (---) > Cc: 57727@debbugs.gnu.org > From: Gerd Möllmann > Date: Mon, 12 Sep 2022 08:33:12 +0200 > > Stefan Monnier writes: > > > That seems a bit over-engineered to me. > > Why not just a DEVAR_BOOL to control whether we flush or not? > > Ok. My thoughts went like so: FWIW, I don't think this is over-engineered. The suspend/resume dance caused me to raise a brow, but I guess you cannot otherwise reset the terminal settings? > 2. I don't believe that just avoiding fflush will be enough. THe code > currently uses a buffer of size BUFSIZ, which is OS-specific. On my > system, for instance, BUFSIZ = 1024. Don't know about MS-Windows today, > but I remember it being 512 there at some time. It's still 512. But buffered stdio functions in the MS-Windows runtime use 4K buffers, AFAIK, not 512B buffers. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 12 07:52:43 2022 Received: (at 57727) by debbugs.gnu.org; 12 Sep 2022 11:52:43 +0000 Received: from localhost ([127.0.0.1]:44432 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXhzW-0003ru-O5 for submit@debbugs.gnu.org; Mon, 12 Sep 2022 07:52:42 -0400 Received: from mail-ej1-f53.google.com ([209.85.218.53]:44790) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXhzU-0003rf-Fm for 57727@debbugs.gnu.org; Mon, 12 Sep 2022 07:52:41 -0400 Received: by mail-ej1-f53.google.com with SMTP id r18so19529855eja.11 for <57727@debbugs.gnu.org>; Mon, 12 Sep 2022 04:52:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date; bh=itjsbBjGzQHAfAGeo3Rsh6WHQHoIM524UGoTmiI3q40=; b=DanZLp0YMmpZ8LZlBsrsxMwseka1zMMGLDt0B9krusggn9O6QsRcf1E4QHgx01Pdnt rM/fF5g0JV5NlAXBtpaQbWH5Zz0sCD/VZvTh0qUEuwSuT+vxuVYz2zVZ7S10isR8gm8z AudcpGrm0J76m63WEiHALl+GTrijbuwu/aIg3gUBHBz6A8chrlx/iTv7+UpYwXBUF4oT xh4Za6/KrRlXTbicpisSB+2uOrlOlaBUjP7AQ87n7Yog2ht7VYxB5bAG+o3HwoV/PuB9 X1ZohpqOccHGEOWPwyYLVEjMnlp5gFJUXV5qrTE2sgHf05jFUubS+WAMQ+yHDtDs5IJu LCOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date; bh=itjsbBjGzQHAfAGeo3Rsh6WHQHoIM524UGoTmiI3q40=; b=LLk9EN8aC3KO9PDm8rR0xOLqu8SOMNxEurLy+TWLH3tRhj+dmS1NlcNtdyxUu7K8DI V8Hn7rrQli+dufrfZBRacnvFcjDS3/ZEJdZPLQLVjLNVUr2gtfRBJfkwj7IyjwctH407 frJXw0lqzVMQ+SjxTJB4H9BELWH2hIo3piuIOgZmGgjB2wl2r1as3/V9Ee8NnMg9eljn Bfjt6G2uHNhAlVozj02ZvrSml7O6rFJxGuF2QHrqAY9E0oTL6KZg5mznTqRLLpnj2W+u Ew8Bp3HU+zACcKQcKNRT0iC2Fvd32YchKLfMG2FqXiSrGqs+ikefJspPdDZXOgIDqyTi RDCA== X-Gm-Message-State: ACgBeo3fTsdbe0g+XN88m+ZMVOnSpgE7pOCrRL0nYJpKfoX5wHOYNHtJ rAYzD1T5c6To3xcnGkxb0sxOzPtV3v2QYw== X-Google-Smtp-Source: AA6agR7WesOhiA3LeIwbgvPm5ugcMy96OCpsbydBEytAIISv/grrNdYlOgYvqbvoNYhplo0ecBHiEA== X-Received: by 2002:a17:907:1c08:b0:77c:8d2:bb9 with SMTP id nc8-20020a1709071c0800b0077c08d20bb9mr5695029ejc.177.1662983553026; Mon, 12 Sep 2022 04:52:33 -0700 (PDT) Received: from Mini.fritz.box (pd9e36bd4.dip0.t-ipconnect.de. [217.227.107.212]) by smtp.gmail.com with ESMTPSA id s1-20020a056402014100b0044e8d0682b2sm5637196edu.71.2022.09.12.04.52.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Sep 2022 04:52:32 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Eli Zaretskii Subject: Re: bug#57727: 29.0.50; Optimize tty display updates In-Reply-To: <83edwg96gm.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 12 Sep 2022 14:29:13 +0300") References: <83edwg96gm.fsf@gnu.org> Date: Mon, 12 Sep 2022 13:52:31 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 57727 Cc: monnier@iro.umontreal.ca, 57727@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 (-) Eli Zaretskii writes: > FWIW, I don't think this is over-engineered. The suspend/resume dance > caused me to raise a brow, but I guess you cannot otherwise reset the > terminal settings? I'll check if can find a way to not suspend/resume. In principle, it should be possible to fflush/fclose/fopen/setvbuf, but I have to check if that is sufficient. Suspend/resume looked a cheap hack to get what I wanted. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 12 09:15:17 2022 Received: (at 57727) by debbugs.gnu.org; 12 Sep 2022 13:15:17 +0000 Received: from localhost ([127.0.0.1]:44601 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXjHR-0006Gn-C9 for submit@debbugs.gnu.org; Mon, 12 Sep 2022 09:15:17 -0400 Received: from mail-ej1-f43.google.com ([209.85.218.43]:44596) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXjHN-0006GU-Qr for 57727@debbugs.gnu.org; Mon, 12 Sep 2022 09:15:16 -0400 Received: by mail-ej1-f43.google.com with SMTP id r18so20088399eja.11 for <57727@debbugs.gnu.org>; Mon, 12 Sep 2022 06:15:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date; bh=CtBCezHimmByxOZNwkok7tzHleI/5KiSXfQLIOM5ifw=; b=mf2sB8PBPzbWGxiZ0rePulj1eKZs00l2LNnVjkzywJSyY8nle2x3oqY/9Jl5G1qQKo Z1rX/tsQHiKXnze+rkokpPoveHI/UtI0OzLWnH+VvBqFUsKAplQVliwvMTV3WXa4HrV5 I68Y4gKHVrgjxj2jKQHM/6VeY4Op7pWL3yY99BN2yADPXRPVeMKiAiOZYL4MFAKVVeZ6 b/Z6Wv0O90VRrxaFOJ4Nh6gmpYGhkzDfVtUVD9b8o1wUf9GK6kpJOGGe4+dj2/lKeOZ0 kuj0NEax15Or3qST9gjFvjz9HctziuVUUBV4C7ZOuLQq/u9sMA7r+buWccCad6h90IrI NGQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date; bh=CtBCezHimmByxOZNwkok7tzHleI/5KiSXfQLIOM5ifw=; b=JLeCnglCgl1bGD2ri2r5eg3BcBxd4PKHMpbl9TWzXK7vtv17pcDr/26cP+tB/lLuh4 ie8OR53lsQKStMlhpxq39UKDlxNHQZOjziMdf1+lmDWAwhGWH5Ufe1gnhfe12Zbg+C4/ OP4ARIkqBQL9trJUi5AYI4FnQ0sFRByK2MF/RjQmMURHCcmphveKpvPoU9CVUsCnWeU+ 7hljZOlKgCIVS4L6p9EJsx1onv2rcjRZ1/Jchn5+fGo2Wbzrc9ZZmleAFV4lsLx1wcOU sg9ssIn2rmImtk7wXYZXf0FkTT3M5rCPEr0Ctp22NGeZWxJ5bYPzvaABIc2kOop7lWO1 A0VQ== X-Gm-Message-State: ACgBeo04kcFS06s6aXb8D3opuzq/qGkmP3XWyJF/Pf9AfMb5lAeZmZzV NlXkmFNBTWG03nw+D3aN9dZBeY/g85M8Bw== X-Google-Smtp-Source: AA6agR43lWdG8QAmFPx2hGDjonV1bNiWHjiAaIXMFcB2KeOHePGjsa6qQeiXVSJCJ17GoQgQ+oFdRw== X-Received: by 2002:a17:907:97cd:b0:731:5d0:4434 with SMTP id js13-20020a17090797cd00b0073105d04434mr17496616ejc.603.1662988507551; Mon, 12 Sep 2022 06:15:07 -0700 (PDT) Received: from Mini.fritz.box (pd9e36bd4.dip0.t-ipconnect.de. [217.227.107.212]) by smtp.gmail.com with ESMTPSA id j1-20020a170906094100b0076f1d939128sm1948500ejd.54.2022.09.12.06.15.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Sep 2022 06:15:06 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Eli Zaretskii Subject: Re: bug#57727: 29.0.50; Optimize tty display updates In-Reply-To: ("Gerd =?utf-8?Q?M=C3=B6llman?= =?utf-8?Q?n=22's?= message of "Mon, 12 Sep 2022 13:52:31 +0200") References: <83edwg96gm.fsf@gnu.org> Date: Mon, 12 Sep 2022 15:15:06 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 57727 Cc: monnier@iro.umontreal.ca, 57727@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 (-) Gerd M=C3=B6llmann writes: > Eli Zaretskii writes: > >> FWIW, I don't think this is over-engineered. The suspend/resume dance >> caused me to raise a brow, but I guess you cannot otherwise reset the >> terminal settings? > > I'll check if can find a way to not suspend/resume. In principle, it > should be possible to fflush/fclose/fopen/setvbuf, but I have to check > if that is sufficient. Suspend/resume looked a cheap hack to get what I > wanted. I'm afraid that doesn't work well. The problem is that a setvbuf with a new buffer size requires an fclose, by the C standard. The fclose closes the file handle used with fdopen, so we have to go through all what suspend/resume already do. Too bad. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 12 10:18:30 2022 Received: (at 57727) by debbugs.gnu.org; 12 Sep 2022 14:18:31 +0000 Received: from localhost ([127.0.0.1]:47543 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXkGc-0000Oo-Ig for submit@debbugs.gnu.org; Mon, 12 Sep 2022 10:18:30 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:22171) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXkGZ-0000Oc-B3 for 57727@debbugs.gnu.org; Mon, 12 Sep 2022 10:18:29 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 2263B100129; Mon, 12 Sep 2022 10:18:21 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 62DD11000FF; Mon, 12 Sep 2022 10:18:19 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1662992299; bh=ZG7luru3RurXYka0KPuhha8tqTHK7JT7epQPPMXpHvY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=WePEYfqg9rnQtWhSPUxEc1YGNfmarHcZWaJ4+XOd2VEoMUHz3f961ufaKjPEK3Cyf Br+S6GIoB7f+O5D1oEPk/urwN1jy9cZhQ1yvJcvp35G4yINQsrSWgU3FQ3VSlb34yM whajzBovHfbwX/nLy1b7AdBvPumU6hdw2EmQjthNik8zNZU7VbxlB+UMTmj8ab6Ros xTJr8AA9pa2Z+G0SKXkHYyi36NFBT7bi19OLrU2uBYVz6boUGoiyVGJ7gj2KJFq9eO Yy3fZ7zEfwD0+hfFqJypJpsY6XzYnqYBudILEFm4mhyrkpyFSmx4+p62gsNibFBcWI lYAIEQlNSVH6Q== Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 551B312036E; Mon, 12 Sep 2022 10:18:19 -0400 (EDT) From: Stefan Monnier To: Gerd =?windows-1252?Q?M=F6llmann?= Subject: Re: bug#57727: 29.0.50; Optimize tty display updates In-Reply-To: ("Gerd =?windows-1252?Q?M=F6l?= =?windows-1252?Q?lmann=22's?= message of "Mon, 12 Sep 2022 08:33:12 +0200") Message-ID: References: Date: Mon, 12 Sep 2022 10:18:14 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.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.177 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 T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57727 Cc: 57727@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: -3.3 (---) > 1. Multi-tty make me feel it's natural to make the behavior terminal > dependent. At least I don't consider unreasonable for a user to expect > being able to tailor the behavior depending on the terminal. I guess the reason why I think it's over-engineered is that I feel it's not something which end-users will want to play with or configure per-terminal: we should have a setting that works well everywhere. The config vars are only needed to help find that universal setting. My guess is that the exact setting won't matter very much anyway as long as it's big enough to cover most redisplays (since we `fflush` anyway at the end of `update_frame`). For that same reason, I expect that using the OS's default will be good enough and it will be difficult to come up with good ways for users to test other values and report meaningful information about the impact. > 3. The coupling of setting the buffer size with not flushing is a bit > strange, but my reasoning would be that setting a larger buffer and > still flushing is kind of nonsensical. Agreed. > 4. From the recent discussion of supporting images on ttys I take away > that using a large buffer might help with that because of more data > being sent to the terminal. Could be. Tho I suspect we'd usually want to send a file name rather a file's data, but in any case, this is still hypothetical, so I see no need to cross this bridge yet. >> If someone wants to try out different buffer sizes, I suspect that >> recompiling is a good enough solution (or provide a DEFVAR_INT for that >> and let the tester(s) call `suspend/resume-tty` by hand). > I didn't do that because of multi-tty. But letting users suspend/resume > manually is of course an option. To the extent that I see it as a "debugging" functionality, it seems sufficient (another option is to tell people to use an Emacs daemon so they can set the var before opening the tty). Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 13 01:53:58 2022 Received: (at 57727) by debbugs.gnu.org; 13 Sep 2022 05:53:58 +0000 Received: from localhost ([127.0.0.1]:48570 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXyrt-0004GP-UH for submit@debbugs.gnu.org; Tue, 13 Sep 2022 01:53:58 -0400 Received: from mail-ej1-f43.google.com ([209.85.218.43]:47004) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXyrr-0004GB-Lh for 57727@debbugs.gnu.org; Tue, 13 Sep 2022 01:53:56 -0400 Received: by mail-ej1-f43.google.com with SMTP id bj12so24895571ejb.13 for <57727@debbugs.gnu.org>; Mon, 12 Sep 2022 22:53:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date; bh=cCRB2r6Tk1TKNyS6eGR4v0OdmFdcptD4tZIhqJkr7gE=; b=UlUiPWWdoda8qdVqtWfZqcEBYrh2VSnMsqzs0Azj+HY/+2FdzFE9uYO3XZMNGQ6mfi gxWuqJA0AK0PDTMGbClYBCPL0LiR/LOqNcTRcF7Wi4OJQWOqXFjSEa7bIChk98cvCgVX Mh/IvgVv9ShwzNoC6yw9WGF4tZ2I1/xz+U+SjFdnkvha9OoNce54byK6WUIma+LZWv1/ hc2gTJSjSNq5KfQJuEOrURSUOoGW3lQC0IyOx+bb4A0sfBix6i6vcUc335tyjrkZ9FRs +waQ7IO8yv0KZUd4DDwUt6tSd2rvRndJpSzX4W1fmOG/2vo6MtbgI/jyfmxVKt5a8swB XTXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date; bh=cCRB2r6Tk1TKNyS6eGR4v0OdmFdcptD4tZIhqJkr7gE=; b=65u1xiM+I8v+5ANpBGctQuwLbeLD1/9G7i1xAhZfOwKHYzO35SjNsh+BUAWHv7DFVn A5zKQqMI+2yurYtORLIL1xu8+xpV61YrZ/TsGgz2XIqO58jgoQF4FQvZ9iEvtqL9sQMP zgrPo4lB2AF8Fj/Ou2ObapN4X2nxU8moI0bbl5020zK321pYDJ8h7RrlNbqVj5WG86Xa vFTr3qfDVCCr3Zq28mT9usk+4j2Ayb5Vd9+CuX0tOe/Q61khZq3CgmcOtZ9PgFztOQPK WrUSPxMVGuTVRTefBeuywM87NsxNFp8FkvkelDDIXD//j014Ipc45MMsWlJ2Ni/8X7Q3 BViw== X-Gm-Message-State: ACgBeo3UGisvVwXo4aOdCCrzTWfNUEbPSrYLEi4bnQL/86wQNKIbGdDF bOsBySm4VjRycPBzHnvJDlUjYK66UthB1A== X-Google-Smtp-Source: AA6agR6VJC6CfDCEiVKh5J2aPBzQh+hMWZFoJN2A0JsiDOTJ4h3CWez/bZOF2ISodTeN1aLxrBE0vA== X-Received: by 2002:a17:906:fd8b:b0:779:dcbe:3a9d with SMTP id xa11-20020a170906fd8b00b00779dcbe3a9dmr13274944ejb.235.1663048429129; Mon, 12 Sep 2022 22:53:49 -0700 (PDT) Received: from Mini.fritz.box (pd9e36665.dip0.t-ipconnect.de. [217.227.102.101]) by smtp.gmail.com with ESMTPSA id 17-20020a170906201100b0073dc5bb7c32sm5502404ejo.64.2022.09.12.22.53.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Sep 2022 22:53:48 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Stefan Monnier Subject: Re: bug#57727: 29.0.50; Optimize tty display updates In-Reply-To: (Stefan Monnier's message of "Mon, 12 Sep 2022 10:18:14 -0400") References: Date: Tue, 13 Sep 2022 07:53:47 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 57727 Cc: 57727@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 (-) Stefan Monnier writes: >> 1. Multi-tty make me feel it's natural to make the behavior terminal >> dependent. At least I don't consider unreasonable for a user to expect >> being able to tailor the behavior depending on the terminal. > > I guess the reason why I think it's over-engineered is that I feel it's > not something which end-users will want to play with or configure > per-terminal: we should have a setting that works well everywhere. I really good default would indeed be a Good Thing. But, on the other hand, I think it's not likely that we find something that works for everyone all the time. > The config vars are only needed to help find that universal setting. > > My guess is that the exact setting won't matter very much anyway as long > as it's big enough to cover most redisplays (since we `fflush` anyway at > the end of `update_frame`). > > For that same reason, I expect that using the OS's default will be > good enough and it will be difficult to come up with good ways for users > to test other values and report meaningful information about the > impact. As far as the OS default goes (1024 on my system), I don't think I agree completely. A frame on a full-size terminal window has a width of ca. 380 columns, which is a bit much for a buffer of 1024. I fully agree that finding a good default value is hard in every respect, though. But I actually count that as an argument in favor of making it an option. >> 4. From the recent discussion of supporting images on ttys I take away >> that using a large buffer might help with that because of more data >> being sent to the terminal. > > Could be. Tho I suspect we'd usually want to send a file name rather > a file's data, but in any case, this is still hypothetical, so I see no > need to cross this bridge yet. Agreed. >>> If someone wants to try out different buffer sizes, I suspect that >>> recompiling is a good enough solution (or provide a DEFVAR_INT for that >>> and let the tester(s) call `suspend/resume-tty` by hand). >> I didn't do that because of multi-tty. But letting users suspend/resume >> manually is of course an option. > > To the extent that I see it as a "debugging" functionality, it seems > sufficient (another option is to tell people to use an Emacs daemon so > they can set the var before opening the tty). Ok, we disagree here. How can we proceed? What do the maintainers think? I could also just put in on a branch, for later. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 13 07:34:05 2022 Received: (at 57727) by debbugs.gnu.org; 13 Sep 2022 11:34:05 +0000 Received: from localhost ([127.0.0.1]:49064 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oY4B3-0004tS-8C for submit@debbugs.gnu.org; Tue, 13 Sep 2022 07:34:05 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56194) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oY4B2-0004sx-4V for 57727@debbugs.gnu.org; Tue, 13 Sep 2022 07:34:04 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52196) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oY4Aw-0000bf-5F; Tue, 13 Sep 2022 07:33:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=qAh9WD1+THwmVraZuPoZwNuegQra2fy58cvwlz6NNuI=; b=IP/spkDGatbf8ZvDhRhN BsOupmYgUpQdqLUWn7v+iAUKCbRHBhuwSZChtbQrippf/0lOQA8eVLaKlk2X6AYPwha9EgTv40osi /ss4OnLi75h36jCOul4P5gOveOz7358atCRjglxs8h13Xw8vimCTk/PEk9QcqMu61uvaOB9nAdplc vEziZ91qiLA/rhyml4brZwA/loSCszeiRMSDI8yTesCGC1GbLEkiryO/20Ivs0CH7RgFscL9JrCfs FPE9EQyWbq+tK6IVTMyV9nyCBjtH+uMMNXGk2S41Vya8lsKNCBvq41sK3dZ4T50MRYolMrohqbNBv cMV/OwaETLSwOg==; Received: from [87.69.77.57] (port=4364 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oY4Av-0007Ek-J1; Tue, 13 Sep 2022 07:33:57 -0400 Date: Tue, 13 Sep 2022 14:33:45 +0300 Message-Id: <83y1un4ig6.fsf@gnu.org> From: Eli Zaretskii To: Gerd =?iso-8859-1?Q?M=F6llmann?= , Lars Ingebrigtsen In-Reply-To: (message from Gerd =?iso-8859-1?Q?M=F6llmann?= on Tue, 13 Sep 2022 07:53:47 +0200) Subject: Re: bug#57727: 29.0.50; Optimize tty display updates References: MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57727 Cc: monnier@iro.umontreal.ca, 57727@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: -3.3 (---) > Cc: 57727@debbugs.gnu.org > From: Gerd Möllmann > Date: Tue, 13 Sep 2022 07:53:47 +0200 > > How can we proceed? What do the maintainers think? I could also just > put in on a branch, for later. I'm okay with having this on master. We can always fine-tune it later, given that we get some feedback. Lars? From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 13 07:36:26 2022 Received: (at 57727) by debbugs.gnu.org; 13 Sep 2022 11:36:26 +0000 Received: from localhost ([127.0.0.1]:49076 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oY4DK-0004x9-0G for submit@debbugs.gnu.org; Tue, 13 Sep 2022 07:36:26 -0400 Received: from quimby.gnus.org ([95.216.78.240]:35534) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oY4DI-0004wv-0Z for 57727@debbugs.gnu.org; Tue, 13 Sep 2022 07:36:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=sq+62zSefL4P2aH9ENw7j9EnkQQ6cxaokVOTatiCm+4=; b=RA+pm2p2wOIubec9yQNi4CcNBa ubmwPqZ2kkYba3oDB43aJhSuP31OnQYUZOgFBjmxCsxYr8+ucAhpH/cHeekQoX2PbErvePQsDGHrK 1tjwiGLajuaoVItWD6JgsoNYTVc0PaDykpvLvA9HZaINDAiAuK/99DlywGLMaqaYSebM=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oY4D8-00029a-41; Tue, 13 Sep 2022 13:36:16 +0200 From: Lars Ingebrigtsen To: Eli Zaretskii Subject: Re: bug#57727: 29.0.50; Optimize tty display updates In-Reply-To: <83y1un4ig6.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 13 Sep 2022 14:33:45 +0300") References: <83y1un4ig6.fsf@gnu.org> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAFVBMVEWho6DUyrt0gohV XV+olnBEQT7///+p9vhSAAAAAWJLR0QGYWa4fQAAAAd0SU1FB+YJDQskBX5kElsAAAGnSURBVDjL dZNdcuQgDISFwwGg4gNQePKeMeGd2WgvEJb7XyUtgX9ma9zlKdv9qYUY20SQfyHxzQUwV4mXAf96 AQXmClyMRfESTDH+387hINgUnoEjTSgwZNxTwlOYQkCrPoRs1jknW96mcoOQN05+ZhR6XLlx5U2f KsQ4GUOH+iS0YHXMS0HNoGdrmWiKEx2LE24Cc/zDGDdOoTtnKZC/BfuHQqQQgkVGQQzkOkDJksKy pJRkcSGxS7sS98SqAAVSueJY4g1gSUdiTdKkCyBpcwVLFC92sKZ1JNJZkhjgaJNaa6QXK4InP9Wm CURw2kDLDYkOkNhqM8yaMlp1EEbrJF7NssZbB8JxL4266K1WeB1UabSDtO8pt5zyAbBWq2vu0x8i WaylNddnv5Ley4Ay5xmEZcyfK8as5ePT+78K9qc8Fft99/P94d9b+zeAoWKN5WJZlQA+e70t9sG2 zIY9zw+Hyq8B4HJhxATIm/jFA8BmgHkDP8wDiOzDGuYNqLOfSIGjn8ibbIJbvAY81Vt3b1J+fNsz ycPBK6ew7J+VE6DCP39G9vsX5xyaMdBJZq0AAAAldEVYdGRhdGU6Y3JlYXRlADIwMjItMDktMTNU MTE6MzY6MDUrMDA6MDDUvEwMAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIyLTA5LTEzVDExOjM2OjA1 KzAwOjAwpeH0sAAAAABJRU5ErkJggg== X-Now-Playing: Hood's _Field Report_: "Field Report a) i An Overcast Sky Part 1" Date: Tue, 13 Sep 2022 13:36:13 +0200 Message-ID: <8735cv4ic2.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.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: Eli Zaretskii writes: >> How can we proceed? What do the maintainers think? I could also just >> put in on a branch, for later. > > I'm okay with having this on master. We can always fine-tune it > later, given that we get [...] 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: -2.3 (--) X-Debbugs-Envelope-To: 57727 Cc: Gerd =?utf-8?Q?M=C3=B6llmann?= , monnier@iro.umontreal.ca, 57727@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: -3.3 (---) Eli Zaretskii writes: >> How can we proceed? What do the maintainers think? I could also just >> put in on a branch, for later. > > I'm okay with having this on master. We can always fine-tune it > later, given that we get some feedback. > > Lars? Yup, fine with me, too. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 13 08:44:32 2022 Received: (at 57727) by debbugs.gnu.org; 13 Sep 2022 12:44:32 +0000 Received: from localhost ([127.0.0.1]:49221 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oY5HE-0000XW-Fq for submit@debbugs.gnu.org; Tue, 13 Sep 2022 08:44:32 -0400 Received: from mail-ej1-f44.google.com ([209.85.218.44]:45958) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oY5HC-0000XA-DA for 57727@debbugs.gnu.org; Tue, 13 Sep 2022 08:44:31 -0400 Received: by mail-ej1-f44.google.com with SMTP id dv25so27156949ejb.12 for <57727@debbugs.gnu.org>; Tue, 13 Sep 2022 05:44:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date; bh=FQwoIKRP9oEdapawHmxM4DmR8CykDZ5xiYqyeRJAOec=; b=IuuCYhG6Q4AFaqRJqgkma4ykIZ5/4MbgxNIzfyGemVvPSfbWww64Y3iIfu1d2UGln6 hhQjUjq+TzHwhWHQs94E4hpB1p3Q6OJ/NtEdA3fjNPs2lGQN1suqutMQsw1d0VBtl8/Y PsZej+iNZ5/DcQtgHjZGMN5hqYbC9O3noRO+BXW6if/WSOD0GxJ87bMnm0UiZfcVkIH8 UE4oKKWIm7jT9Wj14JJwfl3x316/GL+suAY5FLgx5OkCj10GPmFGiwFNKSB1zejUGDfX DzAf8DPstaDD70W2OGX6LXd56ZzbyuE36l0B2wNhGXs1AhFCl3O6hmw2QWcFfMpvVhTV Lplw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date; bh=FQwoIKRP9oEdapawHmxM4DmR8CykDZ5xiYqyeRJAOec=; b=PdepM6VYfy8rAFXi9DtihYY0yScD3v+K7zBoyx8qEYo/Hal553BpbqmyyydCRwXLdz ZcDhcOoz7oH0QWwg6Ltgihe9DKYGoxf1BLvMhk8FzgaoZ4j65UOS6/e+S2V3ANqQC4QV uwYpB0ax0FRhpazS2UG53MyKmfORKm718p7cIWZgUc+QMiB5f0jfyTZ3odr7xxuqQgRq d7COhbUot0MW0NqRVU/TbUYlefWvlumxND4T3NdyKBdyn5CUqOQIQ8K+Z4/BQzJrsoJo ggA0V47frB9/EWBvrxSBZ52ITXk+86bBGROsp5NHphHMSqA/unG8kZ/4UfPDjdYVbxjW SGXw== X-Gm-Message-State: ACgBeo2KjsU3nhjqHEkRPrtki06NGP6psg/8QW22m3kvqehP2amhh05j jVj3MhikrWLY5QalscCAQJqnWRBb5uESAg== X-Google-Smtp-Source: AA6agR60bjz/coMtHUqZ47c/qI6quiiKLqXeC2ahaqS5/1qit9LdPSa651M+t9uKQDBLATmEAsVHuA== X-Received: by 2002:a17:907:3e8b:b0:77f:587:3b1b with SMTP id hs11-20020a1709073e8b00b0077f05873b1bmr4725223ejc.617.1663073063324; Tue, 13 Sep 2022 05:44:23 -0700 (PDT) Received: from Mini.fritz.box (pd9e36665.dip0.t-ipconnect.de. [217.227.102.101]) by smtp.gmail.com with ESMTPSA id i5-20020a170906698500b007081282cbd8sm5927732ejr.76.2022.09.13.05.44.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Sep 2022 05:44:22 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Lars Ingebrigtsen Subject: Re: bug#57727: 29.0.50; Optimize tty display updates In-Reply-To: <8735cv4ic2.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 13 Sep 2022 13:36:13 +0200") References: <83y1un4ig6.fsf@gnu.org> <8735cv4ic2.fsf@gnus.org> Date: Tue, 13 Sep 2022 14:44:21 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 57727 Cc: Eli Zaretskii , monnier@iro.umontreal.ca, 57727@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 (-) Lars Ingebrigtsen writes: > Eli Zaretskii writes: > >>> How can we proceed? What do the maintainers think? I could also just >>> put in on a branch, for later. >> >> I'm okay with having this on master. We can always fine-tune it >> later, given that we get some feedback. >> >> Lars? > > Yup, fine with me, too. Ok, thanks! I'll make up something for NEWS then and commit in the next days. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 13 09:48:52 2022 Received: (at 57727) by debbugs.gnu.org; 13 Sep 2022 13:48:52 +0000 Received: from localhost ([127.0.0.1]:49416 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oY6HU-0000Pw-1p for submit@debbugs.gnu.org; Tue, 13 Sep 2022 09:48:52 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:40594) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oY6HR-0000Ph-Pq for 57727@debbugs.gnu.org; Tue, 13 Sep 2022 09:48:50 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 1B6C4100123; Tue, 13 Sep 2022 09:48:44 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 45B121000FC; Tue, 13 Sep 2022 09:48:42 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1663076922; bh=L+vEBTnPO+w/glcMNZVGvth3PI+YNESgzvubvVPZAI4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=nz+mtJ/70UQx0ZoE/GaNutaixoqvaI0EJ+cK73+KmIYfLgagyOJUyopICAWqGSDa0 C4IhBWoneX0wJyd51SBp7FBslzTuix5U5v5IQOt8hwydissHbrXknHS734mo/KjjvE NyMPEX0xS5FE3MPeeFrPPeqlfq7jB27ChgIAPG90lK4aVVvsEEia3IDtWcNuYkk2GS V4MsQLkqYmwx9L/nbdtyd1m3tsJm6EI22acN3OahVAIhIJUcjS5STj8YOayCLQYBxv BIca0olXOP12157ncn66VaKc0B/zH1VlSIkKJrPwkbcjvzqVQC6CiFN4VE2EzJvxS2 dvf1VtQdrJ0uA== Received: from pastel (unknown [157.52.9.190]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 2256612079B; Tue, 13 Sep 2022 09:48:42 -0400 (EDT) From: Stefan Monnier To: Gerd =?windows-1252?Q?M=F6llmann?= Subject: Re: bug#57727: 29.0.50; Optimize tty display updates In-Reply-To: ("Gerd =?windows-1252?Q?M=F6l?= =?windows-1252?Q?lmann=22's?= message of "Tue, 13 Sep 2022 07:53:47 +0200") Message-ID: References: Date: Tue, 13 Sep 2022 09:48:39 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.048 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 T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57727 Cc: 57727@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: -3.3 (---) Gerd M=F6llmann [2022-09-13 07:53:47] wrote: > Stefan Monnier writes: >>> 1. Multi-tty make me feel it's natural to make the behavior terminal >>> dependent. At least I don't consider unreasonable for a user to expect >>> being able to tailor the behavior depending on the terminal. >> >> I guess the reason why I think it's over-engineered is that I feel it's >> not something which end-users will want to play with or configure >> per-terminal: we should have a setting that works well everywhere. > > I really good default would indeed be a Good Thing. But, on the other > hand, I think it's not likely that we find something that works for > everyone all the time. Really? AFAICT noone has complained about the existing behavior (the change under discussion was prompted by looking at the code, no?), so what we currently have seems to work quite well "for everyone all the time". > As far as the OS default goes (1024 on my system), I don't think I agree > completely. A frame on a full-size terminal window has a width of > ca. 380 columns, which is a bit much for a buffer of 1024. I tend to agree that 1kB sounds a bit small (from a network perspective, I'd expect >1.5kB, to fill a typical Ethernet frame) but whether it matters or not really depends how the "per packet" vs "per byte" overheads compare. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 13 09:53:44 2022 Received: (at 57727) by debbugs.gnu.org; 13 Sep 2022 13:53:44 +0000 Received: from localhost ([127.0.0.1]:49437 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oY6MC-0000Y2-HU for submit@debbugs.gnu.org; Tue, 13 Sep 2022 09:53:44 -0400 Received: from mail-ed1-f43.google.com ([209.85.208.43]:40782) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oY6M9-0000XO-DE for 57727@debbugs.gnu.org; Tue, 13 Sep 2022 09:53:43 -0400 Received: by mail-ed1-f43.google.com with SMTP id m1so17666497edb.7 for <57727@debbugs.gnu.org>; Tue, 13 Sep 2022 06:53:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date; bh=sDwlqkqu31YU6QBXd9Si70xWyNFQpa9pjNNTChFLyJo=; b=AhaYDdqCcJi4HMEuXVYJ2WfM9ihfjo53J0ebJOZ6CY4Oq+HjLYA0L03nptyMn+d6rV pZ5jmtBwM4VFedZbipuEHlz45pyUnaMxCSobVN5QDd6Z8L3HhzEhrsVjtVhDLJ8sTAci SNbri6T5V5A5RYC3hFNoB+HHUMOllbVLQFD2GIqUchPWq6PMmFXdsNp+7cxoM42uYJ4N 4rwICAiP/cQAb9kwowXmB7TIEvy5dIrwLwMbDvcIynCWEU95tn6Di1ffUxq5U0CktRqw L6BDeBIbeypbT4NWIoyryQdHTibjZ3bojGheGWLmYORXIGXL+nFEi9e8WK/drqNczaip DhUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date; bh=sDwlqkqu31YU6QBXd9Si70xWyNFQpa9pjNNTChFLyJo=; b=XhXvTEsUgtNuJr9iHagcDpzYiu7dlhXILbY8p8Fpufb8SRnUUdexDmA6UEAugiV8ce yXd79xg25kOyh5cxtOWNeoPHtK6DGve/Is7cQxGmqvK5eNt8RorD0Rv+Yvz8fDt2GoIX mbB00GW+iH//0iI3hKvFsyMnYJIwoeeXZd+woObPP4cKltfHZca1VWHiSGxDpfFAGRuP 8qBmNbOmaew4+vFKs947A9as9D4U5p9F51SZvB8TKoE/OKqw78/7q9dN5/ECS+fAs9yD SHz1GN9tvZeqCwwleCDXWKhd2TiTVFG2qgRGfXuMLK5knzuK3o+QZaz8k5UTf8iXGjxK QhmA== X-Gm-Message-State: ACgBeo256kVmj/TlGK0lSJh5Mi7mIpYZVtKL1jh7HqQveG7kz5MYrCCC M+fUKumLbBEGtAhKN63SXvEyGZp8yX7mcg== X-Google-Smtp-Source: AA6agR4mSoRLGXLEeKxovmgbpEemkBNyiZm3m+hdRrGchkbQZHyniU7+YSbzseIggVVnDbRL8a7kKQ== X-Received: by 2002:a05:6402:2554:b0:450:28d2:2152 with SMTP id l20-20020a056402255400b0045028d22152mr22127626edb.303.1663077214274; Tue, 13 Sep 2022 06:53:34 -0700 (PDT) Received: from Mini.fritz.box (pd9e36665.dip0.t-ipconnect.de. [217.227.102.101]) by smtp.gmail.com with ESMTPSA id u16-20020a170906781000b0076feb45e2d7sm6064991ejm.135.2022.09.13.06.53.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Sep 2022 06:53:33 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Stefan Monnier Subject: Re: bug#57727: 29.0.50; Optimize tty display updates In-Reply-To: (Stefan Monnier's message of "Tue, 13 Sep 2022 09:48:39 -0400") References: Date: Tue, 13 Sep 2022 15:53:32 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 57727 Cc: 57727@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 (-) Stefan Monnier writes: > Gerd M=C3=B6llmann [2022-09-13 07:53:47] wrote: >> I really good default would indeed be a Good Thing. But, on the other >> hand, I think it's not likely that we find something that works for >> everyone all the time. > > Really? AFAICT noone has complained about the existing behavior (the > change under discussion was prompted by looking at the code, no?), so > what we currently have seems to work quite well "for everyone all the tim= e". True. I was thinking about "technically optimal" as good. There are other ways good can be considered good, of course :-). From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 17 09:34:52 2022 Received: (at 57727) by debbugs.gnu.org; 17 Sep 2022 13:34:52 +0000 Received: from localhost ([127.0.0.1]:45375 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZXy8-0005ND-K7 for submit@debbugs.gnu.org; Sat, 17 Sep 2022 09:34:52 -0400 Received: from mail-ed1-f49.google.com ([209.85.208.49]:36457) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZXy4-0005Mu-G9 for 57727@debbugs.gnu.org; Sat, 17 Sep 2022 09:34:51 -0400 Received: by mail-ed1-f49.google.com with SMTP id e18so35244991edj.3 for <57727@debbugs.gnu.org>; Sat, 17 Sep 2022 06:34:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:to:from:from:to:cc:subject:date; bh=uWyuR+n9B20Jg3efh0lI1lz4RLltxJH/SzFD8NesFSc=; b=hu++NP6Lz2GwV5e3RY3N5J2zHlL3qIO2BfUUOjx/6OZW86bg88qZgLcKznHx84CF5r xpvTunSAa0O5wYnduiKK0VY1VlhCoui5/veceVZELyagmNeenBYNuoqww0JC6K489x3P MV9UQ7IxEAOh7hELvIkGEFQ4tVpAk2PIZY4baSN39RImnEcmERwp1T9UgAy3dBcCzgep dNP8o0tTpTsPZrkUmAFSnK+JYwI0DAWpygHZw0/p+amBHVF3hglqpqYdBs5cZKRbC7C1 kY2vJwvnPrPMl/LatSqWrd79njYDzT2GzB9u7yWz68Xgog1hWiU5+DSueRggedWXGc/P De3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:to:from:x-gm-message-state:from:to:cc:subject:date; bh=uWyuR+n9B20Jg3efh0lI1lz4RLltxJH/SzFD8NesFSc=; b=o9ItqeqRHj363VUDawcc2H1U43LaA65suw0xIjeQGtn+Qboewa69GVfAGW3cEf6fUQ YUfo2zeJqG3PBE9e5XHY5rEhdRvhoN6Bh8pI2M1Ws3usOEA5u1XAyLHgm0KkCOzDFRxa 889qpH0wr64UfDAEZevJB6On14NaX1kw3odQVAQogfGqM3zlvZfNInskUKkeO2QHuzzZ /jvliTu7FmgHgR9yL7W2s84eHnSQyFIs+XdETJ9AHy4VhsGIVf9AutOZDnRLmUpdUP2y yRV/83mObeLFWy8lAbJteI2DkS5NiZY1KzFMbnJEGKN1wA8iuWcFwAq2T8eB2XN+pC0W ZNnw== X-Gm-Message-State: ACrzQf3t7y1Pfiz0E7EHuSphQFZMhli3+JtWtB+DTefJEw7+P3rU/Fl7 +PrXRG0PV/Zmc5ge2tSj+0lraWsm4k0= X-Google-Smtp-Source: AMsMyM6nptCdOZHUTmY68M9fa76+rr03o9RT8mIUhu0Q7YdxxMcpD5AFncNDssgLJh33CWwjrigCSA== X-Received: by 2002:a05:6402:e01:b0:442:dd7e:f49d with SMTP id h1-20020a0564020e0100b00442dd7ef49dmr7720673edh.355.1663421682037; Sat, 17 Sep 2022 06:34:42 -0700 (PDT) Received: from Mini.fritz.box (p4fe3ab90.dip0.t-ipconnect.de. [79.227.171.144]) by smtp.gmail.com with ESMTPSA id p20-20020a056402155400b004479cec6496sm15906151edx.75.2022.09.17.06.34.40 for <57727@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Sep 2022 06:34:41 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: 57727@debbugs.gnu.org Subject: Re: bug#57727: 29.0.50; Optimize tty display updates In-Reply-To: ("Gerd =?utf-8?Q?M=C3=B6llman?= =?utf-8?Q?n=22's?= message of "Sun, 11 Sep 2022 12:03:45 +0200") References: Date: Sat, 17 Sep 2022 15:34:40 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 57727 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 (-) Pushed to master. Closing. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 17 09:34:58 2022 Received: (at control) by debbugs.gnu.org; 17 Sep 2022 13:34:58 +0000 Received: from localhost ([127.0.0.1]:45378 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZXyD-0005NU-SG for submit@debbugs.gnu.org; Sat, 17 Sep 2022 09:34:58 -0400 Received: from mail-ej1-f47.google.com ([209.85.218.47]:37831) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZXyC-0005N4-AF for control@debbugs.gnu.org; Sat, 17 Sep 2022 09:34:56 -0400 Received: by mail-ej1-f47.google.com with SMTP id a26so26420766ejc.4 for ; Sat, 17 Sep 2022 06:34:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:subject:from:to:message-id :date:from:to:cc:subject:date; bh=4lfGFo8z/tGkW7aoNYRVDSVSK0U7n82Yv2cAbFZ03MI=; b=Mr3OJTCMtTbbLzHHkSEv2LrjSvcaCKSN7+p3bX6jSB5sVbKzL7SutVFnmerFYDxHrk ltaBVukAOQaBjuTZfhT2OW8BCLL8Qb1BSiaNWaWgYDeUCJUSGGius+BJrgssD3oAK7UH +BFQmtlrIIM6EobFzxs3cZguXpcC0ZDoIC+l8DOPYJikWlaDLqgVrdAebd+YoDGR8Eqw ZEwEusXlfCqYsNe6YC1X5SgNkZ2ivR1+C8uocaBMCUA8iO0vttZnshKlsXQvdcTV2IWB saqwLVYjIvdTiNHAH/iHUWc6peCurm4fucY7V2N1duCaxqFph5BCvdciMd9QVJpHEoAG ip2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:subject:from:to:message-id :date:x-gm-message-state:from:to:cc:subject:date; bh=4lfGFo8z/tGkW7aoNYRVDSVSK0U7n82Yv2cAbFZ03MI=; b=F9UCAXnFpIsf2b11YMWJV8tF+7GSLXGH0b/evp6H2sCLYQnX6i6yQ8pqlrL+i6vWpJ 7c4Or7CDse/u53kZO/N1rNLM0X67qByD1ukUEvWobK1QzuLwvxAqhnSlerBgzXEFu91E 9aU9f7bhVmZf+M9updIZHn/2VJwlIwvQdYqQbVPKFuBkIDwtAjNPwSHAFlj+XIiXL4Ou gUkWlsG171EPaGghKR039hdlxoMvBq742OYqvcull7mLNYQbTMvOi8BanMIewKgJQY9G cmLTQW3xESLC4NbHyDMITIK7mqmeD91LATSYb6+Jj8F05hynsNi9W2j00RxOKcToJOJc aWIQ== X-Gm-Message-State: ACrzQf0pVy3YWoJ5pbV0QqW4Zew0X9TfIWrT3VbXuXU9SNxwRauyQKVR NKe9h7btc4Cg2UC6Sup7CAGPV42nYmo= X-Google-Smtp-Source: AMsMyM6bn2Yny70xpFYl1B0ucmmZ1KLSEKY3lS3Km4dkD4R5MjGLuAlCRHVSBaIliu2KkTI9OJwJ3Q== X-Received: by 2002:a17:906:fd82:b0:770:7e61:3707 with SMTP id xa2-20020a170906fd8200b007707e613707mr6592849ejb.143.1663421690245; Sat, 17 Sep 2022 06:34:50 -0700 (PDT) Received: from Mini.fritz.box (p4fe3ab90.dip0.t-ipconnect.de. [79.227.171.144]) by smtp.gmail.com with ESMTPSA id o18-20020a170906769200b007386a8b90c9sm12457738ejm.13.2022.09.17.06.34.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Sep 2022 06:34:49 -0700 (PDT) Date: Sat, 17 Sep 2022 15:34:48 +0200 Message-Id: To: control@debbugs.gnu.org From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Subject: control message for bug #57727 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control 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 (-) close 57727 29.1 quit From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 17 17:09:44 2022 Received: (at 57727) by debbugs.gnu.org; 17 Sep 2022 21:09:44 +0000 Received: from localhost ([127.0.0.1]:47273 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZf4K-0004TL-6w for submit@debbugs.gnu.org; Sat, 17 Sep 2022 17:09:44 -0400 Received: from mail-wm1-f49.google.com ([209.85.128.49]:35765) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZf4H-0004T9-U5 for 57727@debbugs.gnu.org; Sat, 17 Sep 2022 17:09:42 -0400 Received: by mail-wm1-f49.google.com with SMTP id r133-20020a1c448b000000b003b494ffc00bso1479940wma.0 for <57727@debbugs.gnu.org>; Sat, 17 Sep 2022 14:09:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd.ie; s=google21; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date; bh=ipi3c6MewZKUTzMCSbkOaVUOIskwy4S50+er6ldG9/s=; b=DYOL5S3FpdrjhBkNMxwpp67zAzoHpJRSFMJwumYuiTp4242R0w1p31Ln++tEKqqyYi mJpPqqzLencesFocdwDZxFHHBiJlGORVHUTP7aTOf1eeXRT4KU+wPzX8XLgLqyZsCVor H0oYJgNQ1rfxeSV+50mn5JOfwpSK7iDTgEQ2juTAuoouDHawr2hgx7gD52oFTt+UKkjf 4SL0u4jjTiYwSSkR9efkpdOL8JmRVVicb+e7VESVq+XtwZK8zjl0f4daxWG2rrG5r6wE aVxzimxKOpOrITqftWvZtL3JY/KhXh6x8GYf0brPptSN9ZUwpieYcLAEvxFQB20qktds 1JSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date; bh=ipi3c6MewZKUTzMCSbkOaVUOIskwy4S50+er6ldG9/s=; b=HQAcD7t/w7/304uTy8G2NiXPVnooneKRr66jzXQFuUGJr2kUqsWLG2E4DABhAAGbt+ E/kmHbA9XvJmZhrQJmVfhgBY9H8vYrPzPm6qqO23EbsxZb1QPqDYDuhSHjT6zrzjuypt USLYKrApdec3aCZW8An/QpygzsuuEejQ/ovUDfOndNsGG3r/GKQMYZdvRG0kjUpviR+H ZzgUYstHg4Tryzh8/rYt8im1YDSKLB6CQWlgP43IS6752mDgKHTghcbTXzsfWbX09gSR zjgrfEjtktsDZqjPaNsaTToy0RDoT6HhtppfurFA4fNgGmkyNvlBl/pfd3zkr/lKXRcN RpdA== X-Gm-Message-State: ACrzQf0LtV2phbfbBUWBr3N0qtYxws2fdohq274jV8hLa6KAIGzPXW0a QSjZfa9sW1HzDC2HwaaXLMU6bA== X-Google-Smtp-Source: AMsMyM4vya5PK3uYe9JnBvqBoynRG0PhVJ90C8ZLUW1Udn7DqkrHbFY8HGjiekfOWo0BqsJzELft1Q== X-Received: by 2002:a7b:c2a2:0:b0:3a8:4959:a327 with SMTP id c2-20020a7bc2a2000000b003a84959a327mr7472407wmk.50.1663448975876; Sat, 17 Sep 2022 14:09:35 -0700 (PDT) Received: from localhost ([2a02:587:3200:85ac:55b:a5ed:9e6e:ecb1]) by smtp.gmail.com with ESMTPSA id s2-20020a5d4242000000b00224f7c1328dsm8711742wrr.67.2022.09.17.14.09.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Sep 2022 14:09:35 -0700 (PDT) From: "Basil L. Contovounesios" To: Gerd =?utf-8?Q?M=C3=B6llmann?= Subject: Re: bug#57727: 29.0.50; Optimize tty display updates In-Reply-To: ("Gerd =?utf-8?Q?M=C3=B6llman?= =?utf-8?Q?n=22's?= message of "Sun, 11 Sep 2022 12:03:45 +0200") References: Date: Sun, 18 Sep 2022 00:09:33 +0300 Message-ID: <877d21g12q.fsf@tcd.ie> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 57727 Cc: 57727@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 (-) Sorry for crashing the party late: Gerd M=C3=B6llmann [2022-09-11 12:03 +0200] wrote: > +DEFUN ("tty--output-buffer-size", Ftty__output_buffer_size, > + Stty__output_buffer_size, 0, 1, 0, doc: > + /* Return the output buffer size of TTY. > + > +TTY may be a terminal object, a frame, or nil (meaning the selected > +frame's terminal). > + > +A value of zero means TTY uses the system's default value. */) > + (Lisp_Object tty) > +{ > + struct terminal *terminal =3D decode_tty_terminal (tty); > + return make_fixnum (terminal->display_info.tty->output_buffer_size); What should tty--output-buffer-size do when called from a graphical terminal (i.e. when decode_tty_terminal returns NULL)? It currently crashes, but that's what every other C program is doing, very banal. Maybe Emacs should do something more eccentric, like return 0 or -1, signal an error, or do my taxes as consolation. > +DEFUN ("tty--set-output-buffer-size", Ftty__set_output_buffer_size, > + Stty__set_output_buffer_size, 1, 2, 0, doc: > + /* Set the output buffer size for a TTY. > + > +SIZE zero means use the system's default value. If SIZE is > +non-zero,this also avoids flushing the output stream. > + > +TTY may be a terminal object, a frame, or nil (meaning the selected > +frame's terminal). > + > +This function temporarily suspends and resumes the terminal > +device. */) > + (Lisp_Object size, Lisp_Object tty) > +{ > + if (!TYPE_RANGED_FIXNUMP (size_t, size)) > + error ("Invalid output buffer size"); Just curious: given this is an internal "--" function, do we want to tell the user what a valid size would be? E.g. along the lines of: size_t sz =3D check_uinteger_max (size, min (MOST_POSITIVE_FIXNUM, SIZE_M= AX)); Or would that be too much? BTW, is there a known upper limit for the buffer size in the OS? > + Fsuspend_tty(tty); > + struct terminal *terminal =3D decode_tty_terminal (tty); Here, terminal should theoretically be non-NULL, as Fsuspend_tty would have otherwise signalled. Maybe we should eassert this assumption, or explicitly check for NULL? Thanks, --=20 Basil From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 18 01:35:04 2022 Received: (at 57727) by debbugs.gnu.org; 18 Sep 2022 05:35:04 +0000 Received: from localhost ([127.0.0.1]:47559 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZmxL-0004bv-M5 for submit@debbugs.gnu.org; Sun, 18 Sep 2022 01:35:03 -0400 Received: from mail-wr1-f48.google.com ([209.85.221.48]:38435) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZmxJ-0004bM-Oc for 57727@debbugs.gnu.org; Sun, 18 Sep 2022 01:35:02 -0400 Received: by mail-wr1-f48.google.com with SMTP id b5so42168436wrr.5 for <57727@debbugs.gnu.org>; Sat, 17 Sep 2022 22:35:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date; bh=jCGw78XSxoYU2Xt43l9PwsPMM6DtEt8xF1oQOZgC8Sc=; b=XWz2E50DtiGlzXza1aBvn6hTt8HoBWZ9L7ONYAauG3pxJOYesBPmp7ICk+gh3MpZjN mxC+MJpN+YPLUSChKfvz4vKvTX9F+3U4oTb3L+15BZNWWNP/MFS+mCmPwy1HYyrMLC2F kUxjzzscvLPr7UpDn4ibYcWe6g2Nw2XywQaCQpQI9nRqthRjW+FmhRMy0nmKoMfxuJ8O 8PT+rXCj0mldEexoWvyDtJqVLl9v0A6T6vaUCIIVTQPuTq5lhmFCtYoxkqzXMflxDmZ3 WzDSKhxK20zsc2QA7hs0PJsg5vhcNMCqcgEzERb926NgZ35kxIN27MyqHm31xgB97Iy8 lVOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date; bh=jCGw78XSxoYU2Xt43l9PwsPMM6DtEt8xF1oQOZgC8Sc=; b=6SQlqxappBm3Ls3Ssms1f8+xHKtHmqUFAhwjwocRBbAvYbOhDe9QiwR3I9gF8Pjl2Z fGcMie4bnUOKrLkUoTbsRvyd+IGLTgGp3CInsII2+Ul2k9kRt3uIhnaiYT6V+CFqd3Ml CqJoOAga0mApPe5dcHymJmKFtBOFhpYgJ8PuJUlr4Bc0aV+oV8QFuDmzqaacNtf/5It7 qOeeyRj2t7K2AKAyKMYVEk4osPy7DGJlsxrXsG85IDFycJppkD8rCt8DZbKu81rmGhvB Uval/11T+nOLcZpxdw5xPFLHKuBTfnYqRaU092CTobCqHg84HEeCga3isbLVjtk+bnPk y5dw== X-Gm-Message-State: ACrzQf1pbt5N/ATgQi9F3auoQDFJibA3Ap21PFRHVEAk747fL4H/Hxy6 CM6iiFfVVwVAQFLoTVVcfk9ndJQBQLD0ug== X-Google-Smtp-Source: AMsMyM7eusNhKoEz2fsekIJ46hTG15GH1QsTt90CPNyXvEJMTLrLnUvD4cWWNZQVaCUSx6qWqIfWiQ== X-Received: by 2002:a05:6000:1881:b0:222:c899:cac6 with SMTP id a1-20020a056000188100b00222c899cac6mr6900190wri.283.1663479295465; Sat, 17 Sep 2022 22:34:55 -0700 (PDT) Received: from Mini.fritz.box (pd9e3614c.dip0.t-ipconnect.de. [217.227.97.76]) by smtp.gmail.com with ESMTPSA id o38-20020a05600c512600b003b47b913901sm2749614wms.1.2022.09.17.22.34.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Sep 2022 22:34:54 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: "Basil L. Contovounesios" Subject: Re: bug#57727: 29.0.50; Optimize tty display updates In-Reply-To: <877d21g12q.fsf@tcd.ie> (Basil L. Contovounesios's message of "Sun, 18 Sep 2022 00:09:33 +0300") References: <877d21g12q.fsf@tcd.ie> Date: Sun, 18 Sep 2022 07:34:54 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 57727 Cc: 57727@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 (-) "Basil L. Contovounesios" writes: > What should tty--output-buffer-size do when called from a graphical > terminal (i.e. when decode_tty_terminal returns NULL)? > > It currently crashes, but that's what every other C program is doing, > very banal. Maybe Emacs should do something more eccentric, like return > 0 or -1, signal an error, or do my taxes as consolation. Oops, it should signal. > Just curious: given this is an internal "--" function, do we want to > tell the user what a valid size would be? E.g. along the lines of: > > size_t sz = check_uinteger_max (size, min (MOST_POSITIVE_FIXNUM, SIZE_MAX)); > > Or would that be too much? > > BTW, is there a known upper limit for the buffer size in the OS? I didn't want to do that because I don't know how to determine SIZE_MAX, so I let users do what the like, as long as it doesn't make Emacs crash :-). > >> + Fsuspend_tty(tty); >> + struct terminal *terminal = decode_tty_terminal (tty); > > Here, terminal should theoretically be non-NULL, as Fsuspend_tty would > have otherwise signalled. Maybe we should eassert this assumption, or > explicitly check for NULL? I don't think that's necessary, or in other words, I think eassert wouldn't give as valuable addtional information here. From unknown Fri Aug 15 03:59:53 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 16 Oct 2022 11:24:05 +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