[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: for all XEmacs users
From: David Faure <faure () kde ! org>
Date: 1999-11-25 0:47:07
[Download RAW message or body]
Excellent, thanks.
On Thu, Nov 25, 1999 at 01:39:45AM +0100, Dirk A. Mueller wrote:
> Hi,
>
> XEmacs (probably also Emacs, don't know) per default can't trim trailing
> spaces from lines, like all other editors do. Especially if you reformat
> your source using XEmacs and somebody who's using a different editor
> commits a change to the file, he also commits many lines that only have a
> change in the amount of white space, nothing more.
>
> The next time a XEmacs user edits the file, there are again many lines with
> only changes in the amount of white space.
>
> You see the problem, it makes reading diffs more difficult and
> produces unnecessarily high delta's between revisions on the CVS server.
>
> A few weeks ago I found a nice elisp hook (.emacs from agulbra@troll.no)
> that forces XEmacs to trim the lines while loading. I adopted it to do that
> during saving, as it makes more sense there.
>
> So, please, everybody who uses XEmacs, please add the following lines to
> your ~/.emacs:
>
> (defun agulbra-clean-out-spaces ()
> "Remove spaces at ends of lines"
> (interactive)
> (and ;;(eq major-mode 'c++-mode)
> (not buffer-read-only)
> (save-excursion
> (goto-char (point-min))
> (let ((count 0)
> (bmp (buffer-modified-p)))
> (while (re-search-forward " *$" nil t)
> (setq count (1+ count))
> (replace-match "" t t))
> (and (> count 0)
> (progn
> (set-buffer-modified-p bmp)
> (message "Cleaned %d lines" count)))))) nil)
> (add-hook 'write-file-hooks 'agulbra-clean-out-spaces)
>
> (custom-set-variables
> '(require-final-newline t)
> )
>
>
> Thanks in advance.
>
> Dirk
>
--
David FAURE
david@mandrakesoft.com, faure@kde.org
http://home.clara.net/faure/
KDE, Making The Future of Computing Available Today
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic