ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: skrantajanneman@gmail.com
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: [NTG-context] Re: Custom highlight ConTeXt syntax in AUCTEX
Date: Wed, 19 Jul 2023 22:48:02 +0200	[thread overview]
Message-ID: <AF501FCF-7711-4123-869E-9AEEF9FBBC36@gmail.com> (raw)
In-Reply-To: <138bb289-dfb2-3fa9-98d5-783114f210d2@fiee.net>


[-- Attachment #1.1: Type: text/plain, Size: 1805 bytes --]

It does not highlight e.g \starttext keyword by default. The colorscheme seems adapted to LaTeX mode so I managed to fix this now for all \start - \stop commands with this code put in ~/.emacs.d/init.el

(add-hook ’ConTeXt-mode-hook
        (lambda ()
                 (font-lock-add-keywords nil
                               ’((”\\(\\\\start\\w*\\)\\>” 1 font-lock-function-name-face t)
                                  (”\\(\\\\stop\\w*\\)\\>” 1 font-lock-function-name-face t)))))

And the regexp was done with help from interactive inbuilt function re-builder in emacs

The next goal is to highlight variabels like \textwidth for example

Thanks for feedback

/Jan-erik 

Skickat från min iPhone

> 19 juli 2023 kl. 17:20 skrev Henning Hraban Ramm <texml@fiee.net>:
> 
> Am 19.07.23 um 15:38 schrieb Jan-Erik Hägglöf:
>> Dear All!
>> I've been using emacs AUCTEX for quite a while and found it very convenient to work with.
>> One issue is the lack of syntax highlighting.
> 
> https://wiki.contextgarden.net/Text_Editors says, Emacs has ConTeXt support including syntax highlighting.
> 
> I don’t use Emacs, so I don’t know how to activate/configure it.
> Maybe it expects a different file extension, like .ctx?
> 
> Hraban
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : https://contextgarden.net
> ___________________________________________________________________________________

[-- Attachment #1.2: Type: text/html, Size: 3527 bytes --]

[-- Attachment #2: Type: text/plain, Size: 495 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

      reply	other threads:[~2023-07-19 20:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-19 13:38 [NTG-context] " Jan-Erik Hägglöf
2023-07-19 15:18 ` [NTG-context] " Henning Hraban Ramm
2023-07-19 20:48   ` skrantajanneman [this message]

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=AF501FCF-7711-4123-869E-9AEEF9FBBC36@gmail.com \
    --to=skrantajanneman@gmail.com \
    --cc=ntg-context@ntg.nl \
    /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 NNTP newsgroup(s).