dieggsy / esh-autosuggest

Fish-like autosuggestions in eshell.
GNU General Public License v3.0
102 stars 10 forks source link

esh-autosuggest--prefix: Fix input-start #15

Open slotThe opened 1 year ago

slotThe commented 1 year ago

This affects Emacs 30 right now (I think, anyways), but the fix should be plenty backwards compatible

Commit Summary

esh-autosuggest--prefix: Fix input-start

In Emacs 30+, eshell-bol is merely an alias for beginning-of-line, not returning the point any longer. This result in input-start always returning nil instead of the correct position of the point. Further, the implementation misbehaves when there is no previous prompt at all, hanging Emacs. There are built in ways to query the previous and next prompt in order to get a sensible starting position, so use these instead.

Pacify the byte compiler

slotThe commented 4 months ago

@dieggsy friendly ping :)

dieggsy commented 6 days ago

Sorry to be so unresponsive to this so far. Have you tested this with emacs 29.4? It does not seem to be working for me there.

slotThe commented 6 days ago

I have not! Judging from the eshell-next-prompt code here it seems like the above suggestions really only applies to Emacs 30 and up. Could you perhaps replace (eshell-next-prompt 0) with (eshell-previous-prompt 1) (eshell-next-prompt 1) and see whether that gives you the desired result?