unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Glenn Morris <rgm@gnu.org>
To: Derick Eddington <derick.eddington@gmail.com>
Cc: 1534@emacsbugs.donarmstrong.com
Subject: bug#1534: Font lock decoration levels mismatch?
Date: Fri, 12 Dec 2008 15:34:33 -0500	[thread overview]
Message-ID: <4xoczhuo86.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <1229107734.29413.18.camel@eep> (Derick Eddington's message of "Fri, 12 Dec 2008 10:48:54 -0800")

Derick Eddington wrote:

>> > when I customize the level for a specific mode (one I'm still
>> > developing) the number given to Customize is 0-based not 1-based;
>> > i.e., my `font-lock-defaults' `KEYWORDS' member is like `(level-1
>> > level-2 level-3 level-4)' and, e.g., to make Customize use
>> > level-3 I have to tell it the number 2.
[...]
> I'm customizing `font-lock-maximum-decoration'.  It's documentation says:
[...]
>          ((c-mode . t) (c++-mode . 2) (t . 1))
>         means use the maximum decoration available for buffers in C
>         mode, level 2 decoration for buffers in C++ mode, and level 1
>         decoration otherwise.
[...]
> When I start customizing it from its default state and activate the
> "Value Menu" with "mode specific", I get:
>
> INS DEL Instance:
>             Mode:
>             (*) all
>             ( ) name: nil
>             Decoration:
>             ( ) default
>             (*) maximum
>             ( ) level: 1


OK. So where's the part where you have to say 2 in order to get 3?

If I use customize to say:

mode: all : maximum
mode: name : f90-mode : level 2

Then I get level 2 highlighting in F90 buffers.


Oh, perhaps I see the problem. You said:

  my `font-lock-defaults' `KEYWORDS' member is like `(level-1 level-2
  level-3 level-4)'

There should be a separate element at the start giving the default
highlighting for the mode. See for example f90-mode:

  (set (make-local-variable 'font-lock-defaults)
       '((f90-font-lock-keywords f90-font-lock-keywords-1
                                 f90-font-lock-keywords-2
                                 f90-font-lock-keywords-3
                                 f90-font-lock-keywords-4)
         nil t))


(or grep for "keywords-1" in the lisp sources)

That does indeed look like a documentation bug in the manual...






  reply	other threads:[~2008-12-12 20:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <fcr64c7lio.fsf@fencepost.gnu.org>
2008-12-10 19:51 ` bug#1534: Font lock decoration levels mismatch? Derick Eddington
2008-12-11 23:52   ` Glenn Morris
2008-12-12 18:48     ` Derick Eddington
2008-12-12 20:34       ` Glenn Morris [this message]
2008-12-13  4:25   ` bug#1534: marked as done (Font lock decoration levels mismatch?) Emacs bug Tracking System

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4xoczhuo86.fsf@fencepost.gnu.org \
    --to=rgm@gnu.org \
    --cc=1534@emacsbugs.donarmstrong.com \
    --cc=derick.eddington@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).