For those using emacs-22.1 (apparently local-write-file-hooks is 
deprecated and didn't work for me) --->

(setq python-mode-hook
       '(lambda ()
          (add-hook 'write-file-functions 'delete-trailing-whitespace)
))

Maybe we should do a big trailing whitespace removal en masse once we 
move the transforms branch to trunk to get this taken care of once and 
for all... (?)

Cheers,
Mike

John Hunter wrote:
> On Nov 21, 2007 1:52 PM, Andrew Straw <[EMAIL PROTECTED]> wrote:
>> Thanks, that works, but unforunately only on emacs21 but not xemacs 21.
>> Looks like I'll now have to find a way to do the one thing in emacs that
>> keeps me using xemacs: goto-line bound to M-g. (Any quick tips appreciated.)
> 
> I think I may have found the ultimate emacs solution.  It really
> annoys me to see the trailing whitespace in my buffer.  When I start a
> new indented line but end up not adding anything there, it highlights
> the region from the left of the to where the cursor was a trailing
> whitespace so I have a lot of ugly red blocks in my buffer.  My new
> solution is not to highlight it, but to add a hook to emacs to delete
> it whenever I save my buffer.
> 
> (add-hook 'python-mode-hook
>           (lambda ()
>           (add-hook 'local-write-file-hooks 'delete-trailing-whitespace)
>           ))
> 
> Now I can be blissfully unaware of trailing whitespace as before, and
> my editor will clean it out on save.
> 
> JDH
> 
> -------------------------------------------------------------------------
> SF.Net email is sponsored by: The Future of Linux Business White Paper
> from Novell.  From the desktop to the data center, Linux is going
> mainstream.  Let it simplify your IT future.
> http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
> _______________________________________________
> Matplotlib-devel mailing list
> Matplotlib-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to