我正在尝试编写一个小脚本,当有人在 erc 中与我交谈时通知我。所以我需要编写一个函数来接收我认为是两个字符串,nick 和 msg,这样我就可以挂钩它。但是我的测试功能失败了。我已经测试了咆哮通知和格式 s 表达式,它们工作正常,但我无法让测试工作。我不知道为什么它会失败。任何指针?
(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))