From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.bugs Subject: bug#63748: [PATCH] bug#63748: 30.0.50; eshell-previous-prompt doesn't work for multiline prompts Date: Sat, 3 Jun 2023 12:35:50 -0700 Message-ID: <88ae9a36-c9f9-fe0a-80a2-d90ff1b3837a@gmail.com> References: <87ilcew4ng.fsf@hyperspace> <14785aa0-e1a5-6f69-9d1f-fccdaac9a7fc@gmail.com> <87bkhwllq5.fsf@hyperspace> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31744"; mail-complaints-to="usenet@ciao.gmane.io" To: Tony Zorman , 63748@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 03 21:36:09 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q5X2l-00081B-OX for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 03 Jun 2023 21:36:07 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q5X2h-0004Lb-Mb; Sat, 03 Jun 2023 15:36:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q5X2g-0004LP-Dz for bug-gnu-emacs@gnu.org; Sat, 03 Jun 2023 15:36:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q5X2g-0007T3-5M for bug-gnu-emacs@gnu.org; Sat, 03 Jun 2023 15:36:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q5X2g-0003WV-0r for bug-gnu-emacs@gnu.org; Sat, 03 Jun 2023 15:36:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Jun 2023 19:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63748 X-GNU-PR-Package: emacs Original-Received: via spool by 63748-submit@debbugs.gnu.org id=B63748.168582096113536 (code B ref 63748); Sat, 03 Jun 2023 19:36:01 +0000 Original-Received: (at 63748) by debbugs.gnu.org; 3 Jun 2023 19:36:01 +0000 Original-Received: from localhost ([127.0.0.1]:44338 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5X2e-0003WG-QC for submit@debbugs.gnu.org; Sat, 03 Jun 2023 15:36:01 -0400 Original-Received: from mail-ot1-f50.google.com ([209.85.210.50]:57764) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5X2c-0003Vz-EE for 63748@debbugs.gnu.org; Sat, 03 Jun 2023 15:36:00 -0400 Original-Received: by mail-ot1-f50.google.com with SMTP id 46e09a7af769-6af6f83fc49so3152201a34.3 for <63748@debbugs.gnu.org>; Sat, 03 Jun 2023 12:35:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685820952; x=1688412952; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=BxLL4lMPM9xf6yYlhl5jS7BS9/oLkrXh6azNA4R60tQ=; b=b39GWXchDSjN0njKkI09a8FMpiWGAIUWv8RltSb2OhuMGruNyiMB9lpKEQKFJA5MU5 D3SZ/pAkZVxgMcAbry8oNEPnl+XAvhxFLOgyVE1Zfl16L4kyXa71VJl64SsIsQTL/ULT AWiCiV7nA9QNXrCUavd5o1Lc9TXztrioX3OOhkk/7/hKMp7KBUMWTJVYjXQNWUXk6+GP dGOU9G2k7/C3yHpiOYybTCUihUvKIhDSlGJEQK7fRfkTE/ELeqfh5pIxNkf2n/WMq+Oa 3eN30WOg9F51eQP+FrYDjHJCyN43HtUUa5mzJhi1/kH78eG9IEqtsyXD3GkVQZ4TGtHZ duzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685820952; x=1688412952; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BxLL4lMPM9xf6yYlhl5jS7BS9/oLkrXh6azNA4R60tQ=; b=dxNPNi0NREtXGld85SqwAy0WX8KMKUl9IlNZHvghftXasFP4oCU7hJ9DE0qFKtSVX3 y5xThqK0l2hJ3isaxEWR8ShSZZ9BwMQ2tEvw6Xyc9kqIPxi4qYqhfTDqE861xsumelH7 RNe/lngbqZT1TqlfThhdnM1toXsG0dRCkU1FLH1Fr9TcMbar9q+VonHjUO/sJnRfAH7n X5J+cKuC7bdDZmceYZEN0B7ILsMTc6m9G2p27SeT14e5tv3RWyFGKE8JigUnJWo34fee XUB87bsBUXHMiNOAoq3/q5iKFMW7PJqSSZpkOTzCe0JCOfBBKnk7/zpRY9helOuq+XiA IwwA== X-Gm-Message-State: AC+VfDyBmmgK+L4tdOnhHU4kz3W7odQzzAecRDrakeBIGc3ZC5DoPiwi 1cRof+tyJLrIVbfZBKQdZlA= X-Google-Smtp-Source: ACHHUZ4jhJExDo9nVKJZnyJ0kNNlupP+XDrOX/jLh+E8Qc4QgJN5KhPlecXAHbchseEn4JE+G6yZlg== X-Received: by 2002:a05:6358:2812:b0:123:5664:e493 with SMTP id k18-20020a056358281200b001235664e493mr17576871rwb.27.1685820952335; Sat, 03 Jun 2023 12:35:52 -0700 (PDT) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id g2-20020a17090a128200b0024e4f169931sm5084132pja.2.2023.06.03.12.35.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 03 Jun 2023 12:35:51 -0700 (PDT) Content-Language: en-US In-Reply-To: <87bkhwllq5.fsf@hyperspace> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:262882 Archived-At: 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.