From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.bugs Subject: bug#57129: 29.0.50; Improve behavior of conditionals in Eshell Date: Sat, 20 Aug 2022 11:03:27 -0700 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="------------E1D8F599EEB8329E850EFB53" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26298"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, 57129@debbugs.gnu.org To: Eli Zaretskii , Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 20 20:04: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 1oPSpV-0006cb-My for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Aug 2022 20:04:17 +0200 Original-Received: from localhost ([::1]:54202 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oPSpU-0005m7-Hv for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Aug 2022 14:04:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56548) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oPSpG-0005lv-Ez for bug-gnu-emacs@gnu.org; Sat, 20 Aug 2022 14:04:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43734) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oPSpG-0007Xo-2h for bug-gnu-emacs@gnu.org; Sat, 20 Aug 2022 14:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oPSpF-0006ld-Uq for bug-gnu-emacs@gnu.org; Sat, 20 Aug 2022 14:04:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Aug 2022 18:04:01 +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.166101861925981 (code B ref 57129); Sat, 20 Aug 2022 18:04:01 +0000 Original-Received: (at 57129) by debbugs.gnu.org; 20 Aug 2022 18:03:39 +0000 Original-Received: from localhost ([127.0.0.1]:33483 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oPSot-0006ky-5D for submit@debbugs.gnu.org; Sat, 20 Aug 2022 14:03:39 -0400 Original-Received: from mail-pf1-f174.google.com ([209.85.210.174]:39669) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oPSoq-0006kk-HV for 57129@debbugs.gnu.org; Sat, 20 Aug 2022 14:03:38 -0400 Original-Received: by mail-pf1-f174.google.com with SMTP id 83so1204530pfw.6 for <57129@debbugs.gnu.org>; Sat, 20 Aug 2022 11:03:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-language:in-reply-to:mime-version:date:message-id:from :references:cc:to:subject:from:to:cc; bh=11IrK6JhG5yVnsmTAD6RsIFZtnt51uOGHkGGl6K1QYY=; b=kCbntuuuP9HsQP6+qIRC2/uohRR52Gg20WmywnfWEuoyvhyYL7XgXWAphTCIWo8VJq wUCeb2BAwOYGV83+bft/oYqwujR5CPmzQNLr9JLIA/9flnKu9rZip9x/s5cFt5wYf6Wl uGhrSan0e8tUO9xfKhf/LOTPMb+WC/32rWBHTs2Id9ltP1DJi6IbEgQ3pMDnBRwlhkmL MzCW6MeRTOV48jZWSdtWd9bIteiE4RVdQSxepKloFfQKcvGfLfneTqqGTaIOACnEIP8C LTrDjKC4Y25DKCLiDm8Tb8dQ3Sj1kOQ2M+p0aG5gOEDFwnnh/2KvP2cS0prO05zYOdlf 5f4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-language:in-reply-to:mime-version:date:message-id:from :references:cc:to:subject:x-gm-message-state:from:to:cc; bh=11IrK6JhG5yVnsmTAD6RsIFZtnt51uOGHkGGl6K1QYY=; b=WhGudz9NTQrl5y7Fr+PuEZqikwpYTXhDo4ck5cGOGppiHRnWRcDESsIYhc+X9mODoj TrXtUjUgkTGoreKOB/j7OhBwz03HvH3/aKsCOUJiR1mjDMR0JVrxvoQS8bDT/RsphCwb XcrFizxqkuHkCW0yMLvy7yLXkYdWyfyAhcxeCGaA8wBDqb6Hp2QA8h65xnikV3yN4sPv HGPonnPT+NW0bcnRM9kYek7lg7KJFgI7R0stZ7MkdWENa58YX5H06jBzzl8qnLpfvYPA Sd9yrXu0SD+a6nAz0SRBtqHBmTGoqEjPDRqHsO1mL3v9vSQ5ZzL+tsrsk997lZCxaRaD xN7A== X-Gm-Message-State: ACgBeo3zhF2oNKghKxThgn5Um1gqx15aYnCb6E99rNs7FDlZMEGv7VTo AKYtDElFBqJF7qeYJTmYYjlbkstV/UQ= X-Google-Smtp-Source: AA6agR7F/ZbRInzcC6ZAKLiNocJFkI9cO8UqNDYeA4SmnNs0AHJmsDSXuHhTCbp6VR0geCOe/zpCjA== X-Received: by 2002:a05:6a00:1a0c:b0:528:6baa:a2e3 with SMTP id g12-20020a056a001a0c00b005286baaa2e3mr13612770pfv.27.1661018610690; Sat, 20 Aug 2022 11:03:30 -0700 (PDT) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id iw3-20020a170903044300b00172c7d6badcsm1512409plb.251.2022.08.20.11.03.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 20 Aug 2022 11:03:29 -0700 (PDT) In-Reply-To: <83ilmtgwq3.fsf@gnu.org> Content-Language: en-US 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:240267 Archived-At: This is a multi-part message in MIME format. --------------E1D8F599EEB8329E850EFB53 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 8/15/2022 11:58 AM, Eli Zaretskii wrote: >> Cc: larsi@gnus.org, 57129@debbugs.gnu.org >> From: Jim Porter >> Date: Mon, 15 Aug 2022 11:30:07 -0700 >> >> The temp files are created by Eshell in lisp/eshell/esh-var.el in the >> function 'eshell-parse-variable-ref', specifically in the part starting >> with: >> >> (eq (char-after) ?\<) > > 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. So if you > are careful and delete the temporary file each time after usage, and > never need more than one temporary file at the same time, you will get > the same name every call. In addition to the changes to temporary file name generation, I think it would be useful for Eshell to kill the temporary buffer too. If you use this feature in Eshell a lot, the temporary buffers could pile up, consuming memory for no real benefit. (A user who wanted the buffer to stick around would probably redirect to a non-temporary file, or even just to a buffer.) Attached is a patch to do this. --------------E1D8F599EEB8329E850EFB53 Content-Type: text/plain; charset=UTF-8; name="0001-Kill-the-buffer-associated-with-a-temp-file-when-usi.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename*0="0001-Kill-the-buffer-associated-with-a-temp-file-when-usi.pa"; filename*1="tch" RnJvbSA2MmU0MzE2YmFkNjY0NWZmMTJlZjc1ODc3MzViOWUxYzVlNzRmZTIxIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBKaW0gUG9ydGVyIDxqcG9ydGVyYnVnc0BnbWFpbC5j b20+CkRhdGU6IFNhdCwgMjAgQXVnIDIwMjIgMTA6NDg6MzIgLTA3MDAKU3ViamVjdDogW1BB VENIXSBLaWxsIHRoZSBidWZmZXIgYXNzb2NpYXRlZCB3aXRoIGEgdGVtcCBmaWxlIHdoZW4g dXNpbmcKICckPGNvbW1hbmQ+JyBpbiBFc2hlbGwKCiogbGlzcC9lc2hlbGwvZXNoLXZhci5l bCAoZXNoZWxsLXBhcnNlLXZhcmlhYmxlLXJlZik6IEtpbGwgdGhlIHRlbXAKZmlsZSdzIGJ1 ZmZlciB3aGVuIHdlJ3JlIGRvbmUuCi0tLQogbGlzcC9lc2hlbGwvZXNoLXZhci5lbCB8IDcg KysrKystLQogMSBmaWxlIGNoYW5nZWQsIDUgaW5zZXJ0aW9ucygrKSwgMiBkZWxldGlvbnMo LSkKCmRpZmYgLS1naXQgYS9saXNwL2VzaGVsbC9lc2gtdmFyLmVsIGIvbGlzcC9lc2hlbGwv ZXNoLXZhci5lbAppbmRleCAyZjY2MTRiNWQ3Li5hOWRmMTcyZTg4IDEwMDY0NAotLS0gYS9s aXNwL2VzaGVsbC9lc2gtdmFyLmVsCisrKyBiL2xpc3AvZXNoZWxsL2VzaC12YXIuZWwKQEAg LTQ5MCw4ICs0OTAsMTEgQEAgZXNoZWxsLXBhcnNlLXZhcmlhYmxlLXJlZgogICAgICAgICAg ICAgICAgICAgICAgICAgICAgOzsgYnkgYGVzaGVsbC1kby1ldmFsJywgd2hpY2ggcmVxdWly ZXMgdmVyeQogICAgICAgICAgICAgICAgICAgICAgICAgICAgOzsgcGFydGljdWxhciBmb3Jt cyBpbiBvcmRlciB0byB3b3JrCiAgICAgICAgICAgICAgICAgICAgICAgICAgICA7OyBwcm9w ZXJseS4gIFNlZSBidWcjNTQxOTAuCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAobGlz dCAoZnVuY3Rpb24gKGxhbWJkYSAoKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAoZGVsZXRlLWZpbGUgLHRlbXApKSkpKSkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgIChsaXN0IChmdW5jdGlvbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IChsYW1iZGEgKCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkZWxl dGUtZmlsZSAsdGVtcCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh3 aGVuLWxldCAoKGJ1ZmZlciAoZ2V0LWZpbGUtYnVmZmVyICx0ZW1wKSkpCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIChraWxsLWJ1ZmZlciBidWZmZXIpKSkpKSkp CiAgICAgICAgICAgICAgICAgICAgKGVzaGVsbC1hcHBseS1pbmRpY2VzICx0ZW1wIGluZGlj ZXMgLGVzaGVsbC1jdXJyZW50LXF1b3RlZCkpKQogICAgICAgICAgICAgKGdvdG8tY2hhciAo MSsgZW5kKSkpKSkpKQogICAgKChlcSAoY2hhci1hZnRlcikgP1woKQotLSAKMi4yNS4xCgo= --------------E1D8F599EEB8329E850EFB53--