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

cannot enable xenops-mode on emacs 29 #27

Closed
lyjdwh opened this issue Oct 16, 2021 · 8 comments · Fixed by #29
Closed

cannot enable xenops-mode on emacs 29 #27

lyjdwh opened this issue Oct 16, 2021 · 8 comments · Fixed by #29

Comments

@lyjdwh
Copy link

lyjdwh commented Oct 16, 2021

I install gccemacs on archlinux with sudo pacman -S emacs-native-comp-git and get the following error when enabling xenops-mode

Debugger entered--Lisp error: (invalid-function (ov (and (not (or parse-at-point-fns no-recurse)) (xenops-overlay-at-point))))
  (ov (and (not (or parse-at-point-fns no-recurse)) (xenops-overlay-at-point)))()
  xenops-parse-any-element-at-point((xenops-math-parse-block-element-at-point xenops-math-parse-inline-element-at-point xenops-math-parse-table-at-point xenops-image-parse-at-point xenops-footnote-parse-at-point xenops-minted-parse-at-point xenops-src-parse-at-point))
  xenops-apply-parse-next-element(23136 (xenops-math-parse-block-element-at-point xenops-math-parse-inline-element-at-point xenops-math-parse-table-at-point xenops-image-parse-at-point xenops-footnote-parse-at-point xenops-minted-parse-at-point xenops-src-parse-at-point))
  xenops-apply-handlers-over-region((xenops-math-reveal xenops-image-reveal xenops-element-reveal) 1 23136 nil nil)
  xenops-apply-operations((reveal))
  xenops-reveal()
  xenops-mode(toggle)
  funcall-interactively(xenops-mode toggle)
  command-execute(xenops-mode record)
  counsel-M-x-action("xenops-mode")
  ivy-call()
  ivy-read("M-x " ("toggle-debug-on-error" "xenops-doctor" ...) :predicate counsel--M-x-externs-predicate :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x)
  counsel-M-x()
  funcall-interactively(counsel-M-x)
  command-execute(counsel-M-x)

@VitalyAnkh
Copy link

I have the same issue.
@lyjdwhc BTW, the AUR package emacs-native-comp-git is outdated for the branch feature/native-comp has been merged into master branch. You can install emacs-git directly.

@longminwang
Copy link

Same issue here for emacs 28 with native comp enabled on mac os and gentoo.

@lizhuohua
Copy link

Same issue on Emacs 28.0.60 built with native-comp on Gentoo.

Seems like the native compilation has bugs. I simply deleted all the xenops-xxxxx.eln files in ~/.emacs.d/eln-cache/28.0.60-xxxxxx, then everything works fine.

@VitalyAnkh
Copy link

@lizhuohua Awesome! It's a great workaround. Just don't know how to blacklist xenops-mode from native compiling...

@dandavison
Copy link
Owner

Hi all, thanks for investigating this. So, when installing from MELPA in Emacs 28 with native-comp, I see many compilation warnings, but in particular I see various "malformed function" warnings like

Warning (comp): xenops-parse.el:14:72: Warning: `(ov (and (not (or parse-at-point-fns no-recurse)) (xenops-overlay-at-point)))' is a malformed function Disable showing Disable logging

which appears to be related to the runtime error reported above. All of these "malformed function" warnings seem to be related to usage of the -if-let* macro from dash.el. Furthermore, for each of the affected files, I see a compilation warning like this

Warning (comp): xenops-parse.el:26:4: Warning: the function `-if-let*' is not known to be defined. Disable showing Disable logging

So, I am wondering whether the problem is that I am not making the required forward declaration of -if-let*. I don't know why that would be a problem on native-comp and yet apparently wasn't with standard byte compilation. In any case, if anybody knows the exact change that I need to make, do shout out.

