TransWikia.com

Wrong type argument: undo-tree, [cl-struct-undo-tree [nil ([nil ([nil nil ]]]

Emacs Asked on September 2, 2021

The way I installed undo-tree:

  • M-x package-install undo-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()

desktop output:

One Answer

A few years ago, I created a fork of undo-tree that was compatible with Emacs 25 (but not later/newer versions of Emacs) and I spent a considerable amount of time debugging in relation thereto. As part of that work, I inspected and debugged countless undo-tree saved history files -- that prior work helped me to identify the initial cursory debugging message and guess-timate the problem. Initial attempts at troubleshooting the problem in the comments underneath the question above were complicated because the O.P. had suppressed visibility of hidden files in the undo-tree saved history file directory, and the O.P. was under the initial misimpression that the directory was empty. It turned out that the saved undo-tree history file was indeed where it was supposed to be, just hidden from view. Deleting that file resolved the issue. It is possible to spend additional time trying to ascertain why the undo-tree saved history file became problematic, but we will leave that issue for another question at some point in the future (should the need arise).

@NickD requested a lengthier backtrace as suggested by the initial cursory debugging message; i.e., "Start Emacs with the --debug-init option to view a complete error backtrace." And once the O.P. provided that detailed backtrace, it became crystal clear where the problem was as mentioned hereinabove.

Correct answer by lawlist on September 2, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP