[Top][All Lists]

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

Re: emacs rendering comparisson between emacs23 and emacs26.3

From: Alan Mackenzie
Subject: Re: emacs rendering comparisson between emacs23 and emacs26.3
Date: Sun, 5 Apr 2020 11:16:23 +0000

Hello, Richard.

On Sat, Apr 04, 2020 at 23:12:49 -0400, Richard Stallman wrote:
> [[[ To any NSA and FBI agents reading my email: please consider    ]]]
> [[[ whether defending the US Constitution against all enemies,     ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]

>   > > 'open-paren-in-column-0-is-defun-start', if non-nil,
>   > > conceptually allows progmodes to avoid scanning an entire buffer
>   > > in order to get things like syntax highlighting and code
>   > > indenting right.  Rather, progmodes are allowed to find the
>   > > first or next paren in column zero wrt a given position and base
>   > > further decisions on the assumption that such a paren is on the
>   > > "top level" of its buffer.

>   > This assumption proved to be very problematic.

> Problematic for whom?

Well, for me for a start.  ;-)  I had to deal with lots of bug reports,
the solution to which was "please put a \ before the ( in your comment".
One of these was in the copyright statement in the Emacs C sources (see
bug #22884).  This bug caused the typing of a "//" to take over 10
seconds to redisplay.

> I don't see why.

Suppose open-paren-in-column-0-is-defun-start is non-nil, and we have
something like:

    /* foo
    (but bar

.  From the indicated point, do (scan-lists (point) -1 1).

(i) scan-lists moves back and finds the comment end....
(ii) ... and thus calls back_comment.
(iii) back_comment finds the ( in column zero, and wrongly assumes this
  is the beginning of a function.
(iv) back_comment breaks off its scanning, returning "comment start not
(v) scan_lists carries on the scanning from just before the "*/", now
  blissfully unaware it's actually inside a comment.
(vi) scan_lists finds the (, and returns its position.

The indentation and/or fontification functions in CC Mode are now

>   > The fact is, people put parentheses in column zero inside
>   > comments, and nothing we can say or do will stop them.  Why should
>   > it?

> Why would we want to "stop them"?  That feature is/was a _convenience_
> for users, a speedup.  If you don't appreciate the speedup, so you decide
> not to arrange to get it, why should I argue with you?  I can still benefit
> from that speedup in my projects. so I am happy and so are you.

o-p-i-c-0-i-d-s is an arcane variable which very few users are aware of.
Their first knowledge of it typically came in my response to their bug
report saying put the backslash before the paren.  There are likely many
more users who have encountered wrong indentation/fontification who have
just not bothered reporting it.

>   > these parentheses are perfectly valid in so many languages.

> Nobody said they were "invalid" in any language.  I think we are
> miscommunicating.

I think I meant that, given their validity, it is up to us as Emacs
developers to arrange that they don't cause trouble, rather than
expecting our users to insert these obtrusive backslashes.

> -- 
> Dr Richard Stallman
> Chief GNUisance of the GNU Project (https://gnu.org)
> Founder, Free Software Foundation (https://fsf.org)
> Internet Hall-of-Famer (https://internethalloffame.org)

Alan Mackenzie (Nuremberg, Germany).

reply via email to

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