Warning (comp): xenops-minted.el:18:4: Warning: the function `-if-let*' is not known to be defined. Disable showing Disable logging
Warning (comp): xenops-parse.el:26:4: Warning: the function `-if-let*' is not known to be defined. Disable showing Disable logging
Warning (comp): xenops-src.el:48:4: Warning: the function `-if-let*' is not known to be defined. Disable showing Disable logging
Warning (comp): xenops-util.el:44:8: Warning: the function `-if-let*' is not known to be defined. Disable showing Disable logging
Warning (comp): xenops-minted.el:16:8: Warning: `(element (xenops-parse-element-at-point 'minted))' is a malformed function Disable showing Disable logging
Warning (comp): xenops-parse.el:14:72: Warning: `(ov (and (not (or parse-at-point-fns no-recurse)) (xenops-overlay-at-point)))' is a malformed function Disable showing Disable logging
Warning (comp): xenops-src.el:46:8: Warning: `(element (xenops-parse-element-at-point 'src))' is a malformed function Disable showing Disable logging
Warning (comp): xenops-src.el:143:46: Warning: `(element (xenops-apply-parse-next-element))' is a malformed function Disable showing Disable logging
Warning (comp): xenops-src.el:156:8: Warning: `(element (xenops-apply-parse-next-element))' is a malformed function Disable showing Disable logging
Warning (comp): xenops-src.el:194:8: Warning: `(element (or (xenops-minted-parse-at-point) (xenops-src-parse-at-point)))' is a malformed function Disable showing Disable logging
Warning (comp): xenops-util.el:38:37: Warning: `(result (funcall fn el))' is a malformed function Disable showing Disable logging
Warning (comp): xenops-util.el:38:37: Warning: `(result (funcall fn el))' is a malformed function Disable showing Disable logging
All warnings
Warning (comp): xenops-element.el:27:4: Warning: the function `xenops-overlay-delete-overlays-in' is not known to be defined. Disable showing Disable logging
Warning (comp): xenops-image.el:93:8: Warning: docstring wider than 80 characters Disable showing Disable logging
Warning (comp): xenops-minted.el:16:8: Warning: `(element (xenops-parse-element-at-point 'minted))' is a malformed function Disable showing Disable logging
Warning (comp): xenops-minted.el:22:49: Warning: reference to free variable `element' Disable showing Disable logging
Warning (comp): xenops-minted.el:24:31: Warning: the function `org-babel-get-src-block-info' is not known to be defined. Disable showing Disable logging
Warning (comp): xenops-minted.el:18:4: Warning: the function `-if-let*' is not known to be defined. Disable showing Disable logging
Warning (comp): xenops-math-latex.el:148:8: Warning: docstring wider than 80 characters Disable showing Disable logging
Warning (comp): xenops-math.el:141:8: Warning: docstring wider than 80 characters Disable showing Disable logging
Warning (comp): xenops-math.el:342:8: Warning: docstring wider than 80 characters Disable showing Disable logging
Warning (comp): xenops-math.el:423:74: Warning: Unused lexical variable `copied-element-is-block' Disable showing Disable logging
Warning (comp): xenops-math.el:439:8: Warning: docstring wider than 80 characters Disable showing Disable logging
Warning (comp): xenops-math.el:612:8: Warning: docstring wider than 80 characters Disable showing Disable logging
Warning (comp): xenops-math.el:668:8: Warning: Unused lexical variable `avy-action' Disable showing Disable logging
Warning (comp): xenops-math.el:103:33: Warning: the function `xenops-render-at-point' is not known to be defined. Disable showing Disable logging
Warning (comp): xenops-math-latex.el:211:31: Warning: reference to free variable `xenops-apply-user-point' Disable showing Disable logging
Warning (comp): xenops-math-latex.el:240:8: Warning: docstring wider than 80 characters Disable showing Disable logging
Warning (comp): xenops-overlay.el:24:25: Warning: reference to free variable `it' Disable showing Disable logging
Warning (comp): xenops-overlay.el:24:4: Warning: the function `--first' is not known to be defined. Disable showing Disable logging
Warning (comp): xenops-parse.el:14:72: Warning: `(ov (and (not (or parse-at-point-fns no-recurse)) (xenops-overlay-at-point)))' is a malformed function Disable showing Disable logging
Warning (comp): xenops-parse.el:14:72: Warning: Unused lexical argument `no-recurse' Disable showing Disable logging
Warning (comp): xenops-parse.el:29:35: Warning: reference to free variable `ov' Disable showing Disable logging
Warning (comp): xenops-parse.el:67:17: Warning: the function `org-in-regexp' is not known to be defined. Disable showing Disable logging
Warning (comp): xenops-parse.el:26:4: Warning: the function `-if-let*' is not known to be defined. Disable showing Disable logging
Warning (comp): xenops-png.el:109:4: Warning: the function `-map-indexed' is not known to be defined. Disable showing Disable logging
Warning (comp): xenops-png.el:98:44: Warning: the function `-zip' is not known to be defined. Disable showing Disable logging
Warning (comp): xenops-src.el:46:8: Warning: `(element (xenops-parse-element-at-point 'src))' is a malformed function Disable showing Disable logging
Warning (comp): xenops-src.el:50:67: Warning: Unused lexical variable `org-mode-hook' Disable showing Disable logging
Warning (comp): xenops-src.el:50:61: Warning: reference to free variable `org-element' Disable showing Disable logging
Warning (comp): xenops-src.el:52:8: Warning: reference to free variable `element' Disable showing Disable logging
Warning (comp): xenops-src.el:55:24: Warning: reference to free variable `org-babel-info' Disable showing Disable logging
Warning (comp): xenops-src.el:143:46: Warning: `(element (xenops-apply-parse-next-element))' is a malformed function Disable showing Disable logging
Warning (comp): xenops-src.el:156:8: Warning: `(element (xenops-apply-parse-next-element))' is a malformed function Disable showing Disable logging
Warning (comp): xenops-src.el:165:44: Warning: reference to free variable `element' Disable showing Disable logging
Warning (comp): xenops-src.el:181:45: Warning: Unused lexical variable `org-mode-hook' Disable showing Disable logging
Warning (comp): xenops-src.el:194:8: Warning: `(element (or (xenops-minted-parse-at-point) (xenops-src-parse-at-point)))' is a malformed function Disable showing Disable logging
Warning (comp): xenops-src.el:200:32: Warning: reference to free variable `element' Disable showing Disable logging
Warning (comp): xenops-src.el:201:6: Warning: reference to free variable `lang' Disable showing Disable logging
Warning (comp): xenops-src.el:202:29: Warning: reference to free variable `beg' Disable showing Disable logging
Warning (comp): xenops-src.el:202:33: Warning: reference to free variable `end' Disable showing Disable logging
Warning (comp): xenops-src.el:201:6: Warning: the function `org-src-font-lock-fontify-block' is not known to be defined. Disable showing Disable logging
Warning (comp): xenops-src.el:200:17: Warning: the function `end' is not known to be defined. Disable showing Disable logging
Warning (comp): xenops-src.el:199:17: Warning: the function `beg' is not known to be defined. Disable showing Disable logging
Warning (comp): xenops-src.el:198:17: Warning: the function `lang' is not known to be defined. Disable showing Disable logging
Warning (comp): xenops-src.el:196:4: Warning: the function `-when-let*' is not known to be defined. Disable showing Disable logging
Warning (comp): xenops-src.el:191:6: Warning: the function `org-babel-execute-src-block' is not known to be defined. Disable showing Disable logging
Warning (comp): xenops-src.el:190:14: Warning: the function `org-babel-exp-code' is not known to be defined. Disable showing Disable logging
Warning (comp): xenops-src.el:96:33: Warning: the function `s-join' is not known to be defined. Disable showing Disable logging
Warning (comp): xenops-src.el:90:24: Warning: the function `s-split' is not known to be defined. Disable showing Disable logging
Warning (comp): xenops-src.el:50:31: Warning: the function `org-babel-get-src-block-info' is not known to be defined. Disable showing Disable logging
Warning (comp): xenops-src.el:50:15: Warning: the function `org-babel-info' is not known to be defined. Disable showing Disable logging
Warning (comp): xenops-src.el:49:55: Warning: the function `org-element-context' is not known to be defined. Disable showing Disable logging
Warning (comp): xenops-src.el:50:67: Warning: the function `org-narrow-to-block' is not known to be defined. Disable showing Disable logging
Warning (comp): xenops-src.el:49:15: Warning: the function `org-element' is not known to be defined. Disable showing Disable logging
Warning (comp): xenops-src.el:48:4: Warning: the function `-if-let*' is not known to be defined. Disable showing Disable logging
Warning (comp): xenops-util.el:38:37: Warning: `(result (funcall fn el))' is a malformed function Disable showing Disable logging
Warning (comp): xenops-util.el:38:37: Warning: `(result (funcall fn el))' is a malformed function Disable showing Disable logging
Warning (comp): xenops-util.el:38:37: Warning: Unused lexical argument `fn' Disable showing Disable logging
Warning (comp): xenops-util.el:43:17: Warning: Unused lexical variable `el' Disable showing Disable logging
Warning (comp): xenops-util.el:45:26: Warning: reference to free variable `result' Disable showing Disable logging
Warning (comp): xenops-util.el:79:31: Warning: the function `s-ends-with?' is not known to be defined. Disable showing Disable logging
Warning (comp): xenops-util.el:51:18: Warning: the function `-partition' is not known to be defined. Disable showing Disable logging
Warning (comp): xenops-util.el:44:8: Warning: the function `-if-let*' is not known to be defined. Disable showing Disable logging
Warning (comp): xenops-style.el:16:1: Warning: defvar `xenops-style-rules' docstring wider than 80 characters Disable showing Disable logging
Warning (comp): xenops-style.el:69:5: Warning: docstring wider than 80 characters Disable showing Disable logging
Warning (comp): xenops-style.el:181:8: Warning: docstring wider than 80 characters Disable showing Disable logging
Warning (comp): xenops-style.el:145:13: Warning: the function `-compose' is not known to be defined. Disable showing Disable logging
Warning (comp): xenops.el:65:1: Warning: global/dynamic var `begin' lacks a prefix Disable showing Disable logging
Warning (comp): xenops.el:107:1: Warning: defvar `xenops-rendered-element-keymap' docstring wider than 80 characters Disable showing Disable logging
Warning (comp): xenops.el:110:1: Warning: defvar `xenops-reveal-on-entry' docstring wider than 80 characters Disable showing Disable logging
Warning (comp): xenops.el:127:1: Warning: docstring wider than 80 characters Disable showing Disable logging
Warning (comp): xenops.el:130:1: Warning: docstring wider than 80 characters Disable showing Disable logging
Warning (comp): xenops.el:133:1: Warning: docstring wider than 80 characters Disable showing Disable logging
Warning (comp): xenops.el:295:1: Warning: defvar `xenops-elements' docstring wider than 80 characters Disable showing Disable logging
Warning (comp): xenops.el:419:8: Warning: docstring wider than 80 characters Disable showing Disable logging

dandavison added a commit that referenced this issue Nov 2, 2021
I suspect that (eval-when-compile (require 'dash)) is actually
more correct, but (require 'dash) is already used in some other
files so just doing this now until I know the correct global change
to require expressions in all package files.

Should fix #27
dandavison added a commit that referenced this issue Nov 2, 2021
I suspect that (eval-when-compile (require 'dash)) is actually
more correct, but (require 'dash) is already used in some other
files so just doing this now until I know the correct global change
to require expressions in all package files.

Should fix #27
@dandavison
Copy link
Owner

I've merged #29 which I hope will fix this. I believe MELPA will pick that up automatically at some point in the next few hours. If anyone is able to tell me exactly where in the package files I should be using (require 'dash) and where (eval-when-compile (require 'dash)) that would be great.

dandavison added a commit that referenced this issue Nov 2, 2021
@dandavison
Copy link
Owner

These issues should be fixed if you reinstall from MELPA now.

M-x package-delete xenops
M-x package-refresh-contents
M-x package-install xenops

@lizhuohua
Copy link

Thank you @dandavison !

Reinstalled from MELPA and now it works perfectly.

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

Successfully merging a pull request may close this issue.

5 participants