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.help Subject: Re: outline-minor-mode and org-mode capabilities for programming languages Date: Mon, 10 May 2021 10:32:16 +0200 Message-ID: References: <87zgx3zu6e.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="24745"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Jean Louis Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 10 10:33:36 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 1lg1M7-0006Kt-VS for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 10 May 2021 10:33:36 +0200 Original-Received: from localhost ([::1]:52854 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lg1M7-0003m1-0t for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 10 May 2021 04:33:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lg1LR-0003lr-6m for help-gnu-emacs@gnu.org; Mon, 10 May 2021 04:32:53 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:60119) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lg1LM-00063D-Rh for help-gnu-emacs@gnu.org; Mon, 10 May 2021 04:32:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1620635536; bh=ymZKGGIy81yAdzzbuN7hRB3hhZX9zfZWefnNAocx2OE=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=P9WfIygr/gLMJr48+NmLbqQRtx+61r4Hsn3xd5Hma+NiAsA8JAkRHg/GeOS5xVJkJ 3IYGaXRk1EnSahd6jeSnPi51LGax7ndEhjTVQTOe5+IBrQfZ8ttQ3pj0eYJ3bdmadP IWodSDDL1XTZeFi+xiXWP7eK32NN4agQMiwKxJMI= 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-bs04.server.lan [172.19.170.170]) (via HTTP); Mon, 10 May 2021 10:32:16 +0200 Importance: normal Sensitivity: Normal In-Reply-To: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:zvwkxSAt77qp8nG5+APsK88+76P96qafdTvGGJQzEz3rcVom592A/3XrMNLSAluHORALg iTooa5yePSEho/Whqbr/HmRTVTrbTzLBY10q3cYYVVpSy/sqyGd6FUiyrq6rAEh2gzBYoaDEhjKE p130Ms239ATlcnlNfFLHT6VSQTQ32og0SYh0piE4keDrsLxnG2Rw4Nl+/OH3Fd4UufG4JLQKBe9X o5BLRnGfa5qnFVG+7ZGtAkB4XOAyWl0FYis/vvEXkJU2mw4FDvmoBg8W93AgkMFKSgZ6v2KeaimD X4= X-UI-Out-Filterresults: notjunk:1;V03:K0:s5aCp+BrSu0=:burbnaJ1aOMYgENU6NQHfj iiEfBQOq6FYQskn+OlujjrxxMStU++m2U/Falunwj8jTz7bLtapJD+gKgxO7djEv82MsteeOQ bZFMuPUBWUxCtdovOi7dIFYQCRc8F24ai89GdegDzly/6l7pFHV8KQc9T5G1U5b2MgIripdhe Fl2m6bFvqZGy/VwdZBwnNo723st0eiBZhIlBzjz/zHLcs7PSFwSZXDzEaXsVLzP91Sg4GYltS 82wcUekBREFwYtKpPLnGVXOivo6Qd4f1H84jTtkPY1fZXfad7l6PnudWUdxbmyb6hnPpIIHJM 7o9qcpNBZLXA015v4dETqOCzWOpg7kHoVECUJdcf31Eo7fM5gis2fBdHYxGkK4dJD904kWcDn RD88WMDK7+expKXAZV9QKcrWoiaWbdnPDOEQdqgJAJRmnQFD01VnOA9nKSCATB1hVC/3mczlf resHxiltxRfxWhaV/CFN4WRmfwKZdSEMYFH5V8TEVgvUWFUGqgfyyVNyXN+Ro1u1/monVSr2R 78pPDUW1tBkLVWmD6Zzjih3nwspmsC/Thl29AA6Qkmad6zd827SWBf2MI5KzkwYH1jkRNh+yc j4KF0Ax324X+PSzmGxOzkqn8IHMhZe/LXLK/Q14h2Aw3ZuT+F3n0Om3YJ6ZBxtIK5QwGVrh2A ilmq1A+PSEUFlzXiM9dKCde8553XHacTlmpfOGo0g6ALILQbxlII9DejY8S+tv/e4pqDkwA/R fW90BL9+JxM/F7jcSqWyvvb5LeMU4D3qk1iQd5IxMXEPgGJiBy6vsL306o+8EFfpsggHx87I Received-SPF: pass client-ip=212.227.17.20; envelope-from=dimech@gmx.com; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, 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:129653 Archived-At: > Sent: Monday, May 10, 2021 at 7:32 PM > From: "Jean Louis" > To: "Christopher Dimech" > Cc: help-gnu-emacs@gnu=2Eorg > Subject: Re: outline-minor-mode and org-mode capabilities for programmin= g languages > > * Christopher Dimech [2021-05-10 09:53]: > > Mainly catering for highligting, headlines and folding to start > > with=2E >=20 > Isn't that what outline-minor-mode is for? >=20 > There are already other packages, I have been testing it, and they > worked similar to outline-minor-mode and could fold things=2E Folding of functions is good, folding by headings not so good=2E =20 =20 > How you want to designate headlines? It has to have some key > string=2E Maybe with 5 ;;;;; on beginning? >=20 > ;;;;; Headline How about extending it to subheadings like org-mode=2E It is a good idea to use the comment declaration for defining headings, and also use * for heading levels as in org-mode=2E For languages with multiline comments I simply used *, then changed to org-mode=2E In elisp I made a multiline comment function=2E For texinfo, which has multi-line comment capability I have been doing @ignore * Heading @end ignore @ignore ** Subheading @end ignore > Evaluate this, and you get highlighting of headlines: > (highlight-regexp "^;;;;;=2E*$" 'hi-yellow) >=20 > But I think you have to first play with:=20 > {M-x customize-group RET outline RET} >=20 > as there is highlighting already included=2E >=20 > For headings, I think each mode need different definition on what is > heading=2E=20 They should always go with the comment declaration for the language=2E Mo= st likely good, but then one cannot easily switch to org-mode=2E Then again, if the= topics of discussion are resolved, there wauld not me much need to change to org-= mode for certain org-mode operations=2E > So you can define heading with `outline-heading-alist' >=20 > outline-heading-alist is a variable defined in =E2=80=98outline=2Eel=E2= =80=99=2E >=20 > Its value is nil >=20 > Automatically becomes buffer-local when set=2E >=20 > Alist associating a heading for every possible level=2E > Each entry is of the form (HEADING =2E LEVEL)=2E > This alist is used two ways: to find the heading corresponding to > a given level and to find the level of a given heading=2E > If a mode or document needs several sets of outline headings (for exampl= e > numbered and unnumbered sections), list them set by set and sorted by le= vel > within each set=2E For example in texinfo mode: >=20 > (setq outline-heading-alist > '(("@chapter" =2E 2) ("@section" =2E 3) ("@subsection" =2E 4) > ("@subsubsection" =2E 5) > ("@unnumbered" =2E 2) ("@unnumberedsec" =2E 3) > ("@unnumberedsubsec" =2E 4) ("@unnumberedsubsubsec" =2E 5) > ("@appendix" =2E 2) ("@appendixsec" =2E 3)=2E=2E=2E > ("@appendixsubsec" =2E 4) ("@appendixsubsubsec" =2E 5) =2E=2E= )) >=20 > Instead of sorting the entries in each set, you can also separate the > sets with nil=2E >=20 > You asked for: >=20 > - highligting,=20 > - headlines; and=20 > - folding >=20 > And I have demonstrated that more or less, that already exists in > outline-minor-mode, play with highlighting options, folding already > exists, and headings you may define yourself=2E I am suggesting to clean things up and put all the capabilities into a sin= gle minor mode=2E We can keep it to outline-minor-mode=2E =20 > Let us say I have this comment and I keep just one space after ;;;; >=20 > ;;;; =E2=9F=A6=E2=9F=A6 LIST FUNCTIONS =E2=9F=A7=E2=9F=A7 >=20 > Folded text >=20 > ;;;; =E2=9F=A6=E2=9F=A6=E2=9F=A6 MORE LIST FUNCTIONS =E2=9F=A7=E2=9F=A7= =E2=9F=A7 >=20 > (setq outline-heading-alist > '((";;;; =E2=9F=A6" =2E 1) (";;;; =E2=9F=A6=E2=9F=A6" =2E 2) (";;;; =E2= =9F=A6=E2=9F=A6=E2=9F=A6" =2E 3))) >=20 > this appears to work on my side in Emacs Lisp mode, but not in > fundamental=2E I can fold those headings and they remain visible=2E >=20 > > > Like should I mark functions with TODO/DONE? > >=20 > > No >=20 > Those mentioned meta level features can look abstract to you, but they > are very real to me so far=2E It leans to subject of literate > programming, similar to programming by using Org Babel and embedded > functions that are described and later interpolated into the > script=2E Just that I can do that on the higher level rich attributes > and references and relations to other functions=2E As humans we are so > late with literate programming=2E That would help so many other people= =2E I agree with you up to a point=2E For starters let's just clean things up with the capabilities that are already implemented=2E Literate schemes ar= e good for organisational purposes, but for programming, literate schemes make everything much more cumbersome, and ultimately yield to total disast= er=20 in terms of efficiency in going through the code base=2E One thing that d= oes help is self documuntation if kept brief within the code file=2E =20 > > I suggest that outline-minor-mode be also refactored and revamped, as = I have > > seen much additional code on top of it (outline-magic, orgstruct, > > outshine)=2E >=20 > For now, those features which you asked for, already exist, you may > try customizations, you are just few minutes away from having > highlighting, folding is already there, and defining headlines=2E Opening-closing headings with the mouse would be good=2E Will spend the f= ew minutes and get back to you, as per your advice=2E Then see what capabilities fro= m the other add-ons are redundant=2E=20 =20 > --=20 > Jean >=20 > Take action in Free Software Foundation campaigns: > https://www=2Efsf=2Eorg/campaigns >=20 > Sign an open letter in support of Richard M=2E Stallman > https://stallmansupport=2Eorg/ > https://rms-support-letter=2Egithub=2Eio/ >=20 >=20 >