From c8d4224e42a710b262e8ba67d720f6eff4e89fcb Mon Sep 17 00:00:00 2001 From: JSDurand Date: Fri, 29 Jan 2021 12:33:03 +0800 Subject: 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. --- basic.el | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'basic.el') 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) -- cgit v1.2.3-18-g5258