Is there a way to change the font associated with the variable-pitch-mode? On my emacs installation enabling variable-pitch-mode changes the font to a sans-serif font; I would like to use a serif font instead.
It seems that function
variable-pitch-mode hard-codes the use of face
variable-pitch. I think your two choices (other than perhaps advising that function) are these:
variable-pitch. Just customize it to be have any appearance you want:
M-x customize-face variable-pitch.
Write your own command, similar to
variable-pitch-mode. That definition is very short. You need only substitute your own face for face
variable-pitchin that definition. (You could also define your command using
buffer-face-mode-invoke, which is what
(defun my-variable-pitch-mode (&optional arg face) "MY Variable-pitch default-face mode. An interface to `buffer-face-mode' which uses FACE \(`variable-pitch', by default). Besides the choice of FACE, it is the same as `buffer-face-mode'." (interactive (list (or current-prefix-arg 'toggle))) (buffer-face-mode-invoke face arg (called-interactively-p 'interactive)))
In fact, I'll (or you can) suggest that as the definition of
M-x report-emacs-bug. (I've done that now - bug #24594.)