From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: wael-zwaiter@gmx.com Newsgroups: gmane.emacs.help Subject: Re: Indenting with spaces rather than tabs Date: Fri, 29 Jan 2021 14:04:20 +0100 Message-ID: References: <87a6ssxqke.fsf@robertthorpeconsulting.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24962"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Robert Thorpe Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 29 14:06:07 2021 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 1l5TTS-0006NF-QQ for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 29 Jan 2021 14:06:06 +0100 Original-Received: from localhost ([::1]:43600 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l5TTR-0007Ah-Od for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 29 Jan 2021 08:06:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55512) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l5TRt-00079t-2m for help-gnu-emacs@gnu.org; Fri, 29 Jan 2021 08:04:30 -0500 Original-Received: from mout.gmx.net ([212.227.15.15]:47513) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l5TRn-0000HS-03 for help-gnu-emacs@gnu.org; Fri, 29 Jan 2021 08:04:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1611925460; bh=GKmQgUGFGzX9rSyfRT4uWUk1D2R1/VZI+e5JgrBAikA=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=UqJ4hlgOyIC+GNzd/ZaBriPc+YVXMQAVqjxOcX1Vx7ku8ZbLclDQ4RbB04g9HiEoF aPHbReaFPcosDUr1+aeLRPUoBxNl5AL8THE950yYYTQ3W39pb/FtYj19gW7Ne1E91H r3ftDbzeJtxgrgmRoQo4OnsG0nlD+3kRlUnBGhks= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [213.165.168.94] ([213.165.168.94]) by web-mail.gmx.net (3c-app-mailcom-bs02.server.lan [172.19.170.129]) (via HTTP); Fri, 29 Jan 2021 14:04:20 +0100 Importance: normal Sensitivity: Normal In-Reply-To: <87a6ssxqke.fsf@robertthorpeconsulting.com> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:X6poB8PWxE5Gxe/DXE5NFRGVVWvXLBxkPbgsUbrZS/EdcWr2KdB4pUk8LHSBXObB20Ecx OQyl3Z/sZzf3wd04ZsrtKNCAaa04mVPqNLSIgH4ZafuxeKPytUqH089k3FHJ8HlT83P7Iw8DoxcA xHG/KajmRZ3nNrkBn1cgwod7RwhOf3LfFwUN7h62jqC8JFsYV+FzZvfx3wN9k8w8iBAUY4e7d/KK VVv0CB886Wche06rLx2zRx1lFfLKyJHIyAt5EZw6piMOOqUonGh7NL1h9sySzDdKeKcRM71qqhAB Q0= X-UI-Out-Filterresults: notjunk:1;V03:K0:KhwXy2XsBJ4=:V4R+eqpg6m+zStmEDAamdc ppDhqB+6eblCjjZs8Ztic3LXJ45Vrs/SCIwV6g7iAXkt61QMLdCwhtCyUODtvIsTKHqqhmmrS b7ZzcCRLUkrF2yGdxl2RPbeFIc2gZqjzDavQwa7ZROpPzqSm3BnxpfD4o6R5VmP2oEWuEgTdR rBJ0c3xOSXpM6l1UsQ9hE/Lvc4Lq2txhXUfjvcT8eQHLEvom3V1ePJMlVcDt/rvxBDILkgCOH ZtiBClYc3Xz1CHNYrnbuI6OhhsQTj1+QxFIa3Bv7EX6MYph3120PfJPCHgXH869Mw3XARkAKN KYiYXPGs+IPZWrGKkVRpCz2x1c2KS5QBtjwl0TE/1Yoaw5zK8QIxYnfxALQFbhur/7pQZXg10 oGlaj4N5R2ceeEpVr5kCaiOMbzUoXFgnNtYq7/CCKOAJ3cijLyIFYAOALUm7H9q9GqYGQcobq AEZ3PM+mpAcDt0mD6kzay6t5XiYipHAfbawU2IJyFjtgUtr6zkc9vFyWiMQ0pfeN5kZCcjMxq VuWaltHJEc8044wNhXCFlWaug1G49SjD07EsOVfjYlmjNfIbMoXV9BEERuP7IV4h+6GCAqW5i WnzfPuYgve5a0= Received-SPF: pass client-ip=212.227.15.15; envelope-from=wael-zwaiter@gmx.com; helo=mout.gmx.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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:127423 Archived-At: Can I do as follows, so that tabs are removed when "dfv-untabify-state" is "true". (defvar dfv-untabify-state nil) (defun clean-before-save () "Removes trailing spaces and tabs upon exiting" (delete-trailing-whitespace) (when (dfv-untabify-state) (unless (member major-mode '(makefile-gmake-mode makefile-mode)) (untabify (point-min) (point-max))) )) > Sent: Friday, January 29, 2021 at 5:25 PM > From: "Robert Thorpe" > To: wael-zwaiter@gmx.com > Cc: help-gnu-emacs@gnu.org > Subject: Re: Indenting with spaces rather than tabs > > wael-zwaiter@gmx.com writes: > > > Want to indent with spaces rather than tabs and have found the command > > > > (setq-default indent-tabs-mode nil) > > > > But one can also use "M-x untabify". > > > > What should I use for my init file? Am not so sure about using "setq" > > rather than "setq-default". > > If you set indent-tabs-mode like that then it applies to things that you > edit. > > But it does not apply to all of the file. Parts of the file you don't > edit are untouched. Now often this is what you want. If you're working > on a project in a group then you don't really want whitespace changes. > (Though really everyone should be using the same convention for tabs). > > On the other hand, untabify deals with the whole file. It changes parts > you have never edited or viewed. > > The setq-default part means that you're setting the default value for > buffers. But modes in buffers may over-ride it with a local variable > write. I'm not sure that you need setq-default here. > > BR, > Robert Thorpe >