emacsocamlmacos-montereyaquamacs

Aquamacs error while loading .emacs : Symbol's function definition is void: register-definition-prefixes


I'm on macOS Monterey and I'm using aquamacs as an IDE to ocaml. Ocaml is install with opam and everything was working well until I delete the wrong switch. Emacs is still working with tuareg in the console but I can't use aquamacs with it anymore.

There's so much error with the "Symbol's function definition is void" but I couldnt' find anyone talking about the register-definition-prefixes.

I try reinstalling opam and his packages and aquamacs from scatch, try editing the .emacs and the .opam-user-setup.el (the equivalent of init.el I thik) but nothing worked.

I understand that most of the errors caused by "Symbol's function definition is void" are a package that is not loaded, so I tried adding this to .opam-user-setup.el :

(require 'register-definition-prefixes)

But he wouldn't load it :

File error: Cannot open load file, No such file or directory, register-definition-prefixes

After searching register-definition-prefixes, the doc talk about Autoload by Prefixes and update-file-autoloads but I don't really understand how it works.

Here's the backtrace from aquamacs with the --debug-init :

Debugger entered--Lisp error: (void-function register-definition-prefixes)
  (register-definition-prefixes "ocamldebug" (quote ("def-ocamldebug" "ocamldebug-")))
  eval-buffer(#<buffer  *load*-970159> nil "/Users/theodusehu/.opam/ocaml.4.13.1/share/emacs/site-lisp/tuareg-site-file.el" nil t)  ; Reading at buffer position 736
  load-with-code-conversion("/Users/theodusehu/.opam/ocaml.4.13.1/share/emacs/site-lisp/tuareg-site-file.el" "/Users/theodusehu/.opam/ocaml.4.13.1/share/emacs/site-lisp/tuareg-site-file.el" nil nil)
  load("tuareg-site-file")
  (lambda nil (add-to-list (quote load-path) (concat opam-share "/tuareg") t) (load "tuareg-site-file"))()
  funcall((lambda nil (add-to-list (quote load-path) (concat opam-share "/tuareg") t) (load "tuareg-site-file")))
  (progn (funcall (symbol-function (cdr tool))))
  (if (member (car tool) opam-tools-installed) (progn (funcall (symbol-function (cdr tool)))))
  (while --dolist-tail-- (setq tool (car --dolist-tail--)) (if (member (car tool) opam-tools-installed) (progn (funcall (symbol-function (cdr tool))))) (setq --dolist-tail-- (cdr --dolist-tail--)))
  (let ((--dolist-tail-- opam-tools) tool) (while --dolist-tail-- (setq tool (car --dolist-tail--)) (if (member (car tool) opam-tools-installed) (progn (funcall (symbol-function (cdr tool))))) (setq --dolist-tail-- (cdr --dolist-tail--))))
  opam-auto-tools-setup()
  eval-buffer(#<buffer  *load*-725109> nil "/Users/theodusehu/.emacs.d/opam-user-setup.el" nil t)  ; Reading at buffer position 4610
  load-with-code-conversion("/Users/theodusehu/.emacs.d/opam-user-setup.el" "/Users/theodusehu/.emacs.d/opam-user-setup.el" nil t)
  require(opam-user-setup "~/.emacs.d/opam-user-setup.el")
  eval-buffer(#<buffer  *load*> nil "/Users/theodusehu/.emacs" nil t)  ; Reading at buffer position 2435
  load-with-code-conversion("/Users/theodusehu/.emacs" "/Users/theodusehu/.emacs" t t)
  load("~/.emacs" t t)
  #[0 "\205\274�    \305=\203�\306\307Q\202?�   \310=\204�\306\311Q\202?�\312\306\313\314#\203*�\315\202?�\312\306\313\316#\203>�\317\320\321!D\nB\322\202?�\315\323\324\323\211#\210\325\326!\203P�\326 \210\323=\203n�\327\330\331\306\332Q!\"\324\323\211#\210\323=\203m�\210\203\260�\333!\334\232\203\260�\335!\211\336P\337!\203\212�\211\202\225�\337!\203\224�\202\225�\313\262\203\256�\340\"\203\254�\341\342#\210\343\344!\210\266\f?\205\272�\324\345\323\211#\262\207" [init-file-user system-type delayed-warnings-list user-init-file inhibit-default-init ms-dos "~" "/_emacs" windows-nt "/.emacs" directory-files nil "^\\.emacs\\(\\.elc?\\)?$" "~/.emacs" "^_emacs\\(\\.elc?\\)?$" initialization format-message "`_emacs' init file is deprecated, please use `.emacs'" "~/_emacs" t load fboundp aquamacs-load-preferences expand-file-name "init" file-name-as-directory "/.emacs.d" file-name-extension "elc" file-name-sans-extension ".el" file-exists-p file-newer-than-file-p message "Warning: %s is newer than %s" sit-for 1 "default"] 7]()
  command-line()
  normal-top-level()

Edit :

It seems the function register-definition-prefixes is in subr which is part of GNU/Emacs. But because it's part of GNU/Emacs I can't require it. So it should work fine but it isn't.


Solution

  • Since aquamacs didn't have register-definition-prefixes defined for an unknown reason, like suggested I copied the definition of the function from subr directly at the begininng of my .emacs.

    I still don't have a prompt when I launch tuareg but at least it work so thanks.