summary refs log tree commit diff
path: root/configs/rcs
diff options
context:
space:
mode:
authorFranck Cuny <fcuny@twitter.com>2018-10-01 09:04:00 -0700
committerFranck Cuny <fcuny@twitter.com>2018-10-01 09:04:00 -0700
commitaeb2067def22366219b6c3fd9ac365eeb5e0a784 (patch)
tree7970536b7b8f52fe7f203457e50e906daa917ee6 /configs/rcs
parent[emacs] new binding for dired-jump (diff)
downloademacs.d-aeb2067def22366219b6c3fd9ac365eeb5e0a784.tar.gz
[emacs] Remove code to manage display.
I don't need so many custom code to manage the display. We just want to
specify the font size, and how to switch to full screen.
Diffstat (limited to '')
-rw-r--r--configs/rcs/emacs.d/init.el70
1 files changed, 10 insertions, 60 deletions
diff --git a/configs/rcs/emacs.d/init.el b/configs/rcs/emacs.d/init.el
index a9249e6..b6749a8 100644
--- a/configs/rcs/emacs.d/init.el
+++ b/configs/rcs/emacs.d/init.el
@@ -101,11 +101,19 @@
  '(inhibit-startup-message t)
  '(inhibit-startup-echo-area-message t))
 
+(use-package frame
+  :ensure nil
+  :bind (("C-c C-m" . toggle-frame-fullscreen))
+  :config
+  ;; when using darwin I don't want to use the native full screen mode, as it opens a new work space
+  (when (eq system-type 'darwin)
+    (setq ns-use-native-fullscreen nil))
+  (set-face-attribute 'default nil :height 150 :weight 'normal :width 'normal))
+
 (use-package general
   :config
   (general-define-key
-   "M-j" 'join-line
-   "C-c m m" 'emacs-toggle-size))
+   "M-j" 'join-line))
 
 ;;; emacs hygiene
 
@@ -370,61 +378,3 @@
 (use-package protobuf-mode
   :after (flyspell)
   :hook ((protobuf-mode . flyspell-prog-mode)))
-
-;;; layout
-;; when using darwin, I don't want to use the native fullscreen mode (it opens a new workspace)
-(when (eq system-type 'darwin)
-  (setq ns-use-native-fullscreen nil))
-
-(defconst display-name
-  (pcase (display-pixel-width)
-    (`1440 'macbook-pro)
-    (_ 'default)))
-
-(defconst emacs-min-top 23)
-
-(defconst emacs-min-left
-  (pcase display-name
-    (`macbook-pro 140)
-    (`default 200)))
-
-(defconst emacs-min-height
-  (pcase display-name
-    (`macbook-pro 60)
-    (`default 47)))
-
-(defconst emacs-min-width
-  (pcase display-name
-    (`macbook-pro 130)
-    (`default 110)))
-
-(defconst emacs-min-font
-  (pcase display-name
-    (_ "-*-DejaVu Sans Mono-normal-normal-normal-*-15-*-*-*-m-0-iso10646-1")))
-
-(defun emacs-min ()
-  (interactive)
-  (cl-flet ((set-param (p v) (set-frame-parameter (selected-frame) p v)))
-    (set-param 'fullscreen nil)
-    (set-param 'vertical-scroll-bars nil)
-    (set-param 'horizontal-scroll-bars nil))
-  (set-frame-position (selected-frame) emacs-min-left emacs-min-top)
-  (set-frame-height (selected-frame) emacs-min-height)
-  (set-frame-width (selected-frame) emacs-min-width)
-  (set-frame-font emacs-min-font))
-
-(defun emacs-max ()
-  (interactive)
-  (cl-flet ((set-param (p v) (set-frame-parameter (selected-frame) p v)))
-    (set-param 'fullscreen 'fullboth)
-    (set-param 'vertical-scroll-bars nil)
-    (set-param 'horizontal-scroll-bars nil))
-  (set-frame-font emacs-min-font))
-
-(defun emacs-toggle-size ()
-  (interactive)
-  (if (alist-get 'fullscreen (frame-parameters))
-      (emacs-min)
-    (emacs-max)))
-
-(add-hook 'emacs-startup-hook #'emacs-min t)