]> code.delx.au - gnu-emacs/blobdiff - lisp/obsolete/old-whitespace.el
Fix MSDOS build broken by 2010-09-10T16:44:35Z!larsi@gnus.org, support MSDOS build...
[gnu-emacs] / lisp / obsolete / old-whitespace.el
index a5adaa3533fdb8112877cf9da4fe8738af71237d..71568f98d55dc6d4abec8d3e890c3f4ba5ad618c 100644 (file)
@@ -1,7 +1,7 @@
 ;;; 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, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+;;   2008, 2009, 2010  Free Software Foundation, Inc.
 
 ;; Author: Rajesh Vaidheeswarran <rv@gnu.org>
 ;; Keywords: convenience
@@ -308,8 +308,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)
@@ -725,9 +725,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 +787,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)