From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christopher Dimech Newsgroups: gmane.emacs.bugs Subject: bug#48724: Code collapsing and outline headings for elisp Date: Sun, 30 May 2021 03:38:39 +0200 Message-ID: References: <877djh42jg.fsf@mail.linkov.net> 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="30539"; mail-complaints-to="usenet@ciao.gmane.io" To: Juri Linkov , 48724@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 30 03:39:12 2021 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 1lnAQ3-0007iz-5y for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 30 May 2021 03:39:11 +0200 Original-Received: from localhost ([::1]:55072 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lnAQ2-0003nr-9V for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 29 May 2021 21:39:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55978) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lnAPu-0003nj-MO for bug-gnu-emacs@gnu.org; Sat, 29 May 2021 21:39:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46448) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lnAPu-0007Qs-Ev for bug-gnu-emacs@gnu.org; Sat, 29 May 2021 21:39:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lnAPu-0003sG-Bv for bug-gnu-emacs@gnu.org; Sat, 29 May 2021 21:39:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Christopher Dimech Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 30 May 2021 01:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48724 X-GNU-PR-Package: emacs Original-Received: via spool by 48724-submit@debbugs.gnu.org id=B48724.162233873214875 (code B ref 48724); Sun, 30 May 2021 01:39:02 +0000 Original-Received: (at 48724) by debbugs.gnu.org; 30 May 2021 01:38:52 +0000 Original-Received: from localhost ([127.0.0.1]:57994 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lnAPj-0003rr-Et for submit@debbugs.gnu.org; Sat, 29 May 2021 21:38:52 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:36257) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lnAPe-0003rX-K0 for 48724@debbugs.gnu.org; Sat, 29 May 2021 21:38:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1622338719; bh=VYRF0U/ceR5oM/gXYyjZvRUsJk5HPC+qgrQvEp7/p+w=; h=X-UI-Sender-Class:From:To:Subject:Date:In-Reply-To:References; b=NVdNh8LVpkGkt7oiO/ChQdP0YrfixpP0QqU4Ar4T7zFs9JEEBYEsm+hASXoeaI4f2 iRt/w/01cIKtRicfyJ+qq8g4JCcJqJyXgVW1eaOpVPYAjNLeWbAy7yp6gxXNjckbCF Z4LYVAGKDW7lTrbgo4+Gn2MFMKprdcJfWE0wafl8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [213.165.168.94] ([213.165.168.94]) by web-mail.gmx.net (3c-app-mailcom-bs16.server.lan [172.19.170.184]) (via HTTP); Sun, 30 May 2021 03:38:39 +0200 Importance: normal Sensitivity: Normal In-Reply-To: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:eTBj8M5uvHLtMot5Vfalva31sVoUTAJkPjEZsiNlD7GpNLVvY8C6i+nBuuZQeX4uIxjfZ VjFySS+h3YJSqewdKKS/H0IxOj30jD/rSSg15w307HZqsXYOJGW5jkIo7fPZ+kNgrJ9X8ZA6vZsY 9BQEqWOpsSrwT8QPx0+hPJ6Z7/rEZaN5YflMgCOUykUpaGqahMS9kZCFl4OCsVMBrcRxLIF3RxjV LogzmEqi+I6khTdOgapvNk8cGNq/uJbT/G651t3MusNI8tC6HD/OD66DIpbs4fA8NlIm6gAowjBV 00= X-UI-Out-Filterresults: notjunk:1;V03:K0:wiEfQM1PONk=:DiwDtl7PJ1llP1rDbcT07h 0ThSY2qTcKM03L5T2dDSMsnp85Jdom1eMIKtUbpePcjZQkkHk96WrHNULzIhRd/7y+3tTn2qh T9QfkY/mfIl0VvMcM20LM8fvP/hiPSnkxmAtC8ZiLm9nqUhharVaCcil/NGzFwqzo/1/YWoAi 7yqbkwZQrMcMp3+h2lAd6KyDqiSIuGlS9Ggcnrfe7QHHKHOq0PKyhJ/nEXEt3JgGrBKQfKZ6U 8xaYTQVoEWwfbMKA7bk5In+A/lB0tHI5wr3RZXlX0yMi9Z8tNKRH53c76Jh55qFWDprZTS5LI +kfY8jN9TIgIad8xjjLNnDmcppjRd3IVwVpk+cBw/nYI1/rIZzICvFhRMDi4HPQkMd0vWDBQK aHEbBBimFRtI0Htay1kjet1LY2YUhMeFTpcK2Bhp6ZK3a6IQ/lv7mNw3UxRicIaC5GVsUl6tJ xxsqqvFKI+FerZTaqqp7AT6fqix1JqRETkNCkfK0NNZUSBFHYzHcjfw4REFA2AQhDyHvMEyMy LkZCLNbtBkDtEuviC/onvcRtIhbh9zeCf65NtsH6gDdQbhWIS2xsF5DaFULSL3MOO9QP5pKz4 HvdtU/8Q/uGd8t6eIycbQqIm2M5mV66EZlAZZoAYXkctxvG5B8UGRx+a41Imdi9/dAZfm4VEx mpNwQD3ShOrGNZcq10z+3WwA0zVPph1U2DeErYpG7REJK4rwOrSIQVJSaDGNgWeVn/6zQ7ooe cT4+/7HmsiYruQ+WnPk//OGAw9PWSf7IL68w+jujOgqXptbaxG3tcPpnLAzM8dhSb5pnOdkY 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" Xref: news.gmane.io gmane.emacs.bugs:207562 Archived-At: > Sent: Sunday, May 30, 2021 at 11:55 AM > From: "Christopher Dimech" > To: "Juri Linkov" > Cc: 48724@debbugs=2Egnu=2Eorg > Subject: bug#48724: Code collapsing and outline headings for elisp > > > Sent: Sunday, May 30, 2021 at 9:57 AM > > From: "Juri Linkov" > > To: "Christopher Dimech" > > Cc: 48724@debbugs=2Egnu=2Eorg > > Subject: Re: bug#48724: Code collapsing and outline headings for elisp > > > > > Currently, outline-minor-mode has the capability to treat "defun" co= nstructs > > > as heading, allowing one to choose to hide some code from view by co= llapsing > > > the region of code=2E It would be beneficial for the actual major m= ode itself > > > (i=2Ee=2E emacs-lisp-mode) to handle the code collapsing, leaving th= e code highlighting > > > intact=2E Code collapsing could also be extended beyond not only co= llapsing > > > functions and variables ((defun, defvar), but also to additional con= structs that could > > > be indented (e=2Eg=2E lists '(=2E=2E=2E), let, let*, pcase) and othe= r constructs users could > > > find useful (e=2Eg=2E if, when, )=2E > > > > > > And for outline-minor-mode, the mode could then be used to further e= nhance the structuring > > > of larger chunks of code (e=2Eg=2E a collection of functions) using = outline headings=2E Outlining > > > would then be a separate capability different from code collapsing= =2E > >=20 > > Currently everything is customizable in outline-minor-mode by just > > two variables: outline-regexp and outline-level=2E So when necessary, > > emacs-lisp-mode could provide an option that will set different values > > of these variables, one of which could set outline-regexp to a regexp > > that matches: lists, '(=2E=2E=2E), let, let*, pcase, if, when, etc=E2= =80=A6 >=20 > The general impression is that outline-minor-mode is a general mode > for customisable headings that are then handled by the respective > major mode=2E >=20 > General settings could be better, because some variables are not customi= zable=2E >=20 > Serious problem is that the two important variables: `outline-regexp' an= d > `outline-heading-alist' are not customizable by using "M-x customize-gro= up"=2E >=20 > Additionally both of them should be customizable per mode=2E Don't you = think so? >=20 > There has been a discussion today about outline-minor-mode settings for = fortran > (both fixed and free form)=2E Have had a go at using "!" and "!!", but = "Hide Body" > did not hide the body=2E >=20 > There could be some default headings for fortran when outline-minor-mode= is enabled=2E > One could follow the current setup for emacs-lisp-mode, for fortran=2E >=20 > !! for heading level 1 > !!! for subheading level 2 > !!!! for subsubheading level 3 >=20 > Together with "Hide Body" for lines beginning with "subroutine" and "fun= ction"=2E =20 Looking at emacs-lisp again, the levels should be as follows !!! for heading level 1 (starting as !!! as in emacs-lisp-mode) !!!! for subheading level 2 !!!!! for subsubheading level 3 etc I wonder if there exists the capabibily in outline-minor-mode to hide code structures inside another code structure=2E For instance for "do", "if" and "else" statements=2E do in1 =3D 1, nr(1) do in2 =3D 1, nr(1) ind =3D in1 - in2 if (ind < 0) then res(in1, in2) =3D conjg(fc(abs(ind)+1)) else res(in1, in2) =3D fc(ind+1) endif enddo enddo hiding would then give the following do in1 =3D 1, nr(1) do in2 =3D 1, nr(1) ind =3D in1 - in2 if (ind < 0) then =2E=2E=2E else =2E=2E=2E end if end do end do do in1 =3D 1, nr(1) do in2 =3D 1, nr(1) =2E=2E=2E end do end do do in1 =3D 1, nr(1) =2E=2E=2E end do