summaryrefslogtreecommitdiff
path: root/basic.el
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2021-01-29 12:33:03 +0800
committerJSDurand <mmemmew@gmail.com>2021-01-29 12:33:03 +0800
commitc8d4224e42a710b262e8ba67d720f6eff4e89fcb (patch)
treebb631456e910e1aeb8984e00db8e3a605f438561 /basic.el
parent43afe6c5db55704f787aaee4cedd7f4c69206b8b (diff)
Change the directory to .emacs.d now.
Now I don't have to use a special command to launch Emacs. And the configuration files are placed in the normal position now.
Diffstat (limited to 'basic.el')
-rw-r--r--basic.el37
1 files changed, 37 insertions, 0 deletions
diff --git a/basic.el b/basic.el
index fc1740e..431c05a 100644
--- a/basic.el
+++ b/basic.el
@@ -97,6 +97,7 @@
'((width . 118)))
(set-frame-width nil 118)
(add-to-list 'default-frame-alist '(width . 118))
+(add-to-list 'default-frame-alist '(height . 35))
(add-to-list 'default-frame-alist '(font . "Droid Sans Mono for Powerline-20"))
(add-to-list 'default-frame-alist '(ns-transparent-titlebar . t))
(add-to-list 'default-frame-alist '(ns-appearance . dark))
@@ -105,6 +106,42 @@
(setq revert-without-query '(".*"))
(set-face-attribute 'variable-pitch nil :family "Avenir" :height 1.0)
+;;; Adjust default size
+
+;;;###autoload
+(defvar durand-frame-width-pixel 1420
+ "Default frame width in pixels.
+Set the frame to this width in order to fill my screen.")
+
+;;;###autoload
+(defvar durand-frame-height-pixel 842
+ "Default frame height in pixels.
+Set the frame to this height in order to fill my screen.")
+
+;;;###autoload
+(defun durand-adjust-font-size (delta)
+ "Increase the default font size by DELTA.
+If DELTA is negative, decrease the size by (- DELTA).
+
+This will maintain the frame's width and height as well."
+ (let* ((width durand-frame-width-pixel)
+ (height durand-frame-height-pixel)
+ (current-font (face-attribute 'default :font))
+ (font-name (aref (query-font current-font) 0))
+ (current-height
+ (progn
+ (string-match
+ "[[:alpha:]-*]+\\([[:digit:]]+\\)"
+ font-name)
+ (string-to-number (match-string 1 font-name))))
+ (new-name (replace-match (number-to-string (+ delta current-height))
+ nil nil font-name 1)))
+ (set-face-attribute 'default nil :font new-name)
+ (set-frame-width (selected-frame) width nil t)
+ (set-frame-height (selected-frame) height nil t)))
+
+(durand-hide-minor-mode buffer-face-mode face-remap "BF")
+
;;; disable line numbers, as that is a performace killer for me.
(setq-default display-line-numbers-type nil)