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: 30.0.50; eshell-previous-prompt doesn't work for multiline prompts Date: Mon, 29 May 2023 22:02:26 -0700 Message-ID: <14785aa0-e1a5-6f69-9d1f-fccdaac9a7fc@gmail.com> References: <87ilcew4ng.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="31238"; 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 Tue May 30 07:03:50 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 1q3rWQ-0007wx-5Z for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 30 May 2023 07:03:50 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q3rWA-0000N9-Am; Tue, 30 May 2023 01:03:35 -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 1q3rVf-00006I-7b for bug-gnu-emacs@gnu.org; Tue, 30 May 2023 01:03:06 -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 1q3rVe-00051N-45 for bug-gnu-emacs@gnu.org; Tue, 30 May 2023 01:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q3rVd-0007NU-Vt for bug-gnu-emacs@gnu.org; Tue, 30 May 2023 01:03: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: Tue, 30 May 2023 05:03: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.168542295528313 (code B ref 63748); Tue, 30 May 2023 05:03:01 +0000 Original-Received: (at 63748) by debbugs.gnu.org; 30 May 2023 05:02:35 +0000 Original-Received: from localhost ([127.0.0.1]:59768 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3rVC-0007Mb-NT for submit@debbugs.gnu.org; Tue, 30 May 2023 01:02:35 -0400 Original-Received: from mail-pf1-f179.google.com ([209.85.210.179]:61602) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3rVA-0007MO-N0 for 63748@debbugs.gnu.org; Tue, 30 May 2023 01:02:33 -0400 Original-Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-64d30ab1ef2so2968963b3a.2 for <63748@debbugs.gnu.org>; Mon, 29 May 2023 22:02:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685422946; x=1688014946; 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=MQjzcxaShuTUO8cHi0X3ZTeP8wPKtzpsmh3xKmM4TOA=; b=qKvXslw9Ix+iDsmMKHx2IorEpc50PE6e//VV56CU1IrszCrmChJFe29LRsYS0FDhGv eVbXAVG/Lu0xgb0WRhdJ9pC4pLJkySwssQHXfaTXPhZAKQ2aH7h/H45L7PSHbjdBzI1y dAkKdQyQ+lphCFR95f5okJd+KZsggf5Wrrx3lqi2j3JdLUyRCnEllU8JdGvzdeY3Da2w 8jKSrPinurcQW5MXhU2PAbnXfU3sH8Apo/OSeBez96QaoaSK1Og9jPoOe+ks0TqBI1tW GUoH64LZfiN8h23cT4VjIYrayZwjKmqCwJtG7g19N7s0awW0eVAWnhdNq4UyCznmiH1k ZMAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685422946; x=1688014946; 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=MQjzcxaShuTUO8cHi0X3ZTeP8wPKtzpsmh3xKmM4TOA=; b=kbIW7TreZP2lwviLj+5tIAdwFtzEreuCu/KQaX0vEhLEhhu+vorL0BjcDpzYlRQuo2 g2rsXyg6T22MQbnbL+/ot6cosQVfWhfxQKqEHvkMy8FEst8mCCxHQL7IMuSK3HlUdtD9 4YMYN2qDMXbVrTcdg0g+zsx7Yi9qzWcw9ZwivcjhsLOtm8KuN8i324LRvDKp0p0sh4kG ONyhnAlNlAVH6nL1d7TmWVdOLvgCwFThCFhzGzX7Mh0Fe65zdDAZp+maknCvRKo+h2Z6 GPpWgPNKNUQ6koA7g5TZe1X3oe1FxPAAG6Kk6fXTTX+jvM91W6Nrcc8Dw3g/acnJO2tg 0fGA== X-Gm-Message-State: AC+VfDwfgH0DqgFYIe2n2/pTBSF6RLyYd+RUqZzTg3+PcQSU4I10ALpW cyMhX9tTDF0as4xS5jnXpHc= X-Google-Smtp-Source: ACHHUZ69ZsC49j5s3UhMZLIIBKFZpNUr7oxFiJuidx5uQDW9F/jTmS7hQX4ILWpkgF32gr+PNRT7lw== X-Received: by 2002:a05:6a00:13a3:b0:64d:30d2:f69e with SMTP id t35-20020a056a0013a300b0064d30d2f69emr1140279pfg.3.1685422946594; Mon, 29 May 2023 22:02:26 -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 r2-20020a654982000000b0050bc4ca9024sm6942324pgs.65.2023.05.29.22.02.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 29 May 2023 22:02:26 -0700 (PDT) Content-Language: en-US In-Reply-To: <87ilcew4ng.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:262619 Archived-At: 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.