[beirc-cvs] CVS update: beirc/application.lisp beirc/variables.lisp

Andreas Fuchs afuchs at common-lisp.net
Sun Oct 2 08:42:21 UTC 2005


Update of /project/beirc/cvsroot/beirc
In directory common-lisp.net:/tmp/cvs-serv3895

Modified Files:
	application.lisp variables.lisp 
Log Message:
Load the user init file when beirc is started, not when loaded. also
add a com-reload command.

Date: Sun Oct  2 10:42:20 2005
Author: afuchs

Index: beirc/application.lisp
diff -u beirc/application.lisp:1.21 beirc/application.lisp:1.22
--- beirc/application.lisp:1.21	Sun Oct  2 10:30:41 2005
+++ beirc/application.lisp	Sun Oct  2 10:42:20 2005
@@ -190,10 +190,11 @@
     (redisplay-frame-pane *application-frame* pane)))
 
 (defun redraw-all-receivers ()
-  (maphash (lambda (name receiver)
-             (declare (ignore name))
-             (redraw-receiver receiver))
-           (receivers *application-frame*)))
+  (when (boundp '*application-frame*)
+   (maphash (lambda (name receiver)
+              (declare (ignore name))
+              (redraw-receiver receiver))
+            (receivers *application-frame*))))
 
 (defmethod handle-event ((frame beirc) (event foo-event))
   ;; Hack:
@@ -225,6 +226,7 @@
                       (ticker-process (clim-sys:make-process (lambda () (ticker frame))
                                                              :name "Beirc Ticker")))
                  (setf *beirc-frame* frame)
+                 (load-user-init-file)
                  (run-frame-top-level frame)
                  (unless (null (current-connection frame))
                    (irc:quit (current-connection frame) "Client Quit"))
@@ -261,6 +263,13 @@
     (clim-internals::event-queue-prepend (climi::frame-event-queue frame)
                                          (make-instance 'bar-event :sheet frame))
     (sleep 1)))
+
+(defun load-user-init-file (&optional (pathname *beirc-user-init-file*))
+  (load pathname)
+  (redraw-all-receivers))
+
+(define-beirc-command (com-reload :name t) ()
+  (load-user-init-file))
 
 (define-beirc-command (com-query :name t) ((nick 'nickname :prompt "who"))
   (raise-receiver (intern-receiver nick *application-frame* :query nick)))


Index: beirc/variables.lisp
diff -u beirc/variables.lisp:1.4 beirc/variables.lisp:1.5
--- beirc/variables.lisp:1.4	Sun Oct  2 10:30:41 2005
+++ beirc/variables.lisp	Sun Oct  2 10:42:20 2005
@@ -9,7 +9,4 @@
                               #+linux  "/usr/bin/x-www-browser")
 
 (defvar *beirc-user-init-file* (merge-pathnames (make-pathname :name ".beirc.lisp")
-                                                (user-homedir-pathname)))
-
-(when (probe-file *beirc-user-init-file*)
-  (load *beirc-user-init-file*))
\ No newline at end of file
+                                                (user-homedir-pathname)))
\ No newline at end of file




More information about the Beirc-cvs mailing list