OSX:
Bản xây dựng nhà phát triển của Emacs Trunk có chức năng được gọi là toggle-frame-maximized
, được bao gồm trong số .../lisp/frame.el
. Có thể thêm chức năng đó vào after-init-hook
hoặc emacs-startup-hook
hoặc chỉ cần bao gồm trong tệp .emacs
được tải khi khởi động. Trên OSX, nó tăng cả chiều rộng và chiều cao trong một ngã.
Windows XP:
Lệnh sau đây có thể được sử dụng sau khi một lệnh make-frame
, hoặc sau khi Emacs tạo khung ban đầu.
(w32-send-sys-command 61488)
OSX và Windows
Dưới đây là một ví dụ cho việc thiết lập kích thước khung hình ban đầu và vị trí - Tôi có nó gần đầu của tập tin .emacs
tôi:
(let ((frame (selected-frame)))
(cond
((eq system-type 'darwin)
(setq ns-auto-hide-menu-bar t)
(set-frame-position frame 0 0) ;; must come after `ns-auto-hide-menu-bar`
(cond
((and
(= 1920 (display-pixel-width))
(= 1080 (display-pixel-height)))
(set-frame-size frame 1895 1054 t))
((and
(= 1920 (display-pixel-width))
(= 1200 (display-pixel-height)))
(set-frame-size frame 1895 1174 t))
((and
(= 1280 (display-pixel-width))
(= 800 (display-pixel-height)))
(set-frame-size frame 1265 774 t))))
((and
(eq system-type 'windows-nt)
(equal (w32-version) '(5 1 2600)))
;; (w32-send-sys-command #xf030)
(set-frame-position frame 0 0)
(cond
((and
(= 1920 (display-pixel-width))
(= 1003 (display-pixel-height)))
(set-frame-size frame 1898 924 t))
((and
(= 1920 (display-pixel-width))
(= 1123 (display-pixel-height)))
(set-frame-size frame 1876 1052 t))
((and
(= 1280 (display-pixel-width))
(= 723 (display-pixel-height)))
(set-frame-size frame 1250 670 t))))
((and
(eq system-type 'windows-nt)
(equal (w32-version) '(6 1 7601)))
(set-frame-position frame 0 0)
(cond
((and
(= 1920 (display-pixel-width))
(= 1080 (display-pixel-height)))
(set-frame-size frame 1890 1003 t))
(t
(message "Not yet contemplated."))))))
Dưới đây là ví dụ về những gì tôi sử dụng để tạo khung hình mới - kiểm soát kích thước và vị trí chính xác:
(defun lawlist-make-frame (&optional alist)
(let ((frame (make-frame alist)))
(set-frame-position frame 0 0)
(cond
((eq system-type 'darwin)
(cond
((and
(= 1920 (display-pixel-width))
(= 1080 (display-pixel-height)))
(set-frame-size frame 1895 1054 t))
((and
(= 1920 (display-pixel-width))
(= 1200 (display-pixel-height)))
(set-frame-size frame 1895 1174 t))
((and
(= 1280 (display-pixel-width))
(= 800 (display-pixel-height)))
(set-frame-size frame 1265 774 t))))
((and
(eq system-type 'windows-nt)
(equal (w32-version) '(5 1 2600)))
(select-frame frame)
(cond
((and
(= 1920 (display-pixel-width))
(= 1003 (display-pixel-height)))
(set-frame-size frame 1898 924 t))
((and
(= 1920 (display-pixel-width))
(= 1123 (display-pixel-height)))
(set-frame-size frame 1876 1052 t))
((and
(= 1280 (display-pixel-width))
(= 723 (display-pixel-height)))
(set-frame-size frame 1250 670 t))))
((and
(eq system-type 'windows-nt)
(equal (w32-version) '(6 1 7601)))
(select-frame frame)
(cond
((and
(= 1920 (display-pixel-width))
(= 1080 (display-pixel-height)))
(set-frame-size frame 1890 1003 t))
(t
(message "Not yet contemplated.")))))))
Tại sao bạn không thiết lập 'ban đầu-frame-alist' hoặc tương ứng với' nguồn xrdb' đến hình học mà bạn muốn thay thế? Xem http://stackoverflow.com/questions/92971/how-do-i-set-the-size-of-emacs-window để biết mã và con trỏ. – tripleee
Tôi muốn có toàn màn hình, câu trả lời được chấp nhận đáp ứng nhu cầu của tôi. cảm ơn vì liên kết BTW. – kindahero