org-gtd.el icon indicating copy to clipboard operation
org-gtd.el copied to clipboard

Ensure that whitespace-cleanup removes empty lines

Open jakalx opened this issue 3 years ago • 5 comments

This change sets 'whitespace-style' to a sane value so that whitespace-cleanup does what it is intended to do, e.g. remove empty lines.

jakalx avatar Aug 29 '22 19:08 jakalx

Ooh, thank you! Are you comfortable adding a test to verify that the behavior is indeed fixed?

Trevoke avatar Aug 30 '22 12:08 Trevoke

Not yet comfortable :) Currently, I have issues to reproduce the incorrect behavior.

jakalx avatar Aug 31 '22 23:08 jakalx

Maybe you have your own whitespace configuration?

I certainly do, which is why I never noticed the problem.

--

Aldric. Sent from a mobile device.

On Wed, Aug 31, 2022, 19:52 jakalx @.***> wrote:

Not yet comfortable :) Currently, I have issues to reproduce the incorrect behavior.

— Reply to this email directly, view it on GitHub https://github.com/Trevoke/org-gtd.el/pull/96#issuecomment-1233564210, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAQSSLGGHK54KY54IQ7HK3V37V2TANCNFSM5764I3FA . You are receiving this because you commented.Message ID: <Trevoke/org-gtd. @.***>

Trevoke avatar Sep 01 '22 00:09 Trevoke

OK, I'm able to reproduce it. I'm using doom-emacs which seems to change whitespace-style, however, I read the documentation of whitespace-cleanup and it should actually work.

I just replayed archiving via "quick action" and it seems it always leaves a newline behind (i.e. a subtree gets replaced by an empty line) - if I just refile one of the headings from inbox.org to somewhere else, there's no newline remaining.

I'm able to run the tests and hopefully I'll figure out how to trigger my issue from within the test environment.

jakalx avatar Sep 01 '22 12:09 jakalx

Hi @jakalx ,

One thing to note is that if you write a test such as "this is what the inbox buffer should look like after processing" and you process, and it works, then probably you don't need to edit the code of this package, just your whitespace configuration -- I say this because the tests run in a very vanilla emacs, so it should be closer to the average user's experience.

Let me know what your results yield, there might be some work to do one way or the other :)

Trevoke avatar Sep 19 '22 22:09 Trevoke

I'm going to close this pull request for two reasons:

  1. long inactivity
  2. I just found org-N-empty-lines-before-current which will do what we need way more cleanly than trying to hack the whitespace mode :D so I'm gonna open an issue describing this particular problem and desired fix.

Trevoke avatar Mar 14 '23 00:03 Trevoke