From: henry atting <nospam@literaturlatenight.de>
To: help-gnu-emacs@gnu.org
Subject: Re: define multi-line comments
Date: Sat, 21 Jun 2008 10:32:39 +0200 [thread overview]
Message-ID: <87tzfnur14.fsf@literaturlatenight.de> (raw)
In-Reply-To: mailman.13617.1213978108.18990.help-gnu-emacs@gnu.org
David Hansen wrote:
> On Fri, 20 Jun 2008 16:46:37 +0200 henry atting wrote:
>
>> I have my own text mode (derived from text-mode), which defines some
>> syntax highlighting. Defining keywords is no problem but as far as I see
>> keywords don't work on serveral lines, e.g. this
>>
>> (list "\".*\"" 0 'font-lock-variable-name-face t)
>>
>> only highlights words or phrases till the line break.
>> Can anyone give me a hint how to get it work multi-line.
>
> There are some words about this in the Elisp manual, lookup
> `font-lock-multiline'. But this is incredible complicated.
Oh yes, you really might say this ;)
In the meantime I found a way to do it. I looked into lua-mode.el where
mulit-line comments work and changed it according to my needs:
(list
"\\(?:^\\|[^-]\\)\\(\"\\(=*\\)\\(?:.\\|\n\\)*?\"\\)"
'(1 'font-lock-string-face t))
> But in many circumstances you can use `font-lock-syntactic-keywords' to
> make some region a "string" or "comment" and then use
> `font-lock-syntactic-face-function' to give it another face.
Now I will take a look at this. Thanks :)
henry
next prev parent reply other threads:[~2008-06-21 8:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-20 14:46 define multi-line comments henry atting
2008-06-20 16:01 ` David Hansen
[not found] ` <mailman.13617.1213978108.18990.help-gnu-emacs@gnu.org>
2008-06-21 8:32 ` henry atting [this message]
2008-06-21 9:11 ` David Hansen
[not found] ` <mailman.13659.1214040211.18990.help-gnu-emacs@gnu.org>
2008-06-22 7:51 ` henry atting
2008-06-22 10:15 ` David Hansen
[not found] ` <mailman.13696.1214130202.18990.help-gnu-emacs@gnu.org>
2008-06-22 15:43 ` henry atting
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87tzfnur14.fsf@literaturlatenight.de \
--to=nospam@literaturlatenight.de \
--cc=help-gnu-emacs@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.