[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#27405: 25.2; Make eshell-next-prompt more reliable
From: |
Pierre Neidhardt |
Subject: |
bug#27405: 25.2; Make eshell-next-prompt more reliable |
Date: |
Sun, 18 Jun 2017 14:29:32 +0100 |
User-agent: |
Mutt/1.8.3 (2017-05-23) |
> > (defun eshell-previous-prompt (n)
> > "Move to end of Nth previous prompt in the buffer.
> > See `eshell-prompt-regexp'."
> > (interactive "p")
> > (backward-char)
> > (eshell-next-prompt (- n))))
>
> What's the backward-char for?
That would have definitely deserved a comment...
Without it, if point is right after the prompt, it won't move. That would be
disturbing for the user.
Detailed rules:
- If point is on the command line _after_ eshell-bol, then go back to
eshell-bol.
- If point is between eshell-bol (included) and _after_ eshell-bol of the last
prompt (excluded), go to the last prompt.
--
Pierre Neidhardt