(defun jira-view-git-branch ()
(interactive)
(markdown-mode)
(shell-command (format "./jira-view.sh &")))
那么如何使输出缓冲区处于降价模式?
我尝试了以下
(defun jira-view-git-branch ()
(interactive)
(with-output-to-temp-buffer "*jira*"
(shell-command (format "./jira-view.sh &") "*jira*" "*Messages*")
(pop-to-buffer "*jira*"))
(with-current-buffer "*jira*"
(markdown-mode)))
但是在* Messages *
中得到了error in process filter: read-from-minibuffer: Wrong type argument: markerp, nil
error in process filter: Wrong type argument: markerp, nil
答案 0 :(得分:3)
不知道您的shell命令jira-view.sh
到底能做什么,我发现很难为此找到一个好的解决方案。
至少,以下内容应为您提供一些指示:
(defun jira-md (buffer)
(interactive "Bbuffer name: ")
(let ((b (get-buffer-create buffer)))
(switch-to-buffer b)
(markdown-mode)
(insert (shell-command-to-string "echo '# title'"))))
B
作为interactive
的参数的第一个字符来请求(可能尚不存在)缓冲区。您还可以通过首先检查主要模式是否尚未设置为markdown-mode来使主要模式的设置为可选。像这样:
(unless (eq major-mode 'markdown-mode)
(markdown-mode))