all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: font-lock-multiline for cc-awk.
Date: Wed, 26 Apr 2006 09:55:52 -0400	[thread overview]
Message-ID: <87k69c8nj1.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <Pine.LNX.3.96.1060426054918.345A-100000@acm.acm> (Alan Mackenzie's message of "Wed, 26 Apr 2006 07:37:54 +0000 (GMT)")

>> AFAICT the patch below converts cc-awk to use font-lock-multiline
>> instead of an after-change-function.

> You've rubbed out my after-change function!  Heeeellllllllllpppppppp!!

Well, it was just a sample patch.

> In fact, it's a massive pain in the posterior that font lock erases these
> text properties without getting permission from the major mode.

Huh?  font-lock only clears the syntax-table properties if you specifically
ask it to manage that property (by setting font-lock-syntactic-keywords).

> I don't want to mix up the syntax-table and f-l-multiline properties,
> because they're very different things.

On the contrary, they belong together: the font-lock-multiline accompagnies
the syntax-table property to say "this syntax-table property depends on this
chunk of text", so that if a part of this chunk of text is changed, the
syntax-table property can be recomputed.

> Doing so would weaken the
> existing functions, which are strong single-purpose functions.  To do
> things this sort of way, I'd put in a new function
> c-awk-set-fl-multiline-properties (a sister function to
> c-awk-set-syntax-table-properties, with the same calling conventions).
> The existing function loops round string/regexp/division sign constructs,
> whereas the new one would be looping round lines.

A multiline-line without strings or regexps doesn't need to be refontified
atomically because none of the other patterns you use can span or depend on
multiple lines of text.

> They don't mix very happily.

On the contrary: they belong together.

> But mainly, I don't want to be applying f-l-m properties throughout the
> region[*].  They should be applied only at the region boundaries when
> these need extending, and only when font lock is enabled, since they serve
> no purpose otherwise.

> [*] As you're aware, I don't want to use f-l-m properties at all.  But if
> I must use them, I only want them where absolutely needed.

Look, I'm just showing this code to try and get you to understand how
font-lock-multiline properties work.  It seems like you've been thinking
much too hard about your a-c-f code and can't think outside of
that setting.

[ Reminds me of "a calculus of capabilities" and "alias types": they present
  a new way to guarantee the safety of "manual" memory
  management primitives.  Contrary to previous appoaches (which tended to be
  very complex and incomplete or much too restrictive), they allow
  dangling pointers.  Many people found it terribly difficult to believe to
  understand that a system that allows dangling pointers can be safe w.r.t
  manual memory management: all previous approaches cared about checking
  that "free" is safe, whereas those new approaches only care about checking
  that the memory access is safe: i.e. they simply disallow access after
  a "free" rather than disallow "free" if the object is still "live" (which
  they typically define as "reachable"). ]

> Why not leave things alone until Richard has settled the whole matter?

Of course, I didn't intend to apply the patch.


        Stefan

  reply	other threads:[~2006-04-26 13:55 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-17  0:56 Last steps for pretesting Richard Stallman
2006-04-17  8:01 ` Ramprasad B
2006-04-17  8:37   ` Eli Zaretskii
2006-04-18  1:42   ` Richard Stallman
2006-04-19  3:54     ` Ramprasad B
2006-04-19 15:40       ` Richard Stallman
2006-04-20  5:23         ` Ramprasad B
2006-04-18 17:31 ` Bill Wohler
2006-04-19 17:02 ` Alan Mackenzie
2006-04-19 21:23   ` Stefan Monnier
2006-04-19 21:30     ` David Kastrup
2006-04-20 21:35       ` Stefan Monnier
2006-04-20 21:37         ` David Kastrup
2006-04-20 21:44           ` Stefan Monnier
2006-04-20 21:46             ` David Kastrup
2006-04-20 22:50             ` Alan Mackenzie
2006-04-19 22:43     ` Last steps for pretesting (font-lock-extend-region-function) Alan Mackenzie
2006-04-20  9:13       ` Alan Mackenzie
2006-04-20 17:46       ` Stefan Monnier
2006-04-20 18:12         ` Alan Mackenzie
2006-04-20 20:58           ` Stefan Monnier
2006-04-20 22:40             ` Alan Mackenzie
2006-04-20 23:34               ` Stefan Monnier
2006-04-21  7:58                 ` Alan Mackenzie
2006-04-21 12:18                   ` Stefan Monnier
2006-04-21 19:51                     ` Alan Mackenzie
2006-04-21 22:28                       ` Stefan Monnier
2006-04-24 19:28                         ` Alan Mackenzie
2006-04-24 21:06                           ` Stefan Monnier
2006-04-25  6:21                             ` Ralf Angeli
2006-04-25 10:53                               ` Alan Mackenzie
2006-04-25 18:37                                 ` Ralf Angeli
2006-04-25 22:00                                   ` Alan Mackenzie
2006-04-26  6:14                                     ` Ralf Angeli
2006-04-25 19:26                                 ` Stefan Monnier
2006-04-25 20:10                                 ` font-lock-multiline for cc-awk Stefan Monnier
2006-04-26  7:37                                   ` Alan Mackenzie
2006-04-26 13:55                                     ` Stefan Monnier [this message]
2006-04-25 19:23                               ` Last steps for pretesting (font-lock-extend-region-function) Stefan Monnier
2006-04-25 20:18                               ` Stefan Monnier
2006-04-25 11:33                             ` Alan Mackenzie
2006-04-25 11:59                               ` David Kastrup
2006-04-25 12:33                               ` Stefan Monnier
2006-04-25 14:07                                 ` Alan Mackenzie
2006-04-25 16:05                                   ` Stefan Monnier
2006-04-25 16:09                                     ` Stefan Monnier
2006-04-25 21:52                                       ` Alan Mackenzie
2006-04-25 21:49                                     ` Alan Mackenzie
2006-04-26  4:50                                       ` Stefan Monnier
2006-04-24 21:20                           ` Stefan Monnier
2006-04-25  7:45                             ` Alan Mackenzie
2006-04-25 12:12                               ` Stefan Monnier
2006-04-25 21:15                                 ` Alan Mackenzie
2006-04-26  4:33                                   ` Stefan Monnier
2006-04-26  8:30                                     ` Alan Mackenzie
2006-04-26 13:36                                       ` Stefan Monnier
2006-04-24 21:33                           ` Stefan Monnier
2006-04-25  7:27                             ` Alan Mackenzie
2006-04-25 12:03                               ` Stefan Monnier
2006-04-25 13:14                                 ` Alan Mackenzie
2006-04-26  0:22                                   ` Miles Bader
2006-04-25  4:39                           ` Tomas Zerolo
2006-04-25 19:02                           ` Ralf Angeli
2006-04-25 19:30                             ` Stefan Monnier
2006-04-25 20:12                               ` Ralf Angeli
2006-04-25 20:26                                 ` Stefan Monnier
2006-04-25 20:58                                   ` Ralf Angeli
2006-04-25 21:11                                     ` Stefan Monnier
2006-04-25 22:30                               ` Alan Mackenzie
2006-04-26  4:25                                 ` Stefan Monnier
2006-04-26  7:44                                   ` Alan Mackenzie
2006-04-25 22:16                             ` Alan Mackenzie
2006-04-26  4:36                               ` Stefan Monnier
2006-04-21 23:14                       ` Drew Adams
2006-04-19 22:53     ` Last steps for pretesting (true file names in load-history?) Alan Mackenzie
2006-04-20  1:14   ` Last steps for pretesting Richard Stallman
2006-04-24 17:52   ` Richard Stallman
2006-04-20 10:54 ` Reiner Steib
2006-04-21  0:10   ` Richard Stallman
2006-04-21  5:46     ` David Kastrup

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=87k69c8nj1.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --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.