1 |
;;; erbot.el --- Another robot for ERC. |
;;; erbot.el --- Another robot for ERC. |
2 |
;; Time-stamp: <2005-01-08 12:52:18 deego> |
;; Time-stamp: <2005-03-29 13:59:29 deego> |
3 |
;; Emacs Lisp Archive entry |
;; Emacs Lisp Archive entry |
4 |
;; Filename: erbot.el |
;; Filename: erbot.el |
5 |
;; Package: erbot |
;; Package: erbot |
654 |
lines)))))) |
lines)))))) |
655 |
|
|
656 |
|
|
657 |
|
(defcustom erbot-setf-p nil |
658 |
|
"If you want your bot to allow setf, set this symbol to non-nil at |
659 |
|
the beginning of your .emacs") |
660 |
|
|
661 |
|
|
662 |
;;;###autoload |
;;;###autoload |
663 |
(defun erbot-install () |
(defun erbot-install () |
664 |
"Run this function AFTER loading all the files..." |
"Run this function AFTER loading all the files..." |
679 |
(add-hook 'erc-server-376-hook |
(add-hook 'erc-server-376-hook |
680 |
'erbot-autojoin-channels)) |
'erbot-autojoin-channels)) |
681 |
) |
) |
682 |
(erbot-install-symbols)) |
(erbot-install-symbols) |
683 |
|
(when erbot-setf-p (erbot-install-setf)) |
684 |
|
) |
685 |
|
|
686 |
|
|
687 |
|
|
688 |
|
(defun erbot-install-setf () |
689 |
|
(interactive) |
690 |
|
(defalias 'fs-setf 'setf) |
691 |
|
(require 'cl) |
692 |
|
(let* |
693 |
|
((syms |
694 |
|
(apropos-internal "" (lambda (a) (get a 'setf-method)))) |
695 |
|
(fssyms |
696 |
|
(mapcar |
697 |
|
(lambda (a) (intern (format "fs-%s" a))) |
698 |
|
syms)) |
699 |
|
(fsisyms |
700 |
|
(mapcar |
701 |
|
(lambda (a) (intern (format "fsi-%s" a))) |
702 |
|
syms))) |
703 |
|
(mapcar* |
704 |
|
(lambda (a b c) |
705 |
|
(let ((foo (get a 'setf-method))) |
706 |
|
(put b 'setf-method foo) |
707 |
|
(put c 'setf-method foo))) |
708 |
|
syms fssyms fsisyms))) |
709 |
|
|
710 |
|
|
711 |
|
|
712 |
|
|