Remove incorrect uses of "modeline".
[bpt/emacs.git] / lisp / obsolete / old-whitespace.el
index a5adaa3..02c8115 100644 (file)
@@ -1,10 +1,10 @@
 ;;; whitespace.el --- warn about and clean bogus whitespaces in the file
 
-;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2012  Free Software Foundation, Inc.
 
 ;; Author: Rajesh Vaidheeswarran <rv@gnu.org>
 ;; Keywords: convenience
+;; Obsolete-since: 23.1
 
 ;; This file is part of GNU Emacs.
 
@@ -23,8 +23,6 @@
 
 ;;; Commentary:
 
-;; This file has been obsolete since Emacs 23.1.
-
 ;; URL: http://www.dsmit.com/lisp/
 ;;
 ;; The whitespace library is intended to find and help fix five different types
@@ -37,9 +35,9 @@
 ;; 4. Spaces followed by a TAB.  (Almost always, we never want that).
 ;; 5. Spaces or TABS at the end of a line.
 ;;
-;; Whitespace errors are reported in a buffer, and on the modeline.
+;; Whitespace errors are reported in a buffer, and on the mode line.
 ;;
-;; Modeline will show a W:<x>!<y> to denote a particular type of whitespace,
+;; Mode line will show a W:<x>!<y> to denote a particular type of whitespace,
 ;; where `x' and `y' can be one (or more) of:
 ;;
 ;; e - End-of-Line whitespace.
@@ -48,7 +46,7 @@
 ;; s - Space followed by Tab.
 ;; t - Trailing whitespace.
 ;;
-;; If any of the whitespace checks is turned off, the modeline will display a
+;; If any of the whitespace checks is turned off, the mode line will display a
 ;; !<y>.
 ;;
 ;;     (since (3) is the most controversial one, here is the rationale: Most
@@ -232,7 +230,7 @@ this variable."
   :group 'whitespace)
 
 (defcustom whitespace-silent nil
-  "All whitespace errors will be shown only in the modeline when t.
+  "All whitespace errors will be shown only in the mode line when t.
 
 Note that setting this may cause all whitespaces introduced in a file to go
 unnoticed when the buffer is killed, unless the user visits the `*Whitespace
@@ -308,8 +306,8 @@ To disable timer scans, set this to zero."
                                 (:background "white")))
   "Face used for highlighting the bogus whitespaces that exist in the buffer."
   :group 'whitespace-faces)
-;; backward-compatibility alias
-(put 'whitespace-highlight-face 'face-alias 'whitespace-highlight)
+(define-obsolete-face-alias 'whitespace-highlight-face
+  'whitespace-highlight "22.1")
 
 (if (not (assoc 'whitespace-mode minor-mode-alist))
     (setq minor-mode-alist (cons '(whitespace-mode whitespace-mode-line)
@@ -517,12 +515,12 @@ See `whitespace-buffer' docstring for a summary of the problems."
   (whitespace-check-whitespace-mode current-prefix-arg)
   (if (and buffer-file-name whitespace-mode)
       (let ((whitespace-any nil)
-           (whitespace-tabwith 8)
-           (whitespace-tabwith-saved tab-width))
+           (whitespace-tabwidth 8)
+           (whitespace-tabwidth-saved tab-width))
 
        ;; since all printable TABS should be 8, irrespective of how
        ;; they are displayed.
-       (setq tab-width whitespace-tabwith)
+       (setq tab-width whitespace-tabwidth)
 
        (if (and whitespace-check-buffer-leading
                 (whitespace-buffer-leading))
@@ -564,7 +562,7 @@ See `whitespace-buffer' docstring for a summary of the problems."
                  (message "The region is now clean")
                (message "%s is now clean" buffer-file-name)))
            (whitespace-update-modeline)))
-       (setq tab-width whitespace-tabwith-saved))))
+       (setq tab-width whitespace-tabwidth-saved))))
 
 ;;;###autoload
 (defun whitespace-cleanup-region (s e)
@@ -655,7 +653,7 @@ If highlighting is enabled, highlight these characters."
       nil)))
 
 (defun whitespace-update-modeline (&optional whitespace-err)
-  "Update modeline with whitespace errors.
+  "Update mode line with whitespace errors.
 Also with whitespaces whose testing has been turned off."
   (if whitespace-display-in-modeline
       (progn
@@ -725,9 +723,8 @@ If timer is not set, then set it to scan the files in
        (setq bufname (cadr thiselt))
        (setq buf (get-buffer bufname))
        (if (buffer-live-p buf)
-           (save-excursion
+           (with-current-buffer bufname
              ;;(message "buffer %s live" bufname)
-             (set-buffer bufname)
              (if whitespace-mode
                  (progn
                    ;;(message "checking for whitespace in %s" bufname)
@@ -788,7 +785,7 @@ This is meant to be added buffer-locally to `write-file-functions'."
 
 (defun whitespace-unload-function ()
   "Unload the whitespace library."
-  (if (unintern "whitespace-unload-hook")
+  (if (unintern "whitespace-unload-hook" obarray)
       ;; if whitespace-unload-hook is defined, let's get rid of it
       ;; and recursively call `unload-feature'
       (progn (unload-feature 'whitespace) t)
@@ -810,5 +807,4 @@ This is meant to be added buffer-locally to `write-file-functions'."
 
 (provide 'whitespace)
 
-;; arch-tag: 4ff44e87-b63c-402d-95a6-15e51e58bd0c
 ;;; whitespace.el ends here