本文介绍了emacs中用于plink(putty)的新comint mod:Symbol的函数定义无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想对plink(putty)使用一种新的comint模式,我将代码放在init.el中,但是如果执行Mx run-plink,我会遇到以下错误:

i want to use a new comint mode for plink(putty), i put the code in init.el, but if M-x run-plink, i got below error:

let *:Symbol的函数定义无效:comint-check-proc

;; 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))


推荐答案

您尚未加载库 comint 。在Emacs知道 comint-check-proc 之前,需要这样做。

You have not loaded library comint. You need to do that before Emacs can know about comint-check-proc.

添加(需要'comint),位于您的init文件中,或者位于 run-plink 开头附近-在尝试使用<$之前c $ c> comint-check-proc 。

Add a (require 'comint), either in your init file or near the beginning of run-plink - somewhere before it tries to use comint-check-proc.

这篇关于emacs中用于plink(putty)的新comint mod:Symbol的函数定义无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 01:20