I am using emacs 23.3. I need to change the font size and font type, can anyone help me?
相关问题
- Symbol's function definition is void: declare-
- How can I set the SVN password with Emacs 23.1 bui
- Emacs shell: save commit message
- emacs bind key to the insertion of another
- Emacs - set mark on edit location
相关文章
- ess-rdired: I get this error “no ESS process is as
- Emacs/xterm color annoyance on Linux
- Pipe less to Emacs
- Capturing the output of “diff” with org-babel
- emacs terminal mode: how to copy and paste efficie
- How to permanently enable the hs-minor-mode in ema
- Pipe emacs shell output to a new buffer
- Following a link into a git-repo without lengthy d
If you use Linux/X11, you may need to set this in
~/.Xdefaults
. I have set the font there since the other answers here have no effect.I'm able to see available font settings by running in Emacs:
helm-select-xfont
Then I start typing
Conso
and I see entries like:So then I put it into
~/.Xdefaults
, setting size12
as:and restart Emacs.
Emacs 25.1 on MacOS has Menlo 12 as default. I wanted to increase the size.
C-x C-f
~/.emacs
Add this to end of
~/.emacs
fileTo see the change effect immediately while staying in
~/.emacs
M-x eval-buffer [RET]
You can use the menu bar. Go to
Options
->Set Default Font...
.After you choose a font, don't forget to press
Options
->Save Options
—otherwise your new font will not be saved after you close Emacs.In my answer, I'll concentrate on setting the default font size through X resources. The use of X resources has already been mentioned in the answer mentioning
~/.Xdefaults
; I'll give more details (the same which I have already described in https://unix.stackexchange.com/a/426914/4319. Apart from the height of the "default" "face" in Emacs, one can similarly set other font parameters.To set a specific default font height for Emacs, I have put into
/etc/X11/Xresources-site
(/etc/X11/Xresources
is also OK, though can be overwritten by your distro):This would affect also remote X clients which are Emacs (e.g., emacs started on a remote host via ssh).
/etc/X11/Xresources-site
and/etc/X11/Xresources
(and probably~/.Xresources
and~/.Xdefaults
) are usually read at the start of your X session; to affect your current X resources immediately, run something likexrdb -merge /etc/X11/Xresources-site
. The X resources can be viewed byxrdb -query
.Actually, in my case,
/etc/X11/Xresources-site
is being read thanks to a line in/etc/X11/Xresources
(which is read by the start scripts):so
/etc/X11/Xresources
is the thing that is read for sure.There are also some files with the same syntax which are read each time an X program like emacs starts. In my case, they are:
~/.Xdefaults-MY_HOST_NAME
,/etc/X11/app-defaults/Emacs
(only for emacs-athena, not for emacs-gtk3),/usr/share/X11/app-defaults/Emacs
etc. (But I like the idea of loaded X resources more -- shown withxrdb -query
; so that remote X clients read the same X resources.)Other X resources which Emacs understands are described at https://www.gnu.org/software/emacs/manual/html_node/emacs/Table-of-Resources.html#Table-of-Resources.
Emacs 24.3 had a bug which made it not honor the attributes for the default face coming from the X resources, such as in my example above. This was fixed since 24.4.
To get an extended list of customization use
You can also do the following in your
.emacs
file.Emacs 23.1
Older versions of Emacs