From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#57129: 29.0.50; Improve behavior of conditionals in Eshell Date: Tue, 16 Aug 2022 14:04:10 +0300 Message-ID: <835yish2l1.fsf__35837.3385899299$1660647922$gmane$org@gnu.org> References: <8fb3461d-b7eb-23c4-2736-cdd6dfeb1aa0@gmail.com> <87mtc9o5af.fsf@gnus.org> <83h72gmxtq.fsf@gnu.org> <7c04a92b-85f4-41c3-917b-4716cca2b9d6@gmail.com> <83pmh3l8ey.fsf@gnu.org> <9ca08054-5b73-a13e-0478-d838b650317b@gmail.com> <837d3bl1tx.fsf@gnu.org> <5ff283e8-9ced-5894-1075-43bba580185e@gmail.com> <831qthiu0s.fsf@gnu.org> <7259f313-c6ef-bce8-ddc4-e35ecc27d856@gmail.com> <83pmh1h2pv.fsf@gnu.org> <83lerpgyg3.fsf@gnu.org> <83ilmtgwq3.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6661"; mail-complaints-to="usenet@ciao.gmane.io" Cc: jporterbugs@gmail.com, larsi@gnus.org, bug-gnulib@gnu.org, 57129@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 16 13:05:18 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oNuNp-0001Xo-B4 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 16 Aug 2022 13:05:17 +0200 Original-Received: from localhost ([::1]:55484 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oNuNn-0007W3-Tz for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 16 Aug 2022 07:05:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37040) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oNuNb-0007UI-1R for bug-gnu-emacs@gnu.org; Tue, 16 Aug 2022 07:05:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55336) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oNuNa-0005ef-PE for bug-gnu-emacs@gnu.org; Tue, 16 Aug 2022 07:05:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oNuNa-0003rh-Hs for bug-gnu-emacs@gnu.org; Tue, 16 Aug 2022 07:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 16 Aug 2022 11:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57129 X-GNU-PR-Package: emacs Original-Received: via spool by 57129-submit@debbugs.gnu.org id=B57129.166064787614820 (code B ref 57129); Tue, 16 Aug 2022 11:05:02 +0000 Original-Received: (at 57129) by debbugs.gnu.org; 16 Aug 2022 11:04:36 +0000 Original-Received: from localhost ([127.0.0.1]:45085 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNuNA-0003qy-68 for submit@debbugs.gnu.org; Tue, 16 Aug 2022 07:04:36 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52230) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNuN5-0003qi-SW for 57129@debbugs.gnu.org; Tue, 16 Aug 2022 07:04:34 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:56246) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oNuMy-0005aO-EN; Tue, 16 Aug 2022 07:04:25 -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=2s9bGlDfB2sYGgIyR4DFRmc6CJotEtUJADjIOPRzRLY=; b=aJF68mt328jv96AToipg Qc5wAKLHucjE95a52/to+7eiUzd/tV6It7nXHTHsGsc65HNFR4hgm/YpXUUi7fXFiVWcJgW2lcTPR i5zwRx/rTMzP125Pdm14abBVJlIqvigg+0nE5U28iksPVuRJaIK1MZJXzNWrGmuofd7+RdXvmg6Cq D+fpf1VRO0SgM4SX31Bor1b2jmlEEpfYwIwWm0nU8dwTp5vS4FQLiMcOh8OJpSjLVBUwhwDaoDKMv QIFTMIWwiCCSMkICe7v9ufQ1I343D4WFF96J6Lo3RrkghuqoJG2DbbWf4fPeKzsEkevz7sfExBtPO TJiIX9WzdRUv4g==; Original-Received: from [87.69.77.57] (port=1712 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 1oNuMx-0004Mw-0y; Tue, 16 Aug 2022 07:04:24 -0400 In-Reply-To: (message from Paul Eggert on Mon, 15 Aug 2022 13:55:35 -0700) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:239895 Archived-At: > Date: Mon, 15 Aug 2022 13:55:35 -0700 > Cc: larsi@gnus.org, 57129@debbugs.gnu.org, Jim Porter > , Gnulib bugs > From: Paul Eggert > > On 8/15/22 11:58, Eli Zaretskii wrote: > > > Ah, okay. It's a (mis)feature of Gnulib's gen_tempname function > > (which is the guts of make-temp-file) in its implementation for > > MS-Windows (and maybe other platforms?): it always begins from the > > same "random" characters in the file name, and only generates other > > random characters if there's already a file by that name. > > Not sure I'd call it a misfeature I didn't say "misfeature". Evidently, for you and perhaps others it's a feature. > as gen_tempname is generating a uniquely-named file that is > exclusive to Emacs, which is all it's supposed to do. Then perhaps calling it from make-temp-file in Emacs is a mistake, because that function's doc string says Create a temporary file. The returned file name (created by appending some random characters at the end of PREFIX, and expanding against ‘temporary-file-directory’ if necessary), is guaranteed to point to a newly created file. When you tell someone that the file name will include "some random characters", they don't expect that they will be the same "random characters" every call, just like saying that some function generates random numbers doesn't imply it will be the same number every call. > I'm not sure I'm entirely understanding the Emacs problem, but it > appears to be that Emacs has its own set of filenames that it thinks it > knows about, and Emacs wants the new temporary file's name to not be a > member of that set. If I'm right, does the second attached patch (this > patch is to Emacs) address the problem? I haven't tested or installed it. I don't think that's the problem, no. The problem is that callers of make-temp-file reasonably expect it to return a new name every call. And evidently, it does that on GNU/Linux (not sure how, given that the tempname.c code is supposed to be in glibc?). So if there's no intention to change gen_tempname on non-glibc platforms so that it doesn't repeat the same "random characters" upon each call, I think Emacs should call a different function to generate "random" names of temporary files, for consistency across platforms if not for other reasons.