作者 Anonymous [actionscript] 2012-04-26 20:51 (点击下载)

  1. (defvar *sh-nicks* (make-hash-table :test 'equal))
  2. (defvar *sh-channel* "#ubuntu-cn")
  3. (defvar *sh-nicks-file* "~/.lisp/say-hello.nicks")
  4. (defun say-hello ()
  5. (goto-char (point-min))
  6. (when (and (string= (buffer-name) *sh-channel*)
  7. (ignore-errors (re-search-forward "^*** \([^(]+\) (~?\([^@]+\)@ .*joined" nil t)))
  8. (let ((str (gethash (match-string-no-properties 2) *sh-nicks*)))
  9. (when str
  10. (erc-send-message (concat (match-string-no-properties 1) ": " str))))))
  11. (defun say-hello-build-nick-list ()
  12. (with-temp-buffer
  13. (clrhash *sh-nicks*)
  14. (insert-file-contents *sh-nicks-file* nil nil nil t)
  15. (while (re-search-forward "\([^[:space:]]+\)[[:space:]]+\([^[:space:]]+\)" nil t)
  16. (puthash (match-string-no-properties 1) (match-string-no-properties 2) *sh-nicks*))))
  17. (say-hello-build-nick-list)
  18. ;; *** blez (blez@ip-162-4-71-77.varnalan.net) has joined channel #ubuntu
  19. (add-hook 'erc-insert-post-hook 'say-hello)
  20. ;; (remove-hook 'erc-insert-post-hook 'auto-hello)

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

屏幕抓图:(jpeg 或 png)