From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: fatiparty--- via Users list for the GNU Emacs text editor Newsgroups: gmane.emacs.help Subject: Computing value from list lengths Date: Fri, 21 Jan 2022 13:19:18 +0100 (CET) Message-ID: Reply-To: fatiparty@tutanota.com Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15608"; mail-complaints-to="usenet@ciao.gmane.io" To: Help Gnu Emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 21 13:21:39 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 1nAsvD-0003s1-3E for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 21 Jan 2022 13:21:39 +0100 Original-Received: from localhost ([::1]:46934 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nAsvB-00078B-MF for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 21 Jan 2022 07:21:37 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:49634) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAst1-00076Z-Pn for help-gnu-emacs@gnu.org; Fri, 21 Jan 2022 07:19:23 -0500 Original-Received: from w1.tutanota.de ([81.3.6.162]:52202) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAssy-0000ZH-9A for help-gnu-emacs@gnu.org; Fri, 21 Jan 2022 07:19:23 -0500 Original-Received: from w3.tutanota.de (unknown [192.168.1.164]) by w1.tutanota.de (Postfix) with ESMTP id C7A14FBF7F9 for ; Fri, 21 Jan 2022 12:19:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1642767558; s=s1; d=tutanota.com; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Content-Transfer-Encoding:Cc:Date:Date:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:Sender; bh=QQB5Y/JlA1yx7wUzEAYWPvGzQmiDL/Gn/VfE+V6TAnQ=; b=QphTbszozQ6lnVMRKl1f+VGxRRiWAEiegGTnDMwiJr7sczIFZGwUr44eL6m3NiIS bYVzRA80EI+a1VbRa3HYnj81G3NVNicxVk+HyfdEK55VUu/Z1LelI6Me0kOF6OWCEbw PQeJuDogSJnMuBKVGYxXvW33/lNVLo9NAcZUeH+JrWClqItNAECGMuBkEUOmazcK3Ak 4Ulj85wz/G0kduiFDPwY7e+HLW7hHgFyDFtmefoIfIJJkhzouBy9aMRuTE8IV4OLPgR bkE7c795zeqltM6U4fPh3Ux2NWrboD0340BMuU7vb2S9w0m8acskzAZ4u77Y1cVenze CFcKcGp8kQ== Received-SPF: pass client-ip=81.3.6.162; envelope-from=fatiparty@tutanota.com; helo=w1.tutanota.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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:135472 Archived-At: I have the following code and want to determine maxdepth automatically from the length of the dark-theme-colours and light-theme-colours (and changing the ahrd coded (dotimes (i 8)). What would be the strategy? (defcustom maxdepth 8 =C2=A0 "Number of faces defined for colouring brace marks. Determines depth at which to cycle through faces again." =C2=A0 :type 'integer =C2=A0 :group 'test) (eval-when-compile =C2=A0 (defmacro colour-typeface () =C2=A0=C2=A0=C2=A0 ( let ( (faces '()) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (dark-th= eme-colours =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [ = "#ff62d4" "#3fdfd0" "#fba849" "#9f80ff" =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "#4fe42f" "#fe6060"= "#4fafff" "#f0dd60" ]) =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 (light-theme-colours =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [ = "#a8007f" "#005f88" "#904200" "#7f10d0" =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "#006800" "#b60000"= "#1f1fce" "#605b00" ]) ) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (dotimes (i 8) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (push =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 `( defface ,(intern (forma= t "depth-%d-face" (1+ i))) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 '( (defa= ult (:inherit richerenkov-base-face)) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 ( ((class color) (background dark)) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 :foreground ,(aref dark-theme-colours=C2=A0 i) ) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 ( ((class color) (background light)) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 :foreground ,(aref light-theme-colours i) )) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ,(format= "Nested delimiter face, depth %d." (1+ i) ) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 :group '= colour-faces ) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 faces)) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 `(progn ,@faces) ) )) (colour-typeface)