reverse-im.el icon indicating copy to clipboard operation
reverse-im.el copied to clipboard

reverse-im-read-char-advice-function doesn't work with native compilation

Open ceed0 opened this issue 2 years ago • 4 comments

It always triggered when reverse-im-read-char-advice-function option is set, even if mu4e excluded/not included.

Mu4e don't have to be configured with more than one mail context, one will trigger the error too:

  1. open mu4e
  2. press C to compose email, then cancel with C-c C-k
  3. press ; to switch context, choosing any context results in the error

Wrong type argument: symbolp, #[0 "\300 \210\301 \207" [mu4e-context-switch revert-buffer] 1 nil nil]

Debugger entered--Lisp error: (wrong-type-argument symbolp #f(compiled-function () (interactive nil) #<bytecode 0x1c91369eb390d40>))
  reverse-im--this-command-p(org-capture)
  #f(compiled-function (elt) #<bytecode -0x41b2b6d3cfcdd5e>)(org-capture)
  mapc(#f(compiled-function (elt) #<bytecode -0x41b2b6d3cfcdd5e>) (org-capture org-export-dispatch))
  seq-do(#f(compiled-function (elt) #<bytecode -0x41b2b6d3cfcdd5e>) (org-capture org-export-dispatch))
  seq-some(reverse-im--this-command-p (org-capture org-export-dispatch))
  reverse-im-read-char-include(#<subr read-char-exclusive> #("[mu4e] Switch to context: [m]ain [C-g to cancel]" 1 5 (face mu4e-title-face) 27 28 (face mu4e-highlight-face) 34 37 (face mu4e-highlight-face)) nil nil)
  apply(reverse-im-read-char-include #<subr read-char-exclusive> (#("[mu4e] Switch to context: [m]ain [C-g to cancel]" 1 5 (face mu4e-title-face) 27 28 (face mu4e-highlight-face) 34 37 (face mu4e-highlight-face)) nil nil))
  read-char-exclusive(#("[mu4e] Switch to context: [m]ain [C-g to cancel]" 1 5 (face mu4e-title-face) 27 28 (face mu4e-highlight-face) 34 37 (face mu4e-highlight-face)) nil nil)
  mu4e--read-char-choice(#("[mu4e] Switch to context: [m]ain [C-g to cancel]" 1 5 (face mu4e-title-face) 27 28 (face mu4e-highlight-face) 34 37 (face mu4e-highlight-face)) (109))
  mu4e-read-option("Switch to context: " (("main" . #s(mu4e-context :name "main" :enter-func nil :leave-func nil :match-func (lambda (msg) (if msg (progn (or ... ...)))) :vars ((user-full-name . snip) (mu4e-compose-signature))))))
  mu4e--context-ask-user("Switch to context: ")
  mu4e-context-switch()
  #f(compiled-function () (interactive nil) #<bytecode 0x1c91369eb390d40>)()
  funcall-interactively(#f(compiled-function () (interactive nil) #<bytecode 0x1c91369eb390d40>))
  command-execute(#f(compiled-function () (interactive nil) #<bytecode 0x1c91369eb390d40>))

GNU Emacs 29.0.60 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 3.24.35, cairo version 1.17.6) of 2022-12-11

ceed0 avatar Jan 19 '23 20:01 ceed0

is native compilation enabled?

a13 avatar Jan 20 '23 10:01 a13

Yes.

ceed0 avatar Jan 21 '23 15:01 ceed0

@ceed0 I've added a workaround (not a fix) to skip native compiled functions. Unfortunately, I can't test it now, feel free to do it yourself.

a13 avatar Jan 25 '23 18:01 a13

This workaround works, thank you.

ceed0 avatar Feb 11 '23 22:02 ceed0