all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jim Porter <jporterbugs@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 60666@debbugs.gnu.org
Subject: bug#60666: 30.0.50; [PATCH] Use field properties in Eshell buffers
Date: Tue, 10 Jan 2023 11:28:17 -0800	[thread overview]
Message-ID: <6a94f805-cb0f-2328-71f8-c64891b18e06@gmail.com> (raw)
In-Reply-To: <83o7r6oadh.fsf@gnu.org>

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 <HOME> 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 <home> 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 <home> 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.





  reply	other threads:[~2023-01-10 19:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-08 23:34 bug#60666: 30.0.50; [PATCH] Use field properties in Eshell buffers Jim Porter
2023-01-09 12:09 ` Eli Zaretskii
2023-01-09 17:52   ` Jim Porter
2023-01-10 12:13     ` Eli Zaretskii
2023-01-10 19:28       ` Jim Porter [this message]
2023-01-10 20:11         ` Eli Zaretskii
2023-01-10 20:51           ` Jim Porter
2023-01-11 12:15             ` Eli Zaretskii
2023-01-12 18:10               ` Jim Porter
2023-01-13 13:07                 ` Eli Zaretskii
2023-01-14 19:30                   ` Jim Porter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6a94f805-cb0f-2328-71f8-c64891b18e06@gmail.com \
    --to=jporterbugs@gmail.com \
    --cc=60666@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.