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

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

Re: Customisation for Comments


From: goncholden
Subject: Re: Customisation for Comments
Date: Fri, 11 Feb 2022 20:14:07 +0000

------- Original Message -------
On Friday, February 11th, 2022 at 8:05 PM, Emanuel Berg via Users list for the 
GNU Emacs text editor <help-gnu-emacs@gnu.org> wrote:
> goncholden wrote:
>
> > Stefan mentioned that a minor-mode would not be the
> > appropriate thing to do. The idea is to derive a mode from
> > a major mode and introduce the comment functionality in it.

> > One could have a go at introducing the functionality in the
> > theme, but that would be too restrictive for others to use.

> If this is the goal

> I want a special customisation for comments, using normal
> weight, and having a keybinding that changes the contrast
> ratio between the comment colour and the background.

> then start with a function that increases the contrast by CON.

I have done all that and introduced them into a minor-mode.  There are a
number of minor-modes out there that do provide font-lock customization.
Extending a major-mode is not simple, eg. a derived mode from prog-mode
is used to make a major-mode, like emacs-lisp-mode (which actually derives
from lisp-data-mode which derives from prog-mode).  This means that if I
derive from prog-mode, I would need to setup the syntax for the major-mode
before I can change the comment font-locking.



reply via email to

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