unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Emacs 23.3 stops font-lock when have long face name
@ 2015-11-25 12:30 Wilson Snyder
  2015-11-25 17:40 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Wilson Snyder @ 2015-11-25 12:30 UTC (permalink / raw)
  To: emacs-devel


I'm trying to fix a font-lock issue with long face names
reported against Emacs 23.3, which I've confirmed is fixed
in Emacs 25.

There's a keyword list:

  (setq verilog-font-lock-keywords
     ....
     (cons (concat "\\<\\(" verilog-font-grouping-keywords "\\)\\>")
	   'verilog-font-lock-fixme-face)

this works correctly.  Changing the face name used to 

           'verilog-font-lock-fixmefixmefixmefixmefixmefixmefixme-face)

which has an identical face definition as the shorter name,
makes the fontification break - font-lock simply stops
highlighting using this face half way through the smallish
buffer, but continues using other (shorter) face names.

This is not affected by font-lock-maximum-size.

Can anyone please suggest what version this was fixed and
suggest a workaround for the older Emacsen?

I would prefer not to rename the long face's name (really
it's verilog-font-grouping-keywords-face) since that name
has been stable for several versions of Emacs and may be in
user's customizations.

Thanks



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

* Re: Emacs 23.3 stops font-lock when have long face name
  2015-11-25 12:30 Emacs 23.3 stops font-lock when have long face name Wilson Snyder
@ 2015-11-25 17:40 ` Eli Zaretskii
  2015-11-25 21:09 ` Stefan Monnier
  2015-11-26 14:13 ` Wilson Snyder
  2 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2015-11-25 17:40 UTC (permalink / raw)
  To: Wilson Snyder; +Cc: emacs-devel

> From: wsnyder@wsnyder.org (Wilson Snyder)
> Date: Wed, 25 Nov 2015 07:30:41 -0500
> 
> I'm trying to fix a font-lock issue with long face names
> reported against Emacs 23.3, which I've confirmed is fixed
> in Emacs 25.
> 
> There's a keyword list:
> 
>   (setq verilog-font-lock-keywords
>      ....
>      (cons (concat "\\<\\(" verilog-font-grouping-keywords "\\)\\>")
> 	   'verilog-font-lock-fixme-face)
> 
> this works correctly.  Changing the face name used to 
> 
>            'verilog-font-lock-fixmefixmefixmefixmefixmefixmefixme-face)
> 
> which has an identical face definition as the shorter name,
> makes the fontification break - font-lock simply stops
> highlighting using this face half way through the smallish
> buffer, but continues using other (shorter) face names.
> 
> This is not affected by font-lock-maximum-size.
> 
> Can anyone please suggest what version this was fixed and
> suggest a workaround for the older Emacsen?

Can you post a minimal file (or files) required to reproduce this, and
a reproducible recipe starting from "emacs -Q"?

Thanks.



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

* Re: Emacs 23.3 stops font-lock when have long face name
  2015-11-25 12:30 Emacs 23.3 stops font-lock when have long face name Wilson Snyder
  2015-11-25 17:40 ` Eli Zaretskii
@ 2015-11-25 21:09 ` Stefan Monnier
  2015-11-26 14:13 ` Wilson Snyder
  2 siblings, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2015-11-25 21:09 UTC (permalink / raw)
  To: emacs-devel

>   (setq verilog-font-lock-keywords
>      ....
>      (cons (concat "\\<\\(" verilog-font-grouping-keywords "\\)\\>")
> 	   'verilog-font-lock-fixme-face)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This is not used as a face name, but as an Elisp expression whose
evaluation returns a face name.  Hysterical raisins and all.

I something like

      (cons (concat "\\<\\(" verilog-font-grouping-keywords "\\)\\>")
 	   ''verilog-font-lock-fixme-face)

or better yet

      `(,(concat "\\<\\(" verilog-font-grouping-keywords "\\)\\>")
 	(0 'verilog-font-lock-fixme-face))


-- Stefan




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

* Re: Emacs 23.3 stops font-lock when have long face name
  2015-11-25 12:30 Emacs 23.3 stops font-lock when have long face name Wilson Snyder
  2015-11-25 17:40 ` Eli Zaretskii
  2015-11-25 21:09 ` Stefan Monnier
@ 2015-11-26 14:13 ` Wilson Snyder
  2015-11-30 16:07   ` Eli Zaretskii
  2 siblings, 1 reply; 5+ messages in thread
From: Wilson Snyder @ 2015-11-26 14:13 UTC (permalink / raw)
  To: emacs-devel

> I'm trying to fix a font-lock issue with long face names
> reported against Emacs 23.3, which I've confirmed is fixed
> in Emacs 25.
>
>...
>
> This is not affected by font-lock-maximum-size.
>
> Can anyone please suggest what version this was fixed and
> suggest a workaround for the older Emacsen?
>
> I would prefer not to rename the long face's name (really
> it's verilog-font-grouping-keywords-face) since that name
> has been stable for several versions of Emacs and may be in
> user's customizations.

A very small tarball showing this issue is at
http://www.veripool.org/attachments/download/703/test.tgz

To run this, using Emacs 24.3 (and 23.3 and probably others but not 25.0),
extract and type ./test.sh

You'll see the first four "new" keywords are highlighted. Later ones are
incorrectly not highlighted.

If you then edit test.el to change
v-font-long-name-here-here-here-here-face to v-font-short-face, which has
an identical definition, you'll see the fontification works correctly.




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

* Re: Emacs 23.3 stops font-lock when have long face name
  2015-11-26 14:13 ` Wilson Snyder
@ 2015-11-30 16:07   ` Eli Zaretskii
  0 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2015-11-30 16:07 UTC (permalink / raw)
  To: Wilson Snyder; +Cc: emacs-devel

> Date: Thu, 26 Nov 2015 09:13:18 -0500
> From: "Wilson Snyder" <wsnyder@wsnyder.org>
> 
> > Can anyone please suggest what version this was fixed and
> > suggest a workaround for the older Emacsen?
> >
> > I would prefer not to rename the long face's name (really
> > it's verilog-font-grouping-keywords-face) since that name
> > has been stable for several versions of Emacs and may be in
> > user's customizations.
> 
> A very small tarball showing this issue is at
> http://www.veripool.org/attachments/download/703/test.tgz
> 
> To run this, using Emacs 24.3 (and 23.3 and probably others but not 25.0),
> extract and type ./test.sh
> 
> You'll see the first four "new" keywords are highlighted. Later ones are
> incorrectly not highlighted.
> 
> If you then edit test.el to change
> v-font-long-name-here-here-here-here-face to v-font-short-face, which has
> an identical definition, you'll see the fontification works correctly.

Thanks for the reproducible test case, and sorry for the long delay.

The problem with this face name has nothing to do with its length.  It
has to do with the fact that the face and the corresponding variable
have similar but different names:

  (defvar v-font-very-long-name-here-here-here-here-face
    'v-font-long-name-here-here-here-here-face
    "x")
  (defface v-font-long-name-here-here-here-here-face

See the difference?  The face name begins with "v-font-very", but the
variable name (name, not value) lacks the "very" part.

This is what causes the problem: you will see error messages from
redisplay in the *Messages* buffer complaining about a void variable.

Rename the variable thusly:

  (defvar v-font-long-name-here-here-here-here-face
    'v-font-long-name-here-here-here-here-face
    "x")

and the problem will disappear in Emacs 24.  So there's your
workaround.

HTH



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

end of thread, other threads:[~2015-11-30 16:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-25 12:30 Emacs 23.3 stops font-lock when have long face name Wilson Snyder
2015-11-25 17:40 ` Eli Zaretskii
2015-11-25 21:09 ` Stefan Monnier
2015-11-26 14:13 ` Wilson Snyder
2015-11-30 16:07   ` Eli Zaretskii

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