From unknown Fri Jun 20 18:14:40 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#1534 <1534@debbugs.gnu.org> To: bug#1534 <1534@debbugs.gnu.org> Subject: Status: Font lock decoration levels mismatch? Reply-To: bug#1534 <1534@debbugs.gnu.org> Date: Sat, 21 Jun 2025 01:14:40 +0000 retitle 1534 Font lock decoration levels mismatch? reassign 1534 emacs submitter 1534 Derick Eddington severity 1534 normal thanks From derick.eddington@gmail.com Wed Dec 10 11:51:44 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.0000 Tokens: new, 53; hammy, 110; neutral, 53; spammy, 5. spammytokens:0.997-1--decoration, 0.987-1--indexing, 0.987-1--basics, 0.987-1--Basics, 0.857-+--UD:com hammytokens:0.000-+--emacs, 0.000-+--Emacs, 0.000-+--gnu, 0.000-+--GNU, 0.000-+--HDKIM-Signature:sk:content X-Spam-Status: No, score=-7.0 required=4.0 tests=AWL,BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 10 Dec 2008 19:51:45 +0000 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mBAJpf7v020247 for ; Wed, 10 Dec 2008 11:51:42 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LAV5x-0004j3-Ab for bug-gnu-emacs@gnu.org; Wed, 10 Dec 2008 14:51:41 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LAV5w-0004ir-Ou for bug-gnu-emacs@gnu.org; Wed, 10 Dec 2008 14:51:40 -0500 Received: from [199.232.76.173] (port=45606 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LAV5w-0004io-Je for bug-gnu-emacs@gnu.org; Wed, 10 Dec 2008 14:51:40 -0500 Received: from yx-out-1718.google.com ([74.125.44.152]:29717) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LAV5w-0002Hj-7W for bug-gnu-emacs@gnu.org; Wed, 10 Dec 2008 14:51:40 -0500 Received: by yx-out-1718.google.com with SMTP id 34so317297yxf.66 for ; Wed, 10 Dec 2008 11:51:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:content-type :date:message-id:mime-version:x-mailer:content-transfer-encoding; bh=X8KTrq9Nbcnh1PgxvPTWwQQVftAk8OWJuOd2ESF3ZP4=; b=XNvba8vo/aaS3rqdEq/Ag/5D/xQ+s0S26RWqJGo7nDa9I7LHZTPcSh/TQoMqgEdowR P3Tgcf9bhGRtJRTn5QfvqSRaKm06Z8pMa1jeRO3wUkIZA3ZwU5M7yrCOMFE9h5FQjszG xJTLVafjl+R+eELghDPkiBx5c7hT0oFOhYhhI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; b=r58/NGgR71fZMKWaHTLkZDXFf8bZD/dcRXfS4F+D3g2nzyTGPW4Uq/YqAEup028Vie 9TPohzFTy4nFFp83f73H60kYsAOF/kMAXQcaYckCWjyT+R39KhjgLAnNSikLjiHJMTsi +oZBfrd1dML2KH92+8lBcE7+RkxYlVgzkdHfo= Received: by 10.143.160.1 with SMTP id m1mr371342wfo.2.1228938697909; Wed, 10 Dec 2008 11:51:37 -0800 (PST) Received: from ?192.168.1.2? (pool-173-51-86-88.lsanca.fios.verizon.net [173.51.86.88]) by mx.google.com with ESMTPS id 24sm1075475wff.17.2008.12.10.11.51.35 (version=SSLv3 cipher=RC4-MD5); Wed, 10 Dec 2008 11:51:36 -0800 (PST) Subject: Font lock decoration levels mismatch? From: Derick Eddington To: bug-gnu-emacs@gnu.org Content-Type: text/plain Date: Wed, 10 Dec 2008 11:51:33 -0800 Message-Id: <1228938693.24919.50.camel@eep> Mime-Version: 1.0 X-Mailer: Evolution 2.24.2 Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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 ---------------------------------------------------------------- From rgm@gnu.org Thu Dec 11 15:52:59 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.0000 Tokens: new, 27; hammy, 96; neutral, 66; spammy, 0. spammytokens: hammytokens:0.000-+--H*M:fsf, 0.000-+--H*UA:Emacs, 0.000-+--H*u:Emacs, 0.000-+--H*MI:fsf, 0.000-+--H*UA:Gnus X-Spam-Status: No, score=-12.4 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, RCVD_IN_DNSWL_MED,X_DEBBUGS_NO_ACK autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1534) by emacsbugs.donarmstrong.com; 11 Dec 2008 23:52:59 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mBBNqulg006849 for <1534@emacsbugs.donarmstrong.com>; Thu, 11 Dec 2008 15:52:57 -0800 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1LAvKM-0005LI-4i; Thu, 11 Dec 2008 18:52:18 -0500 From: Glenn Morris To: Derick Eddington Cc: 1534@debbugs.gnu.org Subject: Re: bug#1534: Font lock decoration levels mismatch? References: <1228938693.24919.50.camel@eep> X-Spook: dictionary industrial espionage bluebird MIT-LL Perl-RSA X-Ran: y43klQw^zfp&wwAE>P6s0&tJ?UK+XBkYA[GXt_CZ;rl+"@4w X-Hue: yellow X-Debbugs-No-Ack: yes X-Attribution: GM Date: Thu, 11 Dec 2008 18:52:18 -0500 Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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). From derick.eddington@gmail.com Fri Dec 12 10:49:05 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.0000 Tokens: new, 43; hammy, 149; neutral, 118; spammy, 2. spammytokens:0.987-1--ins, 0.959-+--association hammytokens:0.000-+--emacs, 0.000-+--Emacs, 0.000-+--nil, 0.000-+--Lisp, 0.000-+--buffers X-Spam-Status: No, score=-6.9 required=4.0 tests=AWL,BAYES_00,FOURLA, HAS_BUG_NUMBER autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1534) by emacsbugs.donarmstrong.com; 12 Dec 2008 18:49:06 +0000 Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.235]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mBCIn36a031907 for <1534@emacsbugs.donarmstrong.com>; Fri, 12 Dec 2008 10:49:04 -0800 Received: by rv-out-0506.google.com with SMTP id k40so1501212rvb.1 for <1534@emacsbugs.donarmstrong.com>; Fri, 12 Dec 2008 10:49:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :in-reply-to:references:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=KBxx37kXwd5c2I9+rOmW6BqHHkqyHIBbYTD3Uoci5Kc=; b=JMeM7QkGLmGVBfQj1Hb3dUzr98gnAlyeptpYgaJuBCUetPhiXDBBfm5cxzmD89k2NO ygav29GpwPHvIV1hnPvX5Kk6bpmnIZYpNjNIKNFTEoOXqYIABTvo/87hGssYfv0fqjYw 2gztCDX6S+1cFT9Q94HG0zmbLTcugn85aj1uU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=EzOGfhM0y5RjRABmxCNd6OCnuEP0fI5iPH6E90WOCOjg0J837Mlv35Te1KRs5QCDQh BX7wUd8WtDxYG8oB/96r+rW8N2e5tdQACHD5Y0Ik+Z/9VCpKv8EO6/t+2b51+giq7sHq ajFK1f2rNUMEn967mxO9PXVefW7PILRR6SfbI= Received: by 10.141.29.20 with SMTP id g20mr2057917rvj.156.1229107742577; Fri, 12 Dec 2008 10:49:02 -0800 (PST) Received: from ?192.168.1.2? (pool-173-51-86-88.lsanca.fios.verizon.net [173.51.86.88]) by mx.google.com with ESMTPS id f42sm2528578rvb.7.2008.12.12.10.48.59 (version=SSLv3 cipher=RC4-MD5); Fri, 12 Dec 2008 10:49:01 -0800 (PST) Subject: Re: bug#1534: Font lock decoration levels mismatch? From: Derick Eddington To: Glenn Morris Cc: 1534@debbugs.gnu.org In-Reply-To: References: <1228938693.24919.50.camel@eep> Content-Type: text/plain Date: Fri, 12 Dec 2008 10:48:54 -0800 Message-Id: <1229107734.29413.18.camel@eep> Mime-Version: 1.0 X-Mailer: Evolution 2.24.2 Content-Transfer-Encoding: 7bit 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 ---------------------------------------------------------------- From rgm@gnu.org Fri Dec 12 12:35:16 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.0000 Tokens: new, 31; hammy, 124; neutral, 64; spammy, 0. spammytokens: hammytokens:0.000-+--H*M:fsf, 0.000-+--H*UA:Emacs, 0.000-+--H*u:Emacs, 0.000-+--H*MI:fsf, 0.000-+--H*UA:Gnus X-Spam-Status: No, score=-12.4 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, RCVD_IN_DNSWL_MED,X_DEBBUGS_NO_ACK autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1534) by emacsbugs.donarmstrong.com; 12 Dec 2008 20:35:17 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mBCKZDPH030917 for <1534@emacsbugs.donarmstrong.com>; Fri, 12 Dec 2008 12:35:14 -0800 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1LBEiX-00031F-Fu; Fri, 12 Dec 2008 15:34:33 -0500 From: Glenn Morris To: Derick Eddington Cc: 1534@debbugs.gnu.org Subject: Re: bug#1534: Font lock decoration levels mismatch? References: <1228938693.24919.50.camel@eep> <1229107734.29413.18.camel@eep> X-Spook: enemy of the state MIT-LL SCUD missile Panama BROMURE X-Ran: 43ok90?Y"$59`Nv1VG3$& (Derick Eddington's message of "Fri, 12 Dec 2008 10:48:54 -0800") Message-ID: <4xoczhuo86.fsf@fencepost.gnu.org> User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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... From rgm@gnu.org Fri Dec 12 20:22:18 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.0000 Tokens: new, 19; hammy, 62; neutral, 47; spammy, 0. spammytokens: hammytokens:0.000-+--H*M:fsf, 0.000-+--H*UA:Emacs, 0.000-+--H*u:Emacs, 0.000-+--H*MI:fsf, 0.000-+--H*UA:Gnus X-Spam-Status: No, score=-12.4 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, RCVD_IN_DNSWL_MED,X_DEBBUGS_NO_ACK autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1534-done) by emacsbugs.donarmstrong.com; 13 Dec 2008 04:22:18 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mBD4MFUM032531 for <1534-done@emacsbugs.donarmstrong.com>; Fri, 12 Dec 2008 20:22:16 -0800 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1LBM0V-0002JE-Gl; Fri, 12 Dec 2008 23:21:35 -0500 From: Glenn Morris To: 1534-done@debbugs.gnu.org Subject: Re: bug#1534: Font lock decoration levels mismatch? References: <1228938693.24919.50.camel@eep> <1229107734.29413.18.camel@eep> <4xoczhuo86.fsf@fencepost.gnu.org> X-Spook: quarter BCCI Vickie Weaver encryption ASPIC Security X-Ran: Xg/tZ"p44q&x+1Z]U[LbiFnlK0yXL^a;`{H4Cl6792P8S%2N6"*no_6g>acjnN/tF#,{N$ X-Hue: magenta X-Debbugs-No-Ack: yes X-Attribution: GM Date: Fri, 12 Dec 2008 23:21:35 -0500 Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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. From unknown Fri Jun 20 18:14:40 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: $requester Subject: Internal Control Message-Id: bug archived. Date: Sat, 10 Jan 2009 15:24:03 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A log time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator