Problem
So the problem is pretty straight forward I'm just trying to get delete trailing spaces from all files in a projectile project.
Here's what I've tried so far:
(defun projectile-delete-trailing-white-spaces-from-project-files ()
"Deletes trailing spaces from all projectile project files."
(interactive)
(let* ((list (projectile-current-project-files))
(buffer (car list)))
(while buffer
(message buffer)
(when
(when (file-exists-p buffer)
(set-buffer (find-file-noselect buffer))
(delete-trailing-whitespace) ;; <-- This isn't working?
(save-buffer)) ;; <-- This isn't working?
(setq list (cdr list))
(setq buffer (car list))
))))