Questions tagged [whitespace-mode]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
38 views

Doom(?) Emacs: whitespace-mode uses incorrect style in c-mode?

I'd like emacs to display tab-marks nicely in c mode: here's an example of how it displays tabs in my config.el, which is how I want it to display tabs everywhere. You can see the nice > ...
user41268's user avatar
1 vote
0 answers
19 views

Initialization not liking whitespace mode after upgrading to 29.1?

I have the following configuration for whitespace mode in my .emacs file: (require 'whitespace) (setq whitespace-style '(trailing lines indentation space-before-tab space-after-tab) whitespace-...
Meng Lu's user avatar
  • 163
0 votes
1 answer
51 views

How to set the column number from which on the text is marked as exceeding line length limit?

The context for my question: Linux Mint 21 Cinnamon, emacs version 28.1.2 compiled from source by myself. See the image to know what I am speaking about: being apparently not alone with such kind of ...
Claudio's user avatar
  • 420
0 votes
2 answers
223 views

continuation markers in terminal visual-line-mode

How do I get continuation indicators (a character indicator at the far right edge, normally \) in visual-line mode when I'm working in a terminal emacs. FYI, the continuation markers on visual-line-...
Michael Stenner's user avatar
1 vote
1 answer
25 views

Changing style for global-whitespace-mode not taking effect

Have written this function to change the style for global-whitespace-mode. I describe the problem as follows. Suppose one calls (space-glow "tab-trail") followed by (space-glow "...
Dilna's user avatar
  • 1
2 votes
1 answer
972 views

How can I display tabs and spaces in Doom Emacs?

I have tried M-x whitespace-mode but it does not do anything.
BigBoy1337's user avatar
0 votes
1 answer
86 views

How to stop Emacs from highlighting Linux Tab characters?

So I opened a c++ script made in Xubuntu and every tab character was highlighted with grey. That doesn't happen when I open scripts made on Windows. How do I stop Emacs from highlighting them, it's ...
Philip's user avatar
  • 3
1 vote
0 answers
39 views

whitespace-mode does not display hidden characters in a patch file

I have a patch file on which if I do cat -A , I get : if (zif->rtadv.AdvIntervalOption)$ {$ struct nd_opt_adv_interval *ndopt_adv = $ ^I(struct nd_opt_adv_interval *)(buf + len);$ But ...
John Doe's user avatar
  • 169
1 vote
0 answers
206 views

Changing global-whitespace-mode options locally to a particular buffer

I want to customize the behavior of global-whitespace-mode on a per-major-mode basis, and also define some interactive commands that change what's being highlighted on a per-buffer basis. global-...
zwol's user avatar
  • 272
1 vote
1 answer
111 views

whitespace-style "face" activates highlighting of quoted string in fundamental mode

After putting face to whitespace-style: (setq whitespace-style '(trailing tabs empty face)) (global-whitespace-mode 1) string enclosed in a double quote started to be highlighted by font-lock-string-...
gavenkoa's user avatar
  • 3,362
0 votes
1 answer
171 views

Whitespace-mode: highlight hidden indentation of empty lines

I use whitespace-mode, intend with tabs (colored pale yellow, which is what I want) and I am wondering about the situation where there is an empty line inside an indented block (see image below). I ...
Guillaume Brunerie's user avatar
0 votes
1 answer
167 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 $ ...
Bussller's user avatar
  • 115
2 votes
0 answers
480 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,...
Justen Martin's user avatar
1 vote
0 answers
135 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 ...
junnu's user avatar
  • 780
0 votes
1 answer
269 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 ...
Norm's user avatar
  • 121
2 votes
1 answer
162 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?
daeda's user avatar
  • 439
1 vote
1 answer
826 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 ...
forthrin's user avatar
  • 451
0 votes
2 answers
841 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 ...
forthrin's user avatar
  • 451
4 votes
3 answers
241 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 ....
jcarpenter2's user avatar
0 votes
1 answer
47 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 ...
halloleo's user avatar
  • 1,311
1 vote
0 answers
116 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 ...
Evan Aad's user avatar
  • 1,511
1 vote
1 answer
83 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, ...
Evan Aad's user avatar
  • 1,511
0 votes
3 answers
1k 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 ...
Flowneee's user avatar
  • 237
1 vote
1 answer
449 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 ...
ideasman42's user avatar
  • 8,546
1 vote
3 answers
164 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.
moyotar's user avatar
  • 76
6 votes
1 answer
143 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 ...
maaartinus's user avatar
2 votes
1 answer
404 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 ...
zzantares's user avatar
  • 227
4 votes
1 answer
326 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. ...
Jorge Israel Peña's user avatar
2 votes
1 answer
701 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 ...
Drew's user avatar
  • 161
1 vote
1 answer
234 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 ...
Mark Karpov's user avatar
  • 4,933
4 votes
0 answers
256 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-...
djangoliv's user avatar
  • 3,179
3 votes
1 answer
761 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 (...
Jenia Ivanov's user avatar
4 votes
1 answer
547 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 ...
bignose's user avatar
  • 639
1 vote
1 answer
1k 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-...
Madhavan's user avatar
  • 1,977
0 votes
2 answers
1k 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 ...
Jenia Ivanov's user avatar
2 votes
1 answer
831 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 ...
Praxeolitic's user avatar
3 votes
1 answer
630 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-...
feklee's user avatar
  • 1,049
8 votes
2 answers
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 ...
jcv's user avatar
  • 235
3 votes
1 answer
391 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 ...
purple_arrows's user avatar
16 votes
2 answers
797 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 ...
remvee's user avatar
  • 561
6 votes
2 answers
700 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 ...
lily's user avatar
  • 375