我已经覆盖erc-match-message
了函数 erc-mode 并将它放在我的 .emacs 文件中erc
error in process filter: Wrong number of arguments: (lambda (match-type
nickuserhost msg notification) (interactive) (if (and (eq match-type
(quote current-nick)) (not notification)) (progn (async-exec-command
"mpg123 -q /home/kuba/Pobrane/beep-8.mp3") (notify "ERC" msg)))), 3
我的钩子函数如下所示:
(defun mention-notify (match-type nickuserhost msg notification)
(interactive)
(if (and (eq match-type 'current-nick)
(not notification))
(progn
(async-exec-command "mpg123 -q /home/kuba/Pobrane/beep-8.mp3")
(notify "ERC" msg))))
(一个额外的notification
参数)当我erc-match-message
使用eval-last-sexp
.
我有这个
(require 'erc)
(defun erc-match-message ()
;; my overwritten function that's defined in erc.el
...)
(defun mention-notify (match-type nickuserhost msg notification)
;; notify hook handler
...)
(defun irc ()
"Connect to the freenode"
(interactive)
(erc :server "barjavel.freenode.net"
:port 6667
:nick "jcubic"
:password "<PASS>"))
(global-set-key (kbd "C-c i") 'irc)
为什么 .emacs 文件中定义的函数不会覆盖使用 require 添加的外部文件中定义的函数?