0

I am trying to set face for org blocks to invisible for certain folders, so that it is nicer to read the org files with code. I am using .dir-locals.el file.

So, this example for the begin line works:

((org-mode . ((eval . (face-remap-add-relative 'org-block-begin-line '(:foreground "#282c34"))))))

But the following doesn't seem to work. Although, when I evaluate the face-attribute part it gives the above colour string.

((org-mode . ((eval . (face-remap-add-relative 'org-block-begin-line '(:foreground (face-attribute 'default :background)))))))

I've tried quoting the face-attribute function, didn't help.

Arktik
  • 932
  • 4
  • 15
  • 1
    You probably need to use `backquote`: `` ;;`(:background ,(face-attribute 'default :background) ``. See [Backquote](https://www.gnu.org/software/emacs/manual/html_node/elisp/Backquote.html) (aargh - I can't remember how to quote the backquote...) – NickD Mar 09 '23 at 17:46
  • Yep. That worked. I have seen the commas around, never really new what they do. :). Thanks! – Arktik Mar 09 '23 at 18:30
  • 1
    There are 58 other questions linked to the one I linked to above, that is canonically used to mark duplicates for this problem. Even though they are all duplicates (in the sense that for all of them the answer is `backquote`), they all appear at first glance to be different - and yet they are not. This one is another manifestation of the same problem. – NickD Mar 09 '23 at 19:19
  • Yes, both the doc link and the post link answered my question. Thanks. – Arktik Mar 09 '23 at 19:58

0 Answers0