qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Patch removing spaces


From: malc
Subject: Re: [Qemu-devel] Patch removing spaces
Date: Tue, 20 May 2008 21:32:39 +0400 (MSD)

On Mon, 19 May 2008, Blue Swirl wrote:

On 5/19/08, malc <address@hidden> wrote:
On Mon, 19 May 2008, Ian Jackson wrote:


Balazs Attila-Mihaly \(Cd-MaN\) writes ("[Qemu-devel] Patch removing

spaces"): If anyone is interested: a patch which removes spaces from
the end of the lines. Compressed because it's rather big.


Please don't apply this patch!

Spaces at the ends of lines are indeed irritating and we should avoid
them.  But going out of our way to remove them is definitely wrong -
it's reformatting, which is nearly always wrong in Free Software.



 [..snip..]

 Preventive measure that makes the code look sufficiently ugly when
 tabs or trailing whitespace is present. Hands almost reflectively
 reach for `M-x nuke-trailing-whitespace' and `C-x h M-x untabify'

No match for M-x nuke-trailing-whitespace, where is that?

Oh, i have had it in my elisp collection for so long that forgot that
it's not included in XEmacs (not sure about FSF Emacs)

That's the one i use:

;; whitespace.el --- strip trailing whitespace from buffers
;; Author: Noah Friedman <address@hidden>
;; Created: 1995-02-11

 (defface font-lock-ws-face
  '((((class color) (background dark)) (:background "white"))
    (((class color) (background light)) (:background "black"))
    (t (:bold t)))
  "Font Lock mode face used to highlight unwated whitespace."
  :group 'font-lock-faces)
 (setq font-lock-ws-face 'font-lock-ws-face)

 (defun font-lock-mode-hook-fn ()
  (setq old-font-lock-keywords font-lock-keywords)
  (make-variable-buffer-local 'font-lock-keywords)
  (let ((elem
         (list
          (list "\\([ \t]+$\\)\\|\\(\t\\)"
                (list 0 font-lock-ws-face)))))
    (setq font-lock-keywords (append font-lock-keywords elem))))

 (add-hook 'font-lock-mode-hook 'font-lock-mode-hook-fn)

Thanks, it's ugly!

You are welcome :)

--
mailto:address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]