
내 .emacs 파일에 이 코드가 있습니다 (set-default-font "Monaco 16")
. Emacs가 열려 있지 않을 때(예를 들어 바로가기를 클릭하여) 시작할 때 Monaco 16으로 시작하지만 새 프레임을 생성하면 C-x 5 2
이전 기본 글꼴로 시작하는데 너무 작아서 읽을 수 없습니다. 이 문제를 해결할 방법이 있나요?
편집하다
emacs를 로드할 때 오류가 발생하고 문제는 내 .emacs
. 뭐가 잘못 되었 니? emacs 디버그 복사본을 복사합니다.
Debugger entered--Lisp error: (wrong-number-of-arguments #[(font-name &optional$
\203^X^@\305\304\306\"\307 _^Q\305\304\310\"\311 _^P\312\313 \314^KBC\"\210
\2039^@\312\313 \306\315 \307 \"B\310\315^H\311 \"BD\"\210*\316\317\320\$
set-default-font("Monaco 16" nil t)
eval-buffer(#<buffer *load*> nil "/Users/a/.emacs" nil t) ; Reading at buff$
load-with-code-conversion("/Users/a/.emacs" "/Users/a/.emacs" t t)
load("~/.emacs" t t)
#[nil "^H\205\276^@ \306=\203^Q^@\307^H\310Q\202A^@ \311=\2033^@\312\307\31$
command-line()
normal-top-level()
답변1
set-default-font
더 이상 사용되지 않습니다. 그러나 어쨌든 문서 문자열이 말하는 대로 작동하는 것처럼 들립니다. 당신이 부르는 방식은,글꼴을 바꿔야 해현재 프레임에만 해당.
모든 프레임의 기본 글꼴을 변경하려면 이를 t
세 번째 인수로 전달합니다. 예를 들어: (set-default-font "Monaco 16" nil t)
.
수행하면 C-h f set-default-font
다음과 같은 내용이 표시됩니다.
,----
| 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 graphical frames. Also, if FRAME 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.
`----
답변2
이것이 GUI 버전의 Emacs에서 작동하지 않으면 다른 설정이 충돌할 가능성이 높습니다.
(set-face-attribute 'default nil :background "black" :foreground "white"
:font "Courier" :height 180)
답변3
Mac OS X 10.9의 Emacs 24.3에서는 (set-frame-font "Monaco 10" nil t)
"잘못된 인수 수" 오류로 인해 실패하지만 (set-frame-font "Monaco 10")은 성공합니다. 단, 선택한/초기 프레임에서만 유효합니다.
고맙게도 (set-face-attribute 'default nil :font "Monaco 10")
나에게 효과적이며 모든 프레임에서 효과적입니다.
답변4
한 가지 해결 방법은 사용자 정의하는 것입니다 default-frame-alist
.
C-h v default-frame-alist click 'customize' If there is no 'font' paramater, click 'INS' and add `font` as the Parameter. As the value, add "Monaco 16" (the double quotes are essential)
그런 다음 이 세션에 대해 '적용'하고(새 프레임을 열어 테스트 C-x 5 2
) 초기화 파일에 '적용 및 저장'합니다.