From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Robert Thorpe Newsgroups: gmane.emacs.help Subject: Re: replace-regexp, the byte-compiler, docstrings, and suggestions Date: Sat, 18 Oct 2014 18:57:20 +0100 Message-ID: <87siilmfb3.fsf@robertthorpeconsulting.com> References: <87h9z35wp7.fsf@debian.uxu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1413655078 1731 80.91.229.3 (18 Oct 2014 17:57:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 18 Oct 2014 17:57:58 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Emanuel Berg Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Oct 18 19:57:51 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XfYGD-0005gJ-PJ for geh-help-gnu-emacs@m.gmane.org; Sat, 18 Oct 2014 19:57:49 +0200 Original-Received: from localhost ([::1]:37360 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XfYGC-0001yE-Vw for geh-help-gnu-emacs@m.gmane.org; Sat, 18 Oct 2014 13:57:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33208) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XfYFw-0001y6-Cy for help-gnu-emacs@gnu.org; Sat, 18 Oct 2014 13:57:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XfYFp-0004lz-Np for help-gnu-emacs@gnu.org; Sat, 18 Oct 2014 13:57:32 -0400 Original-Received: from outbound-smtp05.blacknight.com ([81.17.249.38]:37875) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XfYFp-0004iZ-I0 for help-gnu-emacs@gnu.org; Sat, 18 Oct 2014 13:57:25 -0400 Original-Received: from mail.blacknight.com (pemlinmail02.blacknight.ie [81.17.254.11]) by outbound-smtp05.blacknight.com (Postfix) with ESMTP id 76C172101E8 for ; Sat, 18 Oct 2014 17:55:01 +0000 (UTC) Original-Received: (qmail 32259 invoked from network); 18 Oct 2014 17:57:21 -0000 Original-Received: from unknown (HELO RTLaptop) (rt@robertthorpeconsulting.com@[109.77.195.205]) by 81.17.254.9 with ESMTPSA (DHE-RSA-AES128-SHA encrypted, authenticated); 18 Oct 2014 17:57:21 -0000 In-Reply-To: <87h9z35wp7.fsf@debian.uxu> (message from Emanuel Berg on Fri, 17 Oct 2014 03:09:08 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 81.17.249.38 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:100494 Archived-At: Emanuel Berg writes: > (defun untab-all () > (if (not (member major-mode '(makefile-gmake-mode > makefile-mode) )) ; exceptions > (untabify (point-min) (point-max)) ) > nil) ; tell 'did not write buffer to disk' > > (setq before-save-hook '(untab-all delete-trailing-whitespace)) Code like this can be useful if you only deal with your own code. If you program in collaboration with others it's troublesome. Converting all the whitespace in a file causes version control programs to indicate a lot of changes have happened. In my opinion it's better to work this way: * Write a script to remove all of the tabs in all your personal file. Do that as a one-off operation * Set indent-tabs-mode so Emacs never generates new tabs. * Don't untab files before saving them. The advantage of this is that your own stuff will always be tab-clean but you can still cooperate with others who use VC. BR, Robert Thorpe