Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect face inheritance? #147

Closed
DamienCassou opened this issue Mar 8, 2024 · 2 comments
Closed

Respect face inheritance? #147

DamienCassou opened this issue Mar 8, 2024 · 2 comments

Comments

@DamienCassou
Copy link
Contributor

Hi,

js2-mode which indirectly derives from prog-mode defines a face js2-jsdoc-value that modus-theme makes inherit from font-lock-comment-face (see below for the complete definition).

Because jinx-include-faces specifies that font-lock-comment-face of prog-mode should be included, I would expect that js2-jsdoc-value to be included in jinx analyses. But it's not: jinx--face-ignored-p searches faces ignoring inheritance.

           Family: unspecified
          Foundry: unspecified
            Width: unspecified
           Height: unspecified
           Weight: normal
            Slant: unspecified
       Foreground: unspecified
DistantForeground: unspecified
       Background: unspecified
        Underline: unspecified
         Overline: unspecified
   Strike-through: unspecified
              Box: unspecified
          Inverse: unspecified
          Stipple: unspecified
             Font: unspecified
          Fontset: unspecified
           Extend: unspecified
          Inherit: (font-lock-constant-face font-lock-comment-face)
@minad
Copy link
Owner

minad commented Mar 8, 2024

Hi, traversing the face inheritance hierarchy is not currently done in Jinx since I suspect that it will be less efficient. Also it may lead to false positives. You can add the respective face explicitly to the face exclusion list.

@minad minad closed this as not planned Won't fix, can't repro, duplicate, stale Mar 8, 2024
@DamienCassou
Copy link
Contributor Author

DamienCassou commented Mar 8, 2024

You can add the respective face explicitly to the face exclusion list

I think you meant "inclusion" list instead. That's what I'm currently doing.

it may lead to false positives

good point.

I suspect that it will be less efficient

most probably yes. If one day you change your mind and you want to do it anyway it could be possible to make it fast by caching the result of the inheritance lookup into jinx--include-faces (if the lookup found a matching face) or jinx--exclude-faces otherwise. This way, the lookup is only done once per face: this should make the algorithm fast enough if the buffer doesn't use too many different faces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants