Derek controls your .emacs file?!? That's a little personal, don't you think?? :-)
On Dec 5, 2011, at 12:49 PM, "Cody Permann" <[email protected]> wrote: > Roy, > > We just noticed the whitespace commit. Where you able to get a hook into > place to stop future whitespace commits? If not are their plans to do so? I'd > be happy to share my hook with you if you'd like. Also Derek mentioned that > we added some options to our .emacs file to remove trailing whitespace as we > edit. I'm no expert on LISP but I was able to hack together some functions > with the help of John and Google: > > ; ########################## > (add-hook 'c-mode-common-hook (lambda () > (dolist (path my-path-alist) > (if (string-match path (buffer-file-name)) > (add-hook 'local-write-file-hooks > 'delete-trailing-whitespace))))) > > (add-hook 'conf-mode-hook (lambda () > (dolist (path my-path-alist) > (if (string-match path (buffer-file-name)) > (add-hook 'local-write-file-hooks > 'delete-trailing-whitespace))))) > > (add-hook 'python-mode-hook (lambda () > (dolist (path my-path-alist) > (if (string-match path (buffer-file-name)) > (add-hook 'local-write-file-hooks > 'delete-trailing-whitespace))))) > ;########################### > > Basically we conditionally set a per-buffer "action" to remove trailing > whitespace every time we save a particular buffer. This means that we can > use the same Emacs session to edit multiple projects while still maintaining > the ability to enforce whitespace rules only on specific paths. Anyone using > these functions will need to supply the "my-path-alist" function which just > returns a list of paths. Happy LISPing! > > Cody > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure > contains a definitive record of customers, application performance, > security threats, fraudulent activity, and more. Splunk takes this > data and makes sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-novd2d > _______________________________________________ > Libmesh-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/libmesh-devel ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d _______________________________________________ Libmesh-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libmesh-devel
