bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#48724: Code collapsing and outline headings for elisp


From: Christopher Dimech
Subject: bug#48724: Code collapsing and outline headings for elisp
Date: Tue, 1 Jun 2021 13:24:42 +0200

> Sent: Monday, May 31, 2021 at 10:15 AM
> From: "Juri Linkov" <juri@linkov.net>
> To: "Christopher Dimech" <dimech@gmx.com>
> Cc: 48724@debbugs.gnu.org
> Subject: Re: bug#48724: Code collapsing and outline headings for elisp
>
> > Serious problem is that the two important variables: `outline-regexp' and
> > `outline-heading-alist' are not customizable by using "M-x customize-group".
> >
> > Additionally both of them should be customizable per mode.  Don't you think 
> > so?
>
> I think that modes should set `outline-regexp' and `outline-heading-alist'
> according to the constructs of their programming language.  Then users
> don't need to customize these variables.
>
> > There has been a discussion today about outline-minor-mode settings for 
> > fortran
> > (both fixed and free form).  Have had a go at using "!" and "!!", but "Hide 
> > Body"
> > did not hide the body.
> >
> > There could be some default headings for fortran when outline-minor-mode is 
> > enabled.
> > One could follow the current setup for emacs-lisp-mode, for fortran.
> >
> > !! for heading level 1
> > !!! for subheading level 2
> > !!!! for subsubheading level 3
>
> I agree it would be nice to set an appropriate value of `outline-regexp'
> and `outline-heading-alist' for fortran-mode in lisp/progmodes/fortran.el.

I suggest that emacs-lisp-mode does code collapse (show/hide) by default.
Then outline-minor-mode does additional headings in the form

;;; Heading 1
;;;; SubHeading
;;;;; SubSubHeading

;;; Heading 2

outline-minor-mode would then be made to collapse sections of code between
headlines.

This means that a headline hide could hide a number of variable and function
definitions that belong together.

> But the last time I used Fortran was when Fortran had the "C" character
> for comments at the first fixed column on a punched card, and now
> your example uses some new syntax "!" for comments, so sorry, can't help here.
>
> This task would be a nice assignment for the group of students.

Which major modes could be done straight away?






reply via email to

[Prev in Thread] Current Thread [Next in Thread]