help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: whitespace-cleanup + untabify?


From: Kevin Rodgers
Subject: Re: whitespace-cleanup + untabify?
Date: Sat, 14 Jun 2008 06:37:07 -0600
User-agent: Thunderbird 2.0.0.14 (Macintosh/20080421)

dsevilla@gmail.com wrote:
I'm a no tab person. I would like my whitespace-cleanup command to
also perform an untabify. How can this be done? I haven't found any
option that connects untabify and whitespace-cleanup. I'm using:

GNU Emacs 23.0.60.1 (i486-pc-linux-gnu, GTK+ Version 2.12.9)

I would really appreciate the help.

It's not documented, but because whitespace-global-mode is defined
via define-minor-mode there should be whitespace-global-mode-hook.
So perhaps something like this will work:

(add-hook 'whitespace-global-mode-hook
          (lambda ()
            (when whitespace-global-mode
              (untabify (point-min) (point-max)))))

Alternatively, you could hook directly into find-file-hook,
write-file-functions, and kill-buffer-hook just like
whitespace-global-mode does.

--
Kevin Rodgers
Denver, Colorado, USA





reply via email to

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