Subject: bug#64769: Docstrings made to print specfied lines in colour

From: uzibalqa <[email-masked]>
Date: Fri, 21 Jul 2023 15:26:19 +0000

------- Original Message -------
On Saturday, July 22nd, 2023 at 2:28 AM, Eli Zaretskii <[email-masked]> wrote:

> > Date: Fri, 21 Jul 2023 13:37:02 +0000
> > From: uzibalqa via "Bug reports for GNU Emacs,
> > the Swiss army knife of text editors" [email-masked]
> > 
> > It would be an improvement if docstrings can be made to print specfied lines
> > in colour. Currently everything is one colour, except executable commands that
> > are not expected to have whitespaces.
> 
> 
> Help buffers do have faces, and you can customize them to use
> non-default colors.
> 
> Beyond that, it is not clear what behavior you are asking for. How
> will the "specified lines" be specified, and by whom?
> 
> Doc strings are general Emacs feature, so if it's desirable to have
> specific parts of them highlighted in certain ways, the first question
> to ask is which parts will those be, and how will they be identified?

Quite Right.  How to identify them is the hard part.  A sensible way is
to have specific variables or functions that instruct how doc strings get
colored (rather than having coloured instructions embedded in the docstring
itself).  How to specify the colouring instructions is the essential part
for how to customise the appearance and behavior of doc strings in Emacs. 

Whilst I generally criticise implementation of features, it is evident that
other people would have much clever schemes of how things are actually done.
Although I give the impression that I know better, I hardly ever discuss on
how an actual implementation should be done in Emacs. 

A basic start on this would be to provide a list on which lines (or patterns)
in the docstring need to be coloured differently.  One needs to see how others
could approach it with benefits and difficulties pointed out.