From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: lisa-asket@perso.be Newsgroups: gmane.emacs.help Subject: headings in sh-mode Date: Fri, 2 Jul 2021 22:32:39 +0200 (CEST) Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32712"; mail-complaints-to="usenet@ciao.gmane.io" To: "Yuri Khan" , "Emanuel Berg" , "help-gnu-emacs" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 02 22:33:19 2021 Return-path: Envelope-to: geh-help-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 1lzPqh-0008IC-3q for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 02 Jul 2021 22:33:19 +0200 Original-Received: from localhost ([::1]:48884 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lzPqf-0005i1-2i for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 02 Jul 2021 16:33:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34716) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lzPq9-0005hh-GN for help-gnu-emacs@gnu.org; Fri, 02 Jul 2021 16:32:45 -0400 Original-Received: from ip-16.mailobj.net ([213.182.54.16]:50308 helo=msg-6.mailo.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lzPq7-0000Mb-3I for help-gnu-emacs@gnu.org; Fri, 02 Jul 2021 16:32:45 -0400 Original-Received: by www-8.mailo.com with http webmail; Fri, 2 Jul 2021 22:32:39 +0200 (CEST) X-EA-Auth: a40s4urXdgNzClG/skcAXCF4Fc+iby+GkyW4FcbwNC855+LrlhFJknrAgWHc/5UAE+OoCDzA1H8mh7X6jrUt3VCPnVVDFuA2 X-Priority: 3 X-Mailer: COMS/EA21.01/r20210601 In-Reply-To: Received-SPF: pass client-ip=213.182.54.16; envelope-from=lisa-asket@perso.be; helo=msg-6.mailo.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:131419 Archived-At: >From: Yuri Khan >To: Emanuel Berg ; >=C2=A0=C2=A0 help-gnu-emacs >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 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=E2=80=99re 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.=C2=A0=20 >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=E2=80=99t become addicted to painkillers.