Commits (5)
......@@ -46,7 +46,10 @@
(require 'ft-utilities))
(require 'ft-utilities)
(w/function scroll-bar-mode (scroll-bar-mode -1))
(w/function menu-bar-mode (menu-bar-mode -1))
(w/function tool-bar-mode (tool-bar-mode -1)))
(ft/load-elisp-file "init-pre.el")
......@@ -124,10 +127,6 @@
;; Should work in terminal as well as in GUI emacs:
(ft/map-key "C-M-u" universal-argument :states (normal))
(w/function scroll-bar-mode (scroll-bar-mode -1))
(w/function menu-bar-mode (menu-bar-mode -1))
(w/function tool-bar-mode (tool-bar-mode -1))
(setq-default line-spacing 0.1)
(setq diff-switches '("-u"))
(setq initial-scratch-message nil)
......@@ -1713,7 +1712,7 @@ beginning of the next S-expression."
"Determine if the running emacs instance should try to update
tmux's status line."
(and (eq (ft/host-system) 'console)
(string-match "^screen" ft/term)))
(string-match "^screen" (ft/term))))
(defun ft/tmux-set-title ()
(send-string-to-terminal (format "\ekemacs(%s)\e\\" (buffer-name))))
(when (ft/want-tmux-title)
;; Module that helps setting up emacs frame in a mildly intelligent manner,
;; depending on the system that is running, according to `ft/host-system' as
;; defined by `ft-utilities', as well as the pixel density (pixels per milli-
;; metre) of the monitor that an emacs frame is created on.
(require 'winring)
(require 'ft-utilities)
......@@ -36,11 +41,16 @@ in `ft/generate-font-string'."
The parameter set can be retrieved by functions like
`frame-monitor-attributes' or `display-monitor-attributes'."
(let ((g (mapcar (lambda (x) (float (abs x)))
(cdddr (assq 'geometry m))))
(s (mapcar #'float (cdr (assq 'mm-size m)))))
(max (/ (car g) (car s))
(/ (cadr g) (cadr s)))))
(let* ((g (mapcar (lambda (x) (float (abs x)))
(cdddr (assq 'geometry m))))
(s (mapcar (lambda (x) (if x (float x) nil))
(cdr (assq 'mm-size m))))
(w (car s))
(h (cadr s)))
(if (and w h)
(max (/ (car g) w)
(/ (cadr g) h))
(defun ft/max-pixel-density ()
"Return the maximum pixel density available to the system."
......@@ -98,20 +108,21 @@ frame is visible on."
(setq make-pointer-invisible t)))
(defun ft/update-frame-parameters ()
"Modify current frame's parameters according to system and monitor."
(modify-frame-parameters nil (ft/frame-parameters (ft/host-system))))
(defun ft/frame-creation-hook ()
"ft-gui function to hook into `server-after-make-frame-hook'."
(winring-set-name "default"))
(defun ft/gui-after-init-hook ()
(setq default-frame-alist (ft/frame-parameters (ft/host-system))))
(defun ft/initialise-gui ()
(add-hook 'after-init-hook #'ft/gui-after-init-hook)
"Initialise the ft-gui module."
(unless (daemonp)
(setq default-frame-alist (ft/frame-parameters (ft/host-system))))
(add-hook 'server-after-make-frame-hook #'ft/frame-creation-hook))
(provide 'ft-gui)