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.

link|improve this question

50% accept rate
feedback

2 Answers

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

link|improve this answer
feedback

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.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.