Questions tagged [whitespace-mode]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
16
votes
2answers
674 views

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 ...
8
votes
2answers
2k views

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 ...
6
votes
1answer
102 views

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 ...
6
votes
2answers
579 views

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 ...
4
votes
1answer
216 views

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. ...
3
votes
3answers
185 views

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 ....
3
votes
1answer
513 views

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-...
3
votes
1answer
189 views

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 ...
3
votes
1answer
530 views

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 (...
3
votes
1answer
251 views

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 ...
3
votes
0answers
211 views

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-...
2
votes
1answer
287 views

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 ...
2
votes
1answer
561 views

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 ...
2
votes
0answers
66 views

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,...
1
vote
3answers
99 views

How can I switch whitespace-mode enabled/disabled by key?

(defun switch-whitespace-mode () (interactive) (whitespace-mode) ) (global-set-key (kbd "<f6>") 'switch-whitespace-mode) Through the above configuration,I failed.
1
vote
1answer
405 views

Disable whitespace-mode for single mode [duplicate]

I'm using global-whitespace-mode with a particular whitespace-style as a default for all modes. How can I disable whitespace-mode completely for a single mode, eg. incoming email? I tried the ...
1
vote
1answer
57 views

What kinds of whitespace are visualized in Whitespace mode?

According to the Emacs manual (section 14.16 Useless Whitespace): The kinds of whitespace visualized [in whitespace mode -- Evan] are determined by the list variable whitespace-style. However, ...
1
vote
1answer
152 views

How to visualize trailing blanks and any tab characters (even non trailing)

I would like to visualize tabs. Here, I almost succeeded: (setq whitespace-style '(face trailing tabs lines-tail indentation)) face is needed for other things to work; trailing visualizes trailing ...
1
vote
1answer
534 views

disable whitespace mode on new buffers

After doing an some emacs packages updates, every time a new file is opened the buffer has whitespace mode turned on. I see red on all the whitespace at the start of lines. I've tried disabling ...
1
vote
1answer
558 views

Emacs whitespace mode doesn't show ^M characters

Somebody in my team has checked in a file with MS-DOS line endings into the git repo. with vi's binary mode, vi -b hello.py, i can see lines ending with ctrl character - ^M. In emacs, whitespace-...
1
vote
1answer
289 views

How to toggle whitespace mode in evil insert state?

I'd like to disable whitespace-mode while in evil insert state. The following hooks work, but require refreshing all font colors with (font-lock-fontify-buffer), and even then- sometimes it fails to ...
1
vote
0answers
65 views

How to display Unicode bidi markers only in Whitespace mode?

There's a way of displaying Unicode bidirectionality markers. The problem is: it makes them visible all the time. Is it possible to show them only in whitespace mode? PS I'm not chained to the method ...
0
votes
3answers
862 views

Custom whitespace-line-column for specific modes in whitespace-mode

I want to force whitespace-mode highlight line after 99 character in rust-mode (cuz this length recommended by guidelines). For other modes i want to leave this variable with default value(80). How ...
0
votes
2answers
377 views

Highlight useless whitespace at end of file

How do I make Emacs highlight whitespace at EOF, eg. any whitespace after >?\n for PHP? I think the general rule would be: After the last non-whitespace character, accept one newline, then ...
0
votes
2answers
847 views

whitespace-mode doesn't show the space characters

I need to see the space characters but I can't set it for the life of me. I went to customize the Whitespace Display Mapping and this is what I found. Notice that the mapping for the space is set to ...
0
votes
1answer
28 views

Space and line-end indicators stay after switching off whitespace-mode

When I switch on whitespace-mode I get all the indicators and color for showing superfluous whitespace. So far so good. But when I switch off whitespace-mode the space indicator . and the line-end ...
0
votes
1answer
24 views

Disable white-space mode emacs-26.3

I tried to highlight lines that exceed 80 columns using whitespace-mode. Eventually didn't like that idea and removed that from my init.el. However, the whitespaces are shown as . and line ends are $ ...
0
votes
0answers
50 views

whitespace-line-column highlight basing on the column number instead of char count

config (require 'whitespace) (setq whitespace-line-column 80) ;; limit line length (setq whitespace-style '(face tabs empty trailing lines-tail)) For first line, whitespace-mode correctly highlights ...
0
votes
1answer
40 views

Is it possible to use whitespace-mode without specyfing a background (or foreground) color?

I like having non-breaking spaces and a few other characters represented in my buffer as visible characters. The problem I have is that whitespace-mode seems determined to set the background color. In ...
0
votes
0answers
52 views

Whitespace mode only works in fundamental mode but not others (like org, Clojure, etc)

My problem is - the whitespace mode is only showing dots for whitespaces in fundamental mode, however in other modes, like clojure, when whitespace mode is active - nothing happens. I expect the ...
0
votes
1answer
87 views

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?