Closed sam-s closed 4 years ago
Sounds like you have this well in hand.
You can always modify your personal sds-standard-hook
to further condition on ein:notebook-mode
being t
, e.g., in line 8, (setq show-trailing-whitespace (not ein:notebook-mode))
Not really. I do want the feature enabled, but only in the code cells, not in data cells. Please reopen the issue.
It remains unclear how your personal mode hooks possibly impact other users (that is one criterion for keeping an issue open).
I am also confused about how the qualifiers "feature", "fine", "enabled", and "show" interrelate. Is showing whitespace the feature? And does not showing it mean "everything is fine"? Perhaps you could more simply describe what you expect and how the program doesn't meet that expectation.
I want trailing whitespace to be shown (highlighted) by show-trailing-whitespace
in the editable areas (source code cells), but not in read-only areas (output/data cells).
My apologies, I interpreted your initial post as questioning why trailing ws was being highlighted at all.
The issue then is "holistic" buffer treatments such as those implemented in xdisp.c ought not bleed into indirect buffers. And that does have wider ramifications, so apologies again.
I have no solution for this. I've already cast the die on polymode, and I really would like to avoid going back to the erstwhile "poor man's" python-mode emulation.
The best I could suggest is this, which is not what you want.
(add-hook 'python-mode-hook
(lambda () (setq show-trailing-whitespace
(or (not (boundp 'ein:notebook-mode))
(not ein:notebook-mode)))))
When
point
is in an editable cell,show-trailing-whitespace
ist
and the output data highlights trailing whitespace. Whenpoint
is in non-editable output area,show-trailing-whitespace
isnil
and everything is fine. This might be due to