comparison lisp/modes/whitespace-mode.el @ 189:489f57a838ef r20-3b21

Import from CVS: tag r20-3b21
author cvs
date Mon, 13 Aug 2007 09:57:07 +0200
parents 6075d714658b
children
comparison
equal deleted inserted replaced
188:e29a8e7498d9 189:489f57a838ef
24 24
25 ;;; Synched up with: FSF 19.34. 25 ;;; Synched up with: FSF 19.34.
26 26
27 ;;; Commentary: 27 ;;; Commentary:
28 28
29 ;; $Id: whitespace-mode.el,v 1.4 1997/07/26 22:09:50 steve Exp $ 29 ;; $Id: whitespace-mode.el,v 1.5 1997/09/17 05:19:29 steve Exp $
30 ;; Description: 30 ;; Description:
31 ;; 31 ;;
32 ;; This is a minor mode, which highlights whitespaces (blanks and 32 ;; This is a minor mode, which highlights whitespaces (blanks and
33 ;; tabs) with different faces, so that it is easier to 33 ;; tabs) with different faces, so that it is easier to
34 ;; distinguish between them. 34 ;; distinguish between them.
90 (defgroup whitespace nil 90 (defgroup whitespace nil
91 "Minor mode for making whitespace visible" 91 "Minor mode for making whitespace visible"
92 :group 'outlines 92 :group 'outlines
93 :group 'matching) 93 :group 'matching)
94 94
95
96 (defcustom whitespace-mode nil
97 "Non-nil, if the `whitespace-mode' is active."
98 :type 'boolean
99 :set (lambda (symbol value)
100 (whitespace-mode (or value 0)))
101 :require 'whitespace-mode
102 :initialize 'custom-initialize-default
103 :group 'whitespace)
104
105 (make-variable-buffer-local 'whitespace-mode)
95 106
96 (defcustom whitespace-chars 'tabs-and-blanks 107 (defcustom whitespace-chars 'tabs-and-blanks
97 "*Determines, which whitespaces are highlighted. 108 "*Determines, which whitespaces are highlighted.
98 Valid values are: 109 Valid values are:
99 'tabs-and-blanks => tabs and blanks are highlighted; 110 'tabs-and-blanks => tabs and blanks are highlighted;
361 (null whitespace-mode)) 372 (null whitespace-mode))
362 nil 373 nil
363 (whitespace-dehighlight-region beg end) 374 (whitespace-dehighlight-region beg end)
364 (whitespace-highlight-region beg end))) 375 (whitespace-highlight-region beg end)))
365 376
366 (defvar whitespace-mode nil
367 "Non-nil, if the `whitespace-mode' is active.")
368
369 (make-variable-buffer-local 'whitespace-mode)
370
371 (defun whitespace-mode (&optional arg) 377 (defun whitespace-mode (&optional arg)
372 "Toggle whitespace mode. 378 "Toggle whitespace mode.
373 With arg, turn whitespace mode on iff arg is positive. 379 With arg, turn whitespace mode on iff arg is positive.
374 In whitespace mode the different whitespaces (tab and blank) 380 In whitespace mode the different whitespaces (tab and blank)
375 are highlighted with different faces. The faces are: 381 are highlighted with different faces. The faces are: