+;;;###autoload
+(defun buffer-face-set (&rest specs)
+ "Enable `buffer-face-mode', using face specs SPECS.
+SPECS can be any value suitable for the `face' text property,
+including a face name, a list of face names, or a face-attribute
+If SPECS is nil, then `buffer-face-mode' is disabled.
+
+This function will make the variable `buffer-face-mode-face'
+buffer local, and set it to FACE."
+ (interactive (list (read-face-name "Set buffer face")))
+ (while (and (consp specs) (null (cdr specs)))
+ (setq specs (car specs)))
+ (if (null specs)
+ (buffer-face-mode 0)
+ (set (make-local-variable 'buffer-face-mode-face) specs)
+ (buffer-face-mode t)))
+
+;;;###autoload
+(defun buffer-face-toggle (&rest specs)
+ "Toggle `buffer-face-mode', using face specs SPECS.
+SPECS can be any value suitable for the `face' text property,
+including a face name, a list of face names, or a face-attribute
+
+If `buffer-face-mode' is already enabled, and is currently using
+the face specs SPECS, then it is disabled; if buffer-face-mode is
+disabled, or is enabled and currently displaying some other face,
+then is left enabled, but the face changed to reflect SPECS.
+
+This function will make the variable `buffer-face-mode-face'
+buffer local, and set it to SPECS."
+ (interactive (list buffer-face-mode-face))
+ (while (and (consp specs) (null (cdr specs)))
+ (setq specs (car specs)))
+ (if (or (null specs)
+ (and buffer-face-mode (equal buffer-face-mode-face specs)))
+ (buffer-face-mode 0)
+ (set (make-local-variable 'buffer-face-mode-face) specs)
+ (buffer-face-mode t)))
+
+(defun buffer-face-mode-invoke (specs arg &optional interactive)
+ "Enable or disable `buffer-face-mode' using face specs SPECS, and argument ARG.
+ARG controls whether the mode is enabled or disabled, and is
+interpreted in the usual manner for minor-mode commands.
+
+SPECS can be any value suitable for the `face' text property,
+including a face name, a list of face names, or a face-attribute
+
+If INTERACTIVE is non-nil, a message will be displayed describing the result.
+
+This is a wrapper function which calls `buffer-face-set' or
+`buffer-face-toggle' (depending on ARG), and prints a status
+message in the echo area. In many cases one of those functions
+may be more appropriate."
+ (let ((last-message (current-message)))
+ (if (or (eq arg 'toggle) (not arg))
+ (buffer-face-toggle specs)
+ (buffer-face-set (and (> (prefix-numeric-value arg) 0) specs)))
+ (when interactive
+ (unless (and (current-message)
+ (not (equal last-message (current-message))))
+ (message "Buffer-Face mode %sabled"
+ (if buffer-face-mode "en" "dis"))))))
+
+\f
+;; ----------------------------------------------------------------
+;; variable-pitch-mode
+
+;;;###autoload
+(defun variable-pitch-mode (&optional arg)
+ "Variable-pitch default-face mode.
+An interface to `buffer-face-mode' which uses the `variable-pitch' face.
+Besides the choice of face, it is the same as `buffer-face-mode'."
+ (interactive (list (or current-prefix-arg 'toggle)))
+ (buffer-face-mode-invoke 'variable-pitch arg
+ (called-interactively-p 'interactive)))
+