2

I've been looking at whitespace-mode, but I'm not sure it can do what I want here. Here is an example:

(defn foo []
..(let [x 1]
....(+ x 2)))

How can I do something like that in Emacs? In words, I'd like it to only visualize the leading (indentation) whitespace, but not all spaces in general. Just the spaces at the beginning of the lines.

2 Answers 2

3

The answer is to customize the whitespace-style variable and to remove the trailing keyword. Check out the wiki for whitespace mode.

0

I don't think it can. If you want it highlighted via font-lock you can add the following to an appropriate place (e.g. a mode hook) changing of course the face from trailing-whitespace to whatever you want.

(font-lock-add-keywords
 nil ;;current buffer instead of a particular mode
 '(("^ +" . 'trailing-whitespace)))

If you want it to be displayed with a visible mark then I don't think that can be done (easily) since whitespace-mode sets buffer-display-table which does a "global replacement" i.e., it doesn't take into account syntax or anything.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .