Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers

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

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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