2013-08-27 48 views
0

Hy Guys,我仍然有問題在osx上的終端上運行我的emacs。現在,當我打開一個新的文件,我得到這個錯誤信息:Emacs錯誤:Mac本機窗口未使用或未初始化

Warning (initialization): An error occurred while loading `/Users/den/.emacs.d/init.el': 

error: Mac native windows are not in use or not initialized 

當我運行的emacs --debug-INIT我得到這樣的輸出:

Debugger entered--Lisp error: (error "Mac native windows are not in use or not initialized") 
    x-display-pixel-width() 
    (- (x-display-pixel-width) 918) 
    (defvar emacs-min-left (- (x-display-pixel-width) 918)) 
    (if running-alternate-emacs (progn (defvar emacs-min-top (if (= 1050 (x-display-pixel-heigh$ 
    (if noninteractive nil (if running-alternate-emacs (progn (defvar emacs-min-top (if (= 1050$ 
    eval-buffer(#<buffer *load*> nil "/Users/den/.emacs.d/init.el" nil t) ; Reading at buffer$ 
    load-with-code-conversion("/Users/den/.emacs.d/init.el" "/Users/den/.emacs.d/init.el" t t) 
    load("/Users/den/.emacs.d/init" t t) 
    #[0 "^H\205\262^@  \306=\203^Q^@\307^H\310Q\202;^@ \311=\204^^^@\307^H\312Q\202;^@\313\3$ 
    command-line() 
    normal-top-level() 

檢查我init.el文件無法發現一個錯誤,但說實話我不太瞭解調試輸出。我無法在google或者stackoverflow上找到關於這個錯誤的任何上下文。

回答

3

您的​​文件無條件地調用x-display-pixel-width,但在終端中運行Emacs時該功能不起作用。

變化​​只使用x-display-pixel-width如果window-system是非零,例如:

(when window-system 
    ... include the piece of code defining emacs-min-left here 
)