Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modline/spaceline clobbered during git commit with magit #14726

Closed
jsilve24 opened this issue Apr 29, 2021 · 7 comments · Fixed by #14810
Closed

modline/spaceline clobbered during git commit with magit #14726

jsilve24 opened this issue Apr 29, 2021 · 7 comments · Fixed by #14810
Assignees

Comments

@jsilve24
Copy link

Description :octocat:

First off, thank you for all your help building spacemacs, its awesome.

This is an expansion on the brief notes I left on closed issue #176 (TheBB/spaceline#176)

In short, whenever I enter the commit menu using magit (SPC g s and then c c) my spaceline/modline gets clobbered and does not return until I restart spacemacs.

Screenshot before
spaceline1

** Screenshot during commit (note same modline appearance is seen until spacemacs restarts)**
spaceline2

My .spacemacs (renamed to spacemacs.txt so I can upload to github)
spacemacs.txt

Reproduction guide 🪲

  • Start Emacs using my .spacemacs as it seems at least some other users are not having this trouble
  • SPC g s
  • c c
  • Get frustrated as modline disappears

Observed behaviour: 👀 💔
spaceline replaced by empty bordered "cells"

Expected behaviour: ❤️ 😄
spaceline not clobbered :)

System Info 💻

  • OS: gnu/linux
  • Emacs: 26.3
  • Spacemacs: 0.300.0
  • Spacemacs branch: develop (rev. df15f8c)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
