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

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

bug#20322: 25.0.50; indent-tabs-mode should default to nil


From: Dmitry Gutov
Subject: bug#20322: 25.0.50; indent-tabs-mode should default to nil
Date: Fri, 17 Apr 2015 05:48:08 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:36.0) Gecko/20100101 Thunderbird/36.0

On 04/15/2015 07:10 PM, Eli Zaretskii wrote:

If it turns out that most of the modes need indent-tabs-mode set to
nil, you can make it the default in prog-mode, or even in fundamental
mode.

Make it the default in fundamental mode means changing the default value of the variable.

As long as the modes that don't need to avoid tabs are changed
to have the same default as now, I won't object.

I'm not aware of any popular programming language that doesn't work with tabs for indentation. So "need" is a pretty strong word. If the statistics show that spaces are more popular on GitHub for C and C++, why not follow the logical conclusion and change the defaults for those modes, too?

Note that cc-mode also services the needs of Emacs users writing Java and Objective-C (all seven of them), and those folks must be relatively modern-inclined.

And while I wouldn't mind leaving this bee's nest "as is", there's no way to do that just for C and C++ without introducing additional complication for users that *do* want to use spaces with those langs.

Like I said, in the end that would call for the change of the
default value. In the meantime, should we have an
xxx-indent-tabs-mode variable per major mode?

I don't see a need for a mode-specific variable in this case; do you?

How, then, will the users change that value? With `add-hook', `xxx-mode-hook' and a lambda function?

That's a significant jump in complexity from what's currently needed to change `indent-tabs-mode' - either `setq-default', or actually using the `Customize' interface.

Think back to the four "how to configure indentation" steps I listed in an earlier email. Now mode-hooks and lambdas will add one or two new ones, and without a variable, the user will have to figure out somehow that the major mode function changes the `indent-tabs-mode' value.

It wouldn't have simplified the scenario for me: at the time I configured Emacs both for JavaScript *and* C (and a few other languages), to do tutorials, exercises and that kind of stuff.

The vast majority of people I work with use tabs, FWIW.

Do they use 8-column offsets, then?

No (that's how I know they use tabs in the first place!).

One of us doesn't understand the other here. Just to be sure: I meant `c-basic-offset', not `tab-width'.

For a customizable option, this is not an issue.  I can understand
that the new generation may want to get rid of tabs, but since most of
that generation don't work in C/C++, I think we can leave those alone
for now.

The question is not what the majority of the "new generation" works in (probably Java, or PHP), but what fraction of C/C++ programmers uses spaces.

Anyway, just for an arbitrary example, here's the three projects using C++ that I've looked at most recently. All relevant to Emacs's code assistance (which is the area I'm paying attention to lately):

https://github.com/Sarcasm/irony-mode
https://github.com/AndersBakken/rtags
https://github.com/Valloric/ycmd

None of them use tabs.





reply via email to

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