emacs-devel
[Top][All Lists]
Advanced

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

Re: Emacs rewrite in a maintainable language


From: Oleh Krehel
Subject: Re: Emacs rewrite in a maintainable language
Date: Mon, 12 Oct 2015 17:24:26 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Paul Eggert <address@hidden> writes:

> On 10/12/2015 05:48 AM, Oleh Krehel wrote:
>> I've been trying to get into understanding Emacs C core, but it's just
>> so hard with all those macros around.
>
> I dislike those macros too, and have gotten rid of more than my share
> of them, typically replacing them with inline functions (e.g., XFLOAT)
> or with enum constants (e.g., BITS_PER_CHAR). Much more work could be
> done in this area. This part largely doesn't need C++, and the few
> places where it might benefit from C++ typically require so much C++
> foo that it's not clear it's worth the hassle.

Thanks for your effort. It's very much needed and appreciated.

> I suppose the main advantage of C++ over C, for something like the
> Emacs core, would be encapsulation. But here again, it's not clear
> that C++ would be enough of a win. The ways in which the Emacs core
> are poorly encapsulated are largely independent of C vs C++. Changing
> it to be better-encapsulated C++ would not be that much of a win over
> changing the current Emacs to be better-encapsulated C.

Better encapsulation is definitely needed, and using C++ allows the
compiler to enforce this encapsulation, instead of just grepping
manually to make sure each private isn't used outside of
getters/setters.

For example, I was trying to write some code to make the mark be
window-local and not buffer-local, just like the point.  And it's hard
to see all uses of point wrt window-point, because of insufficient
encapsulation.

    Oleh



reply via email to

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