From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Spaces rather than tabs by a major mode hook Date: Sun, 12 Jun 2022 09:40:01 +0300 Message-ID: <83leu2wfjy.fsf@gnu.org> References: <83r13vy4nf.fsf@gnu.org> <83leu3y0hs.fsf@gnu.org> <83h74rxze0.fsf@gnu.org> <83bkuzxvur.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30830"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 12 08:42:36 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o0HIy-0007vB-Ni for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 12 Jun 2022 08:42:36 +0200 Original-Received: from localhost ([::1]:44976 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o0HIx-000774-CP for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 12 Jun 2022 02:42:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35344) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o0HGo-00076d-KR for help-gnu-emacs@gnu.org; Sun, 12 Jun 2022 02:40:24 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:41628) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o0HGo-0003vH-Ca for help-gnu-emacs@gnu.org; Sun, 12 Jun 2022 02:40:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=xpgyUlH96A6jkFUzsLjd7sq/a8BDh1XsoOiUXwiYhts=; b=UBOHrZJgPntG zBM0KPoh+PaJfp8vOXnLfGf25sZzu8rOZuENtEzxJy0eixhUM8CTPxZKq723epPzuSJcgAUvUtICe ie5mnWUMd5Nve1ALd6EvK32Yznt22ND3heQMXo8qGIEjTYpsBw2PNdj0dAfh9RDUOW+CU+VeCNAur JPrLeZUVWDKC55ChkqcyZJJ7aWsUo+TRREZc3E9UCN4x6x2vx1p7JVH1MG+JYONowXzwdI6C6+H2P JytiNLivW9x7ODJUOG7W3tIOo9DR4hJ0/xLHm+ZFBWQvGFtUfwjD3Me1zhFLBYMXqf26K2OiiHaPP lFmb2/QhyG5Vse0R+A//eg==; Original-Received: from [87.69.77.57] (port=4434 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o0HGk-0004aH-0J for help-gnu-emacs@gnu.org; Sun, 12 Jun 2022 02:40:20 -0400 In-Reply-To: (message from goncholden on Sat, 11 Jun 2022 20:02:57 +0000) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:137714 Archived-At: > Date: Sat, 11 Jun 2022 20:02:57 +0000 > From: goncholden > Cc: help-gnu-emacs@gnu.org > > > Emacs requires you to customize, once, the indentation so that it > > could thereafter help you by indenting everything automatically to > > suit the indentation style. That's a win by any measure. > > That the problem you are taking ages to understand. "Emacs requires you to customize", the origin of the problem. No, it isn't the problem. It is the solution to many problems, whereby people use many different coding styles in their programs. It is impossible to provide good indentation support for any arbitrary style, so if you happen to need to work with non-standard style, you need to tell Emacs about that style. > > > The question about how many columns should each construct be indented, has no answer. > > > > > > It should be possible to answer that question by just examining the > > file you posted. > > No, because there are thousands of files. Are they using different styles? If so, my suggestion is to reformat them to the default style supported by Emacs out of the box, before you start editing. > > Alternatively, you could just reindent the entire file according to > > the defaults, like this: > > > > C-x h > > C-M-\ > > > > and then keep making changes without any customizations. > > That would destroy the possibilities of easily detecting code changes. Detecting code changes is nowadays the job of a VCS. A modern VCS can easily show you changes other than whitespace changes. Or you can commit the reformatted but otherwise unchanged source first, and then examine the changes relative to that. > The mantra that things can always be customised implies observance to a single formatting scheme. Legacy code does not even subscribe to that. They only had simple editors. If I introduce tabs with > "C-q TAB", all those tabs get removed by emacs as soon as one presses return at the end of the line. > > Emacs is acting like a dictator. If Emacs doesn't satisfy your needs, you are free to use another editor, aren't you?