Skip to content

Add var and defun for removing trailing whitespace on save#608

Merged
cxxxr merged 2 commits intolem-project:masterfrom
rearman:whitespace-clean-on-save
Mar 26, 2023
Merged

Add var and defun for removing trailing whitespace on save#608
cxxxr merged 2 commits intolem-project:masterfrom
rearman:whitespace-clean-on-save

Conversation

@rearman
Copy link
Contributor

@rearman rearman commented Mar 22, 2023

Changes made in src/file-command.lisp

This change adds the variable delete-trailing-whitespace-on-writing-file and the defun clear-trailing-whitespace-on-write.
I tried to keep it in the same style as Add-Newline-at-EOF-on-Writing-File and add-newline-at-eof.

I tested by setting the variable to t, introducing trailing whitespace in multiple buffers, then saving using save-current-buffer and save-some-buffers to ensure the whitespace was removed in the proper places. I then did the same with the variable set to nil, and ensured that the whitespace was not removed.

@rearman
Copy link
Contributor Author

rearman commented Mar 22, 2023

Not sure what happened with the whitespace edits on that last commit, but the only change I intended to make was on line 73.

@cxxxr
Copy link
Member

cxxxr commented Mar 26, 2023

Thanks for the PR.
I was hoping to have this feature someday.

@cxxxr cxxxr merged commit 473f272 into lem-project:master Mar 26, 2023
@rearman rearman deleted the whitespace-clean-on-save branch April 14, 2023 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants