1

In my config file i have the following lines to fix faces for Scala-mode:

(make-face-bold scala-font-lock:lazy-face)
(make-face-bold scala-font-lock:final-face)
(make-face-bold scala-font-lock:private-face)
(make-face-bold scala-font-lock:implicit-face)
(make-face-bold scala-font-lock:abstract-face)
(make-face-bold scala-font-lock:override-face)
(make-face-bold scala-font-lock:sealed-face)

That i would really like to simplify to this:

(mapc
  (lambda (kw) (make-face-bold (make-symbol (format "scala-font-lock:%s-face" kw))))
  '("final" "private" "implicit" "abstract" "override" "sealed" "lazy"))

But it complains with (error "Invalid face" scala-font-lock:final-face). How can i make it work, i.e refer to the face using constructed string?

4

(intern "name") returns the interned symbol name

make-symbol returns a new uninterned symbol, which is entirely distinct from the symbol with the face properties.

Refer to C-hig (elisp) Creating Symbols RET

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.