(python csv auto-completion emacs-lisp git helm
        (deft :variables deft-zetteldeft t)
        (markdown :variables markdown-command "pandoc")
        multiple-cursors org spell-checking syntax-checking
        (ranger :variables ranger-override-dired 'ranger ranger-show-preview t)
        treemacs latex bibtex ess polymode imenu-list
        (evil-snipe :variables evil-snipe-enable-alternate-f-and-t-behaviors t))
  • System configuration features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS GLIB NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM THREADS LIBSYSTEMD LCMS2

Backtrace 🐾

<<BACKTRACE IF RELEVANT>>
@lebensterben
Copy link
Collaborator

This is an upstream bug of spaceline.
I use doom-modeline and there's no such issue.

@hhkgrz
Copy link

hhkgrz commented May 9, 2021

Same problem here, it seems this issue is caused by commits 4836a25 and 38f582d.

At

:spacediminish ((fci-mode "" " f"))
, change ':spacediminish ((fci-mode " ⓕ" " f"))' to ':spacediminish (fci-mode " ⓕ" " f")' could make it work.

But not sure if this is an appropriate way to fix this.

Need the experts' help on this.

@lebensterben
Copy link
Collaborator

I will take a look.

@lebensterben lebensterben self-assigned this May 9, 2021
mbertheau added a commit to mbertheau/spacemacs that referenced this issue May 22, 2021
mbertheau added a commit to mbertheau/spacemacs that referenced this issue May 26, 2021
mbertheau added a commit to mbertheau/spacemacs that referenced this issue May 26, 2021
mbertheau added a commit to mbertheau/spacemacs that referenced this issue May 27, 2021
mbertheau added a commit to mbertheau/spacemacs that referenced this issue May 27, 2021
mbertheau added a commit to mbertheau/spacemacs that referenced this issue May 27, 2021
mbertheau added a commit to mbertheau/spacemacs that referenced this issue May 27, 2021
mbertheau added a commit to mbertheau/spacemacs that referenced this issue May 27, 2021
@lebensterben
Copy link
Collaborator

@hhkgrz
Can you verify whether it's fixed now?

@mbertheau
Copy link
Contributor

I still get this:

Error during redisplay: (eval (spaceline-ml-main)) signaled (wrong-type-argument symbolp (fci-mode " ⓕ" " f"))

mbertheau added a commit to mbertheau/spacemacs that referenced this issue May 30, 2021
The code changed here wants to distinguish the cases of whether `arg` is a list
with one set of args to `spacemacs|diminish` or a list of a list of such args.
It used to look at the second element of `args` to make that distinction.
Consequently, if you want to specify a list of a list of args for
`:spacediminish`, you'd have to have at least two such lists of args in the list.

However in
syl20bnr@38f582d
a usage with a list of just one list of args was introduced.

This fixes changes the detection so that it looks at the first element of `arg`.
If that's a list, `arg` is assumed to be a list of lists of args to
`spacemacs|diminish`. If it's not, it's assumed to be just a list of args to
`spacemacs|diminish`. That works well because the first argument to
`spacemacs|diminish` is a symbol.

Fixes syl20bnr#14726
@mbertheau
Copy link
Contributor

I'm getting the following backtrace

Screenshot from 2021-05-30 15-24-36

Tracing a bit through the code, the problem seems to be in here

(defun use-package-handler/:spacediminish (name _keyword arg rest state)
  (debug)
  (let ((body (use-package-process-keywords name rest state)))
    (use-package-concat
     `((when (fboundp 'spacemacs|diminish)
         ,@(if (consp (cadr arg)) ;; e.g. ((MODE1 FOO BAR) (MODE2 BAZ XYZ))
               (mapcar #'(lambda (var) `(spacemacs|diminish ,@var))
                       arg)
             `((spacemacs|diminish ,@arg))))) ;; e.g. (MODE FOO BAR)
     body)))

at (cadr arg) arg is ((fci-mode "..." "...")), so the cadr evals to nil and consequently the other branch of the if is taken.

Thus, in the current implementation, :spacediminish supports a "list of patterns above" (see 4836a25) only if that list has at least two elements in it.

A proposed fix is in #14810.

@lebensterben lebensterben reopened this May 30, 2021
mbertheau added a commit to mbertheau/spacemacs that referenced this issue May 31, 2021
The code changed here wants to distinguish the cases of whether `arg` is a list
with one set of args to `spacemacs|diminish` or a list of a list of such args.
It used to look at the second element of `args` to make that distinction.
Consequently, if you want to specify a list of a list of args for
`:spacediminish`, you'd have to have at least two such lists of args in the list.

However in
syl20bnr@38f582d
a usage with a list of just one list of args was introduced.

This fixes changes the detection so that it looks at the first element of `arg`.
If that's a list, `arg` is assumed to be a list of lists of args to
`spacemacs|diminish`. If it's not, it's assumed to be just a list of args to
`spacemacs|diminish`. That works well because the first argument to
`spacemacs|diminish` is a symbol.

Fixes syl20bnr#14726
lebensterben pushed a commit that referenced this issue May 31, 2021
The code changed here wants to distinguish the cases of whether `arg` is a list
with one set of args to `spacemacs|diminish` or a list of a list of such args.
It used to look at the second element of `args` to make that distinction.
Consequently, if you want to specify a list of a list of args for
`:spacediminish`, you'd have to have at least two such lists of args in the list.

However in
38f582d
a usage with a list of just one list of args was introduced.

This fixes changes the detection so that it looks at the first element of `arg`.
If that's a list, `arg` is assumed to be a list of lists of args to
`spacemacs|diminish`. If it's not, it's assumed to be just a list of args to
`spacemacs|diminish`. That works well because the first argument to
`spacemacs|diminish` is a symbol.

Fixes #14726
@lebensterben
Copy link
Collaborator

Should be fixed in #14810

wang-d pushed a commit to wang-d/spacemacs that referenced this issue Jul 22, 2021
wang-d pushed a commit to wang-d/spacemacs that referenced this issue Jul 22, 2021
The code changed here wants to distinguish the cases of whether `arg` is a list
with one set of args to `spacemacs|diminish` or a list of a list of such args.
It used to look at the second element of `args` to make that distinction.
Consequently, if you want to specify a list of a list of args for
`:spacediminish`, you'd have to have at least two such lists of args in the list.

However in
syl20bnr@38f582d
a usage with a list of just one list of args was introduced.

This fixes changes the detection so that it looks at the first element of `arg`.
If that's a list, `arg` is assumed to be a list of lists of args to
`spacemacs|diminish`. If it's not, it's assumed to be just a list of args to
`spacemacs|diminish`. That works well because the first argument to
`spacemacs|diminish` is a symbol.

Fixes syl20bnr#14726
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants