all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Alan Mackenzie <acm@muc.de>
Cc: Noam Postavsky <npostavs@users.sourceforge.net>, emacs-devel@gnu.org
Subject: Re: font-lock-syntactic-keywords obsolet?
Date: Mon, 20 Jun 2016 19:45:06 +0300	[thread overview]
Message-ID: <076b7311-ad16-4913-b0ec-fc73ea4550a1@yandex.ru> (raw)
In-Reply-To: <20160620152535.GB2192@acm.fritz.box>

On 06/20/2016 06:25 PM, Alan Mackenzie wrote:

> I hold simplicity to be an admirable thing to aim for.  KISS.

Too bad you have to work on CC Mode, then.

> Since when has ad hoc calling of high level code from primitives been
> "simple and sensible design"?  You'll note that the CC Mode way simply
> doesn't need this.

Emacs low-level code runs quite a few hooks already, which are 
implemented in Lisp. You'll also note that the whole Lisp runtime is 
called from low-level code.

> And I say to you quite openly, the continual niggling and nagging I've
> been getting over the past months and years to adapt CC Mode to an
> way of dealing with text properties I hold to be inferior has got tiring
> and draining.  I'd be most obliged if you would stop doing this.

I wouldn't be in that discussion (or the ones like it) if you just 
stayed inside CC Mode and didn't try to push new abstractions, poorly 
designed and duplicating what syntax.el already does, into Emacs core.

> If things had been as you suggest, quite likely I would have come up
> with something a bit like syntax-propertize-function, though maybe not
> very much like it.

Things are like I say. Maybe not quite for CC Mode, but they are for 
many languages around it.

>> You could try adding kludges to that, but ultimately, if you want the
>> file to always be up-to-date in its entirety, eagerly, you're forced to
>> make many operations slower than they have to be.
>
> If you still think this is true, and can demonstrate this with a test
> case, I will have a look at it and attempt to fix it.

I believe I explained the problem quite clearly. But if you're asking 
for a test case for CC Mode, I don't care for it.

This discussion is about general facilities, after all.

>> The shortcuts available to CC Mode aren't something all language modes
>> can use, so syntax-propertization through before/after-change-functions
>> cannot become the standard. s-p-f can, on the other hand, and already is.
>
> I'd be interested to hear of some Mode where such shortcuts, as you call
> them, aren't available.

ruby-mode, for instance. And, like already pointed out, any language 
where (these requirements are sufficient, but not all necessary):

- Double-quoted strings are allowed to span multiple lines.
- Syntax is complex enough that we need to use the syntax-table property.
- Whether a character gets a syntax-property applied, depends on whether 
it's inside a string or comment, among other things.

>> Imagine a language with multiline strings (you can call it "Ruby", or,
>> maybe, "Emacs Lisp"), and a big file that contains at least one string
>> per every ten lines. The user goes to the first string and removes its
>> closing delimiter.
>
>> What's your after-change-function going to do?
>
> Whatever is needed.  Sorry, but the question is too vague.  Emacs Lisp
> Mode, as far as I know doesn't have its own a-c-f, so the answer would
> be "nothing".  I don't know Ruby Mode.

Why don't you do us all a favor and educate yourself about other 
languages and language modes before arguing that 
before/after-change-functions can be a general solution as-is?

> The point here is that, mostly, strings don't require s-t text
> properties.

Some don't, some do. Heredoc strings do.

But text outside of strings often does need text properties. And their 
application depends on whether given text is inside a string.

>>> If the s-t props aren't "local", then maybe the
>>> syntax-propertize-function approach is a good one.  I haven't had any
>>> reason to think this through.
>
>> The zillion email messages on the subject still haven't encouraged you?
>
> On non-"local" syntax table text properties?

On syntax-ppss. Participating in discussions about a subject is usually 
a good reason to educate themselves about it. For most people, at least.

> I don't recall seeing any
> discussion of this, except for the one we're now having.  If I've
> forgotten it, or missed it, you could perhaps point it out to me.

Non-locality is one of the obvious reasons for syntax-propertize's 
design, the way that syntax-table application is performed lazily.

Maybe if you haven't been busy writing shallow critique and asked 
questions instead, we'd gave gotten to this a lot sooner.

>>> Somebody (either you or Stefan) opined
>>> that ALL s-t properties are, in practice, "local".
>
>> You're misremembering.
>
> It must have been somebody else, then.  Are you aware of any non-"local"
> use of syntax table text properties?

Yes. And I've been telling you about them for the last several messages.



  reply	other threads:[~2016-06-20 16:45 UTC|newest]

