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

Eager macro-expansion failure: (error "Unknown cl-type pattern: (cl-type ement-room)") #279

Closed
AdamBark opened this issue Apr 24, 2024 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@AdamBark
Copy link

OS/platform

KDE Neon / Ubuntu 22.04

Emacs version and provenance

27.1 from the Ubuntu repository

Emacs command

emacsclient

Emacs frame type

GUI

Ement package version and provenance

0.15 GNU ELPA (package-install)

Actions taken

ement-connect to a locally running pantalaimon.

Observed results

As Ement periodically syncs I get this error twice Eager macro-expansion failure: (error "Unknown cl-type pattern: (cl-type ement-room)") and then Error running timer ‘plz--respond’: (error "Unknown cl-type pattern: (cl-type ement-room)")

Expected results

No errors.

Backtrace

Debugger entered--Lisp error: (error "Unknown cl-type pattern: (cl-type ement-room)")
  signal(error ("Unknown cl-type pattern: (cl-type ement-room)"))
  error("Unknown %s pattern: %S" cl-type (cl-type ement-room))
  pcase--macroexpand((cl-type ement-room))
  mapcar(pcase--macroexpand ((cl-type ement-room) room))
  pcase--macroexpand((and (cl-type ement-room) room))
  pcase--macroexpand(`,(and (cl-type ement-room) room))
  pcase--macroexpand((app (pcase--flip aref 0) `,(and (cl-type ement-room) room)))
  mapcar(pcase--macroexpand ((pred vectorp) (app length 2) (app (pcase--flip aref 0) `,(and (cl-type ement-room) room)) (app (pcase--flip aref 1) `,(and (cl-type ement-session) session))))
  pcase--macroexpand((and (pred vectorp) (app length 2) (app (pcase--flip aref 0) `,(and (cl-type ement-room) room)) (app (pcase--flip aref 1) `,(and (cl-type ement-session) session))))
  pcase--macroexpand(`[,(and (cl-type ement-room) room) ,(and (cl-type ement-session) session)])
  #f(compiled-function (case) #<bytecode 0x19035326ce01>)((`[,(and (cl-type ement-room) room) ,(and (cl-type ement-session) session)] (vector (ement-user-id (ement-session-user session)) (ement-room-id room))))
  mapcar(#f(compiled-function (case) #<bytecode 0x19035326ce01>) (((and (pred taxy-magit-section-p) it) (taxy-name it)) (`[,(and (cl-type ement-room) room) ,(and (cl-type ement-session) session)] (vector (ement-user-id (ement-session-user session)) (ement-room-id room))) ((pred null) nil) (x1387 (error "No clause matching `%S'" x1387))))
  pcase--expand((oref section value) (((and (pred taxy-magit-section-p) it) (taxy-name it)) (`[,(and (cl-type ement-room) room) ,(and (cl-type ement-session) session)] (vector (ement-user-id (ement-session-user session)) (ement-room-id room))) ((pred null) nil) (x1387 (error "No clause matching `%S'" x1387))))
  #f(compiled-function (exp &rest cases) "The exhaustive version of `pcase' (which see).\nIf EXP fails to match any of the patterns in CASES, an error is signaled." #<bytecode 0x190350d69f1d>)((oref section value) ((and (pred taxy-magit-section-p) it) (taxy-name it)) (`[,(and (cl-type ement-room) room) ,(and (cl-type ement-session) session)] (vector (ement-user-id (ement-session-user session)) (ement-room-id room))) ((pred null) nil))
  macroexpand((pcase-exhaustive (oref section value) ((and (pred taxy-magit-section-p) it) (taxy-name it)) (`[,(and (cl-type ement-room) room) ,(and (cl-type ement-session) session)] (vector (ement-user-id (ement-session-user session)) (ement-room-id room))) ((pred null) nil)) ((function . cl--labels-convert) (cl-next-method-p . #f(compiled-function (&rest args) #<bytecode 0x19035326cd91>)) (cl-call-next-method . #f(compiled-function (&rest args) #<bytecode 0x19035326cd79>)) (cl-generic-current-method-specializers . #f(compiled-function () #<bytecode 0x19035326cd61>))))
  macroexp-macroexpand((pcase-exhaustive (oref section value) ((and (pred taxy-magit-section-p) it) (taxy-name it)) (`[,(and (cl-type ement-room) room) ,(and (cl-type ement-session) session)] (vector (ement-user-id (ement-session-user session)) (ement-room-id room))) ((pred null) nil)) ((function . cl--labels-convert) (cl-next-method-p . #f(compiled-function (&rest args) #<bytecode 0x19035326cd91>)) (cl-call-next-method . #f(compiled-function (&rest args) #<bytecode 0x19035326cd79>)) (cl-generic-current-method-specializers . #f(compiled-function () #<bytecode 0x19035326cd61>))))
  macroexp--expand-all((pcase-exhaustive (oref section value) ((and (pred taxy-magit-section-p) it) (taxy-name it)) (`[,(and (cl-type ement-room) room) ,(and (cl-type ement-session) session)] (vector (ement-user-id (ement-session-user session)) (ement-room-id room))) ((pred null) nil)))
  macroexp--all-forms((progn (pcase-exhaustive (oref section value) ((and (pred taxy-magit-section-p) it) (taxy-name it)) (`[,(and ... room) ,(and ... session)] (vector (ement-user-id (ement-session-user session)) (ement-room-id room))) ((pred null) nil))) 1)
  #f(compiled-function (form func) #<bytecode 0x1f8b762d422d>)(((progn (pcase-exhaustive (oref section value) ((and (pred taxy-magit-section-p) it) (taxy-name it)) (`[,... ,...] (vector (ement-user-id (ement-session-user session)) (ement-room-id room))) ((pred null) nil)))) progn)
  macroexp--expand-all((progn (pcase-exhaustive (oref section value) ((and (pred taxy-magit-section-p) it) (taxy-name it)) (`[,(and ... room) ,(and ... session)] (vector (ement-user-id (ement-session-user session)) (ement-room-id room))) ((pred null) nil))))
  macroexpand-all((progn (pcase-exhaustive (oref section value) ((and (pred taxy-magit-section-p) it) (taxy-name it)) (`[,(and ... room) ,(and ... session)] (vector (ement-user-id (ement-session-user session)) (ement-room-id room))) ((pred null) nil))) ((function . cl--labels-convert) (cl-next-method-p . #f(compiled-function (&rest args) #<bytecode 0x19035326cd91>)) (cl-call-next-method . #f(compiled-function (&rest args) #<bytecode 0x19035326cd79>)) (cl-generic-current-method-specializers . #f(compiled-function () #<bytecode 0x19035326cd61>))))
  #f(compiled-function (arg1 &rest rest) "Make local function definitions.\nEach definition can take the form (FUNC EXP) where\nFUNC is the function name, and EXP is an expression that returns the\nfunction value to which it should be bound, or it can take the more common\nform (FUNC ARGLIST BODY...) which is a shorthand\nfor (FUNC (lambda ARGLIST BODY)).\n\nFUNC is defined only within FORM, not BODY, so you can't write\nrecursive function definitions.  Use `cl-labels' for that.  See\ninfo node `(cl) Function Bindings' for details." #<bytecode 0x190350d80f1d>)(((cl-call-next-method cl--cnm) (cl-next-method-p cl--nmp)) (pcase-exhaustive (oref section value) ((and (pred taxy-magit-section-p) it) (taxy-name it)) (`[,(and (cl-type ement-room) room) ,(and (cl-type ement-session) session)] (vector (ement-user-id (ement-session-user session)) (ement-room-id room))) ((pred null) nil)))
  macroexpand((cl-flet ((cl-call-next-method cl--cnm) (cl-next-method-p cl--nmp)) (pcase-exhaustive (oref section value) ((and (pred taxy-magit-section-p) it) (taxy-name it)) (`[,(and ... room) ,(and ... session)] (vector (ement-user-id (ement-session-user session)) (ement-room-id room))) ((pred null) nil))) ((cl-generic-current-method-specializers . #f(compiled-function () #<bytecode 0x19035326cd61>))))
  macroexp-macroexpand((cl-flet ((cl-call-next-method cl--cnm) (cl-next-method-p cl--nmp)) (pcase-exhaustive (oref section value) ((and (pred taxy-magit-section-p) it) (taxy-name it)) (`[,(and ... room) ,(and ... session)] (vector (ement-user-id (ement-session-user session)) (ement-room-id room))) ((pred null) nil))) ((cl-generic-current-method-specializers . #f(compiled-function () #<bytecode 0x19035326cd61>))))
  macroexp--expand-all((cl-flet ((cl-call-next-method cl--cnm) (cl-next-method-p cl--nmp)) (pcase-exhaustive (oref section value) ((and (pred taxy-magit-section-p) it) (taxy-name it)) (`[,(and ... room) ,(and ... session)] (vector (ement-user-id (ement-session-user session)) (ement-room-id room))) ((pred null) nil))))
  macroexpand-all((cl-flet ((cl-call-next-method cl--cnm) (cl-next-method-p cl--nmp)) (pcase-exhaustive (oref section value) ((and (pred taxy-magit-section-p) it) (taxy-name it)) (`[,(and ... room) ,(and ... session)] (vector (ement-user-id (ement-session-user session)) (ement-room-id room))) ((pred null) nil))) ((cl-generic-current-method-specializers . #f(compiled-function () #<bytecode 0x19035326cd61>))))
  cl--generic-lambda(((section ement-room-list-section)) ("Return ident value for `ement-room-list-section' S..." (pcase-exhaustive (oref section value) ((and (pred taxy-magit-section-p) it) (taxy-name it)) (`[,(and ... room) ,(and ... session)] (vector (ement-user-id (ement-session-user session)) (ement-room-id room))) ((pred null) nil))))
  #f(compiled-function (arg1 arg2 &rest rest) "Define a new method for generic function NAME.\nI.e. it defines the implementation of NAME to use for invocations where the\nvalues of the dispatch arguments match the specified TYPEs.\nThe dispatch arguments have to be among the mandatory arguments, and\nall methods of NAME have to use the same set of arguments for dispatch.\nEach dispatch argument and TYPE are specified in ARGS where the corresponding\nformal argument appears as (VAR TYPE) rather than just VAR.\n\nThe optional second argument QUALIFIER is a specifier that\nmodifies how the method is combined with other methods, including:\n   :before  - Method will be called before the primary\n   :after   - Method will be called after the primary\n   :around  - Method will be called around everything else\nThe absence of QUALIFIER means this is a \"primary\" method.\nThe set of acceptable qualifiers and their meaning is defined\n(and can be extended) by the methods of `cl-generic-combine-methods'.\n\nARGS can also include so-called context specializers, introduced by\n`&context' (which should appear right after the mandatory arguments,\nbefore any &optional or &rest).  They have the form (EXPR TYPE) where\nEXPR is an Elisp expression whose value should match TYPE for the\nmethod to be applicable.\n\nThe set of acceptable TYPEs (also called \"specializers\") is defined\n(and can be extended) by the various methods of `cl-generic-generalizers'." #<bytecode 0x1f8b7629365b>)(magit-section-ident-value ((section ement-room-list-section)) "Return ident value for `ement-room-list-section' S..." (pcase-exhaustive (oref section value) ((and (pred taxy-magit-section-p) it) (taxy-name it)) (`[,(and (cl-type ement-room) room) ,(and (cl-type ement-session) session)] (vector (ement-user-id (ement-session-user session)) (ement-room-id room))) ((pred null) nil)))
  (cl-defmethod magit-section-ident-value ((section ement-room-list-section)) "Return ident value for `ement-room-list-section' S..." (pcase-exhaustive (oref section value) ((and (pred taxy-magit-section-p) it) (taxy-name it)) (`[,(and (cl-type ement-room) room) ,(and (cl-type ement-session) session)] (vector (ement-user-id (ement-session-user session)) (ement-room-id room))) ((pred null) nil)))
  eval-buffer(#<buffer  *load*> nil "/home/adam/.emacs.d/elpa/ement-0.15/ement-room-lis..." nil t)  ; Reading at buffer position 3321
  load-with-code-conversion("/home/adam/.emacs.d/elpa/ement-0.15/ement-room-lis..." "/home/adam/.emacs.d/elpa/ement-0.15/ement-room-lis..." nil t)
  ement-room-list-auto-update(#s(ement-session :user ... :server ... :token "..." :transaction-id 000000 :rooms ... :next-batch "..." :device-id "..." :initial-device-display-name "Ement.el: adam..." :has-synced-p nil :account-data ... :events #<hash-table equal 1639/1642 0x1903518e51dd>))
  run-hook-with-args(ement-room-list-auto-update #s(ement-session :user ... :server ... :token "..." :transaction-id 00000 :rooms ... :next-batch "..." :device-id "..." :initial-device-display-name "Ement.el: adam..." :has-synced-p nil :account-data ... :events #<hash-table equal 1639/1642 0x1903518e51dd>))
  ement--sync-callback(#s(ement-session :user ... :server ... :token "..." :transaction-id 000000 :rooms ... :next-batch "..." :device-id "..." :initial-device-display-name "Ement.el: adam..." :has-synced-p nil :account-data ... :events #<hash-table equal 1639/1642 0x1903518e51dd>) (... ... ... ... ...))
  apply(ement--sync-callback (... ...))
  #f(compiled-function (&rest args2) #<bytecode 0x1903524d1d0d>)(((next_batch . "...") (device_one_time_keys_count (signed_curve25519 . 50)) (org\.matrix\.msc2732\.device_unused_fallback_key_types . []) (device_unused_fallback_key_types . []) (rooms (join (!:matrix\.org (timeline (events . []) (prev_batch . "...") (limited . :json-false)) (state (events . [])) (account_data (events . [...])) (ephemeral (events . [])) (unread_notifications (notification_count . 0) (highlight_count . 0)) (summary))))))
  #f(compiled-function () #<bytecode 0x1903519d3bd1>)()
  plz--respond(#<process plz-request-curl> #<buffer  *plz-request-curl*-246597> "finished\n")
  apply(plz--respond (#<process plz-request-curl> #<buffer  *plz-request-curl*-246597> "finished\n"))
  timer-event-handler([t 26153 20955 445768 nil plz--respond (#<process plz-request-curl> #<buffer  *plz-request-curl*-246597> "finished\n") nil 996000])

Etc.

No response

@AdamBark AdamBark added the bug Something isn't working label Apr 24, 2024
@alphapapa alphapapa added this to the 0.15.1 milestone Apr 24, 2024
@alphapapa
Copy link
Owner

alphapapa commented Apr 24, 2024

Hi, thanks for reporting this. I'll fix it in a v0.15.1 release, hopefully very soon.

In the meantime, you might also want to upgrade Emacs; some very significant improvements have been made in versions 28 and 29.

And to stop this error from happening until it's fixed, you can simply kill the room list buffer.

@AdamBark
Copy link
Author

Thank you.

alphapapa added a commit that referenced this issue Jun 6, 2024
As the preceding comment says, the CL-TYPE form is only in Pcase as of
Emacs 28.  (It's easy to forget these things when supporting 3 
versions of Emacs.)

Fixes <#279>.

Reported-by: Adam Bark <https://github.com/AdamBark>
@alphapapa
Copy link
Owner

@AdamBark Apologies for the delay. This should be fixed now on master and in v0.15.1 when it hits ELPA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants