Questions tagged [whitespace-mode]
41 questions
16
votes
2 answers
Only doing whitespace-cleanup on the lines touched
For most projects I work on I use a before-save-hook to run whitespace-cleanup. This is fine when everybody on the team cleanups up their spaces but sometimes I am involved in already running projects were most files are littered with trailing…

remvee
- 561
- 6
- 13
8
votes
2 answers
Only enable whitespace mode in certain buffers
I would like to have whitespace mode turned on for all buffer except for org-mode ones. It is easy to do this when emacs starts up, but since I use a persistant copy of emacs with emacs daemon mode I can't just do it that way.
I tried:
(require…

jcv
- 225
- 1
- 6
6
votes
1 answer
Whitespace highlighting
I've tried whitespace-mode, but I can't configure it the way I want. There are others, but some of them are obsolete and I don't want to try them all.
I always indent via tabs and can't stand trailing whitespace. I never combine tabs and spaces…

maaartinus
- 235
- 1
- 7
6
votes
2 answers
Prevent whitespace-mode from overzealously highlighting blank lines at end
When using Whitespace Mode with the empty style enabled, the blank lines at the end of a file aren't highlighted if I'm on the very last line. However, I also don't want them to be highlighted if I'm on the line before last, since it visually…

Lily Chung
- 375
- 1
- 8
4
votes
3 answers
magit-status does not open, when using (global-whitespace-mode 1)
This problem started happening today when I switched to my desktop computer after a couple months of using my laptop. I updated emacs to 25.3.1, updated all my packages, and downloaded my latest .emacs, the one that I had been using on my…

jcarpenter2
- 227
- 1
- 6
4
votes
1 answer
distinguish inner consecutive spaces
I'm aware of and use whitespace-mode to great effect. I don't show a glyph/character for spaces because I think it's too noisy and unnecessary. I do highlight trailing spaces red which is great.
Aside from that, I was thinking that it may be useful…

Jorge Israel Peña
- 1,265
- 9
- 17
4
votes
0 answers
mix spaces and tabs in python mode
Is it possible with whitespace-mode (or another mode) to only show mix spaces an tabs (in python mode) ?
Only highlight if:
there is space before tab or tab before space
there is space and indent-tabs-mode is t
there is tabs and indent-tabs-mode is…

djangoliv
- 3,169
- 16
- 31
4
votes
1 answer
Whitespace-mode characters: customise mapping of printable character representations
The whitespace-mode has a default mapping from whitespace characters to printable characters:
U+0020 → U+00B7 “·”
U+0009 → U+00BB “»”
U+000A → U+0024 “$”
etc.
How can I change which printable characters are used for each whitespace character? For…

bignose
- 627
- 3
- 15
3
votes
1 answer
whitespace-mode ignores whitespace-line-column
In ~/.emacs I've globally enabled whitespace-mode:
(require 'whitespace)
(setq whitespace-style '(face empty tabs lines-tail trailing))
(global-whitespace-mode t)
Example buffer content:
-*- fill-column: 100; whitespace-line-column: nil -*-
Lorem…

feklee
- 1,029
- 5
- 17
3
votes
1 answer
Can I modify whitespace mode to distinguish hard and soft newlines?
Currently, whitespace.el shows me newline characters by changing the display table to show a $ at the end of lines.
I don't actually find this useful, so I disable it while I enjoy the many other benefits of whitespace-mode.
When I'm composing…

purple_arrows
- 2,373
- 10
- 19
3
votes
1 answer
Whitespace mode write dots for space chars
I'm using org-indent-mode. As far as I understand, the whitespace on the left is an overlay.
When you use this mode in conjunction with whitespace-mode, then there appears whitespace indications (dots) in the org-mode overlay on the left.
2]
Does…

Jenia Ivanov
- 427
- 4
- 14
2
votes
1 answer
Enable whitespace-mode with Prelude in C++-mode
With a vanilla install of Prelude and with C++-mode as my major mode, M-x whitespace-mode no longer shows whitespace characters. I get a message indicating that I am toggling whitespace-mode on and off but no whitespace is shown.
Has:
M-x…

Praxeolitic
- 387
- 2
- 9
2
votes
0 answers
How to display only leading spaces in whitespace mode
I've been having trouble getting whitespace to visualize properly. Specifically for 'spaces' I'd like to only display leading spaces, but turning on space white space visualization includes all spaces, not just leading spaces.
I've tried a few…

Justen Martin
- 121
- 2
2
votes
1 answer
whitespace-cleanup stopped working
I'm not sure what I did, but I'm trying to use M-x whitespace-cleanup in a python file and nothing happens. How do I debug this?

daeda
- 439
- 3
- 10
2
votes
1 answer
How to set whitespace-line-colum per mode?
I'm trying to have whitespace-line-column set to 80 in prog-mode and 100 in web-mode, etc. However when using hooks seems to get ignored, as is always set to 80.
(require 'whitespace)
(setq whitespace-style '(face trailing tab-mark…

zzantares
- 217
- 1
- 9