From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#71284: 30.0.50; [PATCH] Add support for outline-minor-mode to Eshell Date: Fri, 31 May 2024 09:51:28 +0300 Organization: LINKOV.NET Message-ID: <868qzq1n3r.fsf@mail.linkov.net> References: <048207b3-4d91-34cd-8e2d-ccf41b7bd832@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11257"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: 71284@debbugs.gnu.org To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 31 09:09:16 2024 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 1sCwO4-0002f1-4G for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 31 May 2024 09:09:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCwNh-0007eC-6d; Fri, 31 May 2024 03:08:53 -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 1sCwNf-0007dk-BP for bug-gnu-emacs@gnu.org; Fri, 31 May 2024 03:08:51 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sCwNf-0007t3-0a for bug-gnu-emacs@gnu.org; Fri, 31 May 2024 03:08:51 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sCwNp-0008WP-N7 for bug-gnu-emacs@gnu.org; Fri, 31 May 2024 03:09:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 31 May 2024 07:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71284 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 71284-submit@debbugs.gnu.org id=B71284.171713931832725 (code B ref 71284); Fri, 31 May 2024 07:09:01 +0000 Original-Received: (at 71284) by debbugs.gnu.org; 31 May 2024 07:08:38 +0000 Original-Received: from localhost ([127.0.0.1]:53053 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCwNS-0008Vl-3t for submit@debbugs.gnu.org; Fri, 31 May 2024 03:08:38 -0400 Original-Received: from relay9-d.mail.gandi.net ([217.70.183.199]:52649) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCwNM-0008VT-PJ for 71284@debbugs.gnu.org; Fri, 31 May 2024 03:08:37 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id B0612FF806; Fri, 31 May 2024 07:08:14 +0000 (UTC) In-Reply-To: <048207b3-4d91-34cd-8e2d-ccf41b7bd832@gmail.com> (Jim Porter's message of "Thu, 30 May 2024 22:18:44 -0700") X-GND-Sasl: juri@linkov.net 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:286262 Archived-At: > This patch adds support for outline-minor-mode to Eshell. When enabled, > this will just add outline buttons to the prompt (as the top level), and > one to the start of the output (as level 2). I'm not familiar with Eshell, so I tried in shell-mode to set (setq-local outline-regexp "^.*\\$ ") and it works nicely (for the real use it should be based on 'shell-prompt-pattern'). But I believe you had a good reason to prefer outline-search-function and more changes in outline.el to support outlines in Eshell. > The Eshell side is hopefully fairly straightforward, but the outline.el > part probably warrants a close review. The changes in outline.el are all > there to support outline headings that are just a newline and nothing > else. This is important for both the output (you might call a command that > prints a newline as the first character), and the prompt (the first > character of your prompt could be a newline as a way of separating the > prompt from the output just above it).[1] I don't understand why do you need an outline heading for the empty line. Is it really useful for hide/show an empty line? > Mainly, the changes in outline.el are about checking to see if the > character *before* point is invisible (i.e. part of a collapsed node). This > way, if point is at the beginning of the output, and you collapse that > node, outline.el still considers you to be on a heading. (Without these > changes, cycling a node doesn't work correctly.) > > I'm open to adding regression tests here since the logic is pretty subtle, > but I didn't see any existing ones for outline.el and it's not immediately > obvious the best way to test its behavior. Let me know if anyone has ideas > though. Adding regression tests would be nice since the changes in outline.el don't look trivial. I guess tests for outline.el should do two basic things: call various outline commands (perhaps just outline-cycle and outline-cycle-buffer should be sufficient) with various settings of outline variables, then 'invisible-p' could check if outline visibility is satisfied. Or we could prefer a lazy approach to install changes, then to add tests only in case when a regression will be discovered later.