From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: uzibalqa Newsgroups: gmane.emacs.help Subject: Re: Colouring a cell within a table Date: Thu, 22 Sep 2022 13:40:38 +0000 Message-ID: References: <_RIolNjRicqtmZ5wXvQohcSz55X29e7seWZzaeofeaem-xa2J0_V5U7Vs715AYF7GrecbrcSSZNYxd3y9H5IwYnCU9H-xBcuLYhsBD_2t14=@proton.me> <87mtavbavc.fsf@dataswamp.org> 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="32461"; 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 Thu Sep 22 17:07:53 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 1obNns-0008EY-Gg for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 22 Sep 2022 17:07:52 +0200 Original-Received: from localhost ([::1]:42832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obNnp-0006lD-LQ for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 22 Sep 2022 11:07:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48968) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obMRl-00039O-CV for help-gnu-emacs@gnu.org; Thu, 22 Sep 2022 09:40:57 -0400 Original-Received: from mail-40130.protonmail.ch ([185.70.40.130]:25225) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obMRh-0002pV-Gf for help-gnu-emacs@gnu.org; Thu, 22 Sep 2022 09:40:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1663854048; x=1664113248; bh=UiivnDuW9nquHnS3TUb4gVl1+xBb3PeFd5EW+KTNOKw=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID; b=HMvlrAWWhmpDt4uU2DD1Si9eYF24I46swtEEoQCqqWgSH/5cFQCdu2PL0+q+ZXhaW BBgysnl1n/G9LOOD0sP0PDTDSzOC354nYDdKMyV+4MJFP5bZJHD5LVuwdytWFnqvuz eufE18f/LYr8d9S5peoeCnEhXeeNdnbyn3qapqLXXy7I8uwP/ltZAH/vuCYXoQra7/ S9zlKwKPEVC1PTuvkI5PQ84n3K81twZNzlaMxKWvzOIGc6cA3uAiXwJXG/g2GA2dg8 /BrZvhnwnPRidwan8vl2EmPmOBWpLT+AYAk1W4aAr7EosZBdvT7MDSvRvIB6B9znrJ CmZ0kIMMt66rw== In-Reply-To: <87mtavbavc.fsf@dataswamp.org> Feedback-ID: 52887082:user:proton Received-SPF: pass client-ip=185.70.40.130; envelope-from=uzibalqa@proton.me; helo=mail-40130.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, 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:139609 Archived-At: ------- Original Message ------- On Thursday, September 22nd, 2022 at 12:47 PM, Emanuel Berg wrote: > Yuri Khan wrote: >=20 > > > Am looking for information to see how I can colour a cell > > > within a table. Ideally I would like to have a keybinding > > > so that when I an in a cell its background in changed to > > > a different colour. > >=20 > > Why do you want to do this? > >=20 > > In general, coloring parts of a document in predefined > > colors is a bad thing to want. Users with a different color > > theme than yours will have trouble reading the document. > >=20 > > A better direction is to define a major mode for your class > > of documents, a few faces, and fontification rules that find > > fragments your users would want colored and apply those > > faces. The user will be able to customize the faces to > > their liking. >=20 >=20 > The Emacs mode already has support for font lock > (AKA "syntax highlighting" outside the Emacs world) for the > desired document type. If a different or more tivoli than that > is desired, configure it or add new font lock rules with > `font-lock-add-keywords', e.g. (font-lock-add-keywords 'emacs-lisp-mode '= ( ("`.*'" . font-lock-reference-face) > ("font-lock-builtin-face" . font-lock-builtin-face) > ("font-lock-comment-delimiter-face" . font-lock-comment-delimiter-face) > ("font-lock-comment-face" . font-lock-comment-face) > ("font-lock-constant-face" . font-lock-constant-face) > ("font-lock-doc-face" . font-lock-doc-face) > ("font-lock-function-name-face" . font-lock-function-name-face) > ("font-lock-keyword-face" . font-lock-keyword-face) > ("font-lock-negation-char-face" . font-lock-negation-char-face) > ("font-lock-preprocessor-face" . font-lock-preprocessor-face) > ("font-lock-reference-face" . font-lock-reference-face) > ("font-lock-regexp-grouping-backslash" . 'font-lock-regexp-grouping-backs= lash) > ("font-lock-regexp-grouping-construct" . 'font-lock-regexp-grouping-const= ruct) > ("font-lock-string-face" . font-lock-string-face) > ("font-lock-type-face" . font-lock-type-face) > ("font-lock-variable-name-face" . font-lock-variable-name-face) > ("font-lock-warning-face" . font-lock-warning-face) > ) > t) >=20 > Those faces are then, much like the Donald Trump supporters > that stormed the Capitolium ... How can make get a table cell to be coloured by defining faces?