The way I installed undo-tree:
- M-x
package-installundo-tree
My setup:
- GNU Emacs 26.3
- undo-tree 0.7.4 installed Treat undo history as a tree
(global-undo-tree-mode 1) (setq undo-tree-auto-save-history t) (setq undo-tree-history-directory-alist '(("." . "~/.emacs.d/undo"))) Error I am getting:
Warning (initialization): An error occurred while loading ‘/home/netlab/.emacs’: Wrong type argument: undo-tree, [cl-struct-undo-tree [nil ([nil ([nil nil ((q . -1) (undo-tree-id0 . -1) 2) nil (24247 15636 187465 670000) 0 nil]) ((1 . 2) (t 24232 5976 416148 754000)) nil (24247 15636 187476 578000) 0 nil]) nil nil (24247 15636 187481 124000) 0 nil] [nil nil ((q . -1) (undo-tree-id0 . -1) 2) nil (24247 15636 187465 670000) 0 nil] 41 2 nil] To ensure normal operation, you should investigate and remove the cause of the error in your initialization file. Start Emacs with the ‘--debug-init’ option to view a complete error backtrace. I am not sure how can I fix this error or what causing it.
Update:
Output of the debug output:
Debugger entered--Lisp error: (wrong-type-argument undo-tree [cl-struct-undo-tree [nil ([nil ([nil nil (... ... 2) nil (24247 15636 187465 670000) 0 nil]) ((1 . 2) (t 24232 5976 416148 754000)) nil (24247 15636 187476 578000) 0 nil]) nil nil (24247 15636 187481 124000) 0 nil] [nil nil ((#("q" 0 1 (fontified t)) . -1) (undo-tree-id0 . -1) 2) nil (24247 15636 187465 670000) 0 nil] 41 2 nil]) signal(wrong-type-argument (undo-tree [cl-struct-undo-tree [nil ([nil ([nil nil ... nil ... 0 nil]) ((1 . 2) (t 24232 5976 416148 754000)) nil (24247 15636 187476 578000) 0 nil]) nil nil (24247 15636 187481 124000) 0 nil] [nil nil ((#("q" 0 1 (fontified t)) . -1) (undo-tree-id0 . -1) 2) nil (24247 15636 187465 670000) 0 nil] 41 2 nil])) undo-tree-load-history(nil noerror) undo-tree-load-history-from-hook() run-hooks(find-file-hook) after-find-file(nil t) find-file-noselect-1(#<buffer __init__.py> "~/folder/__init__.py" nil nil "~/folder/__init__.py" (29887794 2050)) find-file-noselect("/home/alper/folder/__init__.py") mapcar(find-file-noselect ("/home/alper/folder/Driver.py" "/home/alper/folder/__init__.py" "/home/alper/folder/config.py" "/home/alper/folder/end_code.py" "/home/alper/folder/garbageCollector.py" "/home/alper/folder/imports.py" "/home/alper/folder/ipfs_daemon.py" "/home/alper/folder/lib.py" "/home/alper/folder/link.py" "/home/alper/folder/setup.py" "/home/alper/folder/start_code.py" "/home/alper/folder/thread_log.py" "/home/alper/folder/utils.py" "/home/alper/folder/whisper_state_receiver.py")) find-file-noselect("*.py" nil nil t) find-file("*.py" t) eval-buffer(#<buffer *load*> nil "/home/alper/.emacs" nil t) ; Reading at buffer position 25178 load-with-code-conversion("/home/alper/.emacs" "/home/alper/.emacs" t t) load("~/.emacs" t t) #f(compiled-function () #<bytecode 0x2967a1>)() command-line() normal-top-level()
~.emacs.d/undois empty. I am not sure which file should I remove and where is it located. This occurs when I try to open a empty file as well. Also where isdesktop save history filelocated?desktop.elsave library to automatically load your last used layout, then evaluating the functiondesktop-full-file-nameshould tell you where it is located. E.g.,M-x eval-expression RET (desktop-full-file-name) RETassuming that thedesktop.ellibrary has already been loaded. It should be somewhere in youruser-emacs-directory, but could be elsewhere ...emacs --debug-initas suggested in the message? If that gives you a backtrace, please add it to your question./Users/HOME/.emacs.d/undo/.!Users!HOME!Desktop!__init__.py.~undo-tree~Move that file to a different directory for potential deletion later, and then restart Emacs.