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

Add additional magit-section wrapping #55

Closed
Oghma opened this issue Oct 5, 2018 · 9 comments
Closed

Add additional magit-section wrapping #55

Oghma opened this issue Oct 5, 2018 · 9 comments
Assignees

Comments

@Oghma
Copy link

Oghma commented Oct 5, 2018

Hi. I started to get this error when I use M-x magit-todos-list

magit-todos: Not overriding bind of "jT" in 'magit-status-mode-map'.
helm-M-x: Wrong type argument: eieio-object, nil, obj

If I try with only magit and magit-todos enabled with the same command I get

eieio-oset: Wrong type argument: eieio-object, nil, obj

I tried to run M-x toggle-debug-on-error on an empty init.el except for magit and magit-todos and I get the following stack trace:

Debugger entered--Lisp error: (wrong-type-argument eieio-object nil obj)
  signal(wrong-type-argument (eieio-object nil obj))
  eieio-oset(nil children (#<magit-section "master" [branch] 1-38>))
  magit-insert-headers(magit-status-headers-hook)
  magit-insert-status-headers()
  magit-todos-list-refresh-buffer()
  apply(magit-todos-list-refresh-buffer nil)
  magit-refresh-buffer()
  magit-mode-setup-internal(magit-todos-list-mode nil)
  magit-mode-setup(magit-todos-list-mode)
  magit-todos-list-internal("/Users/Oghma/Documents/Progetti/prova/")
  magit-todos-list(nil)
  funcall-interactively(magit-todos-list nil)
  call-interactively(magit-todos-list record nil)
  command-execute(magit-todos-list record)
  execute-extended-command(nil "magit-todos-list" "magit-todos-li")
  funcall-interactively(execute-extended-command nil "magit-todos-list" "magit-todos-li")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

I have the issue with both mac os 10.11.6 and archlinux. I’m using emacs 26.1 and in both os I have ripgrep installed.

@alphapapa
Copy link
Owner

Hi,

Have you always had this problem, or did it start recently? Did you upgrade Magit recently? What version of it do you have? Does it happen in every repository?

@Oghma
Copy link
Author

Oghma commented Oct 6, 2018

Sorry if I forgot to write that information

Have you always had this problem, or did it start recently?

It started recently, one or two weeks ago.

Did you upgrade Magit recently? What version of it do you have?

Yes, i have updated magit to the latest version: Magit 20180928.1153

Does it happen in every repository?

Yes. In “old" repositories I can see the TODOs section in magit-status buffer but is not updated with the new TODO

@alphapapa alphapapa self-assigned this Oct 9, 2018
@alphapapa
Copy link
Owner

I'm guessing that something was updated in Magit that broke this. I'll have to upgrade Magit and test. In the meantime, you may be able to work around it by downgrading Magit to the last version you had.

@alphapapa
Copy link
Owner

alphapapa commented Oct 9, 2018

I think this was broken in magit/magit@40616d7. I don't yet understand why, or how to fix it. I'm looking at the old code and trying to figure out what's missing now, but I don't see what it is.

I'm calling magit-insert-status-headers, and the headers get inserted, but then the reparenting fails because the first heading has no parent in the magit-todos-list buffer. I don't know why that is, since I'm deriving from magit-status-mode. @npostavs If you could help, it would be appreciated.

alphapapa referenced this issue in magit/magit Oct 9, 2018
Instead of using multiple inter-calling hooks, just fix up the parent
child relations after the fact.
@alphapapa
Copy link
Owner

@npostavs I figured it out. Sorry for the noise.

@Oghma Thank you very much for reporting.

@npostavs
Copy link

npostavs commented Oct 9, 2018

reparenting fails because the first heading has no parent in the magit-todos-list buffer.

Maybe magit's code shouldn't signal an error in this case? If I understand correctly, before my change the lack of parent didn't cause a problem.

@alphapapa
Copy link
Owner

Maybe magit's code shouldn't signal an error in this case?

Maybe so.

If I understand correctly, before my change the lack of parent didn't cause a problem.

You're right, I don't think it did.

@tarsius What do you think?

@tarsius
Copy link
Contributor

tarsius commented Oct 10, 2018

Magit expects exactly one root section. I am surprised going against this expectations didn't cause things to fall apart more spectacularly. But there will be other issues.

Just wrap the calls to the section inserters in magit-todos-list-refresh-buffer with another magit-insert-section.

@alphapapa
Copy link
Owner

Thank you, Jonas.

@alphapapa alphapapa reopened this Oct 12, 2018
@alphapapa alphapapa changed the title Error with magit-todos-list Add additional magit-section wrapping Nov 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants