all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#1534: Font lock decoration levels mismatch?
@ 2008-12-10 19:51 ` Derick Eddington
  2008-12-11 23:52   ` Glenn Morris
  2008-12-13  4:25   ` bug#1534: marked as done (Font lock decoration levels mismatch?) Emacs bug Tracking System
  0 siblings, 2 replies; 5+ messages in thread
From: Derick Eddington @ 2008-12-10 19:51 UTC (permalink / raw)
  To: bug-gnu-emacs

I'm using:
GNU Emacs 23.0.60.1 (i486-pc-linux-gnu, GTK+ Version 2.14.3) of
2008-10-13 on rothera, modified by Debian

The documentation at "23.6.1 Font Lock Basics" and "23.6.5 Levels of
Font Lock" refers to level numbers starting at 1, but 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.  Should
Customize do 1-based indexing instead so it corresponds to the
documentation, or the documentation use 0-based?

-- 
: Derick
----------------------------------------------------------------








^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#1534: Font lock decoration levels mismatch?
  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-13  4:25   ` bug#1534: marked as done (Font lock decoration levels mismatch?) Emacs bug Tracking System
  1 sibling, 1 reply; 5+ messages in thread
From: Glenn Morris @ 2008-12-11 23:52 UTC (permalink / raw)
  To: Derick Eddington; +Cc: 1534

Derick Eddington wrote:

> The documentation at "23.6.1 Font Lock Basics" and "23.6.5 Levels of
> Font Lock" refers to level numbers starting at 1, but 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 don't really understand the problem. What exactly are you
customizing, and how?

In general, the actual Lisp expression used by Customize is not
terribly important - use a tag instead to give a more human-readable
set of choices (eg "minimum", "medium", "maximum" rather than 1, 2, 3).






^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#1534: Font lock decoration levels mismatch?
  2008-12-11 23:52   ` Glenn Morris
@ 2008-12-12 18:48     ` Derick Eddington
  2008-12-12 20:34       ` Glenn Morris
  0 siblings, 1 reply; 5+ messages in thread
From: Derick Eddington @ 2008-12-12 18:48 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 1534

On Thu, 2008-12-11 at 18:52 -0500, Glenn Morris wrote:
> Derick Eddington wrote:
> 
> > The documentation at "23.6.1 Font Lock Basics" and "23.6.5 Levels of
> > Font Lock" refers to level numbers starting at 1, but 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 don't really understand the problem. What exactly are you
> customizing, and how?
> 
> In general, the actual Lisp expression used by Customize is not
> terribly important - use a tag instead to give a more human-readable
> set of choices (eg "minimum", "medium", "maximum" rather than 1, 2, 3).

I'm customizing `font-lock-maximum-decoration'.  It's documentation
says:

        Maximum decoration level for fontification.
        If nil, use the default decoration (typically the minimum
        available).
        If t, use the maximum decoration available.
        If a number, use that level of decoration (or if not available
        the maximum).
        If a list, each element should be a cons pair of the form
        (MAJOR-MODE . LEVEL), where MAJOR-MODE is a symbol or t (meaning
        the default).  For example:
         ((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.

I'm using the last form with an association for my mode.  I have 4
levels.  I haven't yet learned how to use tags with Customize, I'll read
about that.  But for my mode, I think tag names would not be as clear as
just the numbers.  If Customize is going to allow numbers, shouldn't
their indexing base be consistent with the documentation?

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
INS

Which is not the Lisp syntax and is showing a number.

This isn't a big deal to me, but the Emacs' documentation tells me to
report things like this.

-- 
: Derick
----------------------------------------------------------------







^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#1534: Font lock decoration levels mismatch?
  2008-12-12 18:48     ` Derick Eddington
@ 2008-12-12 20:34       ` Glenn Morris
  0 siblings, 0 replies; 5+ messages in thread
From: Glenn Morris @ 2008-12-12 20:34 UTC (permalink / raw)
  To: Derick Eddington; +Cc: 1534

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






^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#1534: marked as done (Font lock decoration levels mismatch?)
  2008-12-10 19:51 ` bug#1534: Font lock decoration levels mismatch? Derick Eddington
  2008-12-11 23:52   ` Glenn Morris
@ 2008-12-13  4:25   ` Emacs bug Tracking System
  1 sibling, 0 replies; 5+ messages in thread
From: Emacs bug Tracking System @ 2008-12-13  4:25 UTC (permalink / raw)
  To: Glenn Morris

[-- Attachment #1: Type: text/plain, Size: 852 bytes --]


Your message dated Fri, 12 Dec 2008 23:21:35 -0500
with message-id <fcr64c7lio.fsf@fencepost.gnu.org>
and subject line Re: bug#1534: Font lock decoration levels mismatch?
has caused the Emacs bug report #1534,
regarding Font lock decoration levels mismatch?
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact don@donarmstrong.com
immediately.)


-- 
1534: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=1534
Emacs Bug Tracking System
Contact don@donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 4085 bytes --]

From: Derick Eddington <derick.eddington@gmail.com>
To: bug-gnu-emacs@gnu.org
Subject: Font lock decoration levels mismatch?
Date: Wed, 10 Dec 2008 11:51:33 -0800
Message-ID: <1228938693.24919.50.camel@eep>

I'm using:
GNU Emacs 23.0.60.1 (i486-pc-linux-gnu, GTK+ Version 2.14.3) of
2008-10-13 on rothera, modified by Debian

The documentation at "23.6.1 Font Lock Basics" and "23.6.5 Levels of
Font Lock" refers to level numbers starting at 1, but 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.  Should
Customize do 1-based indexing instead so it corresponds to the
documentation, or the documentation use 0-based?

-- 
: Derick
----------------------------------------------------------------





[-- Attachment #3: Type: message/rfc822, Size: 1942 bytes --]

From: Glenn Morris <rgm@gnu.org>
To: 1534-done@emacsbugs.donarmstrong.com
Subject: Re: bug#1534: Font lock decoration levels mismatch?
Date: Fri, 12 Dec 2008 23:21:35 -0500
Message-ID: <fcr64c7lio.fsf@fencepost.gnu.org>


I have clarified the documentation.


Glenn Morris wrote:

> There should be a separate element at the start giving the default
> highlighting for the mode.

BTW, it's not really the "default" any more. It's the level used when
font-lock-maximum-decoration has a nil value. Nowaways it is t by
default.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-12-13  4:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [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
2008-12-13  4:25   ` bug#1534: marked as done (Font lock decoration levels mismatch?) Emacs bug Tracking System

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.