emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mysterious fontification/C++ context issue


From: Stefan Monnier
Subject: Re: Mysterious fontification/C++ context issue
Date: Mon, 11 Dec 2006 02:36:39 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux)

>> I disagree in general.  What I agree to is that programmers should avoid
>> putting things that look like defuns inside comments and strings.
> Commented-out code may look like a defun.

Indeed, so programmers should be careful to comment out in a way that makes
it not look like a defun.  That's generally more or less true of code
commented out with M-x comment-region.

>> I.e. in Lisp, an open-paren-in-col0 is indeed a bad idea.  In C it's not
>> a problem (maybe an open-brace-in-col0 is a problem there, but not an open
>> paren).
> The Emacs manual states
> In modes where `open-paren-in-column-0-is-defun-start' is `t',
> *don't put an opening delimiter at the left margin unless it is a defun
> start*.
> and you say `open-paren-in-column-0-is-defun-start' is obsolete ;-)

Well I didn't say it's obsolete: I said I'd like to declare it obsolete
(but that'll require a few changes).  Note that its current effect is
extremely minor anyway (it only adds "^\\|" to defun-prompt-regexp and
slightly tweaks the way back_comment deals with worst-case scenarios).

> BTW, in Elisp an open bracket in column zero of a string should not
> confuse Emacs.  Yet you highlight it with `font-lock-warning-face'.

Indeed, it *shouldn't*, but it does confuse Emacs, which is why it's
highlighted ;-(.  We should fix it so it doesn't confuse Emacs any more (and
doesn't get highlighted either).


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]