emacs-devel
[Top][All Lists]
Advanced

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

Re: font-lock-maximum-decoration should be 2 by default?


From: Vitalie Spinu
Subject: Re: font-lock-maximum-decoration should be 2 by default?
Date: Sat, 18 Aug 2012 12:10:09 +0200
User-agent: Gnus/5.130004 (Ma Gnus v0.4) Emacs/23.3 (gnu/linux)

  >> Vitalie Spinu <address@hidden>
  >> on Sat, 18 Aug 2012 00:47:02 +0200 wrote:

  >> "Drew Adams" <address@hidden>
  >> on Fri, 17 Aug 2012 13:50:56 -0700 wrote:

  >> > Yes, Emacs Dev concluded after many years that `t' is the 
  >> > most appropriate default value.
  >> 
  >> Interesting. I am curious of reasons for that. Cannot see one 
  >> by myself, but I must be missing something.

  >> Actually, the default has been `t' for as long as I can recall.  Eli has 
said it
  >> is since 20.1.  Stefan has conjectured that it is ever since the variable 
has
  >> existed.
  >> http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg00799.html

  > Apparently it is t from 1997 
http://article.gmane.org/gmane.emacs.devel/66833/match=font+lock+maximum+decoration

  >> But these too might be of interest.  Suggestion: start with the last.  This
  >> useful feature (font-lock levels) is apparently already on its way to the 
trash
  >> heap (its removal is marked `pending' for 24.2).  We will apparently soon 
have
  >> no choice in the matter - the behavior will be hard-coded as maximum
  >> decoration.

  > That's funny. Probably the most subjective part of Emacs, fontification,
  > is left without even basic customization?


How about the following as a replacement for levels:

Let say you are defining mode "X". Then `define-derived-mode' and
`define-generic-mode' can add X-mode-font-lock-keywords as a
(customizable?) variable, which would be a list of keywords or symbols
holding keywords.

Then font-lock can bunch together font-lock-keywords and
X-mode-font-lock-keywords at initialization. 

Each mode can define a set of keyword variables with suggestive names
X-mode-fl-keyword-basic, X-mode-fl-keyword-functions,
X-mode-fl-keyword-brackets, or just X-mode-fl-keyword-1 for
level-1. Emacs can define a bunch of standard keywords as well.

Then user will be able to add/remove keywords from
X-mode-font-lock-keywords as desired.

Vitalie.



reply via email to

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