From 651bc7fdd63695411f892ad4453bce9d90771388 Mon Sep 17 00:00:00 2001 From: ueno Date: Thu, 11 Aug 2005 05:48:44 +0000 Subject: [PATCH] * riece-ruby.el (riece-ruby-property-alist): New variable (riece-ruby-set-property): New function. (riece-ruby-property): New function. (riece-ruby-execute): Locate server.rb from load-path. * Makefile.am (EXTRA_DIST): Added riece-ruby.el and server.rb. * COMPILE (riece-modules): Added riece-ruby. (riece-icons): Use filename instead of symbol. (riece-scripts): New variable. (riece-install-icons): Use filename instead of symbol. (riece-install-scripts): New function. (riece-install): Call riece-install-scripts. (riece-install-package): Ditto. --- lisp/COMPILE | 52 ++++++++++++++++++++++++++++++++++++++-------------- lisp/ChangeLog | 17 +++++++++++++++++ lisp/Makefile.am | 25 +++++++++++++------------ lisp/riece-ruby.el | 26 +++++++++++++++++++++++--- 4 files changed, 91 insertions(+), 29 deletions(-) diff --git a/lisp/COMPILE b/lisp/COMPILE index 05d2262..0215da6 100644 --- a/lisp/COMPILE +++ b/lisp/COMPILE @@ -12,6 +12,7 @@ riece-coding riece-complete riece-addon + riece-ruby riece-mode ;; riece-identity -+-> riece-channel @@ -79,13 +80,16 @@ riece-keepalive)))) (defvar riece-icons - '(riece-command-quit - riece-command-join - riece-command-part - riece-command-previous-channel - riece-command-next-channel - riece-command-change-layout - riece-submit-bug-report)) + '("riece-command-quit.xpm" + "riece-command-join.xpm" + "riece-command-part.xpm" + "riece-command-previous-channel.xpm" + "riece-command-next-channel.xpm" + "riece-command-change-layout.xpm" + "riece-submit-bug-report.xpm")) + +(defvar riece-scripts + '("server.rb")) (defun riece-compile-modules (modules) (let ((load-path (cons nil load-path)) @@ -134,15 +138,26 @@ (unless (or just-print (file-exists-p dest)) (make-directory dest t)) (while icons - (let ((name (symbol-name (car icons)))) - (when (file-exists-p (expand-file-name (concat name ".xpm"))) - (princ (format "%s.xpm -> %s\n" name dest)) - (unless just-print - (copy-file (expand-file-name (concat name ".xpm")) - (expand-file-name (concat name ".xpm") dest) - t t)))) + (when (file-exists-p (expand-file-name (car icons))) + (princ (format "%s -> %s\n" (car icons) dest)) + (unless just-print + (copy-file (expand-file-name (car icons)) + (expand-file-name (car icons) dest) + t t))) (setq icons (cdr icons)))) +(defun riece-install-scripts (scripts dest just-print) + (unless (or just-print (file-exists-p dest)) + (make-directory dest t)) + (while scripts + (when (file-exists-p (expand-file-name (car scripts))) + (princ (format "%s -> %s\n" (car scripts) dest)) + (unless just-print + (copy-file (expand-file-name (car scripts)) + (expand-file-name (car scripts) dest) + t t))) + (setq scripts (cdr scripts)))) + (defun riece-install-just-print-p () (let ((flag (getenv "MAKEFLAGS")) case-fold-search) @@ -160,6 +175,10 @@ (riece-install-icons riece-icons (expand-file-name "riece" (car command-line-args-left)) + (riece-install-just-print-p)) + (riece-install-scripts + riece-scripts + (expand-file-name "riece" (car command-line-args-left)) (riece-install-just-print-p))) (defun riece-compile-package () @@ -183,6 +202,11 @@ riece-icons (expand-file-name "riece" (expand-file-name "lisp" (car command-line-args-left))) + (riece-install-just-print-p)) + (riece-install-scripts + riece-scripts + (expand-file-name "riece" + (expand-file-name "lisp" (car command-line-args-left))) (riece-install-just-print-p))) (defun riece-test () diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 18fa219..1e870eb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,22 @@ 2005-08-11 Daiki Ueno + * riece-ruby.el (riece-ruby-property-alist): New variable + (riece-ruby-set-property): New function. + (riece-ruby-property): New function. + (riece-ruby-execute): Locate server.rb from load-path. + + * Makefile.am (EXTRA_DIST): Added riece-ruby.el and server.rb. + + * COMPILE (riece-modules): Added riece-ruby. + (riece-icons): Use filename instead of symbol. + (riece-scripts): New variable. + (riece-install-icons): Use filename instead of symbol. + (riece-install-scripts): New function. + (riece-install): Call riece-install-scripts. + (riece-install-package): Ditto. + +2005-08-11 Daiki Ueno + * riece-ruby.el: Add docs for variables. (riece-ruby-substitute-variables): Substitute multiple variables. (riece-ruby-filter): Call output-handler/exit-handler with program diff --git a/lisp/Makefile.am b/lisp/Makefile.am index 5d49803..bacc2da 100644 --- a/lisp/Makefile.am +++ b/lisp/Makefile.am @@ -6,19 +6,20 @@ EXTRA_DIST = COMPILE ChangeLog ChangeLog.Liece \ riece-compat.el riece-complete.el riece-debug.el riece-display.el \ riece-emacs.el riece-filter.el riece-globals.el riece-handle.el \ riece-highlight.el riece-identity.el riece-message.el riece-misc.el \ - riece-mode.el riece-naming.el riece-options.el riece-server.el \ - riece-signal.el riece-user.el riece-version.el riece-xemacs.el \ - riece-irc.el riece.el riece-ctcp.el riece-url.el riece-unread.el \ - riece-ndcc.el riece-rdcc.el riece-log.el riece-mini.el \ - riece-doctor.el riece-alias.el riece-layout.el riece-skk-kakutei.el \ - riece-guess.el riece-history.el riece-button.el riece-keyword.el \ - riece-menu.el riece-icon.el riece-async.el riece-lsdb.el \ - riece-xface.el riece-ctlseq.el riece-ignore.el riece-hangman.el \ - riece-biff.el riece-kakasi.el riece-foolproof.el riece-yank.el \ - riece-toolbar.el riece-eval.el riece-google.el riece-keepalive.el \ - url-riece.el \ + riece-mode.el riece-naming.el riece-options.el riece-ruby.el \ + riece-server.el riece-signal.el riece-user.el riece-version.el \ + riece-xemacs.el riece-irc.el riece.el riece-ctcp.el riece-url.el \ + riece-unread.el riece-ndcc.el riece-rdcc.el riece-log.el \ + riece-mini.el riece-doctor.el riece-alias.el riece-layout.el \ + riece-skk-kakutei.el riece-guess.el riece-history.el riece-button.el \ + riece-keyword.el riece-menu.el riece-icon.el riece-async.el \ + riece-lsdb.el riece-xface.el riece-ctlseq.el riece-ignore.el \ + riece-hangman.el riece-biff.el riece-kakasi.el riece-foolproof.el \ + riece-yank.el riece-toolbar.el riece-eval.el riece-google.el \ + riece-keepalive.el url-riece.el \ riece-command-previous-channel.xpm riece-command-next-channel.xpm \ - riece-submit-bug-report.xpm + riece-submit-bug-report.xpm \ + server.rb CLEANFILES = auto-autoloads.el custom-load.el *.elc FLAGS ?= -batch -q -no-site-file diff --git a/lisp/riece-ruby.el b/lisp/riece-ruby.el index eb1fab7..62da69d 100644 --- a/lisp/riece-ruby.el +++ b/lisp/riece-ruby.el @@ -89,6 +89,9 @@ Use `riece-ruby-set-output-handler' to set this variable.") "An alist mapping from program name to exit handler. Exit handlers are called once when \"# exit\" line arrives. Use `riece-ruby-set-exit-handler' to set this variable.") +(defvar riece-ruby-property-alist nil + "An alist mapping from program name to the property list. +Use `riece-ruby-set-property' to set this variable.") (defun riece-ruby-substitute-variables (program alist) (setq program (copy-sequence program)) @@ -228,7 +231,8 @@ Use `riece-ruby-set-exit-handler' to set this variable.") (expand-file-name riece-ruby-server-program (file-name-directory - (symbol-file 'riece-ruby-execute)))))) + (locate-library + (symbol-file 'riece-ruby-execute))))))) (set-process-filter riece-ruby-process #'riece-ruby-filter) (set-process-sentinel riece-ruby-process #'riece-ruby-sentinel))) (save-excursion @@ -264,7 +268,10 @@ Use `riece-ruby-set-exit-handler' to set this variable.") (setq riece-ruby-lock t) (riece-ruby-send-exit name) (while (null riece-ruby-response) - (accept-process-output riece-ruby-process)))) + (accept-process-output riece-ruby-process))) + (let ((entry (assoc name riece-ruby-property-alist))) + (if entry + (delq entry riece-ruby-property-alist)))) (defun riece-ruby-set-exit-handler (name handler) (let ((entry (assoc name riece-ruby-exit-handler-alist))) @@ -274,7 +281,7 @@ Use `riece-ruby-set-exit-handler' to set this variable.") (cons (cons name handler) riece-ruby-exit-handler-alist))) ;;check if the program already exited - (riece-ruby-inspect))) + (riece-ruby-inspect name))) (defun riece-ruby-set-output-handler (name handler) (let ((entry (assoc name riece-ruby-output-handler-alist))) @@ -284,6 +291,19 @@ Use `riece-ruby-set-exit-handler' to set this variable.") (cons (cons name handler) riece-ruby-output-handler-alist))))) +(defun riece-ruby-set-property (name property value) + (let ((entry (assoc name riece-ruby-property-alist)) + property-entry) + (unless entry + (setq entry (list name) + riece-ruby-property-alist (cons entry riece-ruby-property-alist))) + (if (setq property-entry (assoc property (cdr entry))) + (setcdr property-entry value) + (setcdr entry (cons (cons property value) (cdr entry)))))) + +(defun riece-ruby-property (name property) + (cdr (assoc property (cdr (assoc name riece-ruby-property-alist))))) + (provide 'riece-ruby) ;;; riece-ruby.el ends here -- 1.7.10.4