lorniu / go-translate

Translator on Emacs. Supports multiple engines such as Google, Bing, deepL, ChatGPT, StarDict, Youdao and so on.
GNU General Public License v3.0
274 stars 37 forks source link

go-translate.el:285:2: Error: transient-define-*: Interactive form missing #67

Closed YueRen closed 4 months ago

YueRen commented 4 months ago

Since today, I've been getting the following error on startup:

In *Messages* buffer:

Error loading autoloads: (file-missing Cannot open load file No such file or directory /home/ren/.emacs.d/elpa/go-translate-20240507.724/go-translate-autoloads)

In Warnings buffer:

Error (use-package): go-translate/:catch: Eager macro-expansion failure: (error "transient-define-*: Interactive form missing")

Is this related to the recent changes? Here is a minimal init.el:

(defvar bootstrap-version)
(let ((bootstrap-file
       (expand-file-name
        "straight/repos/straight.el/bootstrap.el"
        (or (bound-and-true-p straight-base-dir)
            user-emacs-directory)))
      (bootstrap-version 7))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
         "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
         'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))
(straight-use-package 'use-package)

(setq native-comp-async-report-warnings-errors 'silent)

(setq warning-minimum-level :error)

(require 'package)
(setq package-archives '(("elpa" . "https://elpa.gnu.org/packages/")
                         ("melpa" . "https://melpa.org/packages/")
                         ("org" . "https://orgmode.org/elpa/")))
(package-initialize)
(unless package-archive-contents (package-refresh-contents))

(unless (package-installed-p 'use-package) (package-install 'use-package))
(require 'use-package)
(setq use-package-always-ensure t)

(use-package go-translate)
(setq gt-langs '(en fr))
(setq gt-default-translator (gt-translator :engines (gt-google-engine)))
lorniu commented 4 months ago

I use your config and everything works good. Maybe caused by use-package? Delete the package with package-delete and then reinstall it to have a try please.

Update:

I submit a new commit, update to see if the issue resolved.

YueRen commented 4 months ago

Hi @lorniu, thanks for the quick reply and the tip of reinstalling the package! It seems the error at startup is gone I seem to get an error when trying to reinstall go-translate (copied from *Compile-Log*):


Compiling internal form(s) at Wed May  8 07:35:47 2024
Leaving directory ‘/home/ren/.emacs.d/elpa/go-translate-20240507.2300’

Compiling file /home/ren/.emacs.d/elpa/go-translate-20240507.2300/go-translate.el at Wed May  8 07:35:47 2024
Entering directory ‘/home/ren/.emacs.d/elpa/go-translate-20240507.2300/’
go-translate.el:285:2: Error: transient-define-*: Interactive form missing

Compiling file /home/ren/.emacs.d/elpa/go-translate-20240507.2300/gt-core.el at Wed May  8 07:35:47 2024

Compiling file /home/ren/.emacs.d/elpa/go-translate-20240507.2300/gt-engine-bing.el at Wed May  8 07:35:48 2024

Compiling file /home/ren/.emacs.d/elpa/go-translate-20240507.2300/gt-engine-chatgpt.el at Wed May  8 07:35:48 2024

Compiling file /home/ren/.emacs.d/elpa/go-translate-20240507.2300/gt-engine-deepl.el at Wed May  8 07:35:48 2024

Compiling file /home/ren/.emacs.d/elpa/go-translate-20240507.2300/gt-engine-echo.el at Wed May  8 07:35:48 2024

Compiling file /home/ren/.emacs.d/elpa/go-translate-20240507.2300/gt-engine-google-rpc.el at Wed May  8 07:35:48 2024

Compiling file /home/ren/.emacs.d/elpa/go-translate-20240507.2300/gt-engine-google.el at Wed May  8 07:35:48 2024

Compiling file /home/ren/.emacs.d/elpa/go-translate-20240507.2300/gt-engine-stardict.el at Wed May  8 07:35:48 2024

Compiling file /home/ren/.emacs.d/elpa/go-translate-20240507.2300/gt-engine-youdao.el at Wed May  8 07:35:48 2024

Compiling file /home/ren/.emacs.d/elpa/go-translate-20240507.2300/gt-extension.el at Wed May  8 07:35:48 2024
gt-extension.el:66:10: Warning: Unused lexical variable
    `plz-curl-default-args'
gt-extension.el:68:47: Warning: reference to free variable
    ‘plz-curl-default-args’

Compiling file /home/ren/.emacs.d/elpa/go-translate-20240507.2300/gt-faces.el at Wed May  8 07:35:48 2024

Compiling file /home/ren/.emacs.d/elpa/go-translate-20240507.2300/gt-text-utility.el at Wed May  8 07:35:48 2024

The same error arises when I try to use gts-do-translate (copied from *Messages*):

internal-macroexpand-for-load: Eager macro-expansion failure: (error "transient-define-*: Interactive form missing")
lorniu commented 4 months ago

Entering directory ‘/home/ren/.emacs.d/elpa/go-translate-20240507.2300/’

The version you installed is 20240507.2300, which is the old version. Try the latest code first. Thanks.

YueRen commented 4 months ago

Ah, sorry about that. I still get the error with the compilation error in latest version (either during update of go-translate or during use of gts-do-translate):

Compiling file /home/ren/.emacs.d/elpa/go-translate-20240509.145/go-translate.el at Thu May  9 08:49:43 2024
Entering directory ‘/home/ren/.emacs.d/elpa/go-translate-20240509.145/’
go-translate.el:285:2: Error: transient-define-*: Interactive form missing

If it is working for you, maybe it's my system that is a bit borked? I am running Ubuntu 22.04.4 and I've installed emacs via snap.

edit: apparently, the error message I am getting was recently added: https://lists.defectivebydesign.org/archive/html/emacs-elpa-diffs/2024-04/msg01567.html

lorniu commented 4 months ago

I see. Try the latest code and report the result please. Thanks.

Eason0210 commented 4 months ago

I have the same issue. And I can confirm that the latest commit already fix this issue. Thanks!

YueRen commented 4 months ago

@Eason0210 Great! I have difficulties figuring out how to install the latest version from Github, I'll just wait until straight updates my version to it tomorrow.