unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Werner LEMBERG <wl@gnu.org>
Subject: line continuation and font-lock
Date: Mon, 06 Feb 2006 09:20:24 +0100 (CET)	[thread overview]
Message-ID: <20060206.092024.45747502.wl@gnu.org> (raw)


I wonder how I can handle the line continuation character of groff in
font-lock.  Contrary to other languages, a trailing `\' is handled on
the input level, before anything else.  For example

  This is a \
  .test

is equal to

  This is a .test

Similarly,

  .foo "This is a \
  test"

Is equal to

  .foo "This is a test"

Consequently, for proper fontification, I have to handle trailing
backslashes earlier than anything else, too.  Looking into the
documentation I wasn't able to find a method to do that.  The nearest
thing I can find is font-lock-syntactic keywords, but I have the
feeling that this a)comes too late and b)is not appropriate, since
backslashes are not limited to any synctical element.

A possible solution might be to call a function which assigns a
special text property to the newline character if preceded by `\'
(basically an `ignore me' or `neutral' category) while doing
fontification.  Unfortunately, regular expressions don't have access
to text properties...

Any ideas?


    Werner

             reply	other threads:[~2006-02-06  8:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-06  8:20 Werner LEMBERG [this message]
2006-02-06  8:37 ` line continuation and font-lock Stefan Monnier

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=20060206.092024.45747502.wl@gnu.org \
    --to=wl@gnu.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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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