2016-08-23 12 views
0

私はplink(putty)に新しいコイントモードを使いたい、私はinit.elにコードを入れた。emacsのPlink comintモード:テキストの読み取り専用など

しかし、M-xが実行された場合、「テキストは読み取り専用です」と「comint-send-input:現在のバッファにはプロセスがありません」というメッセージが表示されます。プロンプトが表示されず、入力できません。私はちょうどplink(パテ)のための新しいコミンチモードを持っていたい。

私はemacsで新しいです。誰かがそれを見てもらえますか?

(require 'comint) 
;; path 
(defvar plink-file-path "C:/Programme/Putty/plink.exe" 
    "Path to the program used by `run-plink'") 

;; arguments 
(defvar plink-arguments '() 
    "Commandline arguments to pass to `plink'") 

;; prompt 
(defvar plink-prompt-regexp "^>\s" 
"Prompt for `run-plink'.") 

;; Run-plink 
(defun run-plink() 
    "Run an inferior instance of `plink.js' inside Emacs." 
    (interactive) 
    (setq plink-buffer "*Plink*") 
    (let* ((plink-program plink-file-path) (buffer (comint-check-proc "Plink"))) 
    ;; pop to the "*plink*" buffer if the process is dead, the 
    ;; buffer is missing or it's got the wrong mode. 
    (pop-to-buffer-same-window 
    (if (or buffer (not (derived-mode-p 'plink-mode)) 
      (comint-check-proc (current-buffer))) 
     (get-buffer-create (or buffer "*Plink*")) 
     (current-buffer))) 
    ;; create the comint process if there is no buffer. 
    (unless buffer 
     (apply 'make-comint-in-buffer "Plink" buffer plink-program plink-arguments) 
     (plink-mode)))) 

;; plink-mode 
(define-derived-mode plink-mode comint-mode "plink" nil "plink" 
    (setq comint-process-echoes t) 
    (setq comint-use-prompt-regexp t) 
    (setq comint-prompt-regexp plink-prompt-regexp) 
    ; ">" read-only 
    (setq comint-prompt-read-only t) 
    (set (make-local-variable 'paragraph-separate) "..'") 
    (set (make-local-variable 'paragraph-start) plink-prompt-regexp)) 

答えて

0

これは正常に動作します:

(apply 'make-comint-in-buffer "Plink" buffer plink-program nil plink-arguments) 
関連する問題