unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Checkerboard background colours
@ 2010-02-22 16:42 Jeffrey Ratcliffe
  2010-02-22 20:13 ` Lennart Borgman
  0 siblings, 1 reply; 4+ messages in thread
From: Jeffrey Ratcliffe @ 2010-02-22 16:42 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 332 bytes --]

I'm trying to write a major mode for a data language that uses fixed
field widths. In order to highlight the fields, I'd like to change the
background colour so that adjacent fields do not have the same
background colour, creating a checkerboard effect.

How can I achieve this?

Please cc me as I am not subscribed.

Regards

Jeff

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Checkerboard background colours
  2010-02-22 16:42 Checkerboard background colours Jeffrey Ratcliffe
@ 2010-02-22 20:13 ` Lennart Borgman
  2010-07-23 11:28   ` Jeffrey Ratcliffe
  0 siblings, 1 reply; 4+ messages in thread
From: Lennart Borgman @ 2010-02-22 20:13 UTC (permalink / raw)
  To: Jeffrey Ratcliffe; +Cc: help-gnu-emacs

On Mon, Feb 22, 2010 at 5:42 PM, Jeffrey Ratcliffe
<jeffrey.ratcliffe@gmail.com> wrote:
> I'm trying to write a major mode for a data language that uses fixed
> field widths. In order to highlight the fields, I'd like to change the
> background colour so that adjacent fields do not have the same
> background colour, creating a checkerboard effect.
>
> How can I achieve this?
>
> Please cc me as I am not subscribed.


See for example ocr-user.el in nXhtml.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Checkerboard background colours
  2010-02-22 20:13 ` Lennart Borgman
@ 2010-07-23 11:28   ` Jeffrey Ratcliffe
  2010-07-23 15:04     ` Jeffrey Ratcliffe
  0 siblings, 1 reply; 4+ messages in thread
From: Jeffrey Ratcliffe @ 2010-07-23 11:28 UTC (permalink / raw)
  To: help-gnu-emacs

On 22 February 2010 22:13, Lennart Borgman <lennart.borgman@gmail.com> wrote:
> See for example ocr-user.el in nXhtml.

Thanks for the tip. This works fine in emacs 23, but not on 21.4,
where it gives the error "invalid regular expression".

Do you have any idea how to get this working in 21.4? font-lock itself
seems to work OK, it really does seem to be a problem with the regex.

Please cc me on replies, as I am not subscribed.

Regards

Jeff



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Checkerboard background colours
  2010-07-23 11:28   ` Jeffrey Ratcliffe
@ 2010-07-23 15:04     ` Jeffrey Ratcliffe
  0 siblings, 0 replies; 4+ messages in thread
From: Jeffrey Ratcliffe @ 2010-07-23 15:04 UTC (permalink / raw)
  To: help-gnu-emacs

On 23 July 2010 13:28, Jeffrey Ratcliffe <jeffrey.ratcliffe@gmail.com> wrote:
> Do you have any idea how to get this working in 21.4? font-lock itself
> seems to work OK, it really does seem to be a problem with the regex.

On removing the shy groups, the regex error disappeared under 21.4.
The highlighting still didn't work. I simplified it to the following,
which does:

(defvar my-keywords
 '(
   ("\\([\-+0-9a-zA-Z \.]\\{1,8\\}\\)\\([\-+0-9a-zA-Z \.]\\{1,8\\}\\)?"
                          1 '(:background "LightBlue1"))
  )
)

How can get this only to be active on lines between "BEGIN DATA" and "END DATA"?

Please cc me on replies, as I am not subscribed.

Regards

Jeff



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-07-23 15:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-22 16:42 Checkerboard background colours Jeffrey Ratcliffe
2010-02-22 20:13 ` Lennart Borgman
2010-07-23 11:28   ` Jeffrey Ratcliffe
2010-07-23 15:04     ` Jeffrey Ratcliffe

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).