From 1920a48aec49837d63fa88ca315928dc4e9d14c2 Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Tue, 15 Aug 2023 19:05:01 +0300 Subject: [PATCH] feat(emacs): switched to emacs-next --- .config/guix/manifests/emacs.scm | 4 +- .emacs.d/custom.el | 6 -- .emacs.d/desktop.el | 41 +++++++------- .emacs.d/init.el | 95 +++++++++++++++++--------------- Desktop.org | 41 +++++++------- Emacs.org | 74 ++++++++++++++----------- 6 files changed, 138 insertions(+), 123 deletions(-) diff --git a/.config/guix/manifests/emacs.scm b/.config/guix/manifests/emacs.scm index 191e922..d2344e6 100644 --- a/.config/guix/manifests/emacs.scm +++ b/.config/guix/manifests/emacs.scm @@ -1,5 +1,5 @@ (specifications->manifest - '("emacs" + '("emacs-next-tree-sitter" "texinfo" "the-silver-searcher" "ripgrep" @@ -8,7 +8,7 @@ "imagemagick" "font-gnu-freefont" "font-gnu-unifont" - "tdlib-1.8.14" + "tdlib-1.8.15" "yt-dlp" "mpv" "whisper-cpp" diff --git a/.emacs.d/custom.el b/.emacs.d/custom.el index 5c88683..9c567ba 100644 --- a/.emacs.d/custom.el +++ b/.emacs.d/custom.el @@ -21,9 +21,3 @@ '(sp-highlight-pair-overlay nil) '(wakatime-python-bin nil) '(warning-suppress-types '((emacs) (comp) (:warning) (lsp-mode) (comp)))) -(custom-set-faces - ;; custom-set-faces was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - '(italic ((t (:family "JetBrainsMono Nerd Font, Italic"))))) diff --git a/.emacs.d/desktop.el b/.emacs.d/desktop.el index 3c06ce3..165b1e6 100644 --- a/.emacs.d/desktop.el +++ b/.emacs.d/desktop.el @@ -141,26 +141,27 @@ _=_: Balance " (defun my/exwm-configure-window () (interactive) - (pcase exwm-class-name - ((or "Firefox" "Nightly") - (perspective-exwm-assign-window - :workspace-index 2 - :persp-name "browser")) - ("Nyxt" - (perspective-exwm-assign-window - :workspace-index 2 - :persp-name "browser")) - ("Alacritty" - (perspective-exwm-assign-window - :persp-name "term")) - ((or "VK" "Slack" "discord" "TelegramDesktop" "Rocket.Chat") - (perspective-exwm-assign-window - :workspace-index 3 - :persp-name "comms")) - ((or "Chromium-browser" "jetbrains-datagrip") - (perspective-exwm-assign-window - :workspace-index 4 - :persp-name "dev")))) + (unless exwm--floating-frame + (pcase exwm-class-name + ((or "Firefox" "Nightly") + (perspective-exwm-assign-window + :workspace-index 2 + :persp-name "browser")) + ("Nyxt" + (perspective-exwm-assign-window + :workspace-index 2 + :persp-name "browser")) + ("Alacritty" + (perspective-exwm-assign-window + :persp-name "term")) + ((or "VK" "Slack" "discord" "TelegramDesktop" "Rocket.Chat") + (perspective-exwm-assign-window + :workspace-index 3 + :persp-name "comms")) + ((or "Chromium-browser" "jetbrains-datagrip") + (perspective-exwm-assign-window + :workspace-index 4 + :persp-name "dev"))))) (add-hook 'exwm-manage-finish-hook #'my/exwm-configure-window) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 2ce2e4e..40908a4 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -587,13 +587,13 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer." "M" 'magit-file-dispatch) :config (setq magit-blame-styles - '((headings - (heading-format . "%-20a %C %s\n")) - (highlight - (highlight-face . magit-blame-highlight)) - (lines - (show-lines . t) - (show-message . t))))) + '((headings + (heading-format . "%-20a %C %s\n")) + (highlight + (highlight-face . magit-blame-highlight)) + (lines + (show-lines . t) + (show-message . t))))) (use-package forge :after magit @@ -906,22 +906,23 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer." (defvar my/alpha-for-light 7) (defun my/doom-color (color) - (let ((override (alist-get (my/doom-p) my/theme-override)) - (color-name (symbol-name color)) - (is-light (ct-light-p (doom-color 'bg)))) - (or - (alist-get color override) - (cond - ((eq 'black color) - (if is-light (doom-color 'fg) (doom-color 'bg))) - ((eq 'white color) - (if is-light (doom-color 'bg) (doom-color 'fg))) - ((eq 'border color) - (if is-light (doom-color 'base0) (doom-color 'base8))) - ((string-match-p (rx bos "light-") color-name) - (ct-edit-hsl-l-inc (my/doom-color (intern (substring color-name 6))) - my/alpha-for-light)) - (t (doom-color color)))))) + (when (doom-color 'bg) + (let ((override (alist-get (my/doom-p) my/theme-override)) + (color-name (symbol-name color)) + (is-light (ct-light-p (doom-color 'bg)))) + (or + (alist-get color override) + (cond + ((eq 'black color) + (if is-light (doom-color 'fg) (doom-color 'bg))) + ((eq 'white color) + (if is-light (doom-color 'bg) (doom-color 'fg))) + ((eq 'border color) + (if is-light (doom-color 'base0) (doom-color 'base8))) + ((string-match-p (rx bos "light-") color-name) + (ct-edit-hsl-l-inc (my/doom-color (intern (substring color-name 6))) + my/alpha-for-light)) + (t (doom-color color))))))) (defun my/modus-get-base (color) (let ((base-value (string-to-number (substring (symbol-name color) 4 5))) @@ -1037,7 +1038,9 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer." (tab-bar-tab :background (my/color-value 'bg) :foreground (my/color-value 'yellow) :underline (my/color-value 'yellow)) - (tab-bar :background nil :foreground nil)) + (tab-bar :background nil :foreground nil) + (magit-section-secondary-heading :foreground (my/color-value 'blue) + :weight 'bold)) (defun my/switch-theme (theme) (interactive @@ -1100,11 +1103,18 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer." (when (display-graphic-p) (if (x-list-fonts "JetBrainsMono Nerd Font") - (set-frame-font "JetBrainsMono Nerd Font 10" nil t) + (let ((font "-JB -JetBrainsMono Nerd Font-medium-normal-normal-*-17-*-*-*-m-0-iso10646-1")) + (set-frame-font font nil t) + (add-to-list 'default-frame-alist `(font . ,font))) (message "Install JetBrainsMono Nerd Font!"))) (when (display-graphic-p) - (set-face-attribute 'variable-pitch nil :family "Cantarell" :height 1.0)) + (set-face-attribute 'variable-pitch nil :family "Cantarell" :height 1.0) + (set-face-attribute + 'italic nil + :family "JetBrainsMono Nerd Font" + :weight 'regular + :slant 'italic)) (use-package ligature :straight (:host github :repo "mickeynp/ligature.el") @@ -2581,6 +2591,7 @@ Returns ( . ) or nil." (use-package csv-mode :straight t + :disabled :mode "\\.csv\\'") (use-package yaml-mode @@ -3368,7 +3379,9 @@ KEYS is a list of cons cells like (