GNU bug report logs - #13917
24.3.50; Elisp manual: Font Lock Mode

Previous Next

Package: emacs;

Reported by: Joost Kremers <joost.kremers <at> phil.uni-goettingen.de>

Date: Sun, 10 Mar 2013 18:26:02 UTC

Severity: minor

Found in version 24.3.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 13917 in the body.
You can then email your comments to 13917 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#13917; Package emacs. (Sun, 10 Mar 2013 18:26:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Joost Kremers <joost.kremers <at> phil.uni-goettingen.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 10 Mar 2013 18:26:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Joost Kremers <joost.kremers <at> phil.uni-goettingen.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; Elisp manual: Font Lock Mode
Date: Sun, 10 Mar 2013 17:39:01 +0100
The Elisp manual, info node "(elisp) Search-based Fontification" states
the following:

,----
| `(MATCHER . FACESPEC)'
|      In this kind of element, FACESPEC is an expression whose value
|      specifies the face to use for highlighting.  In the simplest case,
|      FACESPEC is a Lisp variable (a symbol) whose value is a face name.
| 
|           ;; Highlight occurrences of `fubar',
|           ;; using the face which is the value of `fubar-face'.
|           ("fubar" . fubar-face)
| 
|      However, FACESPEC can also evaluate to a list of this form:
| 
|           (face FACE PROP1 VAL1 PROP2 VAL2...)
| 
|      to specify the face FACE and various additional text properties to
|      put on the text that matches.  If you do this, be sure to add the
|      other text property names that you set in this way to the value of
|      `font-lock-extra-managed-props' so that the properties will also
|      be cleared out when they are no longer appropriate.  Alternatively,
|      you can set the variable `font-lock-unfontify-region-function' to
|      a function that clears these properties.  *Note Other Font Lock
|      Variables::.
`----

However, a font lock entry of the type

,----
| (MATCHER . (face FACE PROP1 VAL1 PROP1 VAL2))
`----

does not actually work. What works is any of the forms:

,----
| (MATCHER . (0 (face FACE PROP1 VAL1 PROP1 VAL2)))
| (MATCHER 0 (face FACE PROP1 VAL1 PROP1 VAL2))
| (MATCHER (0 (face FACE PROP1 VAL1 PROP1 VAL2)))
`----

(Where the first two are of course equivalent).




In GNU Emacs 24.3.50.1 (i686-pc-linux-gnu, GTK+ Version 3.6.0)
 of 2013-03-04 on charichuelo, modified by Debian
 (emacs-snapshot package, version 2:20130304-1~ppa1~quantal1)
Windowing system distributor `The X.Org Foundation', version 11.0.11300000
System Description:	Ubuntu 12.10

Configured using:
 `configure --build i686-linux-gnu --host i686-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var
 --infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes
 --enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/24.3.50/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.3.50/site-lisp:/usr/share/emacs/site-lisp
 --without-compress-info --with-crt-dir=/usr/lib/i386-linux-gnu/
 --with-x=yes --with-x-toolkit=gtk3 --with-imagemagick=yes
 CFLAGS='-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2'
 CPPFLAGS='-D_FORTIFY_SOURCE=2' LDFLAGS='-g -Wl,--as-needed
 -znocombreloc''

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Text

Minor modes in effect:
  diff-auto-refine-mode: t
  TeX-PDF-mode: t
  autopair-global-mode: t
  autopair-mode: t
  global-edit-server-edit-mode: t
  override-global-mode: t
  show-paren-mode: t
  delete-selection-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
