70
70
(let ((re (format "\\( \\) \\{%s\\}" (- highlight-indent-offset 1))))
71
71
(if (not highlight-indent-active)
72
72
(progn ;; Toggle on
73
(set (make-local-variable 'highlight-indent-offset)
76
;; Set indentation offset according to major mode
77
(cond ((eq major-mode 'python-mode)
78
(if (boundp 'python-indent)
81
((eq major-mode 'ruby-mode)
83
((eq major-mode 'nxml-mode)
85
((local-variable-p 'c-basic-offset)
73
(set (make-local-variable 'highlight-indent-offset)
76
;; Set indentation offset according to major mode
77
(cond ((eq major-mode 'python-mode)
78
(if (boundp 'python-indent)
81
((eq major-mode 'ruby-mode)
83
((eq major-mode 'nxml-mode)
85
((local-variable-p 'c-basic-offset)
88
88
(default-value 'highlight-indent-offset)))))
89
(set (make-local-variable 'highlight-indent-active) t)
89
(set (make-local-variable 'highlight-indent-active) t)
90
90
(if (featurep 'xemacs)
91
(font-lock-add-keywords nil `((,re (1 'paren-face-match))))
91
(font-lock-add-keywords nil `((,re (1 'paren-face-match))))
92
92
(font-lock-add-keywords nil `((,re (1 'highlight-indent-face)))))
93
(message (format "highlight-indentation with indent-width %s"
93
(message (format "highlight-indentation with indent-width %s"
94
94
highlight-indent-offset)))
96
96
(set (make-local-variable 'highlight-indent-active) nil)