help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Colouring a cell within a table


From: uzibalqa
Subject: Re: Colouring a cell within a table
Date: Thu, 22 Sep 2022 13:40:38 +0000


------- Original Message -------
On Thursday, September 22nd, 2022 at 12:47 PM, Emanuel Berg 
<incal@dataswamp.org> wrote:


> Yuri Khan wrote:
> 
> > > 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.
> > 
> > Why do you want to do this?
> > 
> > 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.
> > 
> > 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.
> 
> 
> 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-backslash)
> ("font-lock-regexp-grouping-construct" . 'font-lock-regexp-grouping-construct)
> ("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)
> 
> 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?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]