unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Daniel Colascione <dancol@dancol.org>
To: Alan Mackenzie <acm@muc.de>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: POC: customizable cc-mode keywords
Date: Fri, 16 May 2014 11:06:24 -0700	[thread overview]
Message-ID: <537653A0.2070109@dancol.org> (raw)
In-Reply-To: <20140516175226.GB3267@acm.acm>

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

On 05/16/2014 10:52 AM, Alan Mackenzie wrote:
>>>> Today, we use clever macros to hard-code the values of all cc-mode
>>>> language variables into the mode functions of each cc-mode major mode
>>>> function or into c-init-language-vars-for, but in order to allow users
>>>> to customize cc-mode syntax, we have to be able to recompute language
>>>> constants and variables at runtime.
> 
>>> Do we, now?  You can imagine I've one or two reservations about this
>>> idea. 
> 
>> What's your alternative?
> 
> Turning the pertinent c-lang-defvars, and only these, into configurable
> variables in cc-vars.el.

Have you looked into what task actually involves? You need to modify
c-decl-hangon-kwds, and as a result, c-prefix-spec-kwds,
c-postfix-spec-kwds, c-keywords, c-keywords-regexp, c-keywords-obarray,
c-nonlabel-token-key, and c-regular-keywords-regexp. It's easier and
more flexible to simply allow the entire set of c-lang-defconst values
to change. You also have to recompute the font-lock matchers, which is
similarly involved.

You claim that there is a great risk of negative side effects resulting
from this change. I don't agree, and I don't see anyone else proposing,
much less implementing, a solution to this problem, and cc-mode's being
developed outside the tree makes it frustratingly slow and difficult to
get much-needed fixes into core where users can see them.

> As I said, I'm not at all happy at making such a massive change to CC
> Mode's architecture.  There would surely be unforeseen consequences, some
> of which might well be negative.

It's not a massive change in architecture. cc-mode can already evaluate
these variables at runtime in the case of a version mismatch. I propose
simply doing so all the time. My timing indicates that it's not a
performance problem in practice.


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

  reply	other threads:[~2014-05-16 18:06 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-02  5:26 POC: customizable cc-mode keywords Daniel Colascione
2014-05-10 23:13 ` Daniel Colascione
2014-05-11 21:13 ` Alan Mackenzie
2014-05-11 21:23   ` Daniel Colascione
2014-05-16 17:52     ` Alan Mackenzie
2014-05-16 18:06       ` Daniel Colascione [this message]
2014-05-18 21:33         ` Alan Mackenzie
2014-05-18 22:28           ` Daniel Colascione
2014-05-19  2:25             ` Stefan Monnier
2014-05-25 18:08             ` Alan Mackenzie
2014-09-08 17:28           ` Stefan Monnier
2014-09-11 13:55             ` Further CC-mode changes Stefan Monnier
2014-09-12 23:59               ` Alan Mackenzie
2014-09-13  1:09                 ` Ivan Andrus
2014-09-13 10:04                   ` Alan Mackenzie
2014-09-13  3:04                 ` Stefan Monnier
2014-09-13 15:10                   ` Alan Mackenzie
2014-09-13 19:24                     ` Stefan Monnier
2014-09-13 23:08                       ` Syntax-propertize and CC-mode [Was: Further CC-mode changes] Alan Mackenzie
2014-09-14  4:04                         ` Stefan Monnier
2014-09-16 17:30                       ` Sync'ing cc-mode Stefan Monnier
2014-09-26 19:19                         ` Stefan Monnier
2014-09-15 20:24                     ` Further CC-mode changes Glenn Morris
2014-09-16  3:07                       ` Stephen J. Turnbull
2014-09-16 13:39                         ` Stefan Monnier
2014-09-16 14:22                         ` David Kastrup
2014-09-16 23:40                           ` Stephen J. Turnbull
2014-09-17  1:02                             ` Stefan Monnier
2014-09-17  1:48                               ` Stephen J. Turnbull
2014-09-17  5:22                                 ` David Kastrup
2014-09-17 13:00                                   ` Stefan Monnier
2014-09-17 18:31                               ` Glenn Morris
2014-09-17 19:12                                 ` David Kastrup
2014-09-17  5:24                             ` Eli Zaretskii
2014-09-17  6:54                               ` Stephen J. Turnbull
2014-09-17  7:20                                 ` Eli Zaretskii
2014-09-17  7:30                                 ` David Kastrup
2014-09-17 13:04                                 ` Stefan Monnier
2014-09-17 18:25                                   ` Glenn Morris
2014-09-18  5:20                                   ` Stephen J. Turnbull
2014-09-18  9:44                             ` Emilio Lopes

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=537653A0.2070109@dancol.org \
    --to=dancol@dancol.org \
    --cc=acm@muc.de \
    --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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).