From 79da59700bd199a20e1cd8de0fc6333906749061 Mon Sep 17 00:00:00 2001 From: Andrea Ciceri Date: Sun, 26 Mar 2023 13:23:57 +0200 Subject: [PATCH] `diff-hl-margin-mode` when in tty --- init.el | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/init.el b/init.el index 8c01920..729aa83 100644 --- a/init.el +++ b/init.el @@ -37,7 +37,6 @@ (global-ligature-mode 't) ) - (setup flycheck (:require flycheck) (:hook-into prog-mode) @@ -58,12 +57,9 @@ backup-directory-alist `(("." . ,temporary-file-directory)) auto-save-files-name-transforms `((".*" ,temporary-file-directory t)) backup-by-copying t) - (defun fix-vertical-border-background-face (&rest args) - (set-face-background 'vertical-border (face-background 'default))) - (advice-add 'load-theme :after #'fix-vertical-border-background-face) (defun ccr/set-faces () (set-face-attribute 'default nil :font "Fira Code 12") - (fix-vertical-border-background-face) + (set-face-background 'vertical-border (face-background 'default)) (meow--prepare-face) (set-display-table-slot standard-display-table 'vertical-border (make-glyph-code ?┃))) (if (daemonp) @@ -76,16 +72,16 @@ (global-auto-revert-mode t) (show-paren-mode 1) (column-number-mode 1) - (unless (display-graphic-p) ;; FIXME make it work when starting Emacs as daemon - (advice-add 'enable-theme - :after - #'(lambda (&rest rest) - (let* ((bg-color (face-attribute 'default :background)) - (ansi-command (format "\033]11;#%s\007" - (string-remove-prefix "#" bg-color)))) - (send-string-to-terminal ansi-command)))) - (defun reset-terminal () (send-string-to-terminal "\033c")) - (add-hook 'kill-emacs-hook #'reset-terminal)) + (advice-add 'enable-theme + :after + #'(lambda (&rest rest) + (set-face-background 'vertical-border (face-background 'default)) + (let* ((bg-color (face-attribute 'default :background)) + (ansi-command (format "\033]11;#%s\007" + (string-remove-prefix "#" bg-color)))) + (send-string-to-terminal ansi-command)))) + (defun reset-terminal () (send-string-to-terminal "\033c")) + (add-hook 'kill-emacs-hook #'reset-terminal) (ef-themes-select 'ef-day) (defun ccr/reload-emacs () @@ -418,12 +414,16 @@ "C-c n j" org-roam-dailies-capture-today) (org-roam-db-autosync-mode)) + + (setup diff-hl (global-diff-hl-mode 1) - (defun maybe-diff-hl-margin-local-mode () - (unless (display-graphic-p) (diff-hl-margin-local-mode))) - (if (daemonp) - (add-hook 'server-after-make-frame-hook #'maybe-diff-hl-margin-local-mode))) + (defun maybe-diff-hl-margin-mode () + (unless (display-graphic-p) (diff-hl-margin-mode))) + (when (daemonp) + ;; FIXME not optimal, after the first time that a client creates a frame all the other frames + ;; will use `diff-hl-margin-mode`, even if they are graphical + (add-hook 'server-after-make-frame-hook #'maybe-diff-hl-margin-mode))) (setup dirvish (dirvish-override-dired-mode)