mawww / kakoune

mawww's experiment for a better code editor
http://kakoune.org
The Unlicense
9.98k stars 715 forks source link

[QUESTION] #4508

Open nonumeros opened 2 years ago

nonumeros commented 2 years ago

Question

i was setting up a new system and I forgot to set and export locales accordingly. The system was using the old UNIX C

I did noticed, however, not only I had missed to specify it under the terminal in use, which wasn't the case on xterm for that matter, but under vim, I managed to get away with it through set encoding=utf-8 easily on the terminal side.

Now, this issue probably has been brought up before as noted here or elsewhere, and I'm sure there are reasons for it. Anyone can say that it would be wise to rely on the system rather than the editor, but this is certainly not the case with vim, as pointed out before.

In other words, I had just set up a fully functional system, albeit with a few glitches here and there, and for which no locales had been exported accordingly and yet vim could handle any characters set utf-8 with a quick implementation such as set encoding=utf-8.

So, isn't there by any chance the possibility, as remote and far fetched as it may be and sound, that someone might say, well, I don't want to have utf-8 as default and I don't need it, but it may be useful to have an editor to handle the task when needed, without further tweaks to the system.

With that being said, if kak is able to handle utf-8, as far as I know, with ease, why not implement it within, as vim does, regardless of the locales set.

I know, (by reading past comments from @screwtapello and @mawww who have indicated that having a Unicode database is something not to be taken lightly, and better avoided at all costs), but hasn't emacs, for example, has done this for centuries?

https://www.gnu.org/software/emacs/manual/html_node/elisp/Text-Representations.html

What characters should there be if any, ought to be be considered and this is the question. Would some sort of latin1 encoding be considered?, And that is the question, and not the answer. Unfortunately I just can't comment there. My knowledge level disallows me to do that.

But, if memory serves me right, (I could be wrong but I remember reading about it a while back) during a discussion among the emacs development team for example, rms at one given time, was strongly against having color emojis implemented. So, there's a clear difference for what should be taken into account and what shouldn't.

Screwtapello commented 2 years ago

All kinds of things are possible, and tools like Vim and Emacs demonstrate what's technically achievable. However, keep in mind that both Emacs and Vim were originally ported to Unix from other, wildly different operating systems. Both projects have a culture of extreme portability, and are willing to make all kinds of sacrifices to keep things working consistently across every supported platform.

Kakoune, in contrast, is much less interested in portability. It's very specifically designed for modern POSIX systems, where "modern" includes things like "A C++20 compiler", "terminals that support more than 16 colours", and "UTF-8 locale support". Even a minimalist POSIX system like Alpine Linux supports the C.UTF-8 locale out-of-the-box, and OpenBSD only supports the C and C.UTF-8 locales (I'm not sure what OpenBSD's default is).

Given that all the platforms Kakoune is interested in have good support for UTF-8, it doesn't make a lot of sense to duplicate all that stuff into Kakoune as well.