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

invalid face: org-level-1 #34

Closed
abzrg opened this issue Jan 24, 2021 · 7 comments
Closed

invalid face: org-level-1 #34

abzrg opened this issue Jan 24, 2021 · 7 comments

Comments

@abzrg
Copy link

abzrg commented Jan 24, 2021

(dolist (face '((org-level-1 . 1.2)
                (org-level-2 . 1.1)
                (org-level-3 . 1.05)
                (org-level-4 . 1.0)
                (org-level-5 . 1.1)
                (org-level-6 . 1.1)
                (org-level-7 . 1.1)
                (org-level-8 . 1.1)))
  (set-face-attribute (car face) nil :font "Cantarell" :weight 'regular :height (cdr face)))

when I evaluate this code, emacs doesn't complain but when I load a new instance of emacs it gives me an error of: error: Invalid face, org-level-1.

emacs version : 27.1, org version: 9.3

@abzrg
Copy link
Author

abzrg commented Jan 25, 2021

Thanks to lawlist on emacs stack exchange we have an solution for the problems like this. As I'm new to emacs I just fixed it with doing:

(with-eval-after-load 'org-faces
;; Increase the size of various headings
(set-face-attribute 'org-document-title nil :font "Cantarell" :weight 'bold :height 1.3)
(dolist (face '((org-level-1 . 1.2)
                (org-level-2 . 1.1)
                (org-level-3 . 1.05)
                (org-level-4 . 1.0)
                (org-level-5 . 1.1)
                (org-level-6 . 1.1)
                (org-level-7 . 1.1)
                (org-level-8 . 1.1)))
  (set-face-attribute (car face) nil :font "Cantarell" :weight 'regular :height (cdr face)))

;; Ensure that anything that should be fixed-pitch in Org files appears that way
(set-face-attribute 'org-block nil    :foreground nil :inherit 'fixed-pitch)
(set-face-attribute 'org-table nil    :inherit 'fixed-pitch)
(set-face-attribute 'org-formula nil  :inherit 'fixed-pitch)
(set-face-attribute 'org-code nil     :inherit '(shadow fixed-pitch))
(set-face-attribute 'org-table nil    :inherit '(shadow fixed-pitch))
(set-face-attribute 'org-verbatim nil :inherit '(shadow fixed-pitch))
(set-face-attribute 'org-special-keyword nil :inherit '(font-lock-comment-face fixed-pitch))
(set-face-attribute 'org-meta-line nil :inherit '(font-lock-comment-face fixed-pitch))
(set-face-attribute 'org-checkbox nil  :inherit 'fixed-pitch))

basically I just wrapped all the "set-face-attributes" that caused me trouble, with (with-eval-after-load 'org-faces <codes>).

@abzrg abzrg closed this as completed Jan 25, 2021
@daviwil
Copy link
Owner

daviwil commented Feb 3, 2021

Hey @reverseila, thanks for sharing the solution! Would you be interesting in submitting a PR to this repo to fix it? If you don't have time, I'll take care of it.

@abzrg
Copy link
Author

abzrg commented Feb 16, 2021

hey @daviwil, sorry for late response. I don't know how to do that. I'm learning git.

@daviwil
Copy link
Owner

daviwil commented Feb 16, 2021

No problem, I'll send it. Thanks again for pointing this out!

@abzrg
Copy link
Author

abzrg commented Feb 16, 2021

my pleasure!

@Skalas
Copy link

Skalas commented Apr 3, 2021

I can do this! :) let me fork this and I'll set up the pull request. (it is still unfixed as I can see)

Skalas added a commit to Skalas/emacs-from-scratch that referenced this issue Apr 3, 2021
@Skalas
Copy link

Skalas commented Apr 3, 2021

It is fixed on #53

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

3 participants