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#60666: 30.0.50; [PATCH] Use field properties in Eshell buffers Date: Tue, 10 Jan 2023 11:28:17 -0800 Message-ID: <6a94f805-cb0f-2328-71f8-c64891b18e06@gmail.com> References: <83cz7nq588.fsf@gnu.org> <537ece85-8808-c7fa-71b0-c355ff3740bb@gmail.com> <83o7r6oadh.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2591"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60666@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 10 20:35:16 2023 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 1pFKOw-0000UH-Lz for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 10 Jan 2023 20:35:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFKIz-0001JP-1k; Tue, 10 Jan 2023 14:29:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFKIw-0001HB-LD for bug-gnu-emacs@gnu.org; Tue, 10 Jan 2023 14:29:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pFKIw-0000jv-Ae for bug-gnu-emacs@gnu.org; Tue, 10 Jan 2023 14:29:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pFKIv-0000wq-PH for bug-gnu-emacs@gnu.org; Tue, 10 Jan 2023 14:29:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 10 Jan 2023 19:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60666 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 60666-submit@debbugs.gnu.org id=B60666.16733789073597 (code B ref 60666); Tue, 10 Jan 2023 19:29:01 +0000 Original-Received: (at 60666) by debbugs.gnu.org; 10 Jan 2023 19:28:27 +0000 Original-Received: from localhost ([127.0.0.1]:41170 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFKIM-0000vw-PL for submit@debbugs.gnu.org; Tue, 10 Jan 2023 14:28:27 -0500 Original-Received: from mail-pl1-f177.google.com ([209.85.214.177]:33771) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFKIL-0000vf-86 for 60666@debbugs.gnu.org; Tue, 10 Jan 2023 14:28:25 -0500 Original-Received: by mail-pl1-f177.google.com with SMTP id 17so14307787pll.0 for <60666@debbugs.gnu.org>; Tue, 10 Jan 2023 11:28:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=NsgF550TXGbF8AzQg1Z5FylbZak6i87tdtnBiL+fRd8=; b=IG2xox5Y5qLgb1W0s9NSRadR95qpBAyv55CHVvDVTxcy7OUeat7JqATutrtp1z7y4P 7kHuvdSv8uECI7xrVx/OWhFu2xYLrLEsxeGe1eu1tu1+j1tkdbhDlhSXmlzvbtEOpfMv e1ZFremJCHkQM5VkMIcxcYSc3ZAc4goGHu1KnpG2Xj8/dQpTsF59onw5aXjlnFAln+lz idvZ6K0KZQ8JqNuhak7gyUe4fe9cvdoU8JRrNHNtz39Pb82kK8yVCAe3dFqCYIRcDY2e NY9dNywMIBbf7q14rGRI2Ry5oal4sAV0dXA2SeJGY4J1WCY6veivEDvJ2jUHpIaM5tPX B95w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NsgF550TXGbF8AzQg1Z5FylbZak6i87tdtnBiL+fRd8=; b=2caevcNEogI0T9C8eMSGdjOEPU7sYnj8ZLssrC+pZoIxyNEnCoJEAIOVOL3nfKxi7i 5n9eTs9G0ed2N7TrkvpZzks3N5S3XQP3u/fEo7ihaLQwAfOMCmgvv90qomdqoJ0Jml55 tYGsMTGTlq10ZCQVHT5tPDpT8SrMyx+PujCNf6J6IU8VQ3WsNVcKSj2TfO2YKyuQL7tT WOrez9M6lY23btKCZlLQwfvElCMs111Lbf8e24M4/Kim/2cQfh1nZ65zJFLSge6aMsHH Nrdv0XaPWgW/G8ZoLTbcr7tGlyGtBmAMhjXm9XoYOf0FBqMdJWaqXkkJSxuoaYD+AqaD GeRw== X-Gm-Message-State: AFqh2kpwH75+zOKXqLPCtaSPWtuiO9B++IyXsEUvrZMU419sLp7+A8+K 1u3aY+n8q5mi3+gQvrRZNEM= X-Google-Smtp-Source: AMrXdXsMtzTLfe4wLUnLMJ8medezklppAPGL4Z6REFTPFbchiouytKZQfRo2IdJ9yYEql+7KVYjMtQ== X-Received: by 2002:a17:902:ab84:b0:192:e555:28e4 with SMTP id f4-20020a170902ab8400b00192e55528e4mr21109947plr.4.1673378899245; Tue, 10 Jan 2023 11:28:19 -0800 (PST) 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 d4-20020a170902654400b0018bde2250fcsm7115511pln.203.2023.01.10.11.28.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Jan 2023 11:28:18 -0800 (PST) Content-Language: en-US In-Reply-To: <83o7r6oadh.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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:253106 Archived-At: On 1/10/2023 4:13 AM, Eli Zaretskii wrote: > I don't think I understand why keeping eshell-bol and telling people > to bind to that function if they want wouldn't be a much more > reasonable solution. I'm probably missing something. Do you mean that users who want to go to the very beginning of the line would bind it to 'eshell-bol'? If so, that wouldn't help. 'eshell-bol' moves the point to the beginning of the user's input, not the actual beginning of the line. If you mean the other way, and that users who want to go to the beginning of the input should just bind it to 'eshell-bol', that would help, but then we wouldn't get the benefits of using 'field' properties in Eshell. One of the nice things about using 'field' properties is that 'eshell-prompt-regexp' is no longer necessary[1]. That regexp is fairly brittle. Also, users who customize their prompt need to make sure they update it correctly. Here's an example of the brittleness. Starting from "emacs -Q -f eshell": ~ $ mkdir "folder #1" ~ $ cd "folder #1" ~/folder #1 $ | ^-- Point is here Now press C-a. Normally, that should take you to the beginning of the input, but it takes you to the beginning of the whole line because the prompt regexp isn't robust enough. Even worse, because Eshell can't tell where the user's input starts, completion doesn't work on that line. (We could probably fix this particular case by just tweaking 'eshell-prompt-regexp', but I don't think it could ever work in *all* cases, whereas it shouldn't be hard to get perfection with 'field' properties.) Avoiding the need for 'eshell-prompt-regexp' also makes it simpler to customize the Eshell prompt. Currently, it's just another thing to set, and it's easy to get it wrong (it took me several tries to get it right in my own configuration). The next patch I have planned for Eshell will make it easier to customize the prompt[2], so getting rid of 'eshell-prompt-regexp' would be nice for any users who want to finally try customizing the prompt. [1] Except for using it to set 'paragraph-start' in Eshell. [2] I plan to use 'format-mode-line' and provide some mode-line constructs ("prompt constructs"?) for Eshell. Then users will have a small toolbox of constructs they could use for their prompts.