unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* font-lock-reference-face no longer defined?
@ 2022-09-16 17:28 T.V Raman
  2022-09-16 17:50 ` Daniel Martín
  0 siblings, 1 reply; 9+ messages in thread
From: T.V Raman @ 2022-09-16 17:28 UTC (permalink / raw)
  To: emacs-devel

Background:

There are times that I'm  seeing errors from jit-lock re
font-lock-reference-face not being defined -- have seen it while
working in elisp files, but dont have a reliable repro case.

Doing  a recursive grep in the Emacs sources @HEAD, I see numerous
references to font-lock-reference-face but I indeed dont see it
defined anywhere. Confused ...


-- 

Thanks,

--Raman(I Search, I Find, I Misplace, I Research)
♉ Id: kg:/m/0285kf1  🦮

-- 

Thanks,

--Raman(I Search, I Find, I Misplace, I Research)
♉ Id: kg:/m/0285kf1  🦮



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

* Re: font-lock-reference-face no longer defined?
  2022-09-16 17:28 font-lock-reference-face no longer defined? T.V Raman
@ 2022-09-16 17:50 ` Daniel Martín
  2022-09-16 18:00   ` T.V Raman
  2022-09-16 18:26   ` Stefan Monnier
  0 siblings, 2 replies; 9+ messages in thread
From: Daniel Martín @ 2022-09-16 17:50 UTC (permalink / raw)
  To: T.V Raman; +Cc: emacs-devel

"T.V Raman" <raman@google.com> writes:

> Background:
>
> There are times that I'm  seeing errors from jit-lock re
> font-lock-reference-face not being defined -- have seen it while
> working in elisp files, but dont have a reliable repro case.
>
> Doing  a recursive grep in the Emacs sources @HEAD, I see numerous
> references to font-lock-reference-face but I indeed dont see it
> defined anywhere. Confused ...

It was an obsolete alias since Emacs 20.3 and was removed by this
commit:

commit 107f832577123ea7ebe867cba55601d0142f546f
Author: Stefan Kangas <stefan@marxist.se>
Date:   Sun Jul 31 11:33:42 2022 +0200

    Delete additional items obsolete since 20, 21 and 22
    
    * lisp/font-lock.el (font-lock-reference-face): Delete variable
    alias obsolete since 20.3.
    * lisp/progmodes/cc-cmds.el (c-toggle-auto-state): Delete alias
    obsolete since 22.1.
    * lisp/replace.el (query-replace-regexp-eval): Delete function
    obsolete since 22.1.
    (replace-count, replace-re-search-function): Doc fixes; adjust for
    above deleted function.

Code should use font-lock-constant-face instead.  I'm also confused
because I still see references to the old variable name in the Emacs
codebase.



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

* Re: font-lock-reference-face no longer defined?
  2022-09-16 17:50 ` Daniel Martín
@ 2022-09-16 18:00   ` T.V Raman
  2022-09-16 18:26   ` Stefan Monnier
  1 sibling, 0 replies; 9+ messages in thread
From: T.V Raman @ 2022-09-16 18:00 UTC (permalink / raw)
  To: mardani29; +Cc: raman, emacs-devel

thanks for confirming -- the right fix might be to purge those
reference, or add the equivalent of a defalias -- at present, the
somewhat random errors from jit-lock are very disruptive.

Daniel Martín writes:
 > "T.V Raman" <raman@google.com> writes:
 > 
 > > Background:
 > >
 > > There are times that I'm  seeing errors from jit-lock re
 > > font-lock-reference-face not being defined -- have seen it while
 > > working in elisp files, but dont have a reliable repro case.
 > >
 > > Doing  a recursive grep in the Emacs sources @HEAD, I see numerous
 > > references to font-lock-reference-face but I indeed dont see it
 > > defined anywhere. Confused ...
 > 
 > It was an obsolete alias since Emacs 20.3 and was removed by this
 > commit:
 > 
 > commit 107f832577123ea7ebe867cba55601d0142f546f
 > Author: Stefan Kangas <stefan@marxist.se>
 > Date:   Sun Jul 31 11:33:42 2022 +0200
 > 
 >     Delete additional items obsolete since 20, 21 and 22
 >     
 >     * lisp/font-lock.el (font-lock-reference-face): Delete variable
 >     alias obsolete since 20.3.
 >     * lisp/progmodes/cc-cmds.el (c-toggle-auto-state): Delete alias
 >     obsolete since 22.1.
 >     * lisp/replace.el (query-replace-regexp-eval): Delete function
 >     obsolete since 22.1.
 >     (replace-count, replace-re-search-function): Doc fixes; adjust for
 >     above deleted function.
 > 
 > Code should use font-lock-constant-face instead.  I'm also confused
 > because I still see references to the old variable name in the Emacs
 > codebase.

-- 

Thanks,

--Raman(I Search, I Find, I Misplace, I Research)
♉ Id: kg:/m/0285kf1  🦮

--

Thanks,

--Raman(I Search, I Find, I Misplace, I Research)
♉ Id: kg:/m/0285kf1  🦮



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

* Re: font-lock-reference-face no longer defined?
  2022-09-16 17:50 ` Daniel Martín
  2022-09-16 18:00   ` T.V Raman
@ 2022-09-16 18:26   ` Stefan Monnier
  2022-09-16 18:32     ` T.V Raman
  2022-09-16 19:01     ` Alan Mackenzie
  1 sibling, 2 replies; 9+ messages in thread
