From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#36591: 26.2; Term's pager seems broken Date: Thu, 25 Jul 2019 18:58:29 +0200 Message-ID: References: <87lfwox3fi.fsf@gmail.com> <838ssops2u.fsf@gnu.org> <87imrsw5gj.fsf@gmail.com> <83y30no4hi.fsf@gnu.org> <87ftmvvsol.fsf@gmail.com> <875znqctzy.fsf@mouse.gnus.org> <83imrqnu9e.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="244959"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: abliss@gmail.com, 36591@debbugs.gnu.org, npostavs@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 25 18:59:10 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hqh59-0011VM-Gf for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Jul 2019 18:59:07 +0200 Original-Received: from localhost ([::1]:34058 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hqh58-0004lr-HP for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Jul 2019 12:59:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47502) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hqh55-0004lZ-Lx for bug-gnu-emacs@gnu.org; Thu, 25 Jul 2019 12:59:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hqh54-0002nE-D0 for bug-gnu-emacs@gnu.org; Thu, 25 Jul 2019 12:59:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59743) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hqh54-0002mn-8C for bug-gnu-emacs@gnu.org; Thu, 25 Jul 2019 12:59:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hqh54-0003S8-5S for bug-gnu-emacs@gnu.org; Thu, 25 Jul 2019 12:59:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Jul 2019 16:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36591 X-GNU-PR-Package: emacs Original-Received: via spool by 36591-submit@debbugs.gnu.org id=B36591.156407391613235 (code B ref 36591); Thu, 25 Jul 2019 16:59:02 +0000 Original-Received: (at 36591) by debbugs.gnu.org; 25 Jul 2019 16:58:36 +0000 Original-Received: from localhost ([127.0.0.1]:40331 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hqh4d-0003RP-Sh for submit@debbugs.gnu.org; Thu, 25 Jul 2019 12:58:36 -0400 Original-Received: from quimby.gnus.org ([80.91.231.51]:46668) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hqh4c-0003RH-ME for 36591@debbugs.gnu.org; Thu, 25 Jul 2019 12:58:35 -0400 Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hqh4Y-0006JG-2Z; Thu, 25 Jul 2019 18:58:32 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAHlBMVEXEvr0jISsREBtVUlcI CBKHhIc+O0JgYGOkoKKxra6SPbW5AAACRklEQVQ4jVWUPW/bMBCGuaS1x2MMdiYhZHeE0HMN/oHA oOQxjNAzuiUQLKGbi8KwvAko0tj/tkeRtOWbqPfhe8evE2vbcxfj7CMMD5a17TrqR5JPcVxoAnY0 P5I9EqjXIz2SP4gJHBMYijSVi8ArPZv2gRxQR4efz3xMB9JgSpV0ChpShQiOPk+M6anECxjp7KDd GFzmrzDo7gr21pZtiwgOcwiOowcf3UcNfCkFOa6gZ/bY1Q5AOKVEquEzffq0FRHEBoSoXAJN1Wr+ 3ZFDtxpEFR39HT71BRcI0GxtjcDBAyrxd7PbfUL+NAex6cocgJsADltar9Rvv4XQ21KTEyJod4wB vH0RmK/cHGQE5zL/1U+42Db3m/Wp4FKCG8C01IsfBObZt58T9pVLJSEBRN3kXOGL7Uq+TDXObY26 XrxL7sRi0SiTapCj0oVf5FLSCfBlZrJYnFK5TEoCtHmujDHhSAhoZwxwycnnde/o+r7NcyQgOCWH V54A64tNDWjMvVJZhm5mzFIN4PzPX5xRDxntwFuNieCOboJnRs4kHTEfAfZM2ZURjw/OgddTKjoG WqbUTjoyej0BthouerbkQVY8ACIHDBtTIQawG97VdF/nC7p12uDIkZ7i3RwgkGHn0+sbncz9kQSw Zqfrq6bH7rK4qjWbXPqAzKfiAvpJaEEWenD/SMAXt2wy6k3q2hXPBocHF+K7eV/OvSO3lOrmh2Ht syOgbd/dhLV2JQdg7fpWtxYiuKL98GXfX1mta8Qqp2ivsS3cf0H6gIg6x/rGAAAAAElFTkSuQmCC In-Reply-To: <83imrqnu9e.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 25 Jul 2019 16:01:01 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:163719 Archived-At: Eli Zaretskii writes: >> I think Noam is right -- the "we may not have the socket yet" refers to >> this bit: >> >> if (p->infd >= 0) >> set_process_filter_masks (p); > > So you are saying that the commit log message wanted to explain the > code which existed there already? Because the condition that tested > p->infd was already there before you refactored the code into > set_process_filter_masks. > > That's somewhat strange, but I guess is OK. However, I still wonder > what was the rationale for making the code change in the first place. > It seems to me that the real reason was the addition of the call to > set_process_filter_masks in connect_network_socket, but why was that > necessary? Yes, it was refactored out into its own function so that we can call it from connect_network_socket, too. I think the logic is slowly coming back to me... Lisp programs typically call `set-process-filter' after calling `make-network-process' -- even when opening an asynchronous connection. This worked before because the connection wouldn't really be all that synchronous -- it would do name resolution, and then open the socket, so when `make-network-process' had returned, then p->infd would (almost) always be valid. When `make-network-process' was made more asynchronous, then p->infd typically not be initialised yet, so `set-process-filter' would not do the main bit any more. To avoid having to rewrite all the callers of `set-process-filter' with async connections, I just made it do the filter setup in connect_network_socket, by which time we really have a p->infd. Logically speaking, it would make more sense if nobody called `set-process-filter' until we have a connection, but that wouldn't be backwards compatible. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no