Emacs indentation coloring

Amit Patel amitp at Xenon.Stanford.EDU
Sun Jun 25 22:31:56 EDT 2000


 Emile van Sebille <emile at fenx.com> wrote:
| 
| 
| Which is why I prefer an editor that shows whitespace
| and use tabs.  That makes it easy to follow the column
| of tab marks down the screen.
| 
| Emile van Sebille
| emile at fenx.com

So here's something I've played with in XEmacs:

Create a pixmap/png that's one indentation wide, with a single vertical
line in it.  Then,

(make-face 'indent-face)
(set-face-background-pixmap 'indent-face [png :file "indent.png"])
(require 'python-mode)
(setq python-font-lock-keywords
  (append 
    '(
       ("^ +" . indent-face)
     )
   python-font-lock-keywords))


This will put in vertical lines that lead you from the beginning of a
block to the end.  (It doesn't work so great when you have blank lines
in the code though, unless you fill them with spaces.)


-but-i-admit-i-miss-semicolons-and-braces-ly-yr's, Amit


-- 
--
Amit J Patel, Computer Science Department, Stanford University
http://www-cs-students.stanford.edu/~amitp/



More information about the Python-list mailing list