Thread overview: 95+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-16 10:18 font-lock-syntactic-keywords obsolet? Andreas Röhler
2016-06-17 22:13 ` Stefan Monnier
2016-06-18  7:03   ` Andreas Röhler
2016-06-18 15:07     ` Noam Postavsky
2016-06-18 17:12       ` Alan Mackenzie
2016-06-18 18:13         ` Stefan Monnier
2016-06-18 19:41           ` Noam Postavsky
2016-06-19  7:12             ` Andreas Röhler
2016-06-19 13:21               ` Noam Postavsky
2016-06-19 14:03                 ` Andreas Röhler
2016-06-19 14:36               ` Stefan Monnier
2016-06-19 15:12                 ` Alan Mackenzie
2016-06-19 15:18                   ` Dmitry Gutov
2016-06-19 15:26                     ` Alan Mackenzie
2016-06-19 15:52                       ` Stefan Monnier
2016-06-19 15:53                       ` Dmitry Gutov
2016-06-20  2:58                   ` Stefan Monnier
2016-06-20 11:57                     ` Alan Mackenzie
2016-06-20 13:37                       ` Stefan Monnier
2016-06-20 13:50                         ` Dmitry Gutov
2016-06-20 16:00                           ` Andreas Röhler
2016-06-20 18:15                             ` Dmitry Gutov
2016-06-20 23:33                               ` John Wiegley
2016-06-20 18:55                             ` Alan Mackenzie
2016-06-20 20:22                               ` Andreas Röhler
2016-06-19 15:27                 ` Andreas Röhler
2016-06-19 15:51                   ` Stefan Monnier
2016-06-19 12:31         ` Dmitry Gutov
2016-06-19 13:31           ` Alan Mackenzie
2016-06-19 13:48             ` Dmitry Gutov
2016-06-19 14:59               ` Alan Mackenzie
2016-06-19 15:07                 ` Dmitry Gutov
2016-06-19 15:18                   ` Alan Mackenzie
2016-06-19 15:22                     ` Dmitry Gutov
2016-06-19 15:34                       ` Alan Mackenzie
2016-06-19 15:50                         ` Dmitry Gutov
2016-06-19 17:15                           ` Alan Mackenzie
2016-06-19 17:55                             ` Dmitry Gutov
2016-06-19 22:20                               ` Dmitry Gutov
2016-06-20 10:22                               ` Alan Mackenzie
2016-06-20 11:50                                 ` Dmitry Gutov
2016-06-20 14:50                                   ` Alan Mackenzie
2016-06-20 15:02                                     ` Dmitry Gutov
2016-06-20 13:39                                 ` Stefan Monnier
2016-06-20 10:58                               ` Alan Mackenzie
2016-06-20 11:12                                 ` Andreas Röhler
2016-06-20 12:15                                 ` Dmitry Gutov
2016-06-20 14:52                                   ` Noam Postavsky
2016-06-20 15:57                                     ` Dmitry Gutov
2016-06-20 17:23                                       ` Noam Postavsky
2016-06-20 18:58                                         ` Dmitry Gutov
2016-06-20 15:25                                   ` Alan Mackenzie
2016-06-20 16:45                                     ` Dmitry Gutov [this message]
2016-06-20 18:12                                       ` Alan Mackenzie
2016-06-20 19:15                                         ` Dmitry Gutov
2016-06-20 20:08                                           ` Alan Mackenzie
2016-06-20 20:32                                             ` Dmitry Gutov
2016-06-21 14:40                                               ` Alan Mackenzie
2016-06-21 21:06                                                 ` Dmitry Gutov
2016-06-21 23:50                                                 ` Dmitry Gutov
2016-06-23 16:30                                                   ` Alan Mackenzie
2016-06-27 11:48                                                     ` Alan Mackenzie
2016-06-29  0:30                                                     ` Dmitry Gutov
2016-06-30  9:52                                                       ` Alan Mackenzie
2016-07-10  2:01                                                         ` Dmitry Gutov
2016-07-10 22:11                                                           ` Alan Mackenzie
2016-07-11  0:06                                                             ` Dmitry Gutov
2016-07-11 17:20                                                               ` Alan Mackenzie
2016-07-11 22:44                                                                 ` Dmitry Gutov
2016-06-20 22:45                                       ` John Wiegley
2016-06-20 23:30                                         ` Dmitry Gutov
2016-06-20 23:56                                           ` John Wiegley
2016-06-21  0:26                                           ` John Wiegley
2016-06-21 15:26                                           ` Alan Mackenzie
2016-06-21 16:09                                             ` Dmitry Gutov
2016-06-21 18:34                                               ` Andreas Röhler
2016-06-21 18:42                                                 ` John Wiegley
2016-06-21 18:52                                                   ` Eli Zaretskii
2016-06-27 11:50                                                     ` Andreas Röhler
2016-06-21 19:23                                                   ` Andreas Röhler
2016-06-21 18:49                                                 ` Eli Zaretskii
2016-06-21 21:05                                               ` Alan Mackenzie
2016-06-21 21:17                                                 ` Dmitry Gutov
2016-06-21 16:28                                             ` Dmitry Gutov
2016-06-20  0:06                             ` Stefan Monnier
2016-06-20 11:03                               ` Alan Mackenzie
2016-06-20 13:53                                 ` Stefan Monnier
2016-06-20  4:33                             ` Stefan Monnier
2016-06-20  5:05                               ` John Wiegley
2016-06-19 23:59                         ` Stefan Monnier
2016-06-20  3:14                       ` Stefan Monnier
2016-06-20  3:20                         ` Dmitry Gutov
2016-06-20  3:47                           ` Stefan Monnier
2016-06-20  6:40                 ` Andreas Röhler
2016-06-20  3:08             ` 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=076b7311-ad16-4913-b0ec-fc73ea4550a1@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    --cc=npostavs@users.sourceforge.net \
    /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.