help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

headings in sh-mode


From: lisa-asket
Subject: headings in sh-mode
Date: Fri, 2 Jul 2021 22:32:39 +0200 (CEST)

>From: Yuri Khan <yuri.v.khan@gmail.com>
>To: Emanuel Berg <moasenwood@zoho.eu>;
>   help-gnu-emacs <help-gnu-emacs@gnu.org>
>Subject: Re: headings in sh-mode
>Date: 02/07/2021 22:02:57 Europe/Paris

>On Sat, 3 Jul 2021 at 01:34, Emanuel Berg via Users list for the GNU
>Emacs text editor <help-gnu-emacs@gnu.org> wrote:

>> But honestly... you don't need a header hierarchy like this
>> for a shell script, they should be simple and short (well, as
>> short as possible, and long scripts aren't advanced, really,
>> they are just long).

>This. If your shell script is so long and/or nested that you want
>folding, then you’re much better served by rewriting in a proper
>programming language. My personal rule of thumb is, rewrite if you
>want to do any arithmetics, or arrays, or the script no longer fits in
>a single screenful.



I am not arguing on the merits or otherwise of header folding.



Only pointing out that headings using outline-minor-mode should be

made to work correctly as expected by the minor mode, irrespective

of whether a user ultimately uses the functionality or not.



Such rational does make sense actually.  



>A similar point goes for other programming languages: If you want to
>fold parts of a function, the part you want to fold is a candidate for
>extraction. If you want to hide some functions while looking at
>others, maybe split your module.

>A working folding facility can be a painkiller when working with
>existing code. But don’t become addicted to painkillers.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]