From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sharon Kimble Subject: SOLUTION - Re: How to colorize text in square brackets? Date: Thu, 14 Feb 2019 09:05:30 +0000 Message-ID: <87mumyagf9.fsf@skimble.plus.com> References: <87zhr2idiw.fsf@skimble.plus.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:49808) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guCxm-0006gX-6J for emacs-orgmode@gnu.org; Thu, 14 Feb 2019 04:05:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guCxk-0003Zu-17 for emacs-orgmode@gnu.org; Thu, 14 Feb 2019 04:05:46 -0500 Received: from avasout02.plus.net ([212.159.14.17]:58746) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1guCxj-0003Wb-Qz for emacs-orgmode@gnu.org; Thu, 14 Feb 2019 04:05:43 -0500 In-Reply-To: <87zhr2idiw.fsf@skimble.plus.com> (Sharon Kimble's message of "Mon, 11 Feb 2019 14:51:51 +0000") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Sharon Kimble writes: > How can I colorize text within square brackets please, like [fu] ? > > I need them colorized as they will hold reminders for myself at that posi= tion whilst I'm writing. > When I posted this question I knew that the answer would probably lie somew= here within font-lock-add-keywords, but I was unable to find it until I sta= rted googling for 'font-lock-keyword-face' which I was already using. This = search then lead me to these two pages [1] and [2]. And that lead to this code which achieves what I was trying to accomplish, = the text within the square boxes to be coloured totally different from its = surrounding text, meaning that now I can write my book and leave myself rem= inders of various questions, which when I've found the answers can then be = deleted. =2D-8<---------------cut here---------------start------------->8--- #+BEGIN_SRC emacs-lisp (font-lock-add-keywords 'org-mode '(("\\[\\(.*\\)\\]" 1 font-lock-type-face prepend))) #+END_SRC =2D-8<---------------cut here---------------end--------------->8--- Thanks Sharon. [1] - https://stackoverflow.com/questions/7401787/emacs-mode-how-to-specify= -that-thing-in-square-brackets-should-be-colored [2] - https://www.gnu.org/software/emacs/manual/html_node/elisp/Faces-for-F= ont-Lock.html =2D-=20 A taste of linux =3D http://www.sharons.org.uk TGmeds =3D http://www.tgmeds.org.uk DrugFacts =3D https://www.drugfacts.org.uk Debian 9.5, fluxbox 1.3.7, emacs 26.1.91, org 9.2.1 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEELSc/6QwVBIYugJDbNoGAGQr4g1sFAlxlL1oACgkQNoGAGQr4 g1tmaQ/+OuPk5LN22L2SvCZLY7TmOUghpsbrQHSPJphblVw3/0Dq+e1p/a+op448 RNvlsnzWiFFzbJXs00B+7d312HUNtUKK1nL+0Kb+JCHLTfEfycxhr28Tng8MdOsD y8EstE+LmZuP4CN5Y7ND2efSC3LeF/9CwNncLlEkpzfdhuWGxZ/7SZUh2A5GM2LA 0U/7RGEg/+v+tLGZjnKyMBxHECKlid5JBZZA9+V7Vv/3t9XZ2+UIEioSxCtNmf2J 6QQ4waQuSEMnazuEaIYZwD/9KUkacyCKxS/TqkL7ySLt8Ml7AavPFrZM6z3I8tnk q6Tqrku8HspLbw4MLTNzh0wTOjQCIBUj5m4FHrFgWfeunLcQbWikglC0ooPiGO28 Ao10ahBBjpjO68tJaF4LeUikNSwwoP9F2VDrpRviouxwpCRvWWV8Uwd7VEg720R3 k7A+XZBpH9k/zAB+K2DouqeIXSkOR+3Q8i6+/z0pvgLVTXo9SL9/WNCIUNXh+B7U qs1NrPLNy46fAHBw2YUmQAizP1LTFpWThTQT+c/XIAFAXs26CWddTViqft3kn009 jRWEpgv9H2l358dKv753WjTOwe7ikRwyQoK3Yc74I6wq/e5hbFMBrfb9/geo/Ev+ Jq+Ifi0ekhXqdsO6VODwvMsAhben+7/V0wiZf8G4uKry72b12xg= =yq8n -----END PGP SIGNATURE----- --=-=-=--