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: Wed, 2 Jun 2021 02:07:40 +0200

> Sent: Wednesday, June 02, 2021 at 8:44 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

> 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.

Recently we changed the outlines of emacs-lisp-mode in 
https://debbugs.gnu.org/46878
So this is already fixed.

Have been discussing all this together with Protesilaos Stavrou.  Could you 
have a read
to see if we actually got to something?

> Sent: Wednesday, June 02, 2021 at 1:46 AM
> From: "Protesilaos Stavrou" <info@protesilaos.com>
> To: "Christopher Dimech" <dimech@gmx.com>
> Subject: Re: modus-themes and headlines
>
> On 2021-06-01, 14:42 +0200, Christopher Dimech <dimech@gmx.com> wrote:
>
> > I send you a file to see how doing "Hide Body" looks like after enabling
> > outline-minor-mode.
> >
> > For headings, you seem to change the font.  Anyway, I have seen that the 
> > colours
> > for headings staring with comments (;;; ;;;; ;;;;; ...) are basically 
> > indistinguisable
> > from code headlines ("(defvar", "(defun"),  Almost same colour but not the 
> > same.
> >
> > Don't you play with contrast ratio between headings starting with ;;; and 
> > those starting
> > with code?
>
> Just rebuilt Emacs and checked with the file you sent.  Long story
> short: this is the same as we discussed the other day, namely, that the
> problem is with outline.el and how it chooses to fontify forms that are
> not explicitly defined as headings (defvar, defun...).
>
> To the defun, defvar etc. it applies the outline-8 face, whereas the
> real headings (starting with comments that have three delimiters: ;;;)
> are styled with outline-1 and then incremented for each extra comment
> delimiter.
>
> This happens regardless of theme.  It just is that the generic theme
> inherits from font-lock, so the problem is not obvious even though it is
> still there: try it with and without outline-minor-mode to see the
> difference.
>
> Here is what I did (screenshots attached):
>
> - emacs -Q and find-file gungadin.el (screenshot 1)
>
> - M-x outline-minor-mode (screenshot 2)
>
> - M-x load-theme RET modus-operandi RET (screenshot 3)
>
> - M-: (setq-default outline-minor-mode-highlight 'override) RET
>   and then M-x outline-minor-mode twice to re-enable the mode
>   (screenshot 4)
>
> - M-x disable-theme RET modus-operandi RET (screenshot 5)
>
> - M-x outline-minor-mode (screenshot 6)
>
> Just comparing the last two screenshots you can see that the problem is
> there.
>
> As for the style of the headings for the modus-themes (screenshot 4),
> you can use the variable 'modus-themes-headings' as we mentioned before.
>
> I suggest we bring this issue upstream.  Ask them whether the
> defvar,defun etc. can retain their styles and only for explicit headings
> to be fontified.
>
> --
> Protesilaos Stavrou
> https://protesilaos.com
>

Attachment: gungadin.el
Description: Text document

Attachment: screenshot-1.png
Description: PNG image

Attachment: screenshot-2.png
Description: PNG image

Attachment: screenshot-3.png
Description: PNG image

Attachment: screenshot-4.png
Description: PNG image

Attachment: screenshot-5.png
Description: PNG image

Attachment: screenshot-6.png
Description: PNG image


reply via email to

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