From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: suzee Newsgroups: gmane.emacs.help Subject: Problem with defining a background color by variable Date: Sun, 12 Jun 2022 10:24:30 +0200 Message-ID: <0916306f-7e89-426d-5b05-631e5b8fa522@mailbox.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17216"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 12 10:26:19 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o0IvK-0004HM-Q5 for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 12 Jun 2022 10:26:18 +0200 Original-Received: from localhost ([::1]:51308 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o0IvJ-0008K9-Qn for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 12 Jun 2022 04:26:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44630) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o0Ito-0008J3-G7 for help-gnu-emacs@gnu.org; Sun, 12 Jun 2022 04:24:45 -0400 Original-Received: from mout-p-201.mailbox.org ([2001:67c:2050:0:465::201]:45990) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1o0Itl-00011j-W4 for help-gnu-emacs@gnu.org; Sun, 12 Jun 2022 04:24:43 -0400 Original-Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4LLSRN5w30z9sWS for ; Sun, 12 Jun 2022 10:24:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1655022272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vtyzBToKlXfIVX5BGhMg8sBAjjLTom/5zz/h6uzmvTA=; b=bSLeiaqIHc7sbR2sFdLyd8prvyP7FC7f0/Tv5pKOprte+TYHmWO/gmBbpRFPIOPJUhtIFT fFBk4zWq4PfqvpmgQqdDalbmnH/+owy5LYtR84lGAmaLSLQf3QCmhh0xe21YHqpcesfPG6 Atql+QkrHufebEuoXm9w01/QDRvwx23uC5tM/xHtDjEd1qyIKtvown1B6+baKI8G2qMm+M KQeARZWy+OnrHyR8CFd2GgDlle80EExFz4ElyHKR+6jxDCwf+96yyi2uRvg2NFew/S8OXR hHTSbjsxgfx8acJSIMGtSUSi4iwXD2dP3+O5BOsCVXq4orOBSIO6TFaEnG10cg== Content-Language: en-US X-MBO-RS-META: 4yca6487dd5znogjtriofads9w1r68as X-MBO-RS-ID: 3cb6462637b7430ef88 X-Rspamd-Queue-Id: 4LLSRN5w30z9sWS Received-SPF: pass client-ip=2001:67c:2050:0:465::201; envelope-from=vronk+cllbrtn.mcs@mailbox.org; helo=mout-p-201.mailbox.org X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FROM_LOCAL_NOVOWEL=0.5, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:137727 Archived-At: Hello, I want to change the background color of code (and other) blocks in org-mode as proposed here: https://orgmode.org/worg/org-contrib/babel/examples/fontify-src-code-blocks.html#org4218fd0 I use emacs with a theme (gruvbox) and when I literally use the proposed code (defface org-block-background '((t (:background "#FFFFEA"))) "Face used for the source block background.") it does work. But I want to use a color, which is derived (made darker or lighter) from another color by an emacs lisp function, so basically I want something like this: (defvar mycolor (color-lighten-name "navy" 20)) (defface org-block-background '((t (:background mycolor))) "Face used for the source block background.") However, when I try this, I get the following error when debugging: Debugger entered--Lisp error: (wrong-type-argument stringp mycolor) internal-set-lisp-face-attribute(org-block-background :background mycolor #) set-face-attribute(org-block-background # :background mycolor) [...] Does someone know why it fails? Is it not possible to use a variable for the color there? What can I do to make it work or to achieve my goal in a different way? I searched the docs and manuals, but didn't find a solution. I also checked the type of the variable 'mycolor' and it is in fact a string and 'stringp mycolor' returns t, so I don't understand the error message. But my knowledge of elisp is very sketchy, so I might miss something very basic. Thanks suzee