【发布时间】:2020-11-02 20:49:21
【问题描述】:
当我在 org 模式下运行 J 代码块时,会弹出 java jconsole。所以必须发送一个 jconsole 命令而不是 ijconsole...当然 J 代码块不被评估。 如何解决这个问题,以便在 org 模式下正确评估 J 代码块?
我的设置背景: 一旦我将 j-console-cmd 设置为“ijconsole-9.01”,我就可以使用 j-mode。 所以 j-mode 工作正常,它只是在 org 模式下评估我遇到问题的 J 代码块。
仅供参考,我的 init 文件的 J 部分是这样的(在 j-mode github 自述文件中推荐):
(add-to-list 'load-path "~/.emacs.d/elpa/j-mode-20171224.1856/")
(autoload 'j-mode "j-mode.el" "Major mode for editing J files" t)
;; Add for detection of j source files if the auto-load fails
(add-to-list 'auto-mode-alist '("\\.ij[rstp]$" . j-mode))
这是我的 init.el 的 babel 部分:
(org-babel-do-load-languages
'org-babel-load-languages
'((J . t)
(python . t)))
我试图运行的 j.org 文件是:
This is an example j org mode doc.
#+begin_src J :exports both
'Hello , World!'
#+end_src
#+begin_src J
load 'plot'
plot 1 o. 0.1 * i.200
#+end_src
谢谢。
【问题讨论】:
-
您如何设置
j-console-cmd以使其在j-mode中工作?你定制了吗?如果你在 Org 模式缓冲区中执行C-h v j-mode-cmd,你会得到什么? -
我没有名为 j-mode-cmd 的变量。 j-console-cmd 的值为 ijconsole-9.01。我需要将其更改为在尝试以 j-mode 评估 J 代码时会弹出 Java jconsole。
-
对不起,我的意思是
j-console-cmd。我看不出这里有什么问题。 -
就好像 org 模式正在运行 j-console 来评估 Jcode 块。而不是 j-console-9.01,就像我在 emacs 中的 j-mode 时那样。我在想,在评估 J 代码块时,org-mode 可能不在 j-mode 中,但我不知道如何解决这个问题(目前)。