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

Invalid slot name #62

Closed OrionRandD closed 6 months ago

OrionRandD commented 11 months ago

;; In Doom-Emacs, this line:

;; (gts-google-rpc-engine :parser (gts-google-rpc-parser) :url "https://translate.google.com")

;; is getting this error:

;; Invalid slot name: "#", :url

This is the debug message:

Debugger entered--Lisp error: (invalid-slot-name "#<gts-google-rpc-engine gts-google-rpc-engine-1583..." :url) signal(invalid-slot-name ("#<gts-google-rpc-engine gts-google-rpc-engine-1583..." :url))

f(compiled-function (object slot-name operation &optional new-value) #<bytecode 0x981ad1b01a1b321>)(# :url oset "https://translate.google.com")

apply(#f(compiled-function (object slot-name operation &optional new-value) #<bytecode 0x981ad1b01a1b321>) # (:url oset "https://translate.google.com")) slot-missing(# :url oset "https://translate.google.com")

f(compiled-function (obj slots) "Set slots of OBJ with SLOTS which is a list of name/value pairs.\nCalled from the constructor routine." #<bytecode 0xc40095489ed7e5e>)(# (:parser # :url "https://translate.google.com"))

apply(#f(compiled-function (obj slots) "Set slots of OBJ with SLOTS which is a list of name/value pairs.\nCalled from the constructor routine." #<bytecode 0xc40095489ed7e5e>) # (:parser # :url "https://translate.google.com")) shared-initialize(# (:parser # :url "https://translate.google.com"))

f(compiled-function (this &optional args) "Construct the new object THIS based on ARGS.\nARGS is a property list where odd numbered elements are tags, and\neven numbered elements are the values to store in the tagged slot.\nIf you overload the initialize-instance', there you will need to\ncallshared-initialize' yourself, or you can call `call-next-method'\nto have this constructor called automatically. If these steps are\nnot taken, then new objects of your class will not have their values\ndynamically set from ARGS." #<bytecode -0xba8fccbe71c2c47>)(# (:parser # :url "https://translate.google.com"))

apply(#f(compiled-function (this &optional args) "Construct the new object THIS based on ARGS.\nARGS is a property list where odd numbered elements are tags, and\neven numbered elements are the values to store in the tagged slot.\nIf you overload the initialize-instance', there you will need to\ncallshared-initialize' yourself, or you can call `call-next-method'\nto have this constructor called automatically. If these steps are\nnot taken, then new objects of your class will not have their values\ndynamically set from ARGS." #<bytecode -0xba8fccbe71c2c47>) # (:parser # :url "https://translate.google.com")) initialize-instance(# (:parser # :url "https://translate.google.com"))

f(compiled-function (class &rest slots) "Default constructor for CLASS eieio-default-superclass'.\nSLOTS are the initialization slots used byinitialize-instance'.\nThis static method is called when an object is constructed.\nIt allocates the vector used to represent an EIEIO object, and then\ncalls `initialize-instance' on that object." #<bytecode 0x1de2701c3bb28ab3>)(gts-google-rpc-engine :parser # :url "https://translate.google.com")

apply(#f(compiled-function (class &rest slots) "Default constructor for CLASS eieio-default-superclass'.\nSLOTS are the initialization slots used byinitialize-instance'.\nThis static method is called when an object is constructed.\nIt allocates the vector used to represent an EIEIO object, and then\ncalls `initialize-instance' on that object." #<bytecode 0x1de2701c3bb28ab3>) gts-google-rpc-engine (:parser # :url "https://translate.google.com")) make-instance(gts-google-rpc-engine :parser # :url "https://translate.google.com") gts-google-rpc-engine(:parser # :url "https://translate.google.com") (list (gts-bing-engine) (gts-google-engine :parser (gts-google-summary-parser)) (gts-google-rpc-engine :parser (gts-google-rpc-parser) :url "https://translate.google.com")) (progn (list (gts-bing-engine) (gts-google-engine :parser (gts-google-summary-parser)) (gts-google-rpc-engine :parser (gts-google-rpc-parser) :url "https://translate.google.com"))) elisp--eval-last-sexp(nil)

(nil)

apply(# nil) eval-last-sexp(nil) eros-eval-last-sexp(nil) funcall-interactively(eros-eval-last-sexp nil) command-execute(eros-eval-last-sexp)

lorniu commented 9 months ago

There is no :url slot in gts-google-rpc-engine, use gts-google-rpc-base-url instead if necessary:

(setq gts-google-rpc-base-url "https://translate.google.com")