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 12:27:46 +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="6835"; 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 12:29:32 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 1lg3AJ-0001bp-Rb for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 10 May 2021 12:29:31 +0200 Original-Received: from localhost ([::1]:48148 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lg3AI-0004ot-UW for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 10 May 2021 06:29:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43536) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lg39C-0003x8-06 for help-gnu-emacs@gnu.org; Mon, 10 May 2021 06:28:22 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:47223) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lg398-0008RL-Uh for help-gnu-emacs@gnu.org; Mon, 10 May 2021 06:28:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1620642466; bh=JSjgVLkcPFvU6WPkWtaL1+qPaQIMRxewA1fci9HtWf0=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=A6Ksty45MkHq76RF4rjDbzCqYgAnIo0+tafZ1dI8ig7Dx7+EafrhvtqUasbgUCUr/ pq3MqSz20tovylYq70Mo3TCPv4o58XwsGWHrdg87+40A0yMMZ87JtzO4tQgS2kM0mI 51S+KGWYm3S6SUef0a/hzR/XADCL2Ht8Bl6p917U= 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-bs03.server.lan [172.19.170.169]) (via HTTP); Mon, 10 May 2021 12:27:46 +0200 Importance: normal Sensitivity: Normal In-Reply-To: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:MULLDZj4AekX0uBYwcicSMNE8QU3p/j5dBdGUMA/hpBLhDgTZMkwiHn19kuJZdgw0s4a5 NLlu0sVRj36/OxgJoGg4Foo2Zc9pOmL79ftuMF5MUNpj5XvurXU6y/mOt0+G94sZ05rUgERZRtD8 GfQZEc0elyrAxg62DDpWo5fERtApX0uyyEy8462g98veUvV5J9wbPEVvTBpRFSm8aVXQnkFDoxc1 qTUquw0JeMmgSlDU9D5IDneKUDt3f6KLR36R/iktgASUO3UojKlCvefKSxB++4YIQdQJfW6rBP7D 9k= X-UI-Out-Filterresults: notjunk:1;V03:K0:bb6AwueITSI=:FCnvfKr0nRxc70hsF9zFd2 KTfCGt8BD7vRW26HCrPXCFRez2Klb2ojM4XRxnkbSEbkXkiVbdKEvbEYg8BpqyYImLTgTNaYA BWCgu3fUCYtbDFxpQLgtg35/PMI55FAv+WIofd/Wr06M4+eZ6lR+ReyvnnAnu1xYR/GpFhPQK Fc81aAB+ef5hp+6Zvegc7mSjNmKwvass/Pc32bFy1/XmwasW6fefWmR32sf4R7qf565fMw58g chZ5joNP6swp2cYLrpvXZQhNGc9X4GhB6OlP3BWt2dsOu6MOWwm4MR4HNoD1X/TpqoHPP7rt4 NnK1dNSVkMxXdhG3qMw515u/zjcfd47FVqk25n+gBGCs4ro0hFDjBmSi5ukmNt5KdCP0HgMG4 SefMJA4w6sf7Zf3hUh+W/GYKFpu8wyZKnM6RABg0A/2ELobIc/ICiJCgY4UW7N0h0B9tnK/qH JQh9noOTYBQdp+oSVLHOzhZpoLoPfYz5FE0hBtiGbHKeAau+wbyCiZqEE9BrX1GisqZFg3xOj X3lceDC1zJkD6U40VFTkA+2dGJxGaF2VVKXoJ6Dn5+r3QMIOBx4zPkt7/kEDqmS8/Wd3O7wyG NgfpFHPIgWTifwMoPpJfRIPKBGrVJw16fl71dmN43NDAjV/SUXiY1fPpPf4SQvhmLJk6RM49o Udn+z0q4kVPK7FY6I5LvuB7TYEoDUPLz1/pZEKxxZdH17hbpzyJ7BI0rx6iGwH5jSiwCfmnbk nwltYrKM0OyD0+QLMBxQ0UvdReXcV9vwV/6YucH4d9/mzPypaUmXBOXvzkrme8z1TbW61Y7f Received-SPF: pass client-ip=212.227.17.21; 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:129660 Archived-At: I would like to use=20 ;; * heading ;; ** subheading Have done (add-hook 'emacs-lisp-mode-hook #'outline-minor-mode) (add-hook 'emacs-lisp-mode-hook (lambda () (outline-minor-mode 1))) (highlight-regexp "^;;;;;=2E*$" 'hi-yellow) (setq outline-heading-alist '((";; * " =2E 1) (";; ** " =2E 2) (";; *** " =2E 3)) ) ((emacs-lisp-mode =2E ((outline-heading-alist =2E '( (";; * " =2E 1) (";; ** " =2E 2) (";; *** " =2E 3) ) )))) Still want to ask example code for hon to change the outline-minor-mode=20 keybindings to something else=2E > Sent: Monday, May 10, 2021 at 9:31 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 11:32]: > > > There are already other packages, I have been testing it, and they > > > worked similar to outline-minor-mode and could fold things=2E > >=20 > > Folding of functions is good, folding by headings not so good=2E =20 >=20 > I still think you have to verify outline-heading-alist as that is > where you define headings=2E I just did it on my side and it works > well=2E=20 >=20 > ;;;; =E2=86=9D THIS IS MY STYLE OF A HEADING in Emacs Lisp >=20 > I like it that way, and I have only defined one level, as I don't need > more in that mode=2E >=20 > In that mode it is: >=20 > outline-heading-alist =E2=87=92 '((";;;; =E2=86=9D" =2E 2)) >=20 > As simple as that=2E >=20 > See my video demonstration here below=2E >=20 > The Power of Outline Minor Mode for Emacs > https://hyperscope=2Elink/3/7/2/7/9/The-Power-of-Outline-Minor-Mode-for-= Emacs-37279=2Ehtml >=20 > > How about extending it to subheadings like org-mode=2E It is a good i= dea > > to use the comment declaration for defining headings, and also use * f= or > > heading levels as in org-mode=2E For languages with multiline comment= s > > I simply used *, then changed to org-mode=2E In elisp I made a multil= ine > > comment function=2E > >=20 > > For texinfo, which has multi-line comment capability I have been doing > >=20 > > @ignore > > * Heading > > @end ignore > >=20 > > @ignore > > ** Subheading > > @end ignore >=20 > No need for that, please just see description of variable: > 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 > Also, when I need re-numbering of lists like in Org mode, invoke > orgalist-mode when I need that=2E In general, many Org functions could > be useful in other modes, would they be split into separate packages=2E >=20 > > They should always go with the comment declaration for the language=2E > > Most 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 >=20 > I don't believe Org mode is solution for everything=2E In my Hyperscope > system and also Website Revision System specific system, I have no > limitation on what mode or text processor to use=2E=20 >=20 > Org mode IS bloated=2E It has everything what one needs and much more > what I don't need=2E It is based on Outline mode and thus I like often > invoking Outline mode as that satisfies basic needs without fiddling > with Org mode keybindings and whatever other additional not necessary > functions=2E Surely I do use Org mode, but when it is needed=2E >=20 > When you mention "Org" I think of bloated number of Org packages and > functions=2E That is why I asked, what do you think you need? You said > highlighting, headings, folding, so that is about all available in > outline-minor-mode >=20 > > 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 are good for organisational purposes, but for > > programming, literate schemes make everything much more cumbersome, > > and ultimately yield to total disaster in terms of efficiency in > > going through the code base=2E One thing that does help is self > > documuntation if kept brief within the code file=2E >=20 > Disaster comes with inefficient or non-integrated implementation=2E How > I see Emacs in general, it is a pile of useful stuff, on which pile, > more piles are added on top, with more stuff on top of the top, of the > top of the piles of piles=2E=20 >=20 > We have all function well described, indexed, findable, locatable, > usable in programming, we have it all, but IMHO integration is not > adequate for my standard=2E I have expected more of computing in 21st > century=2E >=20 > I would expect something like, to tell by speech to computer: >=20 > "=2E=2E=2ETHEN GIVE ME ALL BUFFER AS A STRING=2E=2E=2E" which would inte= rpolate > into necessary functions=2E >=20 > "=2E=2E=2ETHEN REPLACE ALL OCCURENCES OF THE FOLLOWING=2E=2E=2E" (type t= he string) > and computer asks "With what do you want to replace it?" then type the > replacement=2E And then computer would ask for various possible > mischievous effects, and would correct programmer, and in the same > time find similar functions in other 10000 Emacs packages or for any > kind of programming language that could be related to it=2E It would > conduct database queries locally and remotely=2E >=20 > How about tag based programming? Just think what you want to do, and > other tags appear=2E Like STRING --- CUT, FIRST PART, LAST PART, FIND > ANYWHERE IN THE STRING, SPLIT, CONVERT TO LIST, CHARS, or LIST -- > REMOVE DUPLICATES, REVERSE etc=2E Tags could be shown on screen, user > just clicks on it and decides relations, something similar to=20 > https://scratch=2Emit=2Eedu -- where children program animations=2E More > literate, more meanings, just ideas and intentions that result in a > program=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 >