emacs-solaire-mode icon indicating copy to clipboard operation
emacs-solaire-mode copied to clipboard

Calls to `save-some-buffers` makes the area shared by the echo area and minibuffer "flash", as `(solaire-mode-fix-minibuffer 'unset)` is called.

Open hab25 opened this issue 2 years ago • 0 comments

What did you expect to happen?

I expected my echo/minibuffer shared area to not be distracting me with flashes caused by face changes.

What actually happened?

In my Doom Emacs config, I have

(auto-save-visited-mode +1)
(setq! auto-save-visited-interval 0.1)

With the above configuration, the area shared by the echo area and minibuffer keeps rapidly and frequently flashing a light color, this seems to be due to https://github.com/hlissner/emacs-solaire-mode/blob/8af65fbdc50b25ed3214da949b8a484527c7cc14/solaire-mode.el#L533

Describe your attempts to resolve the issue

I'm using the following advice to prevent solaire-mode from ever unsetting, this solves the problem and I've had no issues so far.

(define-advice solaire-mode-fix-minibuffer ( :around (orig-fn &rest _)) (apply orig-fn nil))

This prevents the unadviced solaire-mode-fix-minibuffer from ever being called with non-nil first arg, e.g. (solaire-mode-fix-minibuffer 'unset).

However, this is not robust; it would break for me if/when in a future update solaire-mode changes some thing about this function like name, arguments or implementation.

A possible solution is for this project to implement not calling solaire-mode with 'unset in the map-y-or-n-p@fix-background advice. I don't know what problems this would cause.

Steps to reproduce

  1. Install doomemacs with the default init.el.
  2. Put the following in config.el
(auto-save-visited-mode +1)
(setq! auto-save-visited-interval 0.1)
  1. See that the shared echo/minibuffer area will flash whenever emacs becomes idle for 0.1 seconds (which is frequently).
Details The following is not directly relevant, but I am also using the below code, and am sharing it here just to show that there is a safe use-case for `auto-save-visited-mode`; the safety is provided by `magit-wip-mode` .
(setq! magit-wip-mode +1)
(add-hook! 'find-file-hook (if (eq (vc-backend buffer-file-name) 'Git)
                               (progn (make-local-variable 'doom-modeline-buffer-state-icon)
                                      (setq doom-modeline-buffer-state-icon nil)
                                      (make-local-variable 'save-silently)
                                      (setq save-silently t))
                               (progn (make-local-variable 'auto-save-visited-mode)
                                      (setq auto-save-visited-mode nil))))

Package commit

8af65fbdc50b25ed3214da949b8a484527c7cc14

System Information

Pop!_OS 22.04 Emacs 28.2 nix-doom-emacs (rev d73237307872f29f2c6492aa81dfc8be0dead7a8) Doom Emacs (rev 3853dff5e11655e858d0bfae64b70cb12ef685ac)

hab25 avatar Nov 27 '22 23:11 hab25