我正在尝试编写一个emacs函数,该函数将在当前目录中运行make
,更改为另一个目录并运行make link
,同时将文本输出到名为 make-的新缓冲区输出(原创,嗯?)。完成后,我想转到 make-output 缓冲区的 end ,以便查看编译是否成功。这是我目前所拥有的:
(defun remake-libefp-interface()
"Will run make in the current directory, change to the NWChem src directory and relink the binary."
(interactive)
(defvar T_pwd (getenv "PWD"))
(defvar T_top (concat (getenv "NWCHEM_TOP") "/src"))
(defvar cmd (concat "make; cd " T_top "; make link;cd " T_pwd))
(with-output-to-temp-buffer "*make-output*"
(shell-command cmd "*make-output*")
(pop-to-buffer "*make-output*")
(end-of-buffer)))
这会重新编译,但会将我转发到 make-output 的 beginninng 。我也尝试用(end-of-buffer)
替换(goto-char (point-max))
,但这也让我在开始时就离开了。
答案 0 :(得分:2)
将pop-to-buffer
和(goto-char (point-max))
移到with-output-to-temp-buffer
之外。