s SPC t h e SPC o n e SPC t h a t SPC C-d r e t u r 
n s SPC t h e SPC f i e l d SPC t o SPC i n h e r i 
t SPC f r o m SPC <backspace> , SPC b a s e d SPC o 
n SPC a SPC f i e l d M-b M-b M-b M-b M-b M-b M-b M-b 
t a r g e t SPC M-f M-d M-d M-d M-f M-f M-f <backspace> 
t h e SPC o <backspace> s o u r c e M-f SPC a n d SPC 
t h e SPC n e t r y SPC <M-backspace> e n t r y SPC 
t y p e SPC o f SPC t e h SPC s o u r c e . M-b C-b 
C-b C-p C-e C-x C-s C-x # M-x e m a <tab> b u <tab> 
<M-backspace> <M-backspace> r e p <tab> o <tab> <tab> 
r <tab> <return> M a n u a l <M-backspace> C-g C-h 
i u u u m f o n - <backspace> t SPC l o c k <tab> m 
o <tab> <return> 3 b <backspace> <backspace> <backspace> 
<backspace> <backspace> C-t C-t C-t C-t C-t C-t C-t 
C-t C-t C-t C-t C-t C-t C-t C-t C-t C-t C-t C-SPC C-n 
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n 
C-n C-n C-n C-n C-n C-n C-n M-w <C-tab> <return> <return> 
C-y <C-S-iso-lefttab> <C-S-iso-lefttab> <C-tab> <C-tab> 
C-h i <home> C-n C-b C-SPC C-e M-w q <return> <return> 
C-y C-t M-d M-d M-d M-d C-d C-d M-f M-f M-f C-k C-c 
C-g M-x e <backspace> r e p a r <backspace> <backspace> 
o r <tab> <return>

