从 .sh 脚本启动时,Emacs 看不到 agda

发布于 2025-01-17 04:37:20 字数 1365 浏览 4 评论 0原文

我使用以下代码创建了一个 .sh 脚本

#!/bin/sh
cd ~/Projects/Agda\ projects/
emacs

,但是每当我启动它时,我都会收到以下错误:

File is missing: Cannot open load file, no such file or directory, /bin/bash: agda-mode: command not found


To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the ‘--debug-init’ option to view a complete error backtrace.

在此会话中,agda 的可执行文件不在 PATHPATH 上 与我在 ~/.bashrc 中的不同,

我尝试安装 exec-path-from-shell 但这并没有解决问题。

由于某种原因,从 konsole 手动启动 emacs 可以完美地工作。

调试跟踪:

Debugger entered--Lisp error: (file-missing "Cannot open load file" "No such file or directory" "/bin/bash: agda-mode: command not found\n")
  load("/bin/bash: agda-mode: command not found\n" nil nil t)
  load-file("/bin/bash: agda-mode: command not found\n")
  eval-buffer(#<buffer  *load*> nil "/home/bratjuuc/.emacs" nil t)  ; Reading at buffer position 470
  load-with-code-conversion("/home/bratjuuc/.emacs" "/home/bratjuuc/.emacs" t t)
  load("~/.emacs" t t)
  #f(compiled-function () #<bytecode 0x1e0f4d>)()
  command-line()
  normal-top-level()

如何从 .sh 脚本启动带有 agda-modeemacs

I made an .sh script with the following code

#!/bin/sh
cd ~/Projects/Agda\ projects/
emacs

But whenever I launch it I get the following error

File is missing: Cannot open load file, no such file or directory, /bin/bash: agda-mode: command not found


To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the ‘--debug-init’ option to view a complete error backtrace.

In this session agda's executable isn't on the PATH and PATH differs from what I have in ~/.bashrc

I have tried installing exec-path-from-shell but that didn't solve the problem.

Launching emacs from konsole manually works flawlessly for some reason.

Debug trace:

Debugger entered--Lisp error: (file-missing "Cannot open load file" "No such file or directory" "/bin/bash: agda-mode: command not found\n")
  load("/bin/bash: agda-mode: command not found\n" nil nil t)
  load-file("/bin/bash: agda-mode: command not found\n")
  eval-buffer(#<buffer  *load*> nil "/home/bratjuuc/.emacs" nil t)  ; Reading at buffer position 470
  load-with-code-conversion("/home/bratjuuc/.emacs" "/home/bratjuuc/.emacs" t t)
  load("~/.emacs" t t)
  #f(compiled-function () #<bytecode 0x1e0f4d>)()
  command-line()
  normal-top-level()

How do I launch emacs with agda-mode from an .sh script?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

划一舟意中人 2025-01-24 04:37:20

建议将环境上下文添加到您的脚本中。

#!/bin/sh
. ~/.profile
cd ~/Projects/Agda\ projects/
emacs

suggesting to add environment context to your script.

#!/bin/sh
. ~/.profile
cd ~/Projects/Agda\ projects/
emacs
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文