;;; 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
(: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)
(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)
(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)