+2005-08-25 Daiki Ueno <ueno@unixuser.org>
+
+ * riece.el (riece): Don't override riece-addons setting.
+
+ * riece-globals.el (riece-addon-dependencies): New variable.
+
+ * riece-addon.el (riece-sort-addon-dependencies): Rename from
+ riece-resolve-addon-dependencies; return addon dependencies as an
+ alist, instead of returning a list of addons.
+
2005-08-20 Daiki Ueno <ueno@unixuser.org>
* riece-addon.el (riece-command-enable-addon): Redraw entire
;; Merge pred's succs.
(while pointer
(if (setq entry (assq (car pointer) dependencies))
- (setcdr (cdr entry)
- (cons (car addons) (nthcdr 2 entry)))
+ (setcdr (cdr entry) (cons (car addons) (nthcdr 2 entry)))
(setq dependencies (cons (list (car pointer) 0 (car addons))
dependencies)))
(setq pointer (cdr pointer))))
(setq addons (cdr addons)))
dependencies))
-(defun riece-resolve-addon-dependencies (addons)
- (let ((pointer addons)
- dependencies queue)
- ;; Uniquify, first.
- (while pointer
- (if (memq (car pointer) (cdr pointer))
- (setcar pointer nil))
- (setq pointer (cdr pointer)))
- (setq dependencies (riece-load-and-build-addon-dependencies
- (delq nil addons))
- pointer dependencies)
- ;; Sort them.
+(defun riece-sort-addon-dependencies (dependencies)
+ (let ((pointer dependencies)
+ addons queue)
(while pointer
(if (zerop (nth 1 (car pointer)))
(setq dependencies (delq (car pointer) dependencies)
queue (cons (car pointer) queue)))
(setq pointer (cdr pointer)))
- (setq addons nil)
(while queue
- (setq addons (cons (car (car queue)) addons)
+ (setq addons (cons (cons (car (car queue)) (nthcdr 2 (car queue)))
+ addons)
pointer (nthcdr 2 (car queue)))
(while pointer
(let* ((entry (assq (car pointer) dependencies))
(nreverse addons)))
(defun riece-resolve-addons (addons)
+ ;; Add files in riece-addon-directory to addons.
+ (if (file-directory-p riece-addon-directory)
+ (setq addons (nconc
+ addons
+ (mapcar
+ (lambda (name)
+ (unless (file-directory-p
+ (expand-file-name name riece-addon-directory))
+ (intern (file-name-sans-extension name))))
+ (directory-files riece-addon-directory nil "\\`[^.]")))))
+ ;; Sort & uniquify.
+ (setq addons (sort addons (lambda (symbol1 symbol2)
+ (string-lessp (symbol-name symbol1)
+ (symbol-name symbol2)))))
+ (let ((pointer addons))
+ (while pointer
+ (if (memq (car pointer) (cdr pointer))
+ (setcar pointer nil))
+ (setq pointer (cdr pointer)))
+ (delq nil addons))
+ ;; Build & resolve dependencies.
(riece-resolve-addon-dependencies
- (if (file-directory-p riece-addon-directory)
- (append addons
- (mapcar
- (lambda (name)
- (unless (file-directory-p
- (expand-file-name name riece-addon-directory))
- (intern (file-name-sans-extension name))))
- (directory-files riece-addon-directory nil "\\`[^.]" t)))
- addons)))
+ (riece-load-and-build-addon-dependencies addons)))
(defun riece-insinuate-addon (addon &optional verbose)
(if (get addon 'riece-addon-insinuated)
(modify-frame-parameters (selected-frame)
(list (cons 'riece-window-configuration
(current-window-configuration))))
- (setq riece-addons (riece-resolve-addons riece-addons))
- (let ((pointer riece-addons))
+ (setq riece-addon-dependencies (riece-resolve-addons riece-addons))
+ (let ((pointer riece-addon-dependencies))
(while pointer
- (riece-insinuate-addon (car pointer) riece-debug)
+ (riece-insinuate-addon (car (car pointer)) riece-debug)
(setq pointer (cdr pointer))))
(if (or confirm (null riece-server))
(setq riece-server (completing-read "Server: " riece-server-alist)))
(unless (riece-server-opened server)
(riece-command-open-server server))
(setq channel-list (cdr channel-list))))
- (let ((pointer riece-addons))
+ (let ((pointer riece-addon-dependencies))
(while pointer
(unless (get (car pointer) 'riece-addon-default-disabled)
(riece-enable-addon (car pointer) riece-debug))