From: Jim Porter <jporterbugs@gmail.com>
To: Tony Zorman <soliditsallgood@mailbox.org>, 63748@debbugs.gnu.org
Subject: bug#63748: 30.0.50; eshell-previous-prompt doesn't work for multiline prompts
Date: Mon, 29 May 2023 22:02:26 -0700 [thread overview]
Message-ID: <14785aa0-e1a5-6f69-9d1f-fccdaac9a7fc@gmail.com> (raw)
In-Reply-To: <87ilcew4ng.fsf@hyperspace>
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.
next prev parent reply other threads:[~2023-05-30 5:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-27 8:38 bug#63748: 30.0.50; eshell-previous-prompt doesn't work for multiline prompts Tony Zorman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-30 5:02 ` Jim Porter [this message]
2023-06-03 13:27 ` bug#63748: [PATCH] " Tony Zorman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-03 19:35 ` Jim Porter
2023-06-08 15:11 ` Tony Zorman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-15 16:46 ` Jim Porter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=14785aa0-e1a5-6f69-9d1f-fccdaac9a7fc@gmail.com \
--to=jporterbugs@gmail.com \
--cc=63748@debbugs.gnu.org \
--cc=soliditsallgood@mailbox.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).