GNU bug report logs -
#63748
30.0.50; eshell-previous-prompt doesn't work for multiline prompts
Previous Next
Reported by: Tony Zorman <soliditsallgood <at> mailbox.org>
Date: Sat, 27 May 2023 08:39:02 UTC
Severity: normal
Found in version 30.0.50
Done: Jim Porter <jporterbugs <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 63748 <at> debbugs.gnu.org (full text, mbox):
On 5/27/2023 1:38 AM, Tony Zorman via Bug reports for GNU Emacs, the
> diff --git a/lisp/eshell/em-prompt.el b/lisp/eshell/em-prompt.el
> index 9f9e58e83d..b6c873b41d 100644
> --- a/lisp/eshell/em-prompt.el
> +++ b/lisp/eshell/em-prompt.el
> @@ -180,7 +180,8 @@ eshell-next-prompt
> (text-property-search-forward 'field 'prompt t))
> (setq n (1- n)))
> (let (match this-match)
> - (forward-line 0) ; Don't count prompt on current line.
> + ;; Don't count prompt on current line.
> + (text-property-search-backward 'field 'prompt t)
> (while (and (< n 0)
> (setq this-match (text-property-search-backward
> 'field 'prompt t)))
>
> This is a tiny change, so I suppose it can be applied immediately (if I
> haven't overlooked anything, of course), or I can prepare a proper patch
> (that perhaps adds a test for multiline prompts to the right place).
Thanks for catching this. I think the change you propose makes sense
(though I haven't actually tried it out).
A test would be great. See "test/lisp/eshell/em-prompt-tests.el":
another test based on 'em-prompt-test/next-previous-prompt' (and
possibly 'em-prompt-test/forward-backward-matching-input' too) should be
sufficient, I think.
If you want to add a test yourself, go for it, and let me know if you
run into any issues. Otherwise if you prefer, I can write a test case
for this.
This bug report was last modified 1 year and 342 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.