From: Stefan Monnier @ 2022-09-16 18:26 UTC (permalink / raw)
  To: Daniel Martín; +Cc: T.V Raman, emacs-devel, Alan Mackenzie

> It was an obsolete alias since Emacs 20.3 and was removed by this
> commit:
[...]
> Code should use font-lock-constant-face instead.  I'm also confused
> because I still see references to the old variable name in the Emacs
> codebase.

There was one reference left in `lisp/cedet/semantic/grammar.el` which
I just fixed, the rest is all in CC-mode, which I'll leave to Alan.


        Stefan




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

* Re: font-lock-reference-face no longer defined?
  2022-09-16 18:26   ` Stefan Monnier
@ 2022-09-16 18:32     ` T.V Raman
  2022-09-16 18:51       ` Stefan Monnier
  2022-09-16 19:01     ` Alan Mackenzie
  1 sibling, 1 reply; 9+ messages in thread
From: T.V Raman @ 2022-09-16 18:32 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Daniel Martín, emacs-devel, Alan Mackenzie

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=gb18030, Size: 2075 bytes --]

Stefan Monnier <monnier@iro.umontreal.ca> writes:
For completeness:

After a git pull and running rgrep shows  a few more places:

-*- mode: rg; default-directory: "~/sourceforge/emacs/" -*-
rg started at Fri Sep 16 11:30:17

/home/raman/.cargo/bin/rg --color=always --colors=match:fg:red --colors=path:fg:magenta --colors=line:fg:green --colors=column:none -n --column --type-add=gyp\:\*.gyp --type-add=gyp\:\*.gypi -i --heading --no-config --type=elisp -e font-lock-reference-face

File: lisp/progmodes/cperl-mode.el
6060   8 ;; 		  font-lock-reference-face
6067   8 ;; 		  font-lock-reference-face

