set-default-font: "Symbol's function definition is void" after upgrading Emacs to 27.0.50

After upgrading Emacs to 27.0.50, set-default-font function is gone. To fix this issue, change set-default-font to set-frame-font.

Checked some old version of Emacs found below document:

set-default-font is an alias for ‘set-frame-font’ in ‘frame.el’.

(set-default-font FONT &optional KEEP-SIZE FRAMES)

This function is obsolete since 23.1; use ‘set-frame-font’ instead.

Set the default font to FONT. When called interactively, prompt for the name of a font, and use that font on the selected frame. When called from Lisp, FONT should be a font name (a string), a font object, font entity, or font spec.

If KEEP-SIZE is nil, keep the number of frame lines and columns fixed. If KEEP-SIZE is non-nil (or with a prefix argument), try to keep the current frame size fixed (in pixels) by adjusting the number of lines and columns.

If FRAMES is nil, apply the font to the selected frame only. If FRAMES is non-nil, it should be a list of frames to act upon, or t meaning all existing graphical frames. Also, if FRAMES is non-nil, alter the user’s Customization settings as though the font-related attributes of the ‘default’ face had been “set in this session”, so that the font is applied to future frames.


© 2015-2020 tendant