all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nir Friedman <quicknir@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 23501@debbugs.gnu.org
Subject: bug#23501: Non-regex-based syntax highlighting
Date: Tue, 10 May 2016 16:16:03 -0400	[thread overview]
Message-ID: <CA+cBnHDouHrX8b1Ozbs3zASQCAMu0y6Y2V2QddPqEDD-=Jzpdg@mail.gmail.com> (raw)
In-Reply-To: <83vb2lbtxc.fsf@gnu.org>

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

My idea for a hook was basically to make it possible to provide a callback
function to the Major mode. If this callback function is provided, then
when a new file is loaded or an existing one saved with modifications, the
callback function is called with the full path to the file. The callback
function must return something that basically tells the major mode how to
color everything. A simple way would just be to return a list of the colors
for every single non-whitespace character taken sequentially. A single very
fast pass through this list would then be able to color every character.

Is there a reason why that would not be workable? Also, can you point me to
where exactly (e.g. via link to the emacs github mirror) the major modes
are stored?



On Tue, May 10, 2016 at 3:21 PM, Eli Zaretskii <eliz@gnu.org> wrote:

> > From: Nir Friedman <quicknir@gmail.com>
> > Date: Tue, 10 May 2016 14:55:41 -0400
> > Cc: 23501@debbugs.gnu.org
> >
> > I guess I'm a bit less clear on the solution, because I don't have a
> good sense of who the owner of the C++
> > major mode is, and how the code is structured. My thinking was that
> perhaps hooks could be added to make
> > it easier for plugin writers to modify the syntax coloring of the major
> mode. As opposed to plugin writers
> > needing to rewrite the C++ major mode from scratch just to change the
> syntax coloring.
>
> Colors are added at display time, so hooks will not help here.  Or at
> least it isn't immediately clear to me how they could help.
>
> I suggest to study how syntax highlighting works in Emacs, including
> the JIT font-lock feature and its relation to the display engine.
> Until you have a good understanding of how this stuff works, I don't
> think you will be able to come with a design for hooks which external
> tools could use for this purpose.
>

[-- Attachment #2: Type: text/html, Size: 2376 bytes --]

  reply	other threads:[~2016-05-10 20:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-10  3:12 bug#23501: Non-regex-based syntax highlighting Nir Friedman
2016-05-10 15:57 ` Richard Stallman
2016-05-10 15:59 ` Eli Zaretskii
2016-05-10 18:55   ` Nir Friedman
2016-05-10 19:21     ` Eli Zaretskii
2016-05-10 20:16       ` Nir Friedman [this message]
2016-05-11  7:49         ` Eli Zaretskii
2020-08-12  2:31           ` Stefan Kangas
2016-05-11 17:56         ` John Mastro

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='CA+cBnHDouHrX8b1Ozbs3zASQCAMu0y6Y2V2QddPqEDD-=Jzpdg@mail.gmail.com' \
    --to=quicknir@gmail.com \
    --cc=23501@debbugs.gnu.org \
    --cc=eliz@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.