From a4d2e873abfca17da4322e801fe9bfd13aa68031 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 21 May 2021 23:08:15 -0400 Subject: [PATCH] Bump :ui doom hlissner/emacs-doom-themes@4199e74 -> hlissner/emacs-doom-themes@4d24728 hlissner/emacs-solaire-mode@9d143db -> hlissner/emacs-solaire-mode@186f97d Rewrite solaire-mode usage to adapt to upstream changes. This will yield a new class of edge cases, but I'll tackle those as I encounter them. Closes #5063 --- modules/app/everywhere/config.el | 4 +- modules/app/twitter/config.el | 3 -- modules/completion/helm/autoload/posframe.el | 6 +-- modules/lang/org/autoload/contrib-present.el | 3 -- modules/lang/org/config.el | 2 - modules/ui/doom/README.org | 8 +-- modules/ui/doom/config.el | 56 +------------------- modules/ui/doom/packages.el | 4 +- 8 files changed, 9 insertions(+), 77 deletions(-) diff --git a/modules/app/everywhere/config.el b/modules/app/everywhere/config.el index df16f07f159..4e5e04247d2 100644 --- a/modules/app/everywhere/config.el +++ b/modules/app/everywhere/config.el @@ -32,6 +32,4 @@ (add-hook! 'emacs-everywhere-init-hooks (defun +everywhere-clear-persp-info-h () (when (bound-and-true-p persp-mode) - (setq persp-emacsclient-init-frame-behaviour-override nil)))) - (after! solaire-mode - (add-hook 'emacs-everywhere-init-hooks #'solaire-mode))) + (setq persp-emacsclient-init-frame-behaviour-override nil))))) diff --git a/modules/app/twitter/config.el b/modules/app/twitter/config.el index db8849a5062..5e194e04336 100644 --- a/modules/app/twitter/config.el +++ b/modules/app/twitter/config.el @@ -38,9 +38,6 @@ (when (featurep! :ui popup) (setq twittering-pop-to-buffer-function #'+twitter-display-buffer-fn)) - (after! solaire-mode - (add-hook 'twittering-mode-hook #'solaire-mode)) - ;; Custom header-line for twitter buffers (add-hook! 'twittering-mode-hook (defun +twitter-switch-mode-and-header-line-h () diff --git a/modules/completion/helm/autoload/posframe.el b/modules/completion/helm/autoload/posframe.el index 9dccf01c36c..da0e32d01f0 100644 --- a/modules/completion/helm/autoload/posframe.el +++ b/modules/completion/helm/autoload/posframe.el @@ -15,8 +15,7 @@ bottom, which is easier on the eyes on big displays." (defun +helm-posframe-display-fn (buffer &optional _resume) "TODO" (setq helm--buffer-in-new-frame-p t) - (let ((solaire-p (bound-and-true-p solaire-mode)) - (params (copy-sequence +helm-posframe-parameters))) + (let ((params (copy-sequence +helm-posframe-parameters))) (let-alist params (require 'posframe) (posframe-show @@ -45,9 +44,6 @@ bottom, which is easier on the eyes on big displays." (unless (or (null +helm-posframe-text-scale) (= +helm-posframe-text-scale 0)) (with-current-buffer buffer - (when (and (featurep 'solaire-mode) - (not solaire-p)) - (solaire-mode +1)) (text-scale-set +helm-posframe-text-scale))))) ;;;###autoload diff --git a/modules/lang/org/autoload/contrib-present.el b/modules/lang/org/autoload/contrib-present.el index 04aac9366e3..1e637c8c902 100644 --- a/modules/lang/org/autoload/contrib-present.el +++ b/modules/lang/org/autoload/contrib-present.el @@ -78,9 +78,6 @@ (+org-pretty-mode arg) (cond (org-tree-slide-mode (set-window-fringes nil 0 0) - (when (bound-and-true-p solaire-mode) - (solaire-mode -1) - (fringe-mode 0)) (when (bound-and-true-p flyspell-mode) (flyspell-mode -1)) (add-hook 'kill-buffer-hook #'+org-present--cleanup-org-tree-slides-mode diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index 1cff153fb63..85a67ea86d5 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -130,9 +130,7 @@ Is relative to `org-directory', unless it is absolute. Is used in Doom's default org-refile-use-outline-path 'file org-outline-path-complete-in-steps nil) - ;; Previews are rendered with the incorrect background (plist-put org-format-latex-options :scale 1.5) ; larger previews - (plist-put org-format-latex-options :background 'default) ; match the background ;; HACK Face specs fed directly to `org-todo-keyword-faces' don't respect ;; underlying faces like the `org-todo' face does, so we define our own diff --git a/modules/ui/doom/README.org b/modules/ui/doom/README.org index 54bf0af6993..71ec163fa5b 100644 --- a/modules/ui/doom/README.org +++ b/modules/ui/doom/README.org @@ -75,10 +75,10 @@ If you're seeing strange unicode symbols, this is likely because you don't have all-the-icons-install-fonts~. ** Ugly background colors in tty Emacs for daemon users -=solaire-mode= is an aesthetic plugin that makes file-visiting buffers brighter -than the rest of the Emacs' frame (to visually differentiate temporary windows -or sidebars from editing windows). This looks great in GUI Emacs, but can look -questionable in the terminal. +=solaire-mode= is an aesthetic plugin that makes non-file-visiting buffers +darker than the rest of the Emacs' frame (to visually differentiate temporary +windows or sidebars from editing windows). This looks great in GUI Emacs, but +can look questionable in the terminal. It disables itself if you start tty Emacs with ~emacs -nw~, but if you create a tty frame from a daemon (which solaire-mode cannot anticipate), you'll get an diff --git a/modules/ui/doom/config.el b/modules/ui/doom/config.el index 366b23ef9b7..fa8a59dd722 100644 --- a/modules/ui/doom/config.el +++ b/modules/ui/doom/config.el @@ -23,58 +23,4 @@ (use-package! solaire-mode :when (or (daemonp) (display-graphic-p)) - :hook (doom-load-theme . solaire-global-mode) - :config - (when (daemonp) - (add-hook! '(doom-switch-frame-hook after-make-frame-functions) - (defun +doom-disable-solaire-mode-maybe-h (&optional frame) - (if (display-graphic-p frame) - (unless solaire-global-mode - (solaire-global-mode +1)) - (when solaire-global-mode - (solaire-global-mode -1)))))) - - ;; DEPRECATED No longer needed in Emacs 27+ - (unless EMACS27+ - ;; HACK On Emacs <=26, when point is on the last (or second to last) line - ;; and solaire-mode is remapping the hl-line face, hl-line's highlight - ;; bleeds into the rest of the window after eob. On Emacs 27 this no - ;; longer happens. This tries to fix it for 26 users, but it imposes - ;; another problem: the 2nd-to-last line will only be highlighted up to - ;; the (n-1)th character, but I think that is the lesser evil. - (defun +doom--line-range-fn () - (if solaire-mode - (let ((bol (line-beginning-position)) - (eol (line-end-position)) - (eob (point-max))) - (cond ((= bol eob) - nil) - ((= (1+ eol) eob) - (cons bol (1- eob))) - ((or (= eol eob) (eobp)) - (cons bol eol)) - ((cons bol (line-beginning-position 2))))) - (cons (line-beginning-position) - (line-beginning-position 2)))) - (setq hl-line-range-function #'+doom--line-range-fn) - - ;; HACK The fringe cannot have a buffer-local remapping on Emacs <= 26, so - ;; we jump through hoops to reset it (globally) whenever it is likely - ;; that the fringe will have lost its background color. - (add-hook! '(doom-load-theme-hook doom-after-reload-hook) :append - #'solaire-mode-reset) - - ;; fringe can become unstyled when deleting or focusing frames - (add-hook 'focus-in-hook #'solaire-mode-reset) - - ;; A global fringe color means the minibuffer (with its fringes) will always - ;; stand out, so we remove them (in which-key popups too). - (add-hook! 'solaire-mode-hook - (defun +doom-disable-fringes-in-minibuffer-h (&rest _) - (set-window-fringes (minibuffer-window) 0 0 nil))) - (defadvice! +doom--no-fringes-in-which-key-buffer-a (&rest _) - :after 'which-key--show-buffer-side-window - (+doom-disable-fringes-in-minibuffer-h) - (set-window-fringes (get-buffer-window which-key--buffer) 0 0 nil)) - (add-hook! '(minibuffer-setup-hook window-configuration-change-hook) - #'+doom-disable-fringes-in-minibuffer-h))) + :hook (doom-load-theme . solaire-global-mode)) diff --git a/modules/ui/doom/packages.el b/modules/ui/doom/packages.el index 8bbd05ca453..a3ad1e9d7aa 100644 --- a/modules/ui/doom/packages.el +++ b/modules/ui/doom/packages.el @@ -1,5 +1,5 @@ ;; -*- no-byte-compile: t; -*- ;;; ui/doom/packages.el -(package! doom-themes :pin "4199e74db170200995ee8dfbb55ffae004d6e219") -(package! solaire-mode :pin "9d143db85428c5a7798e429f3b8abd2bf3f80747") +(package! doom-themes :pin "4d24728f11853b5bd231687ac3f7a95108688313") +(package! solaire-mode :pin "186f97d7dddc85131fb1e7be5f89de226f26ae51")