diff options
| -rw-r--r-- | .emacs | 39 | ||||
| -rw-r--r-- | .emacs-custom.el | 4 |
2 files changed, 33 insertions, 10 deletions
@@ -387,9 +387,6 @@ ;;; Version control. -(add-hook 'magit-pre-refresh-hook 'diff-hl-magit-pre-refresh) -(add-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh) - (add-hook 'git-commit-setup-hook 'git-commit-turn-on-flyspell) (setq magit-process-finish-apply-ansi-colors t) @@ -456,8 +453,6 @@ (setq truncate-lines nil) (setq-local recenter-positions '(top middle bottom))) -(add-hook 'dired-mode-hook 'diff-hl-dired-mode-unless-remote) - (add-to-list 'ibuffer-saved-filter-groups '("my/ibuffer-groups" ("REPL" @@ -683,6 +678,34 @@ (my/list-update package-archives '(("melpa" . "https://melpa.org/packages/"))))) +(use-package diff-hl + :custom + (diff-hl-flydiff-mode t) + (global-diff-hl-mode t) + + ;; FIXME: Adding to these hooks _here_ clobbers them, i.e. they end + ;; up containing (a) the diff-hl functions (b) whatever functions + ;; their libraries add dynamically (c) *none* of the functions + ;; included in the defcustom's default value. + ;; + ;; Therefore, set these hooks up in the :config form _for the + ;; libraries that define these hooks_, so that (presumably) the + ;; default values for these hooks are loaded *before* adding the + ;; diff-hl functions. + ;; + ;; :hook + ;; ((dired-mode . diff-hl-dired-mode-unless-remote) + ;; (magit-pre-refresh . diff-hl-magit-pre-refresh) + ;; (magit-post-refresh . diff-hl-magit-post-refresh)) + ) + +(use-package dired + :custom + (dired-kill-when-opening-new-dired-buffer t) + (dired-listing-switches "-al -Fhv --group-directories-first") + :config + (add-hook 'dired-mode-hook 'diff-hl-dired-mode-unless-remote)) + (use-package ediff :custom (ediff-merge-split-window-function 'split-window-vertically) @@ -738,7 +761,11 @@ (magit-define-global-key-bindings nil) (magit-diff-refine-hunk t) (magit-ediff-dwim-show-on-hunks t) - (magit-revision-show-gravatars t)) + (magit-revision-show-gravatars t) + :config + ;; See `diff-hl' form for rationale. + (add-hook 'magit-pre-refresh-hook 'diff-hl-magit-pre-refresh) + (add-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh)) (use-package magit-blame :delight "👉") diff --git a/.emacs-custom.el b/.emacs-custom.el index 8d3b619..11bfaf4 100644 --- a/.emacs-custom.el +++ b/.emacs-custom.el @@ -14,9 +14,6 @@ '(delete-selection-mode t) '(describe-bindings-outline t) '(diff-default-read-only t) - '(diff-hl-flydiff-mode t) - '(dired-kill-when-opening-new-dired-buffer t) - '(dired-listing-switches "-al -Fhv --group-directories-first") '(electric-pair-mode t) '(enable-recursive-minibuffers t) '(epg-pinentry-mode 'loopback) @@ -29,7 +26,6 @@ '(gdb-many-windows t) '(generic-extras-enable-list '(ansible-inventory-generic-mode etc-fstab-generic-mode etc-modules-conf-generic-mode etc-passwd-generic-mode etc-services-generic-mode etc-sudoers-generic-mode hosts-generic-mode java-manifest-generic-mode java-properties-generic-mode pkginfo-generic-mode prototype-generic-mode resolve-conf-generic-mode x-resource-generic-mode xmodmap-generic-mode)) - '(global-diff-hl-mode t) '(global-page-break-lines-mode t nil (page-break-lines)) '(gnus-cloud-method "nnimap:gmail") '(highlight-nonselected-windows t) |
