all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Clément Pit--Claudel" <clement.pit@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: Feature request/RFC: proper highlighting of code embedded in comments
Date: Mon, 17 Oct 2016 10:19:47 -0400	[thread overview]
Message-ID: <9bad1572-eaa3-2b5e-e9a8-5cc22d334299@gmail.com> (raw)
In-Reply-To: <jwvmvi3dtfk.fsf-monnier+gmane.emacs.devel@gnu.org>


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

On 2016-10-17 09:02, Stefan Monnier wrote:
>> Thanks!  How is the package called? I don't see it list-packages :/
> 
> It's called sm-c-mode.  And no, it's not in GNU ELPA, it's in elpa.git.

Thanks! I'll look.

>> The issue here is that “What a great example” is a string.  I tried
>> using a syntactic face function to mark the last ‘>’ as a string
>> closer and the newline as a string opener,
> 
> Never set `syntax-table` text properties from
> font-lock-syntactic-face-function (this will bring nothing but
> problems that are difficult to track down).  Been there, done that.
> Do it from syntax-propertize-function.

Woops, this was a typo.  I'm using a syntax-propertize-function.

>> but that confused the existing function, which expects the docstring
>> starter to be ‘"""’, not ‘\n’.  Even after fixing this, python-mode
>> was unusable: it inflooped when trying to find a whole defun, because
>> the nav-end-of-defun function isn't ready to accept ‘\n’ as
>> a string starter.
> 
> Sounds like you need to adjust other parts of the code, yes.
> 
> Alternatively, don't use `syntax-table` text properties at all, and
> highlight the nested strings "by hand" (with regexps and/or manual
> parsing).

OK; I think I'll go with the solution I posted in the other subthread :)

Thanks!
Clément.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2016-10-17 14:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-15 15:19 Feature request/RFC: proper highlighting of code embedded in comments Clément Pit--Claudel
2016-10-15 20:22 ` Dmitry Gutov
2016-10-15 21:21   ` Clément Pit--Claudel
2016-10-16 17:42 ` Stefan Monnier
2016-10-16 21:05   ` Clément Pit--Claudel
2016-10-17 13:02     ` Stefan Monnier
2016-10-17 14:19       ` Clément Pit--Claudel [this message]
2016-10-16 21:10 ` Clément Pit--Claudel
2016-10-17 13:12   ` Stefan Monnier
2016-10-17 14:25     ` Clément Pit--Claudel

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=9bad1572-eaa3-2b5e-e9a8-5cc22d334299@gmail.com \
    --to=clement.pit@gmail.com \
    --cc=emacs-devel@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.