File: lisp/progmodes/cc-fonts.el
  32  19 ;;    Emacs), or `font-lock-reference-face'.
  40  36 ;;    `font-lock-builtin-face' or `font-lock-reference-face' in Emacs.
 102  21 (cc-bytecomp-defvar font-lock-reference-face) ; For Emacs 29
 117  24 	((and (c-face-name-p 'font-lock-reference-face)
 118  12 	      (eq font-lock-reference-face 'font-lock-reference-face))
 119   4 	 'font-lock-reference-face)
 137   4 	 'font-lock-reference-face)))
 148  29    (if (and (c-face-name-p 'font-lock-reference-face)
 149  10 	    (eq font-lock-reference-face 'font-lock-reference-face))
 153   9        'font-lock-reference-face

File: etc/themes/deeper-blue-theme.el
  74   6    `(font-lock-reference-face ((,class (:foreground "LightCoral"))))

File: etc/themes/whiteboard-theme.el
  54   6    `(font-lock-reference-face ((,class (:foreground "salmon"))))

rg finished (16 matches found) at Fri Sep 16 11:30:17


>> It was an obsolete alias since Emacs 20.3 and was removed by this
>> commit:
> [...]
>> Code should use font-lock-constant-face instead.  I'm also confused
>> because I still see references to the old variable name in the Emacs
>> codebase.
>
> There was one reference left in `lisp/cedet/semantic/grammar.el` which
> I just fixed, the rest is all in CC-mode, which I'll leave to Alan.
>
>
>         Stefan
>

-- 

Thanks,

--Raman(I Search, I Find, I Misplace, I Research)
7©4 Id: kg:/m/0285kf1  •0Ü8



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

* Re: font-lock-reference-face no longer defined?
  2022-09-16 18:32     ` T.V Raman
@ 2022-09-16 18:51       ` Stefan Monnier
  2022-09-16 19:29         ` Stefan Kangas
  2022-09-16 20:46         ` T.V Raman
  0 siblings, 2 replies; 9+ messages in thread
From: Stefan Monnier @ 2022-09-16 18:51 UTC (permalink / raw)
  To: T.V Raman; +Cc: Daniel Martín, emacs-devel, Alan Mackenzie

> File: lisp/progmodes/cperl-mode.el
> 6060   8 ;; 		  font-lock-reference-face
> 6067   8 ;; 		  font-lock-reference-face

Notice: inside a comment (and AFAIK that commented code doesn't actually
use that face, it just says what to do in case that face shows up).

> File: lisp/progmodes/cc-fonts.el

That's the CC-mode I was referring to.

> File: etc/themes/deeper-blue-theme.el
>   74   6    `(font-lock-reference-face ((,class (:foreground "LightCoral"))))
>
> File: etc/themes/whiteboard-theme.el
>   54   6    `(font-lock-reference-face ((,class (:foreground "salmon"))))

These two themes just define the face, i.e. say what to do in case some
third party uses it.  Notice how `whiteboard-theme` also defines the
appearance of `realgud-*` faces, which aren't defined in Emacs.
We could remove those "references", but I see no urgency.


        Stefan




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

* Re: font-lock-reference-face no longer defined?
  2022-09-16 18:26   ` Stefan Monnier
  2022-09-16 18:32     ` T.V Raman
@ 2022-09-16 19:01     ` Alan Mackenzie
  1 sibling, 0 replies; 9+ messages in thread
From: Alan Mackenzie @ 2022-09-16 19:01 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Daniel Martín, T.V Raman, emacs-devel

Hello, Stefan.

On Fri, Sep 16, 2022 at 14:26:35 -0400, Stefan Monnier wrote:
> > It was an obsolete alias since Emacs 20.3 and was removed by this
> > commit:
> [...]
> > Code should use font-lock-constant-face instead.  I'm also confused
> > because I still see references to the old variable name in the Emacs
> > codebase.

> There was one reference left in `lisp/cedet/semantic/grammar.el` which
> I just fixed, the rest is all in CC-mode, which I'll leave to Alan.

I've been sorting this out the last few days, and it should be OK now.
It's perhaps more complicated than it need be.

The way CC Mode works with this face is that when the test suite is
running, the test suite creates font-lock-reference-face (along with a
few others) if it doesn't already exist.  (It doesn't in Emacs 29.)
c-reference-face-name is then set to (the artificial)
font-lock-reference-face.

On the other hand, when Emacs 29 is running normally, f-l-ref-face
doesn't exist, so c-reference-face-name is set to
font-lock-constant-face, as is recommended.

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).



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

* Re: font-lock-reference-face no longer defined?
  2022-09-16 18:51       ` Stefan Monnier
@ 2022-09-16 19:29         ` Stefan Kangas
  2022-09-16 20:46         ` T.V Raman
  1 sibling, 0 replies; 9+ messages in thread
From: Stefan Kangas @ 2022-09-16 19:29 UTC (permalink / raw)
  To: Stefan Monnier, T.V Raman; +Cc: Daniel Martín, emacs-devel, Alan Mackenzie

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> File: lisp/progmodes/cperl-mode.el
>> 6060   8 ;; 		  font-lock-reference-face
>> 6067   8 ;; 		  font-lock-reference-face
>
> Notice: inside a comment (and AFAIK that commented code doesn't actually
> use that face, it just says what to do in case that face shows up).

I just deleted that.  I took a closer look, and it turns out that we
already have a `cperl-ps-print-init' in cperl-mode.el that does the same
thing.



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

* Re: font-lock-reference-face no longer defined?
  2022-09-16 18:51       ` Stefan Monnier
  2022-09-16 19:29         ` Stefan Kangas
@ 2022-09-16 20:46         ` T.V Raman
  1 sibling, 0 replies; 9+ messages in thread
From: T.V Raman @ 2022-09-16 20:46 UTC (permalink / raw)
  To: monnier; +Cc: raman, mardani29, emacs-devel, acm

thx, apologies for the noise, rgrep didn't tell me those were  in
comments, and I was too lazy to check;-)



Stefan Monnier writes:
 > > File: lisp/progmodes/cperl-mode.el
 > > 6060   8 ;; 		  font-lock-reference-face
 > > 6067   8 ;; 		  font-lock-reference-face
 > 
 > Notice: inside a comment (and AFAIK that commented code doesn't actually
 > use that face, it just says what to do in case that face shows up).
 > 
 > > File: lisp/progmodes/cc-fonts.el
 > 
 > That's the CC-mode I was referring to.
 > 
 > > File: etc/themes/deeper-blue-theme.el
 > >   74   6    `(font-lock-reference-face ((,class (:foreground "LightCoral"))))
 > >
 > > File: etc/themes/whiteboard-theme.el
 > >   54   6    `(font-lock-reference-face ((,class (:foreground "salmon"))))
 > 
 > These two themes just define the face, i.e. say what to do in case some
 > third party uses it.  Notice how `whiteboard-theme` also defines the
 > appearance of `realgud-*` faces, which aren't defined in Emacs.
 > We could remove those "references", but I see no urgency.
 > 
 > 
 >         Stefan

-- 

Thanks,

--Raman(I Search, I Find, I Misplace, I Research)
♉ Id: kg:/m/0285kf1  🦮

--

Thanks,

--Raman(I Search, I Find, I Misplace, I Research)
♉ Id: kg:/m/0285kf1  🦮



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

end of thread, other threads:[~2022-09-16 20:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-16 17:28 font-lock-reference-face no longer defined? T.V Raman
2022-09-16 17:50 ` Daniel Martín
2022-09-16 18:00   ` T.V Raman
2022-09-16 18:26   ` Stefan Monnier
2022-09-16 18:32     ` T.V Raman
2022-09-16 18:51       ` Stefan Monnier
2022-09-16 19:29         ` Stefan Kangas
2022-09-16 20:46         ` T.V Raman
2022-09-16 19:01     ` Alan Mackenzie

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