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#71284: 30.0.50; [PATCH] Add support for outline-minor-mode to Eshell Date: Sun, 2 Jun 2024 21:34:14 -0700 Message-ID: <52b77c3b-f556-b436-c8c5-1f157681fa53@gmail.com> References: <048207b3-4d91-34cd-8e2d-ccf41b7bd832@gmail.com> <868qzq1n3r.fsf@mail.linkov.net> <86frtvrgtn.fsf@mail.linkov.net> 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="36765"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71284@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 03 06:36:26 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 1sDzQn-0009M4-GX for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 03 Jun 2024 06:36:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sDzQX-0000gz-4x; Mon, 03 Jun 2024 00:36:09 -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 1sDzQE-0000dm-CI for bug-gnu-emacs@gnu.org; Mon, 03 Jun 2024 00:35: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 1sDzQE-0007SW-2B for bug-gnu-emacs@gnu.org; Mon, 03 Jun 2024 00:35:50 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sDzQQ-0007c1-75 for bug-gnu-emacs@gnu.org; Mon, 03 Jun 2024 00: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: Mon, 03 Jun 2024 04:36:02 +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.171738933629192 (code B ref 71284); Mon, 03 Jun 2024 04:36:02 +0000 Original-Received: (at 71284) by debbugs.gnu.org; 3 Jun 2024 04:35:36 +0000 Original-Received: from localhost ([127.0.0.1]:41548 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sDzPz-0007al-Q1 for submit@debbugs.gnu.org; Mon, 03 Jun 2024 00:35:36 -0400 Original-Received: from mail-pj1-f44.google.com ([209.85.216.44]:61688) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sDzPx-0007aO-Ek for 71284@debbugs.gnu.org; Mon, 03 Jun 2024 00:35:34 -0400 Original-Received: by mail-pj1-f44.google.com with SMTP id 98e67ed59e1d1-2bfdae7997aso3081808a91.2 for <71284@debbugs.gnu.org>; Sun, 02 Jun 2024 21:35:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717389255; x=1717994055; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=5ZOSxeY8ucNvOrqA08ysgbsfc26S2FcH3wUrHRkrmS0=; b=ZAxboKV05WdxlzZZmvYmKx2C9A6uo9AxPmfoqR+N1PTUnXFAuhTGKYNIXIPxJoJZwH VcWqEoX378iIV/VT6FNU7qomHHZIcyyhsV8Hlf6WA3n6/wuapr6DdmyZFFXvJjq/Q+qE 1wHa6pgTv0T+cgIPwsgZFKwRD9Jc8E6OhVnBiKib7bW/SRcqpYrGdEu4Xjvf2ug4yx+8 GxvjmIHbzynZIlosUw8iMPSmfL8BAOfMRzXbUQsQMU2GeagM3ZNzgQ6xF3t2R1VygYfS cu4TPCEtn953dvFRdJl+HnclP4zczrsarH2QbbFna2KHXJ1U0kALuQR8SHsLKXaSiO2Y Sv5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717389255; x=1717994055; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5ZOSxeY8ucNvOrqA08ysgbsfc26S2FcH3wUrHRkrmS0=; b=wk7IjMijbHAI7pC5lVt1RyT72p44VfJVsoEmlFUrKSYTK5i5W59ZpN1ESOCTVmwYku fjRxWpiwzJrnEbKAdwz7++SUYURzOS+U0+H3fAFNhN4r331kHHeA/1gWJ4+APU5fT2mb xodIWPQI6EzQ+9j1F9UrM5yl7zcQprZF+S9Njen6o73AU6qJBe2GjS6uOBc94UHhpZbn aDix1YQ/BnUrV2zd+aseXZe1ny2YcRb2dBLhICYleNP624R4dkVFHZeRrTkvfIuiuVjU /KRJExqo39SRKmqxpAs872dRmjVV5nUOdyuETPLkwUgIg9JDiE6/sCA84XI+iPZfoq51 bC9g== X-Gm-Message-State: AOJu0YwqkhOkr/x8Q0KUqH8D7YI4ED8fnaLW0g6OZOAoIf/SieWKXp1Z 49B1MP7Q02EvcxsDIJEYedC+y1BlosTgOM/TDEXUE5R+R9l2E/vt X-Google-Smtp-Source: AGHT+IH9rQVO5BX1/4DDN5LAoVCLIn0GKz7hSeBXAMyoyiwSTGXNoSzWIVLrSUWJJYLvaM58JDA7sw== X-Received: by 2002:a17:90b:505:b0:2c1:e54a:19b9 with SMTP id 98e67ed59e1d1-2c1e54a1a65mr6445251a91.21.1717389254707; Sun, 02 Jun 2024 21:34:14 -0700 (PDT) Original-Received: from [192.168.1.2] (syn-023-240-098-037.res.spectrum.com. [23.240.98.37]) by smtp.googlemail.com with ESMTPSA id 98e67ed59e1d1-2c238690cbdsm918280a91.0.2024.06.02.21.34.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 02 Jun 2024 21:34:14 -0700 (PDT) Content-Language: en-US In-Reply-To: <86frtvrgtn.fsf@mail.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:286401 Archived-At: On 6/1/2024 11:37 PM, Juri Linkov wrote: > Sorry, I still don't understand why do you need two levels. > Is it because in Eshell prompts are often multi-line? I'm not sure if Eshell prompts are *often* multi-line, but personally I use multi-line prompts everywhere I can. Maybe I'm just over-optimizing for my own personal preferences here. > IIUC, with two levels, the case when the output is empty has such problems > that one line will contain two outline headers, that also means > two conflicting margin arrows on the same line? The way I implemented this, this problem wouldn't come up: if the output is completely empty, there's no second-level node in the outline for that command. >> For prompts, this isn't as important, since a single-line prompt should >> always have some visible text. For multi-line prompts, it would be possible >> to treat the heading as the first non-empty line, but that would be >> additional work on the Eshell side, and I think we'd still need the >> outline.el changes to handle collapsing the command output. (Improving >> heading-detection for multi-line prompts could always be done in a later >> bug, too.) > > So the outline.el changes are required only to handle empty output lines? > That essentially means adding support for two outline headers > on the same line? To be more precise, the outline.el changes would be required to handle the case where a command's output *begins* with one or more newlines. So the total output isn't empty, but the first *line* of it is. In any case, the more I think about this, the more my current patch seems like the wrong way to go about this. Even just describing the user-facing behavior in all scenarios is pretty complex, so I think it might be better to keep it simple and have a single outline level. That said, for the multi-line prompt case, I wonder if it would make sense for outline.el to support multi-line headers. If I could mark the entire prompt + command input as a "header", then collapsing it would look better: users would still see all of their input in the collapsed node. It would look something like so: v /home/user/dir $ cat some-file.txt output output output > /home/user/dir $ cat some-file.txt...