From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: headings in sh-mode Date: Sat, 3 Jul 2021 03:02:57 +0700 Message-ID: References: <875yxsefab.fsf@zoho.eu> 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="15954"; mail-complaints-to="usenet@ciao.gmane.io" To: 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:03:55 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 1lzPOE-0003t2-DY for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 02 Jul 2021 22:03:54 +0200 Original-Received: from localhost ([::1]:42666 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lzPOD-0008LS-Eo for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 02 Jul 2021 16:03:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59140) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lzPNY-0008Kz-IV for help-gnu-emacs@gnu.org; Fri, 02 Jul 2021 16:03:12 -0400 Original-Received: from mail-ua1-x92e.google.com ([2607:f8b0:4864:20::92e]:46641) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lzPNX-0007B1-64 for help-gnu-emacs@gnu.org; Fri, 02 Jul 2021 16:03:12 -0400 Original-Received: by mail-ua1-x92e.google.com with SMTP id x37so4245550uac.13 for ; Fri, 02 Jul 2021 13:03:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=lyTbcI54xDdEIAWcGZQL8X/JnNPR2gkHrfzOvi84OuM=; b=b9fvqVIYSU8I6Q3aYOp2xBc//ZHEajlnu4uUdS4fm7QqxxdEYjU2rgPOUgNEHnjy/r ZCiewhZkH9dH2ImTGPNTA3ebavSzPHZzooYjhwnSRCk/ADWOnMIQ45gSpyd548r0U/tF tQSzONPL+8tJG8tZKx+/1D/K1fyRZZ1oHJ5liq6UQJdCVXRuYe5m62mbg3MC8QTuW8sl iu+/7QmtSRTi/ZbEMUS8z/BETOPpsNkcZaxpwv37aYV7T8wkw25xgHem2LiO5+lgZ5Ue lh0RpHiZBK2S9KJM+XEGcu0slhzAF0Y6hnpYHFCufW5GJ9QA5Xz4AdbbR2Wmz6uF5qf2 sY/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-transfer-encoding; bh=lyTbcI54xDdEIAWcGZQL8X/JnNPR2gkHrfzOvi84OuM=; b=oqq4vpOlqj0MVXVnnfcM+TDDYUYu78RWbxdd6PgaH7L+iIYGg8rArpmYGnTpebtdgT utAFr8cYZeltWQhodzq6fvs6PXndFnpfQ0rUdtaa6vQJdPecChF7/sG5kwBdhYSN0P0R fuhbj+vU/IVuoGYDWfqISJzjF0cnqPDg30cu3FISlcapV0bWR/Np3tIPI3SadMnv4Qj4 Zuo1HWJr6F+8U9jMlIWL+xljFC9M6BRuPSaVAn93MGrp/tQQT3Aigt5SD6jfgqUoERck G1xamAU9L+4sjAAFyKHkT9nXNXzfLTTgA8gdFvFYitQY8iRzhi97aMuTeMZHLJEF9qnW CDDA== X-Gm-Message-State: AOAM531kczE8mo6OGULOlE/Gfvg47aUEru4//MWGhpC4dV+X0S8P9s/C Gxpx9IzH3Q1LxPNyTeVk7o6YnLARwkmBJLFycz0= X-Google-Smtp-Source: ABdhPJzN3YBf19ixPuss94JmtYlxAMX4VfV+HjIf6PDnwrQC4AG6S5AiPqjlnMxXfa0rkIApbC5z6gflp+NzDWV61GU= X-Received: by 2002:ab0:211a:: with SMTP id d26mr2199549ual.41.1625256188762; Fri, 02 Jul 2021 13:03:08 -0700 (PDT) In-Reply-To: <875yxsefab.fsf@zoho.eu> Received-SPF: pass client-ip=2607:f8b0:4864:20::92e; envelope-from=yurivkhan@gmail.com; helo=mail-ua1-x92e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:131418 Archived-At: 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. 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.