2009-12-08 4 views
3

저는 Mac에서 Carbon Emacs를 사용하고 있습니다. GUI emacs는 매우 기분 좋은 색 구성표를 사용하도록 설정되어 있습니다. 불행히도, 내 루트 폴더에있는 .emacs 파일을 분석하는 터미널 창에서 "emacs"를 실행할 때 지옥처럼 보입니다.Emacs의 명령 행 버전에서만 .emacs 파일에서 코드를 실행 하시겠습니까?

내 .emacs 파일에서 조건부로 코드를 실행하여 명령 줄과 "GUI"이맥스에 다른 색 구성표를 선택할 수있는 방법이 있습니까?

감사합니다.

답변

10

변수를 사용하여 창 환경에서 Emacs를 실행 중인지 확인할 수 있습니다. 예를 들어, 당신은 당신의 .emacs.el에 다음과 같은 무언가를 추가 할 수 있습니다 : 여기

(when window-system 
    (setq default-frame-alist 
    (append 
     '((background-color . "#102e4e") 
     (background-mode . dark) 
     ...)))) 

window-system 변수에 대한 문서입니다 (이맥스 내에서 볼을 입력하여 채널 V 윈도우 시스템 RET) :

선택한 프레임이 표시되는 윈도우 시스템의 이름입니다.
값은 기호입니다 (예 : X 윈도우의 경우 'x').
선택한 프레임이 텍스트 전용 터미널에 있으면 값은 nil입니다.

+0

환호성. 트릭을 했어. – MarcWan

0

Mac에는 정말 오래된 버전의 이맥스가 있습니다. 터미널에있을 때 그래서 먼저 해당 버전을 찾습니다

Valideres-MacBook-Pro:be james$ which emacs 
/usr/bin/emacs 
Valideres-MacBook-Pro:be james$ emacs --version 
GNU Emacs 22.1.1 
Copyright (C) 2007 Free Software Foundation, Inc. 
GNU Emacs comes with ABSOLUTELY NO WARRANTY. 
You may redistribute copies of Emacs 
under the terms of the GNU General Public License. 
For more information about these matters, see the file named COPYING. 
Valideres-MacBook-Pro:be james$ /Applications/Emacs.app/Contents/MacOS/Emacs --version 
GNU Emacs 25.1.1 
Copyright (C) 2016 Free Software Foundation, Inc. 
GNU Emacs comes with ABSOLUTELY NO WARRANTY. 
You may redistribute copies of GNU Emacs 
under the terms of the GNU General Public License. 
For more information about these matters, see the file named COPYING. 
Valideres-MacBook-Pro:be james$ /Applications/Emacs.app/Contents/MacOS/Emacs -nw ~/code/tmp/greatstuff.lsp 

이맥스는 단말기에서 실행할 수있는 데스크톱 버전 점에서 정말 좋은 것입니다. "no window"에 대해 -nw 옵션을 전달하십시오. 그 터미널에서,

/Applications/Emacs.app/Contents/MacOS/Emacs -nw ~/code/tmp/greatstuff.lsp 

나는 바탕 화면의 색상 테마, 바탕 화면의 현대적인 패키지와 데스크톱 버전의 모든 새로운 기능을 얻을 수 있지만 : 나를 위해 그래서 나는 입력합니다. 새 운영체제를 기본으로 설정하기 위해 일부 OS 링크를 수행 할 수 있습니다 (귀찮게 할 수는 없습니다)

관련 문제