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

标签 bash emacs sh agda agda-mode

我用下面的代码制作了一个.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.

在此 session 中,agda 的可执行文件不在 PATH 中,PATH 与我在 ~/.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-mode 启动 emacs

最佳答案

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

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

关于bash - 从 .sh 脚本启动时,Emacs 看不到 agda,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71634942/

相关文章:

linux shell 脚本 sed

awk - ORS 拒绝将输出记录分隔到新行

linux - 巴什 : Difference between '-' and '--' options

bash - 使用 Curl 数据二进制选项,内存不足

django - 启动失败 [/bin/bash, --rcfile,/snap/pycharm-professional/127/plugins/terminal/jediterm-bash.in, -i]

git - Jenkins Git Publisher 标签不检测环境变量

emacs - 在 Emacs 中正确缩进 Clojure 的 `match`

node.js - Node 在 Windows 上的 Ubuntu 上无法在 Bash 上运行

emacs - Emacs 中的缓冲区切换

emacs - 是什么让您想学习 Common Lisp?你想从中得到什么?