首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Emacs在从.sh脚本启动时看不到agda

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

Stack Overflow用户
提问于 2022-03-27 08:54:02
回答 1查看 84关注 0票数 3

我用以下代码编写了一个.sh脚本

代码语言:javascript
复制
#!/bin/sh
cd ~/Projects/Agda\ projects/
emacs

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

代码语言:javascript
复制
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的可执行文件不在PATH上,PATH与我在~/.bashrc中的不同之处

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

出于某种原因,从emacs手动启动konsole是完美的。

调试跟踪:

代码语言:javascript
复制
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()

如何从emacs脚本用agda-mode启动.sh?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-03-27 10:01:23

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

代码语言:javascript
复制
#!/bin/sh
. ~/.profile
cd ~/Projects/Agda\ projects/
emacs
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71634942

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档