gonewest818 / dimmer.el

Interactively highlight which buffer is active by dimming the others.
GNU General Public License v3.0
267 stars 14 forks source link

`wrong-type-argument listp default` in Magit Status when Magit Delta is also loaded #54

Open balajisivaraman opened 3 years ago

balajisivaraman commented 3 years ago

Hi,

I am not 100% sure whether this is a Dimmer issue. I do not face it with this package disabled, so I think it is not a Magit Delta issue. I think it's a combination of Magit, Magit Delta and Dimmer.

Emacs Version: GNU Emacs 27.1.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.23) of 2020-10-12 Magit Version: Magit 20210406.454, Git 2.31.1, Emacs 27.1.50, gnu/linux Dimmer Version: dimmer-20210109.1932 Magit Delta Version: magit-delta-20210104.1541

Steps to Reproduce:

  1. Open any Git repository
  2. Open Magit Status
  3. Without killing the status buffer, go to any other buffer in the repository
  4. Open Magit Status again

Error:

Debugger entered--Lisp error: (wrong-type-argument listp default)
  remq((:foreground "#83029ece79fd") default)
  face-remap-remove-relative((magit-diff-added :foreground "#83029ece79fd"))
  mapc(face-remap-remove-relative ((default :foreground "#776077607760") (shadow :foreground "#a3b0a3b0a3b0") (link-visited :foreground "#b0a98c1cd7b0") (region :foreground "#776077607760") (line-number :foreground "#a3b0a3b0a3b0") (line-number-current-line :foreground "#776077607760") (line-number-major-tick :foreground "#9dc290b0785c") (line-number-minor-tick :foreground "#a3b0a3b0a3b0") (fill-column-indicator :foreground "#ebc1ebc1ebc1") (escape-glyph :foreground "#cd488cef90b2") (homoglyph :foreground "#beb1926a7998") (nobreak-space :foreground "#cd488cef90b2") (nobreak-hyphen :foreground "#cd488cef90b2") (mode-line :foreground "#7ad87ad77ad7") (mode-line-inactive :foreground "#9a899b089f20") (mode-line-emphasis :foreground "#9e6191e9dbef") (header-line :foreground "#8d478d478d47") (vertical-border :foreground "#c289c289c289") (window-divider :foreground "#c289c289c289") (window-divider-first-pixel :foreground "#a838a838a838") (window-divider-last-pixel :foreground "#a838a838a838") (minibuffer-prompt :foreground "#8a06a9f9ac29") (tool-bar :foreground "#776077607760") (tab-bar :foreground "#776077607760") (tab-line :foreground "#776077607760") (help-argument-name :foreground "#91b1a4f6c4e8") (error :foreground "#e1a48ec379d5") (warning :foreground "#c80f9ab27c57") (success :foreground "#8a59ad417ec1") (tty-menu-enabled-face :foreground "#776077607760") (tty-menu-disabled-face :foreground "#a3b0a3b0a3b0") (show-paren-match :foreground "#776077607760") (button :foreground "#a4ec8432e2e0") (completions-annotations :foreground "#8d35a389b9db") (completions-first-difference :foreground "#cc088e00b8e5") (completions-common-part :foreground "#a27a9cbedf2d") (font-lock-comment-face :foreground "#b1f69c7f7bad") (font-lock-string-face :foreground "#9776aa9b7ea3") (font-lock-doc-face :foreground "#a8828a57a38a") (font-lock-keyword-face :foreground "#8a06a9f9ac29") (font-lock-builtin-face :foreground "#a27a9cbedf2d") (font-lock-function-name-face :foreground "#cc088e00b8e5") (font-lock-variable-name-face :foreground "#9415981ec5f9") (font-lock-type-face :foreground "#9886a3fbbe42") (font-lock-constant-face :foreground "#b0a98c1cd7b0") (font-lock-warning-face :foreground "#bc5191ed8735") (font-lock-negation-char-face :foreground "#c80f9ab27c57") (font-lock-preprocessor-face :foreground "#d9e990e99044") (font-lock-regexp-grouping-backslash :foreground "#a27a9cbedf2d") (font-lock-regexp-grouping-construct :foreground "#cc088e00b8e5") ...))
  dimmer-restore-buffer(#<buffer magit: balaji>)
  dimmer-process-all(t)
  dimmer-config-change-handler()
  redisplay_internal\ \(C\ function\)()

This is the relevant bit from my Magit, Magit Delta and Dimmer configuration:

(use-package dimmer
  :config
  (dimmer-configure-which-key)
  ;; (dimmer-configure-magit)
  (dimmer-configure-posframe)
  (dimmer-mode t)
  (setq dimmer-fraction 0.5))

(use-package magit
  :init
  (setq-default magit-last-seen-setup-instructions "1.4.0")
  (advice-add 'magit-status :after #'delete-other-windows))

(use-package magit-delta
  :after magit
  :hook ((magit-mode . (lambda () (magit-delta-mode +1)))))

In the above config, I have commented (dimmer-configure-magit) and surprisingly the error occurs even with that. I first that it was because of this function being called, but this is not the case apparently.

This error does not happen when I open Magit Status for the first time. It only happens if the buffer is already open, and I go to the buffer again.

Thanks.

gonewest818 commented 3 years ago

Hi Balaji, thanks for this.

The stack trace is definitely from dimmer. It’s trying to manipulate the faces in the magit status buffer because you’re returning to it (that buffer was dimmed, so we want to “un-dim”.).

My hunch would be that magit delta is defining or manipulating faces in some way dimmer doesn’t expect.

As a workaround you could exclude the magit status buffer from dimmer. That would prevent the errors but also inhibit dimming in that buffer until I figure out the issue.

On Apr 10, 2021, at 7:56 AM, Balaji Sivaraman @.***> wrote:

 Hi,

I am not 100% sure whether this is a Dimmer issue. I do not face it with this package disabled, so I think it is not a Magit Delta issue. I think it's a combination of Magit, Magit Delta and Dimmer.

Emacs Version: GNU Emacs 27.1.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.23) of 2020-10-12 Magit Version: Magit 20210406.454, Git 2.31.1, Emacs 27.1.50, gnu/linux Dimmer Version: dimmer-20210109.1932 Magit Delta Version: magit-delta-20210104.1541

