wyuenho / emacs-pet

Tracks down the correct Python tooling executables from your virtualenvs so you can glue the binaries to Emacs and delete code in init.el
GNU General Public License v3.0
105 stars 13 forks source link

pet-20230423.2326/pet.elc failed to define function pet #22

Closed skeezix closed 1 year ago

skeezix commented 1 year ago

Description After adding pet (use-package pet :ensure t) I'm getting a tonne of this in Messages

File mode specification error: (error Autoloading file /Users/mit5893/.emacs.d/elpa/pet-20230423.2326/pet.elc failed to define function pet)

Expected behavior ... not to see an error :)

PET version 20230423 from melpa

Emacs version 30.0.50 (probably an alpha or beta build using homebrew on Mac)

FWIW: bash-3.2$ grep defun pet.el (defun pet-system-bin-dir () (defun pet-report-error (err) (defun pet-project-root () (defun pet-find-file-from-project-root (file) (defun pet-locate-dominating-file (file) (defun pet-find-file-from-project-root-recursively (file) (defun pet-find-file-from-project (file) (defun pet-parse-json (str) (defun pet-parse-config-file (file-path) (defun pet-make-config-file-change-callback (cache-var parser) (defun pet-watch-config-file (config-file cache-var parser) (defun ,(intern path-accessor-name) () (defun ,(intern accessor-name) () (defun pet-use-pre-commit-p () (defun pet-use-conda-p () (defun pet-use-poetry-p () (defun pet-use-pyenv-p () (defun pet-use-pipenv-p () (defun pet-pre-commit-config-has-hook-p (id) (defun pet-parse-pre-commit-db (db-file) (defun pet-pre-commit-virtualenv-path (hook-id) (defun pet-executable-find (executable) (defun pet-virtualenv-root () (defun pet-flycheck-python-pylint-find-pylintrc () (defun pet-flycheck-checker-get-advice (fn checker property) (defun pet-flycheck-toggle-local-vars () (defun pet-flycheck-setup () (defun pet-flycheck-teardown () (defun pet-buffer-local-vars-setup () (defun pet-buffer-local-vars-teardown () (defun pet-verify-setup () (defun pet-cleanup-watchers-and-caches ()

wyuenho commented 1 year ago

I need a stack trace.

You can get it by putting (setq debug-on-error t) at the top of your init file.

skeezix commented 1 year ago

Lets see if image attach works.. this is on start up with persp and desktop mode picking up existing state and loading up the previously opened files image

skeezix commented 1 year ago

I wonder if the issue was popping up due to the package being roped in as a dependancy (but also explicitly by me, later in the config.) I added a 'use-package pet' to near the top of the config and most of the Messages lines went away; still a couple in response to undo-tree trying to open a bunch of files.

Removed undo-tree for now, still seeing a couple:

Entities are now displayed as UTF8 characters File mode specification error: (error Autoloading file /Users/mit5893/.emacs.d/elpa/pet-20230423.2326/pet.el failed to define function pet) Entities are now displayed as UTF8 characters File mode specification error: (error Autoloading file /Users/mit5893/.emacs.d/elpa/pet-20230423.2326/pet.el failed to define function pet)

I suppose the ultimate would be to set aside my config, and build up a new config bit by bit to see when the error pops up, but oooof.

image

skeezix commented 1 year ago

;; emacs-pet python executable tracker to locate pythons better (use-package pet :ensure t :hook (python-mode))

wyuenho commented 1 year ago

Oh I see, I think the README has misled you. Try this:

(use-package pet
  :ensure t
  :hook (python-mode . pet-mode))
wyuenho commented 1 year ago

I've update the README now, this should fix your issue.

skeezix commented 1 year ago

Yep, this did clear up the errors :) Good catch, thanks very much!