Recent messages:
Package `multiple-cursors-20130226.2138' deleted.
Package `ebib-20130309.145' deleted.
Package `dash-20130225.2203' deleted.
Field contents killed.
Wrote /home/joost/Dropbox/Work/Bibtex/genbib.bib
[mu4e] Retrieving mail...
[mu4e] Indexing... processed 4000, updated 0
[mu4e] Indexing completed; processed 4306, updated 0, cleaned-up 0
Making completion list... [2 times]
Quit

Load-path shadows:
/home/joost/.elpa/ess-20130225.1754/.dir-locals hides /home/joost/.elpa/magit-20130304.2017/.dir-locals
/usr/share/emacs/24.3.50/site-lisp/cmake-data/cmake-mode hides /usr/share/emacs/site-lisp/cmake-mode
~/.emacs.d/custom hides /usr/share/emacs/24.3.50/lisp/custom
~/src/org-mode/contrib/lisp/org-w3m hides /usr/share/emacs/24.3.50/lisp/org/org-w3m
~/src/org-mode/contrib/lisp/org-vm hides /usr/share/emacs/24.3.50/lisp/org/org-vm
~/src/org-mode/contrib/lisp/org-wl hides /usr/share/emacs/24.3.50/lisp/org/org-wl
~/src/org-mode/contrib/lisp/org-mew hides /usr/share/emacs/24.3.50/lisp/org/org-mew
/home/joost/.elpa/ess-20130225.1754/.dir-locals hides /usr/share/emacs/24.3.50/lisp/gnus/.dir-locals

Features:
(shadow emacsbug mc-separate-operations rectangular-region-mode
mc-mark-more mc-cycle-cursors mc-edit-lines multiple-cursors-core
autoload tar-mode url-http url-gw url-cache url-auth url url-proxy
url-privacy url-expand url-methods url-history url-cookie url-domsuf
url-util url-parse url-vars mailcap finder-inf ace-jump-mode jump-char
debug ebib loadhist epa-file gnutls network-stream starttls tls
mailalias qp mail-extr sort parse-time boxquote crm view magit-bisect
magit-key-mode magit diff-mode log-edit pcvs-util add-log compile
re-builder bm expand-region text-mode-expansions org-mode-expansions
latex-mode-expansions expand-region-custom expand-region-core vc-git
reftex-index rect reftex-sel reftex-ref reftex-toc texmathp
writeroom-mode pcmpl-unix cus-edit cus-start cus-load wid-edit misearch
multi-isearch mule-util reftex-cite reftex-parse pandoc-mode bibtex
preview prv-emacs tex-buf reftex-dcr reftex reftex-vars face-remap
adaptive-wrap tex-fold font-latex latex tex-style tex dbus xml latexenc
offlineimap diminish epresent org-latex org-export-latex org-beamer
footnote autopair quail em-unix em-term term disp-table ehelp electric
em-script em-prompt em-ls em-hist em-pred em-glob em-dirs em-cmpl
em-basic em-banner em-alias esh-var esh-io esh-cmd esh-opt esh-ext
esh-proc esh-arg eldoc esh-groups eshell esh-module esh-mode esh-util
ielm pp anti-zenburn-theme edit-server uniquify org-mu4e org-exp ob-exp
org-exp-blocks org-agenda mu4e mu4e-speedbar speedbar sb-image ezimage
dframe mu4e-main mu4e-view epa epg epg-config browse-url mu4e-headers
mu4e-compose mu4e-draft mu4e-actions rfc2368 smtpmail auth-source eieio
gnus-util password-cache sendmail mu4e-mark mu4e-message html2text
mu4e-proc mu4e-utils doc-view jka-compr image-mode dired mu4e-lists
mu4e-about mu4e-vars message rfc822 mml mml-sec mm-decode mm-bodies
mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mailabbrev mail-utils gmm-utils mailheader hl-line mu4e-meta
dictem org-drill org-learn org-id hi-lock org-inlinetask org byte-opt
warnings bytecomp byte-compile cconv ob-tangle ob-ref ob-lob ob-table
org-footnote org-src ob-comint ob-keys org-pcomplete pcomplete comint
ansi-color ring org-list org-faces org-entities org-version
ob-emacs-lisp ob org-compat org-macs ob-eval org-loaddefs format-spec
find-func cal-menu calendar cal-loaddefs yasnippet dropdown-list derived
help-mode cl cm-mode cl-macs gv cl-lib markdown-mode thingatpt noutline
outline windmove swbuff nadvice advice help-fns preview-latex tex-site
auto-loads server edmacro kmacro bind-key easy-mmode paren delsel
ace-jump-mode-autoloads adaptive-wrap-autoloads
anti-zenburn-theme-autoloads autopair-autoloads bm-autoloads
boxquote-autoloads dash-autoloads diminish-autoloads ebib-autoloads
edit-server-autoloads expand-region-autoloads jump-char-autoloads
magit-autoloads multiple-cursors-autoloads offlineimap-autoloads
pandoc-mode-autoloads unfill-autoloads wc-mode-autoloads
writeroom-mode-autoloads info easymenu package time-date tooltip
ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd
fontset image regexp-opt fringe tabulated-list newcomment lisp-mode
register page menu-bar rfn-eshadow timer select scroll-bar mouse
jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer loaddefs button faces cus-face macroexp files text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind inotify
dynamic-setting system-font-setting font-render-setting move-toolbar gtk
x-toolkit x multi-tty emacs)

-- 
Joost Kremers, PhD
University of Göttingen
Institute for German Philology
Käte-Hamburger-Weg 3
37073 Göttingen, Germany




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13917; Package emacs. (Fri, 01 Nov 2019 16:49:02 GMT) Full text and rfc822 format available.

Message #8 received at 13917 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Joost Kremers <joost.kremers <at> phil.uni-goettingen.de>
Cc: 13917 <at> debbugs.gnu.org
Subject: Re: 24.3.50; Elisp manual: Font Lock Mode
Date: Fri, 01 Nov 2019 17:48:11 +0100
Joost Kremers <joost.kremers <at> phil.uni-goettingen.de> writes:

> The Elisp manual, info node "(elisp) Search-based Fontification" states
> the following:
>
> ,----
> | `(MATCHER . FACESPEC)'
> |      In this kind of element, FACESPEC is an expression whose value
> |      specifies the face to use for highlighting.  In the simplest case,
> |      FACESPEC is a Lisp variable (a symbol) whose value is a face name.
> | 
> |           ;; Highlight occurrences of `fubar',
> |           ;; using the face which is the value of `fubar-face'.
> |           ("fubar" . fubar-face)
> | 
> |      However, FACESPEC can also evaluate to a list of this form:
> | 
> |           (face FACE PROP1 VAL1 PROP2 VAL2...)
> | 
> |      to specify the face FACE and various additional text properties to
> |      put on the text that matches.  If you do this, be sure to add the
> |      other text property names that you set in this way to the value of
> |      `font-lock-extra-managed-props' so that the properties will also
> |      be cleared out when they are no longer appropriate.  Alternatively,
> |      you can set the variable `font-lock-unfontify-region-function' to
> |      a function that clears these properties.  *Note Other Font Lock
> |      Variables::.
> `----
>
> However, a font lock entry of the type
>
> ,----
> | (MATCHER . (face FACE PROP1 VAL1 PROP1 VAL2))
> `----
>
> does not actually work. What works is any of the forms:
>
> ,----
> | (MATCHER . (0 (face FACE PROP1 VAL1 PROP1 VAL2)))
> | (MATCHER 0 (face FACE PROP1 VAL1 PROP1 VAL2))
> | (MATCHER (0 (face FACE PROP1 VAL1 PROP1 VAL2)))
> `----
>
> (Where the first two are of course equivalent).

Hm...  is this a bug in the documentation or the code, though?  It seems
like it would be logical for the described syntax to work, doesn't it?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13917; Package emacs. (Mon, 31 May 2021 06:41:02 GMT) Full text and rfc822 format available.

Message #11 received at 13917 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Joost Kremers <joost.kremers <at> phil.uni-goettingen.de>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 13917 <at> debbugs.gnu.org
Subject: Re: bug#13917: 24.3.50; Elisp manual: Font Lock Mode
Date: Mon, 31 May 2021 08:40:42 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

>> However, a font lock entry of the type
>>
>> ,----
>> | (MATCHER . (face FACE PROP1 VAL1 PROP1 VAL2))
>> `----
>>
>> does not actually work. What works is any of the forms:
>>
>> ,----
>> | (MATCHER . (0 (face FACE PROP1 VAL1 PROP1 VAL2)))
>> | (MATCHER 0 (face FACE PROP1 VAL1 PROP1 VAL2))
>> | (MATCHER (0 (face FACE PROP1 VAL1 PROP1 VAL2)))
>> `----
>>
>> (Where the first two are of course equivalent).
>
> Hm...  is this a bug in the documentation or the code, though?  It seems
> like it would be logical for the described syntax to work, doesn't it?

Perhaps Stefan as an opinion; added to the CCs.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13917; Package emacs. (Mon, 31 May 2021 12:54:02 GMT) Full text and rfc822 format available.

Message #14 received at 13917 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 13917 <at> debbugs.gnu.org, Joost Kremers <joost.kremers <at> phil.uni-goettingen.de>
Subject: Re: bug#13917: 24.3.50; Elisp manual: Font Lock Mode
Date: Mon, 31 May 2021 08:52:53 -0400
Lars Ingebrigtsen [2021-05-31 08:40:42] wrote:
> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>>> However, a font lock entry of the type
>>>
>>> ,----
>>> | (MATCHER . (face FACE PROP1 VAL1 PROP1 VAL2))
>>> `----
>>>
>>> does not actually work. What works is any of the forms:
>>>
>>> ,----
>>> | (MATCHER . (0 (face FACE PROP1 VAL1 PROP1 VAL2)))
>>> | (MATCHER 0 (face FACE PROP1 VAL1 PROP1 VAL2))
>>> | (MATCHER (0 (face FACE PROP1 VAL1 PROP1 VAL2)))
>>> `----
>>>
>>> (Where the first two are of course equivalent).
>>
>> Hm...  is this a bug in the documentation or the code, though?  It seems
>> like it would be logical for the described syntax to work, doesn't it?
>
> Perhaps Stefan as an opinion; added to the CCs.

I don't know if there might be some conflict with existing syntax.
Personally I dislike this support for those different syntaxes, it just
makes the doc and the code more complex without any clear benefit.


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13917; Package emacs. (Tue, 01 Jun 2021 05:58:01 GMT) Full text and rfc822 format available.

Message #17 received at 13917 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 13917 <at> debbugs.gnu.org, Joost Kremers <joost.kremers <at> phil.uni-goettingen.de>
Subject: Re: bug#13917: 24.3.50; Elisp manual: Font Lock Mode
Date: Tue, 01 Jun 2021 07:57:42 +0200
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> I don't know if there might be some conflict with existing syntax.
> Personally I dislike this support for those different syntaxes, it just
> makes the doc and the code more complex without any clear benefit.

Right.  So I've just changed the documentation here to reflect what's
actually accepted.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 28.1, send any further explanations to 13917 <at> debbugs.gnu.org and Joost Kremers <joost.kremers <at> phil.uni-goettingen.de> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 01 Jun 2021 05:59:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 29 Jun 2021 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 295 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.