X-Git-Url: https://git.shemshak.org/~bandali/configs/blobdiff_plain/bb65cc2c65192c71b1be24a7f33bf3d2b3a669d6..7c054dcebe12d7121f067b279a772f874b29d3da:/.emacs.d/init.el diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 0500aa8..b4a16cc 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -60,9 +60,8 @@ ;; (debbugs "0.29") ;; (delight "1.7") ;; (emms "7.7") - ;; (rt-liberation "2.4") - ;; (yasnippet "0.14.0"))) -(package-initialize)) + ;; (rt-liberation "2.4"))) + (package-initialize)) (setq package-archive-upload-base "/ssh:caffeine:~/www/p/elpa") @@ -147,10 +146,9 @@ (defalias 'yes-or-no-p #'y-or-n-p) (when (display-graphic-p) + ;; (set-frame-font "Source Code Pro-10.5:weight=medium" nil t) + ;; (set-frame-font "FreeSans" nil t) (set-fontset-font t 'arabic "Vazir")) -;; ;; (set-frame-font "Drafting Mono-14:weight=light" nil t) -;; (set-frame-font "Drafting Mono:pixelsize=16" nil t) -;; (set-face-attribute 'bold nil :weight 'semi-bold) ;;;; Elisp-level customizations @@ -317,7 +315,9 @@ (when (display-graphic-p) (with-eval-after-load 'faces (let ((grey "#e7e7e7")) - (set-face-attribute 'fixed-pitch nil :family "Source Code Pro") + (set-face-attribute 'fixed-pitch nil + :font "Source Code Pro" + :weight 'medium) (set-face-attribute 'mode-line nil :background grey :inherit 'fixed-pitch)))) @@ -375,16 +375,16 @@ For disabling the behaviour for certain buffers and/or modes." (make-local-variable 'mouse-autoselect-window) (setq mouse-autoselect-window nil)) -(defun b/move-indentation-or-beginning-of-line (arg) - "Move to the indentation or to the beginning of line." - (interactive "^p") - ;; (if (bolp) - ;; (back-to-indentation) - ;; (move-beginning-of-line arg)) - (if (= (point) - (progn (back-to-indentation) - (point))) - (move-beginning-of-line arg))) +;; (defun b/move-indentation-or-beginning-of-line (arg) +;; "Move to the indentation or to the beginning of line." +;; (interactive "^p") +;; ;; (if (bolp) +;; ;; (back-to-indentation) +;; ;; (move-beginning-of-line arg)) +;; (if (= (point) +;; (progn (back-to-indentation) +;; (point))) +;; (move-beginning-of-line arg))) (defun b/join-line-top () "Like `join-line', but join next line to the current line." @@ -418,12 +418,19 @@ Make N (default: 1) copies of the current line or region." (dotimes (_ (abs n1)) (insert text)))))) -(defun b/invert-default-face () - "Invert the `default' face (swap its background and foreground). -Effectively a very simple light/dark theme toggle switch." - (interactive) - (invert-face 'default (selected-frame)) - (invert-face 'mode-line (selected-frame))) +(defun b/invert-default-face (arg) + "Invert the `default' and `mode-line' faces for the current frame. +Swap the background and foreground for the two `default' and +`mode-line' faces, effectively acting like a simple light/dark +theme toggle. If prefix argument ARG is given, invert the faces +for all frames." + (interactive "P") + (let ((frame (unless arg + (selected-frame)))) + (invert-face 'default frame) + (invert-face 'mode-line frame)) + (when (fboundp #'exwm-systemtray--refresh-background-color) + (exwm-systemtray--refresh-background-color 'remap))) (defun b/export-frame () (interactive) @@ -438,7 +445,7 @@ Effectively a very simple light/dark theme toggle switch." ;;; General key bindings -(global-set-key (kbd "C-a") #'b/move-indentation-or-beginning-of-line) +;; (global-set-key (kbd "C-a") #'b/move-indentation-or-beginning-of-line) (global-set-key (kbd "C-c i") #'ielm) (global-set-key (kbd "C-c d") #'b/duplicate-line-or-region) (global-set-key (kbd "C-c j") #'b/join-line-top) @@ -484,7 +491,8 @@ Effectively a very simple light/dark theme toggle switch." (expand-file-name (convert-standard-filename "lisp") user-emacs-directory)) -;; (require 'bandali-exwm) +(when (member (system-name) '("chaman")) + (require 'bandali-exwm)) (require 'bandali-org) @@ -746,7 +754,6 @@ Effectively a very simple light/dark theme toggle switch." ;; ,---- ;; | make pretty boxed quotes like this ;; `---- -(add-to-list 'load-path (b/lisp "boxquote")) (run-with-idle-timer 0.6 nil #'require 'boxquote) (with-eval-after-load 'boxquote (defvar b/boxquote-prefix-map) @@ -773,37 +780,6 @@ Effectively a very simple light/dark theme toggle switch." (define-key b/boxquote-prefix-map (kbd "M-q") #'boxquote-fill-paragraph) (define-key b/boxquote-prefix-map (kbd "M-w") #'boxquote-kill-ring-save)) -(add-to-list 'load-path (b/lisp "hl-todo")) -(run-with-idle-timer 0.5 nil #'require 'hl-todo) -(with-eval-after-load 'hl-todo - ;; Highlight TODO in buffers. - (global-hl-todo-mode)) - -(run-with-idle-timer 0.6 nil #'require 'yasnippet) -(with-eval-after-load 'yasnippet - (declare-function yas-reload-all - "yasnippet" (&optional no-jit interactive)) - (declare-function yas-maybe-expand-abbrev-key-filter - "yasnippet" (cmd)) - - (defconst yas-verbosity-cur yas-verbosity) - (setq yas-verbosity 2 - yas-snippet-dirs `(,(b/etc "yasnippet/snippets"))) - ;; (add-to-list 'yas-snippet-dirs "~/src/git/guix/etc/snippets" t) - (yas-reload-all) - (setq yas-verbosity yas-verbosity-cur) - - (defun b/yas-maybe-expand-abbrev-key-filter (cmd) - (when (and (yas-maybe-expand-abbrev-key-filter cmd) - (not (bound-and-true-p git-commit-mode))) - cmd)) - (defconst b/yas-maybe-expand - '(menu-item "" yas-expand - :filter b/yas-maybe-expand-abbrev-key-filter)) - (define-key yas-minor-mode-map (kbd "SPC") b/yas-maybe-expand) - - (yas-global-mode)) - ;; `debbugs' (global-set-key (kbd "C-c D d") #'debbugs-gnu) (global-set-key (kbd "C-c D b") #'debbugs-gnu-bugs) @@ -881,8 +857,7 @@ Effectively a very simple light/dark theme toggle switch." (with-eval-after-load 'delight (delight 'auto-fill-function " f" "simple") (delight 'abbrev-mode "" "abbrev") - (delight 'mml-mode " mml" "mml") - (delight 'yas-minor-mode "" "yasnippet")) + (delight 'mml-mode " mml" "mml")) (require 'bandali-po)