From: Robert Thorpe <rt@robertthorpeconsulting.com>
To: Emanuel Berg <embe8573@student.uu.se>
Cc: help-gnu-emacs@gnu.org
Subject: Re: replace-regexp, the byte-compiler, docstrings, and suggestions
Date: Sat, 18 Oct 2014 18:57:20 +0100 [thread overview]
Message-ID: <87siilmfb3.fsf@robertthorpeconsulting.com> (raw)
In-Reply-To: <87h9z35wp7.fsf@debian.uxu> (message from Emanuel Berg on Fri, 17 Oct 2014 03:09:08 +0200)
Emanuel Berg <embe8573@student.uu.se> 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
next prev parent reply other threads:[~2014-10-18 17:57 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-12 18:28 replace-regexp, the byte-compiler, docstrings, and suggestions Emanuel Berg
2014-10-12 20:32 ` John Mastro
2014-10-13 0:50 ` Robert Thorpe
[not found] ` <mailman.11050.1413145964.1147.help-gnu-emacs@gnu.org>
2014-10-16 23:55 ` Emanuel Berg
2014-10-17 0:07 ` Drew Adams
[not found] ` <mailman.11343.1413504497.1147.help-gnu-emacs@gnu.org>
2014-10-17 1:09 ` Emanuel Berg
2014-10-17 2:22 ` Drew Adams
2014-10-18 17:57 ` Robert Thorpe [this message]
2014-10-17 2:26 ` John Mastro
2014-10-17 3:05 ` Stefan Monnier
[not found] ` <mailman.11351.1413515156.1147.help-gnu-emacs@gnu.org>
2014-10-17 23:21 ` Emanuel Berg
[not found] ` <mailman.11350.1413512841.1147.help-gnu-emacs@gnu.org>
2014-10-17 19:11 ` Emanuel Berg
2014-10-17 19:20 ` Stefan Monnier
[not found] ` <mailman.11400.1413573661.1147.help-gnu-emacs@gnu.org>
2014-10-17 19:38 ` Emanuel Berg
2014-10-17 20:15 ` Stefan Monnier
[not found] ` <mailman.11404.1413576982.1147.help-gnu-emacs@gnu.org>
2014-10-17 22:52 ` Emanuel Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87siilmfb3.fsf@robertthorpeconsulting.com \
--to=rt@robertthorpeconsulting.com \
--cc=embe8573@student.uu.se \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).