You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have ethan-wspace installed for more than a year with the following configuration:
(use-package ethan-wspace
:diminish
:config
(setq mode-require-final-newline nil)
(setq ethan-wspace-face-customized nil)
(global-ethan-wspace-mode 1))
I'm using current emacs from git (compiled and built every two days or so)
For a week or two I have found that the function ethan-wspace-clean-before-save-hook in before-save-hook deletes trailing dashes (minuses) in math formulas of auctex mode. I have also noticed that strings of trailing dashes in comments of other modes are also removed.
How this happens and how to prevent it (delete only trailing spaces not dashes)?
Thank you in advance!
The text was updated successfully, but these errors were encountered:
This is a really nasty bug - many equations in auctex mode and comments composed of trailing dashes/hyphens in other files were deleted. Fortunately I could identify and revert these changes under git version control.
In fact I played with spell-fu these days so it can the the reason. Anyway, I removed loading spell-fu and now the dashes are not removed anymore and the syntax of '---' is symbol.
Can you confirm that this could be the reason that the syntax table is related to this trailing dash removal?
This sounds like it's related to the eol cleanup code. However, this code doesn't itself do any of the deleting -- it just calls to the builtin emacs function delete-trailing-whitespace (shown here). You could see if the problem is there by just calling delete-trailing-whitespace explicitly instead of saving the file. I suspect that it will still delete your hyphen characters because of the code here -- it's going backwards until it finds a character that isn't of the syntax -, and then deleting it.
It seems that the syntax - is the syntax category of "whitespace". I see that spell-fu describes this as trying to make the hyphen character a "word boundary". Maybe setting it to syntax class _, meaning "symbol constitutent", would work instead, or ., for "punctuation character? However, I think the code in spell-fu is not trying to use this modified syntax table globally, but just in a few functions. Maybe the bug is that the syntax table is getting used too broadly somehow?
I do think that this interaction is the cause of the bug. I'm not 100% sure what to do about it. Maybe you could open a bug on the spell-fu repository. I'm happy to help more if I can!
I have ethan-wspace installed for more than a year with the following configuration:
(use-package ethan-wspace
:diminish
:config
(setq mode-require-final-newline nil)
(setq ethan-wspace-face-customized nil)
(global-ethan-wspace-mode 1))
I'm using current emacs from git (compiled and built every two days or so)
For a week or two I have found that the function
ethan-wspace-clean-before-save-hook
inbefore-save-hook
deletes trailing dashes (minuses) in math formulas of auctex mode. I have also noticed that strings of trailing dashes in comments of other modes are also removed.How this happens and how to prevent it (delete only trailing spaces not dashes)?
Thank you in advance!
The text was updated successfully, but these errors were encountered: