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

No applicable method: forge--format, nil, "%i:new-comment" #124

Closed
Alexander-Miller opened this issue Mar 16, 2019 · 5 comments
Closed

No applicable method: forge--format, nil, "%i:new-comment" #124

Alexander-Miller opened this issue Mar 16, 2019 · 5 comments
Labels
support User needs some help

Comments

@Alexander-Miller
Copy link

Just ran into this trying to create a new post. Reproduced as follows:

  • emacs -q
  • Load magit & forge.
  • Call magit-status for repository with open PR, in my case this one
  • Call forge-pull
  • Move point to the single PR and call forge-create-post

This results in the following stack trace:

Debugger entered--Lisp error: (cl-no-applicable-method forge--format nil "%i:new-comment")
  signal(cl-no-applicable-method (forge--format nil "%i:new-comment"))
  cl-no-applicable-method(#s(cl--generic :name forge--format :dispatches ((1 #s(cl--generic-generalizer :name cl--generic-t-generalizer :priority 0 :tagcode-function #f(compiled-function (name &rest _) #<bytecode 0x25b319>) :specializers-function #f(compiled-function (tag &rest _) #<bytecode 0x25b32d>))) (0 #s(cl--generic-generalizer :name eieio--generic-generalizer :priority 50 :tagcode-function cl--generic-struct-tag :specializers-function #f(compiled-function (tag &rest _) #<bytecode 0x56b3f1>)) #s(cl--generic-generalizer :name cl--generic-typeof-generalizer :priority 10 :tagcode-function #f(compiled-function (name &rest _) #<bytecode 0x25c505>) :specializers-function #f(compiled-function (tag &rest _) #<bytecode 0x25c511>)) #s(cl--generic-generalizer :name cl--generic-t-generalizer :priority 0 :tagcode-function #f(compiled-function (name &rest _) #<bytecode 0x25b319>) :specializers-function #f(compiled-function (tag &rest _) #<bytecode 0x25b32d>)))) :method-table (#s(cl--generic-method :specializers (forge-topic t) :qualifiers nil :uses-cnm nil :function #f(compiled-function (topic slot &optional spec) #<bytecode 0x13af741>)) #s(cl--generic-method :specializers (forge-post t) :qualifiers nil :uses-cnm nil :function #f(compiled-function (post slot &optional spec) #<bytecode 0x13a14bd>)) #s(cl--generic-method :specializers (forge-repository t) :qualifiers nil :uses-cnm nil :function #f(compiled-function (repo format-or-slot &optional spec) #<bytecode 0x13956e1>)) #s(cl--generic-method :specializers (string t) :qualifiers nil :uses-cnm nil :function #f(compiled-function (remote slot &optional spec) #<bytecode 0x1394ed5>))) :options nil) nil "%i:new-comment")
  apply(cl-no-applicable-method #s(cl--generic :name forge--format :dispatches ((1 #s(cl--generic-generalizer :name cl--generic-t-generalizer :priority 0 :tagcode-function #f(compiled-function (name &rest _) #<bytecode 0x25b319>) :specializers-function #f(compiled-function (tag &rest _) #<bytecode 0x25b32d>))) (0 #s(cl--generic-generalizer :name eieio--generic-generalizer :priority 50 :tagcode-function cl--generic-struct-tag :specializers-function #f(compiled-function (tag &rest _) #<bytecode 0x56b3f1>)) #s(cl--generic-generalizer :name cl--generic-typeof-generalizer :priority 10 :tagcode-function #f(compiled-function (name &rest _) #<bytecode 0x25c505>) :specializers-function #f(compiled-function (tag &rest _) #<bytecode 0x25c511>)) #s(cl--generic-generalizer :name cl--generic-t-generalizer :priority 0 :tagcode-function #f(compiled-function (name &rest _) #<bytecode 0x25b319>) :specializers-function #f(compiled-function (tag &rest _) #<bytecode 0x25b32d>)))) :method-table (#s(cl--generic-method :specializers (forge-topic t) :qualifiers nil :uses-cnm nil :function #f(compiled-function (topic slot &optional spec) #<bytecode 0x13af741>)) #s(cl--generic-method :specializers (forge-post t) :qualifiers nil :uses-cnm nil :function #f(compiled-function (post slot &optional spec) #<bytecode 0x13a14bd>)) #s(cl--generic-method :specializers (forge-repository t) :qualifiers nil :uses-cnm nil :function #f(compiled-function (repo format-or-slot &optional spec) #<bytecode 0x13956e1>)) #s(cl--generic-method :specializers (string t) :qualifiers nil :uses-cnm nil :function #f(compiled-function (remote slot &optional spec) #<bytecode 0x1394ed5>))) :options nil) (nil "%i:new-comment"))
  #f(compiled-function (&rest args) #<bytecode 0x1530ffd>)(nil "%i:new-comment")
  apply(#f(compiled-function (&rest args) #<bytecode 0x1530ffd>) nil "%i:new-comment")
  forge--format(nil "%i:new-comment")
  forge-create-post()
  funcall-interactively(forge-create-post)
  call-interactively(forge-create-post record nil)
  command-execute(forge-create-post record)
  execute-extended-command(nil "forge-create-post" "forge-create-pos")
  funcall-interactively(execute-extended-command nil "forge-create-post" "forge-create-pos")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

Magit 20190316.1829, Git 2.21.0, Emacs 26.1, gnu/linux

@vermiculus
Copy link
Contributor

It would appear that (car magit-refresh-args) is nil. Should this function really be called interactively with M-x? It would seem that it's mapped to certain keys for forge-topic objects:

(defvar forge-topic-mode-map
  (let ((map (make-sparse-keymap)))
    (define-key map (kbd "C-c C-n") 'forge-create-post)
    (define-key map (kbd "C-c C-r") 'forge-create-post)
    (define-key map [remap magit-browse-thing] 'forge-browse-topic)
    map))

What exactly were you trying to do? Reply to a PR from the status buffer or create a PR?

@Alexander-Miller
Copy link
Author

Should this function really be called interactively with M-x?

It is (interactive) and I seemed to be in the right place, so why shouldn't I call it?

What exactly were you trying to do? Reply to a PR from the status buffer or create a PR?

I was trying to reply to the PR, and also trying to see what I can do, exploring how emacs can interact with the review process. As you can see in the PR I had already tried github-review.el, and while that was successful it works by typing comments into a diff-mode buffer, lacking all the power and comfort of the magit interface I am used to, so I wanted to see what capabilities magit and forge have on that front.

Going through the manual I now see that

These commands are available only from the topic buffer

so I guess I've been doing it wrong (and doing it right did allow me to make a comment), however I still would expect either an error message like from magit-visit-thing or some dwim-ish behaviour, since point was on the topic I was trying to create a post for.

Another thing I noticed: the comment I made with forge is visible in the topic view, the comment I made with github-review.el is not. Is this a known limitation/ working as intended, or a bug, or something I didn't do right?

@vermiculus
Copy link
Contributor

github-review likely creates 'review' comments which are a separate entity as far as GitHub is concerned. Forge does not yet have support for it, though I do believe it is a planned feature (but no planned release date).

@vermiculus
Copy link
Contributor

Does the above patch provide a more useful error message in this case?

@Alexander-Miller
Copy link
Author

Does the above patch provide a more useful error message in this case?

Yes.

github-review likely creates 'review' comments which are a separate entity as far as GitHub is concerned.

There's an option for "reject", "approve" and "plain" comments. I picked the latter, but you're right, they're all still review comments, so I'll go subscribe to #75 for this.

@tarsius tarsius added the support User needs some help label Apr 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support User needs some help
Projects
None yet
Development

No branches or pull requests

3 participants