nyxt icon indicating copy to clipboard operation
nyxt copied to clipboard

`describe-slot` crashes Nyxt

Open aadcg opened this issue 3 months ago • 1 comments

Three issues here:

  • Fixing the root cause of the crash (trivial);
  • Ensuring that these kind of crashes are suppressed (they're due to a custom condition being raised);
  • #2695.

aadcg avatar Apr 04 '24 12:04 aadcg

The more general issue here is that all forms defined via define-internal-page-command that call prompt will invoke a condition since, in this case, *interactive-p* is NIL. Note that those defined via define-command don't suffer from this issue.

(define-internal-page-command test-internal-page-cmd ()
    (buffer "test")
  ;; *interactive-p* => NIL
  (prompt1 :prompt "Describe slot"
           :sources '(slot-source
                      slot-non-nyxt-source
                      slot-internal-source)))

(define-command test-cmd ()
    (buffer "test")
  ;; *interactive-p* => T
  (prompt1 :prompt "Describe slot"
           :sources '(slot-source
                      slot-non-nyxt-source
                      slot-internal-source)))

The bug is present in the master branch, not on the 3-series releases. The direct culprit is a688e8cd91fbf049162d514730801cfe53d73117. It seemed bogus to set *interactive-p* to T in order to run custom scheme callbacks, so I got rid of it. It is now clear that it was done to hide bad design.

The underlying issue is commit 62b7dc93f2fa5b0daf34eb5084f02cbaa15399d2.

The only sane decision is to delete the logic behind *interactive-p* and *headless-p* since it's poorly implemented and misaligned with the Nyxt's priorities.

aadcg avatar Apr 08 '24 18:04 aadcg