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

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







  reply	other threads:[~2008-12-12 18:48 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 [this message]
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

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=1229107734.29413.18.camel@eep \
    --to=derick.eddington@gmail.com \
    --cc=1534@emacsbugs.donarmstrong.com \
    --cc=rgm@gnu.org \
    /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).