unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: uzibalqa <uzibalqa@proton.me>
To: Emanuel Berg <incal@dataswamp.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Colouring a cell within a table
Date: Thu, 22 Sep 2022 13:40:38 +0000	[thread overview]
Message-ID: <y1HeWs3bvUTbngVPFbcePqpZwcciXfQ2ojJLG4jWDT1mfM_Ue3hYE7m9q5Onh4l7svsc1JwKVOuH791j8tQnT98cxi5wrOSRjYhp2lzMI0c=@proton.me> (raw)
In-Reply-To: <87mtavbavc.fsf@dataswamp.org>



------- 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	other threads:[~2022-09-22 13:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-17 12:35 Colouring a cell within a table uzibalqa
2022-09-18  7:54 ` Jean Louis
2022-09-18 14:33   ` uzibalqa
2022-09-18 21:22     ` uzibalqa
2022-09-19  7:46       ` Jean Louis
2022-09-19  9:39         ` Emanuel Berg
2022-09-19  7:42     ` Jean Louis
2022-09-19 13:15       ` uzibalqa
2022-09-19 16:51       ` Christopher Dimech
2022-09-19 15:29 ` Yuri Khan
2022-09-19 16:13   ` Emanuel Berg
2022-09-22 13:40     ` uzibalqa [this message]
2022-09-19 16:33   ` Christopher Dimech

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='y1HeWs3bvUTbngVPFbcePqpZwcciXfQ2ojJLG4jWDT1mfM_Ue3hYE7m9q5Onh4l7svsc1JwKVOuH791j8tQnT98cxi5wrOSRjYhp2lzMI0c=@proton.me' \
    --to=uzibalqa@proton.me \
    --cc=help-gnu-emacs@gnu.org \
    --cc=incal@dataswamp.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).