设置不会被忽略。您看到上述行为的原因是由于before-make-frame-hook
ns-win.el 中的一个在顶部和左侧添加了 25。
为避免上述影响,您可以将以下内容添加到您的 .emacs 文件中:
(setq default-frame-alist '((left . 0) (top . 0) (width . 80) (height . 55)))
(defvar parameters)
(add-hook 'before-make-frame-hook
(lambda ()
(let ((left (cdr (assq 'left (frame-parameters))))
(top (cdr (assq 'top (frame-parameters)))))
(setq parameters (cons (cons 'left (+ left 0))
(cons (cons 'top (+ top 0))
parameters))))))
如果上述方法不起作用,您可以尝试以下来自ns-win.el before-make-frame-hook
.
(setq default-frame-alist '((left . 0) (top . 0) (width . 80) (height . 55)))
(defvar parameters)
(add-hook 'before-make-frame-hook
(lambda ()
(let ((left (cdr (assq 'left (frame-parameters))))
(top (cdr (assq 'top (frame-parameters)))))
(if (consp left) (setq left (cadr left)))
(if (consp top) (setq top (cadr top)))
(cond
((or (assq 'top parameters) (assq 'left parameters)))
((or (not left) (not top)))
(t
(setq parameters (cons (cons 'left (+ left 0))
(cons (cons 'top (+ top 0))
parameters))))))))