2012-08-13 3 views
-1

누군가 내가 erc에서 나에게 이야기 할 때 알려주는 작은 스크립트를 작성하려고합니다. 그래서 나는 그것을 추정 할 수있는 함수를 작성해야합니다. 두 문자열, 닉, msg가 있다고 가정합니다. 하지만 내 테스트 기능이 실패합니다. 나는 growl-notify 및 형식 s-expresions을 테스트했으며 제대로 작동하지만 테스트를받을 수 없습니다. 나는 그것이 왜 실패했는지 전혀 모른다. 어떤 포인터?Elisp 도움. 왜 다음 발췌 문장은 실패합니까?

(defun growl-notify (&key message) 
    "Use growl for notifications" 
    (start-process "growlnotify" "growlnotifications" "growlnotify" "-m " message)) 

(defun test (nick msg) 
    (growlnotify :message (format "%s: %s" nick msg))) 

(test "Ppop" "something") 

다음과 같은 역 추적을 통해 도움이되기를 바랍니다.

Debugger entered--Lisp error: (void-function growlnotify) 
    (growlnotify :message (format "%s: %s" nick msg)) 
    test("oi" "poi") 
    eval((test "oi" "poi") nil) 
    eval-last-sexp-1(t) 
    eval-last-sexp(t) 
    eval-print-last-sexp() 
    call-interactively(eval-print-last-sexp nil nil) 
    recursive-edit() 
    debug(error (wrong-number-of-arguments (lambda (&key message) "Use growl for notifications" (start-process "growlnotify" "growlnotifications" "growlnotify" "-m " message)) 3)) 
+0

s/Pop/oi /와 s/something/poi/ – PuercoPop

+2

당신은'growl-notify' 함수를 호출했지만'growlnotify'로 호출하려고했습니다. – tripleee

+0

감사합니다. @tripleee : $ – PuercoPop

답변

1

오류 메시지가 growlnotify이 함수로 정의되어 있지 않은 사실을 알려줍니다, Debugger entered--Lisp error: (void-function growlnotify)이다.

코드를 보면 growl-notify이라는 함수를 정의하는 (defun growl-notify (&key message)과 같이 정의한 것을 볼 수 있습니다. 간단한 오타.

관련 문제