Closed Xiao-M0 closed 10 months ago
抱歉,这是代码中忘了做跨平台的适配。由于我手头只有 Linux 的设备,所以可能无法一次性地解决您的问题,如果还有问题,麻烦继续提供详细的信息,谢谢。
我测试了,问题并未被解决 这是它的错误信息 并且现在不会在D:/tmp下生成文件了
看样子是 anki-helper--curl-sentinel
中的 (json-read)
的问题,请麻烦您执行以下步骤
(defun anki-helper--curl-sentinel (process _status)
"Process sentinel for AnkiConnect curl requests.
PROCESS and _STATUS are process parameters."
(let ((proc-buf (process-buffer process)))
(when (eq (process-status process) 'exit)
(with-current-buffer proc-buf
(goto-char (point-min))
(let* ((json-object-type 'plist)
(json-array-type 'list)
result)
(setq anki-helper--response (buffer-string))
(setq result (json-read))
(if-let ((err (plist-get result :error)))
(message (format "Error: %s" err))
(let* ((result (plist-get result :result))
(info (alist-get process anki-helper--process-alist))
(command (plist-get info :command))
(orig-info (plist-get info :orig-info)))
(funcall (alist-get command anki-helper-callback-alist anki-helper-default-callback)
orig-info result))))))
(setf (alist-get process anki-helper--process-alist nil 'remove) nil)
(kill-buffer proc-buf)))
执行 anki-helper-set-front-region
和 anki-helper-make-two-sided-card
请告诉我变量 anki-helper--response
中的值
是这个吗?
@Xiao-M0 不是,按照上面的 3 步完成后, C-h v anki-helper--response RET,中间产生的错误无视即可
很抱歉,我不太清楚第一步的函数是怎么执行的(是用debug-on-entry
吗?)
我用debug-on-entry
执行了anki-helper--curl-sentinel
后面按照上述的步骤操作后并未发现anki-helper--response
这条命令
很抱歉,我不太清楚第一步的函数是怎么执行的(是用debug-on-entry吗?)
抱歉,是我描述不清,具体操作是: 光标放在函数的末尾,然后 M-x eval-buffer RET
因为这个变量是第一步里设置的,所以需要你 eval 后才有
第二步就是正常通过 M-x 来使用,中间产生的报错忽视即可
不是,按照上面的 3 步完成后, C-h v anki-helper--response RET,中间产生的错误无视即可
我完成了上面3步,但是C-h v
中并没有发现anki-helper--response
@Xiao-M0 那看来我需要装个虚拟机来研究一下了,感谢您耐心帮忙调试
刚装虚拟机试了一下,问题应该解决了。
感谢,问题已经解决了👍
你好,请问这个json readtable error: 37 是我没配置好吗? 系统是windows11 使用
anki-helper-set-front-region
和anki-helper-make-two-sided-card
会报错 它会在D盘生成 文件中的内容