1

嗨,伙计们,我在 osx 的终端上运行我的 emacs 仍然有问题。现在,当我打开一个新文件时,我收到以下错误消息:

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 上都找不到有关此错误的任何上下文。

4

1 回答 1

5

您的init.el文件x-display-pixel-width无条件调用,但在终端中运行 Emacs 时该功能不起作用。

更改init.el为仅x-display-pixel-widthwindow-system非零时使用,例如:

(when window-system
    ... include the piece of code defining emacs-min-left here
)
于 2013-08-27T12:08:06.123 回答