作者 Anonymous [lisp] 2012-04-28 21:49 (点击下载)

  1.  
  2. (defun erc-say-hi (&rest ignore)
  3. "when someone join channel, say hi message"
  4. (let* ((nick (car (erc-parse-user (erc-response.sender parsed)))))
  5. (progn
  6. (if (and
  7. (string-equal (erc-response.command parsed) "JOIN")
  8. (not (string-equal nick (erc-current-nick)))
  9. (file-exists-p "~/.emacs.d/erc-hi.txt")
  10. )
  11. (let* ((erc-say-hi (with-temp-buffer
  12. (insert-file "~/.emacs.d/erc-hi.txt")
  13. (goto-char (point-min))
  14. (if (re-search-forward
  15. (concat "^" nick " :: " "\(.*\)")
  16. nil t 1)
  17. (concat (match-string-no-properties 1))
  18. ))))
  19. (if erc-say-hi
  20. (erc-send-message (concat nick ": " erc-say-hi))))))))
  21.  
  22. (add-hook 'erc-channel-members-changed-hook 'erc-say-hi)

提交下面的校正或者修改. (点击这里开始一个新的帖子)
姓名: 在 cookie 中记住我的名字

屏幕抓图:(jpeg 或 png)