GNU bug report logs - #71284
30.0.50; [PATCH] Add support for outline-minor-mode to Eshell

Previous Next

Package: emacs;

Reported by: Jim Porter <jporterbugs <at> gmail.com>

Date: Fri, 31 May 2024 05:22:02 UTC

Severity: wishlist

Tags: patch

Found in version 30.0.50

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Cc: juri <at> linkov.net
Subject: 30.0.50; [PATCH] Add support for outline-minor-mode to Eshell
Date: Thu, 30 May 2024 22:18:44 -0700
[Message part 1 (text/plain, inline)]
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).

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]

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.

[1] In the prompt case, a different way to solve this would be to treat 
the start of the heading as the first non-empty line. That doesn't work 
for output though since *all* lines could be empty.
[0001-Add-support-for-outline-minor-mode-in-Eshell.patch (text/plain, attachment)]

This bug report was last modified 123 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.