Cursor kicking makes `M-x delete-trailing-whitespace` delete newline at the end of each form feed
wasamasa opened this issue · comments
M-x delete-trailing-whitespace
contains a hack to counter Emacs assumption of a form feed being whitespace (yes, seriously). The cursor kicking feature messes this hack up and makes the command delete a newline at the end of the displayed line which is not ok.
I can think of two ways of going at this. The fun way would involve writing a more powerful variant of called-interactively-p
to detect whether the point-entered
function was called by an interactive movement command. The boring way would involve submitting a bug report for Emacs, providing a minimal example and explaining the actual problem in excruciating detail, hoping that someone will take a look at it and provide a fix.
Considering that Stefan is on a crusade to eradicate similiar behaviour and the fact that cursor kicking was added to avoid the visual glitch of point on such a line hiding it in graphical Emacs instances (textual ones don't expose this), I think I'll just remove the feature after handing in a bug report about that oddity.
Bump
I noticed such a blank line disappearing in one of my diffs just now. I didn't call delete-trailing-whitespace
, nor did ethan-wspace-mode
do this in its after-save-hook, but toggling this mode prevents it from happening.
@expez You can temporarily work around this by customizing form-feed-kick-cursor
before enabling form-feed-mode
. See #2 for earlier discussion of this problem.
I'm writing a minimal example for reproducing the display bug and will submit a bug report afterwards, then I can dike the feature out and live with that glitch until its fixed in the Git release :)
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21500
I don't ever expect it to get fixed, but I can deal with it.
Great!
I did (setq form-feed-kick-cursor nil)
, prior to starting the mode, and will keep watching this thread :)
Thanks for reminding me about this.
I've got a workaround for the cursor thing, see http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21500#35 for further details. This means that you'll need to customize the face in your theme, but eh, I can live with that.