From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#57129: 29.0.50; Improve behavior of conditionals in Eshell Date: Mon, 15 Aug 2022 13:55:35 -0700 Organization: UCLA Computer Science Department Message-ID: 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: multipart/mixed; boundary="------------z02mCF0yqnIghhs3seMwKK6j" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38089"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Cc: Jim Porter , larsi@gnus.org, Gnulib bugs , 57129@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 15 22:56:15 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 1oNh8B-0009iI-1v for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 15 Aug 2022 22:56:15 +0200 Original-Received: from localhost ([::1]:43272 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oNh89-0000q7-KV for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 15 Aug 2022 16:56:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59790) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oNh7y-0000pR-JZ for bug-gnu-emacs@gnu.org; Mon, 15 Aug 2022 16:56:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54453) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oNh7y-0006wP-A7 for bug-gnu-emacs@gnu.org; Mon, 15 Aug 2022 16:56:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oNh7y-000712-5H for bug-gnu-emacs@gnu.org; Mon, 15 Aug 2022 16:56:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 15 Aug 2022 20:56: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.166059695026951 (code B ref 57129); Mon, 15 Aug 2022 20:56:02 +0000 Original-Received: (at 57129) by debbugs.gnu.org; 15 Aug 2022 20:55:50 +0000 Original-Received: from localhost ([127.0.0.1]:44202 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNh7l-00070c-6K for submit@debbugs.gnu.org; Mon, 15 Aug 2022 16:55:50 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:36318) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNh7f-00070L-Gs for 57129@debbugs.gnu.org; Mon, 15 Aug 2022 16:55:47 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 3D80A160149; Mon, 15 Aug 2022 13:55:37 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id iz8g08aNcE6e; Mon, 15 Aug 2022 13:55:35 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id BD060160139; Mon, 15 Aug 2022 13:55:35 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 4OIYDawA6Uhx; Mon, 15 Aug 2022 13:55:35 -0700 (PDT) Original-Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 7FCE2160129; Mon, 15 Aug 2022 13:55:35 -0700 (PDT) Content-Language: en-US In-Reply-To: <83ilmtgwq3.fsf@gnu.org> 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:239841 Archived-At: This is a multi-part message in MIME format. --------------z02mCF0yqnIghhs3seMwKK6j Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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, as gen_tempname is generating a uniquely-named file that is exclusive to Emacs, which is all it's supposed to do. I do see a comment saying that gen_tempname generates "hard-to-predict" names, which as you note is not correct on MS-DOS, nor even strictly speaking on all POSIX platforms. I installed the first attached patch into Gnulib to fix that comment. 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. --------------z02mCF0yqnIghhs3seMwKK6j Content-Type: text/x-patch; charset=UTF-8; name="0001-tempname-remove-incorrect-comment.patch" Content-Disposition: attachment; filename="0001-tempname-remove-incorrect-comment.patch" Content-Transfer-Encoding: base64 RnJvbSBhN2VmMjFiZjM0N2RhNWUzYThiNTQ5MmI4NDlkNjMzZWYzMjUyZDYyIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBQYXVsIEVnZ2VydCA8ZWdnZXJ0QGNzLnVjbGEuZWR1 PgpEYXRlOiBNb24sIDE1IEF1ZyAyMDIyIDEzOjA0OjA4IC0wNzAwClN1YmplY3Q6IFtQQVRD SF0gdGVtcG5hbWU6IHJlbW92ZSBpbmNvcnJlY3QgY29tbWVudAoKKiBsaWIvdGVtcG5hbWUu YywgbGliL3RlbXBuYW1lLmg6IFJlbW92ZSBpbmNvcnJlY3QgY29tbWVudCwKYXMgdGhlIG5h bWVzIGFyZSBub3QgbmVjZXNzYXJpbHkgaGFyZCB0byBwcmVkaWN0IChCdWcjNTcxMjkpLgot LS0KIENoYW5nZUxvZyAgICAgIHwgNiArKysrKysKIGxpYi90ZW1wbmFtZS5jIHwgMiArLQog bGliL3RlbXBuYW1lLmggfCAyICstCiAzIGZpbGVzIGNoYW5nZWQsIDggaW5zZXJ0aW9ucygr KSwgMiBk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Wxnb3JpdGht IHRvIGdldCBoYXJkLXRvLXByZWRpY3QgbmFtZXMuICovCisgICAqLwogI2lmZGVmIF9MSUJD CiBzdGF0aWMKICNlbmRpZgpkaWZmIC0tZ2l0IGEvbGliL3RlbXBuYW1lLmggYi9saWIvdGVt cG5hbWUuaAppbmRleCBjMTcyODIwZjdmLi41ZTNjNWUxNTUwIDEwMDY0NAotLS0gYS9saWIv dGVtcG5hbWUuaAorKysgYi9saWIvdGVtcG5hbWUuaApAQCAtNDgsNyArNDgsNyBAQCBleHRl cm4gIkMiIHsKICAgICAgICAgICAgICAgICAgICAgICAgIGFuZCByZXR1cm4gYSByZWFkLXdy aXRlIGZkLiAgVGhlIGZpbGUgaXMgbW9kZSAwNjAwLgogICAgR1RfRElSOiAgICAgICAgICAg ICAgY3JlYXRlIGEgZGlyZWN0b3J5LCB3aGljaCB3aWxsIGJlIG1vZGUgMDcwMC4KIAotICAg V2UgdXNlIGEgY2xldmVyIGFsZ29yaXRobSB0byBnZXQgaGFyZC10by1wcmVkaWN0IG5hbWVz LiAqLworICAgKi8KIGV4dGVybiBpbnQgZ2VuX3RlbXBuYW1lIChjaGFyICp0bXBsLCBpbnQg c3VmZml4bGVuLCBpbnQgZmxhZ3MsIGludCBraW5kKTsKIC8qIFNpbWlsYXIsIGV4Y2VwdCBY X1NVRkZJWF9MRU4gZ2l2ZXMgdGhlIG51bWJlciBvZiBYcy4gICovCiBleHRlcm4gaW50IGdl bl90ZW1wbmFtZV9sZW4gKGNoYXIgKnRtcGwsIGludCBzdWZmaXhsZW4sIGludCBmbGFncywg aW50IGtpbmQsCi0tIAoyLjM0LjEKCg== --------------z02mCF0yqnIghhs3seMwKK6j Content-Type: text/x-patch; charset=UTF-8; name="0001-Don-t-create-temp-file-with-same-name-as-visited.patch" Content-Disposition: attachment; filename*0="0001-Don-t-create-temp-file-with-same-name-as-visited.patch" Content-Transfer-Encoding: base64 RnJvbSBhMDc3Njk4NGJjMzYzMGM4YzBiZDU3YjNmZDF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