From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: goncholden Newsgroups: gmane.emacs.help Subject: Re: face-remap-add-relative versus set-face-attribute Date: Sun, 13 Feb 2022 05:06:24 +0000 Message-ID: References: <87a6evvax9.fsf@zoho.eu> <87wnhzbil6.fsf@zoho.eu> <87sfsnbhf7.fsf@zoho.eu> <87leyfbf0l.fsf@zoho.eu> Reply-To: goncholden 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="35169"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Emanuel Berg Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 13 06:08:13 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 1nJ77M-00090g-VD for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 13 Feb 2022 06:08:12 +0100 Original-Received: from localhost ([::1]:57990 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nJ77L-0006CT-Dj for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 13 Feb 2022 00:08:11 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:59496) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJ75j-00069E-HY for help-gnu-emacs@gnu.org; Sun, 13 Feb 2022 00:06:31 -0500 Original-Received: from mail-40137.protonmail.ch ([185.70.40.137]:59657) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJ75h-00034N-1r for help-gnu-emacs@gnu.org; Sun, 13 Feb 2022 00:06:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1644728786; bh=D3XYMRB5Nf+sgdNFh2MGVOFoDMKfe4gYx3HStCPiwvc=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID; b=cm5j3guGEidw2bA4Lj21JPmgpvbdyfUd/OWNjN0vo6wmOQvQuWEzFQmM/IYey+1AX FBM/WvljvPBE9S9CK+AnJkHtxSJWcKuqRsipWGjN4idGmqVlOrVWH2PTP3w7NtzXg6 DnS+CnKXZQfnLVeLQGl+f+1THcfLmBMhfiKWxzyimso66K+G07ISPe347qtec+MEAL NAPt9kRntfUFnC77WHKYtw7nHIAd/YDz5XQwp0VtabFEdExR8LqP2XY1Fnq2dl5MUQ y2hcavWp5bFYExsxMwRtociReIn/ry/HvUCDQYXLGE1xoVfQmgEIxw71xCIOJpfB7w comIIQwfckONQ== In-Reply-To: <87leyfbf0l.fsf@zoho.eu> Received-SPF: pass client-ip=185.70.40.137; envelope-from=goncholden@protonmail.com; helo=mail-40137.protonmail.ch 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, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-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:135927 Archived-At: ------- Original Message ------- On Sunday, February 13th, 2022 at 3:51 AM, Emanuel Berg via Users list for = the GNU Emacs text editor wrote: > goncholden wrote: > > > You have to evaluate it to find out what it does ... > > The beginning (characters ;; are red), the rest is another > > colour I had set up. Should one also colourise > > the delimiters? > I want them the same color, so I copy the color of > font-lock-comment-face to font-lock-comment-delimiter-face. I am a little stuck here (defvar richkov-annotation-contrast 2 "Sets the colour contrast (against background) for comments.") (defvar richkov-annotation-chroma '( (dark . ((low . "#8300E0") (mid . "#AA33FF") (high . "#C370FF"))) (light . ((low . "#C16BFF") (mid . "#AA33FF") (high . "#8000DB"))) ) "Colour contrast for comments, indigo on dark and light background.") (defun richkov-annotation-typeface (chroma) "Set the foreground colour for comments. CHROMA Intensity Key used for setting colour of comments ." (message "richkov-annotation-typeface ") (let* ( (colors richkov-annotation-chroma) (levels (alist-get (frame-parameter nil 'background-mode) colors)) ) (face-remap-add-relative 'font-lock-comment-face `(:foreground ,(alist-get chroma levels))) (message "richkov-annotation: %s contrast" chroma)) ) (defun richkov-annotation-low-contrast () (when richkov-minor-mode (richkov-annotation-typeface 'low))) ;;;###autoload (define-minor-mode richkov-minor-mode "Colour Brace Marks according to their depth." :lighter "richkov" ; indicator in mode-line (font-lock-remove-keywords nil richkov-font-lock) (set-face-attribute 'font-lock-comment-face nil :weight (face-attribute 'default :weight)) (when richkov-minor-mode (set-face-attribute 'default :weight 'bold) (set-face-attribute 'font-lock-comment-face nil :weight 'normal) (font-lock-add-keywords nil richkov-font-lock 'append) (set (make-local-variable 'jit-lock-contextually) t) (richkov-annotation-tools)) (when font-lock-mode (if (fboundp 'font-lock-flush) (font-lock-flush) (with-no-warnings (font-lock-fontify-buffer)) )) )