Steps to Reproduce:

Open any Git repository Open Magit Status Without killing the status buffer, go to any other buffer in the repository Open Magit Status again Error:

Debugger entered--Lisp error: (wrong-type-argument listp default) remq((:foreground "#83029ece79fd") default) face-remap-remove-relative((magit-diff-added :foreground "#83029ece79fd")) mapc(face-remap-remove-relative ((default :foreground "#776077607760") (shadow :foreground "#a3b0a3b0a3b0") (link-visited :foreground "#b0a98c1cd7b0") (region :foreground "#776077607760") (line-number :foreground "#a3b0a3b0a3b0") (line-number-current-line :foreground "#776077607760") (line-number-major-tick :foreground "#9dc290b0785c") (line-number-minor-tick :foreground "#a3b0a3b0a3b0") (fill-column-indicator :foreground "#ebc1ebc1ebc1") (escape-glyph :foreground "#cd488cef90b2") (homoglyph :foreground "#beb1926a7998") (nobreak-space :foreground "#cd488cef90b2") (nobreak-hyphen :foreground "#cd488cef90b2") (mode-line :foreground "#7ad87ad77ad7") (mode-line-inactive :foreground "#9a899b089f20") (mode-line-emphasis :foreground "#9e6191e9dbef") (header-line :foreground "#8d478d478d47") (vertical-border :foreground "#c289c289c289") (window-divider :foreground "#c289c289c289") (window-divider-first-pixel :foreground "#a838a838a838") (window-divider-last-pixel :foreground "#a838a838a838") (minibuffer-prompt :foreground "#8a06a9f9ac29") (tool-bar :foreground "#776077607760") (tab-bar :foreground "#776077607760") (tab-line :foreground "#776077607760") (help-argument-name :foreground "#91b1a4f6c4e8") (error :foreground "#e1a48ec379d5") (warning :foreground "#c80f9ab27c57") (success :foreground "#8a59ad417ec1") (tty-menu-enabled-face :foreground "#776077607760") (tty-menu-disabled-face :foreground "#a3b0a3b0a3b0") (show-paren-match :foreground "#776077607760") (button :foreground "#a4ec8432e2e0") (completions-annotations :foreground "#8d35a389b9db") (completions-first-difference :foreground "#cc088e00b8e5") (completions-common-part :foreground "#a27a9cbedf2d") (font-lock-comment-face :foreground "#b1f69c7f7bad") (font-lock-string-face :foreground "#9776aa9b7ea3") (font-lock-doc-face :foreground "#a8828a57a38a") (font-lock-keyword-face :foreground "#8a06a9f9ac29") (font-lock-builtin-face :foreground "#a27a9cbedf2d") (font-lock-function-name-face :foreground "#cc088e00b8e5") (font-lock-variable-name-face :foreground "#9415981ec5f9") (font-lock-type-face :foreground "#9886a3fbbe42") (font-lock-constant-face :foreground "#b0a98c1cd7b0") (font-lock-warning-face :foreground "#bc5191ed8735") (font-lock-negation-char-face :foreground "#c80f9ab27c57") (font-lock-preprocessor-face :foreground "#d9e990e99044") (font-lock-regexp-grouping-backslash :foreground "#a27a9cbedf2d") (font-lock-regexp-grouping-construct :foreground "#cc088e00b8e5") ...)) dimmer-restore-buffer(#) dimmer-process-all(t) dimmer-config-change-handler() redisplay_internal\ (C\ function)() This error does not happen when I open Magit Status for the first time. It only happens if the buffer is already open, and I go to the buffer again.

Thanks.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

balajisivaraman commented 3 years ago

Thanks @gonewest818. I can also try and do some debugging with my limited ELisp skills in my free time. Meanwhile, doing this: (add-to-list 'dimmer-buffer-exclusion-regexps "^magit.*") resolves the issue. :+1: