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
View this message in rfc822 format
On 6/3/2023 6:27 AM, Tony Zorman via Bug reports for GNU Emacs, the
Swiss army knife of text editors wrote:
> Okay, I now added some hopefully sufficient tests for this based on both
> next-previous-prompt and forward-backward-matching-input (if that's not
> too overkill). Let me know what you think.
Thanks. You can probably simplify the multiline wrapper in your test to
something like this:
(defmacro em-prompt-test--with-multiline (&rest body)
"Execute BODY with a multiline Eshell prompt."
`(let ((eshell-prompt-function (lambda () "multiline prompt\n$ ")))
,@body))
Then use it like so:
;; Note: no arguments necessary.
(defun em-prompt-test/forward-backward-matching-input-with ()
;; ...
)
(ert-deftest em-prompt-test/forward-backward-matching-input-multiline ()
(em-prompt-test--with-multiline
(em-prompt-test/forward-backward-matching-input-with)))
That should be safer than setq'ing the prompt function. (You also don't
need to set the prompt regexp, since that's only useful if you want to
navigate via '(forward|backward)-paragraph', and we don't test that here.)
If you prefer, I can make that change myself and then merge your patch.
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.