bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#60666: 30.0.50; [PATCH] Use field properties in Eshell buffers


From: Jim Porter
Subject: bug#60666: 30.0.50; [PATCH] Use field properties in Eshell buffers
Date: Sun, 8 Jan 2023 15:34:03 -0800

This was prompted by a small annoyance I noticed in Eshell. When entering a command in an Eshell buffer, "C-a" takes you to the beginning of your input, but the Home key takes you all the way to the beginning of the line (so that the point is located within the the actual prompt text).

After digging through the Eshell code, I realized that this was because Eshell binds C-a to 'eshell-bol', but doesn't do the same for Home. The easiest way to fix this would be to add a binging for Home. However, when comparing this code to that of 'M-x shell', I noticed that the latter uses field properties to delimit parts of the shell buffer so that things Just Work. I think that's a more-robust way of doing things, and it would be nice to make Eshell do the same.

Attached are some patches to do this. Aside from the user-facing change that the Home key works like C-a now, this also means that users don't have to set 'eshell-prompt-regexp' anymore (unless they want to use paragraph navigation, that is). In fact, maybe it would be better to map M-{ and M-} to 'eshell-prompt-(previous|next)'. That would have the same effect as '(backward|forward)-paragraph' (I think), but it would be more robust.

Any thoughts here?

Attachment: 0001-Set-the-field-property-for-Eshell-output.patch
Description: Text document

Attachment: 0002-Make-eshell-bol-obsolete.patch
Description: Text document

Attachment: 0003-Use-the-field-property-to-navigate-through-Eshell-pr.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]