OSX:
В сборке Emacs Trunk для разработчиков есть функция toggle-frame-maximized
, включенная в .../lisp/frame.el
.Эту функцию можно добавить в after-init-hook
или emacs-startup-hook
или просто включить в файл .emacs
, который загружается при запуске.В OSX он увеличивает ширину и высоту одним махом.
Windows XP:
Следующая команда может использоваться после команды make-frame
или после Emacsгенерирует начальный кадр.
(w32-send-sys-command 61488)
OSX и Windows
Вот пример для установки исходного размера и местоположения кадра - он у меня рядомначало моего .emacs
файла:
(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.")))) ))
Вот пример того, что я использую для создания новых фреймов - контроля точного размера и местоположения:
(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.")))) )))