【发布时间】:2019-03-28 10:58:30
【问题描述】:
假设我正在编写一个 emacs lisp 函数,该函数与相对于定义该函数的文件所在的文件进行交互。
- bin/executable
- foo.el
foo.el:
(defun foo ()
(shell-command-to-string
(format "echo '%s' | ./bin/executable"
(buffer-substring-no-properties
(point-min)
(point-max)))))
如果我从foo.el 运行它,那么效果很好。如果我在编辑任何其他文件时调用该函数,它不起作用,因为路径不正确。
无论在何处调用函数,我如何才能从foo.el 中可靠地引用./bin/executable?
【问题讨论】:
标签: emacs elisp relative-path