From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: `message' not outputting the newline "atomically" Date: Thu, 27 Jun 2019 16:31:38 +0300 Message-ID: <83zhm3i285.fsf@gnu.org> References: <07619925-e367-fb88-2dd8-27addb2e9052@grinta.net> <68b398b1-3790-b32f-535d-6ea2518f79b8@cs.ucla.edu> <83pnn1lkej.fsf@gnu.org> <83tvccjrpo.fsf@gnu.org> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="242616"; mail-complaints-to="usenet@blaine.gmane.org" Cc: eggert@cs.ucla.edu, daniele@grinta.net, emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 27 15:33:22 2019 Return-path: Envelope-to: ged-emacs-devel@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 1hgUWg-0010xR-1X for ged-emacs-devel@m.gmane.org; Thu, 27 Jun 2019 15:33:22 +0200 Original-Received: from localhost ([::1]:50784 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgUWe-0007GK-KV for ged-emacs-devel@m.gmane.org; Thu, 27 Jun 2019 09:33:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35834) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgUVF-0007Fw-VL for emacs-devel@gnu.org; Thu, 27 Jun 2019 09:31:55 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:50311) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hgUVF-0000JH-4J; Thu, 27 Jun 2019 09:31:53 -0400 Original-Received: from [176.228.60.248] (port=4549 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hgUVE-0000xg-J0; Thu, 27 Jun 2019 09:31:52 -0400 In-reply-to: (message from Lars Ingebrigtsen on Thu, 27 Jun 2019 13:03:17 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:238193 Archived-At: > From: Lars Ingebrigtsen > Cc: eggert@cs.ucla.edu, daniele@grinta.net, emacs-devel@gnu.org > Date: Thu, 27 Jun 2019 13:03:17 +0200 > > Eli Zaretskii writes: > > > Sorry, I've probably misunderstood what was being discussed. I thought > > you were talking about the conversion itself. The target string is of > > course created via xmalloc. B ut that could hardly infloop. > > So, that function is a function that will commonly already call xmalloc, > so adding another one doesn't substantially change the guarantees or > behaviour of that function, which was my point (because that's the > `message' path). Each additional call increases the risk you will run out of memory or hit some calamity. It isn't an all or nothing situation. > The practical problems with interleaving (that is, the only ones I see > with any regularity) are the ones that stems from using `message' in a > batch Emacs, and the other uses of stderr aren't problems in practice. > (Because they're only used for errors that "shouldn't happen".) > > But I'm all for fixing those things if that can be done in a way that > doesn't break anything, and then (of course) the `message' path could > also use that machinery. I'm okay with making 'message' write in one go to stderr, but I don't want to pay the price of having stderr buffered globally. Several solutions for this single issue were already proposed, but we keep rejecting them and returning to line-buffering time and again. I think if we want to solve the original problem, that of 'message' in batch sessions, we should stop looking for a 110% perfect solution, and certainly not try to solve additional issues while we are at that.