From ab5f11c95e2f82fb6782466f6d2df9c2a4b12eb3 Mon Sep 17 00:00:00 2001 From: ueno Date: Fri, 30 May 2003 00:38:44 +0000 Subject: [PATCH] * Makefile.am (elc): Renamed from "compile". * Don't use pop and push. --- lisp/ChangeLog | 2 ++ lisp/Makefile.am | 6 +++--- lisp/riece-300.el | 3 ++- lisp/riece-commands.el | 10 +++++++--- lisp/riece-display.el | 8 ++++++-- lisp/riece-handle.el | 48 +++++++++++++++++++++++------------------------- lisp/riece-misc.el | 6 +++--- lisp/riece-server.el | 12 ++++++------ lisp/riece.el | 26 +++++++++++++++----------- 9 files changed, 67 insertions(+), 54 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6824e58..cca77eb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2003-05-30 Daiki Ueno + * Makefile.am (elc): Renamed from "compile". + * riece.el (riece-dialogue-mode-map): Bind riece-command-toggle-channel-list-buffer-mode. diff --git a/lisp/Makefile.am b/lisp/Makefile.am index 366a471..ba32be6 100644 --- a/lisp/Makefile.am +++ b/lisp/Makefile.am @@ -11,12 +11,12 @@ EXTRA_DIST = COMPILE ChangeLog ChangeLog.Liece \ CLEANFILES = auto-autoloads.el custom-load.el *.elc FLAGS ?= -batch -q -no-site-file -all: compile +all: elc -compile: +elc: $(EMACS) $(FLAGS) -l COMPILE -f riece-compile -install: compile +install: elc $(EMACS) $(FLAGS) -l COMPILE -f riece-install $(lispdir) # $(MAKE) package: diff --git a/lisp/riece-300.el b/lisp/riece-300.el index bab3204..99f83c4 100644 --- a/lisp/riece-300.el +++ b/lisp/riece-300.el @@ -173,7 +173,8 @@ (let* ((channel (match-string 1 string)) (mode-string (substring string (match-beginning 2))) (modes (string-to-list (match-string 2 string))) - (toggle (pop modes))) + (toggle (car modes))) + (setq modes (cdr modes)) (while modes (riece-channel-toggle-mode channel (car modes) (eq toggle ?+)) (setq modes (cdr modes))) diff --git a/lisp/riece-commands.el b/lisp/riece-commands.el index 7ed3322..74ab97f 100644 --- a/lisp/riece-commands.el +++ b/lisp/riece-commands.el @@ -254,7 +254,8 @@ (list users current-prefix-arg))) (let (group) (while users - (push (pop users) group) + (setq group (cons (car users) group) + users (cdr users)) (if (or (= (length group) 3) (null users)) (riece-send-string @@ -285,7 +286,8 @@ (list users current-prefix-arg))) (let (group) (while users - (push (pop users) group) + (setq group (cons (car users) group) + users (cdr users)) (if (or (= (length group) 3) (null users)) (riece-send-string @@ -523,7 +525,9 @@ If prefix argument ARG is non-nil, toggle frozen status." server-name))) (with-current-buffer (process-buffer process) (setq riece-server-name server-name)) - (push (cons server-name process) riece-server-process-alist))) + (setq riece-server-process-alist + (cons (cons server-name process) + riece-server-process-alist)))) (defun riece-command-close-server (server-name &optional message) (interactive diff --git a/lisp/riece-display.el b/lisp/riece-display.el index 65de48d..be5934c 100644 --- a/lisp/riece-display.el +++ b/lisp/riece-display.el @@ -214,11 +214,15 @@ (unless (riece-identity-assoc-no-server identity riece-channel-buffer-alist) (let ((buffer (riece-channel-buffer-create identity))) - (push (cons identity buffer) riece-channel-buffer-alist))) + (setq riece-channel-buffer-alist + (cons (cons identity buffer) + riece-channel-buffer-alist)))) (unless (riece-identity-assoc-no-server identity riece-user-list-buffer-alist) (let ((buffer (riece-user-list-buffer-create identity))) - (push (cons identity buffer) riece-user-list-buffer-alist))))) + (setq riece-user-list-buffer-alist + (cons (cons identity buffer) + riece-user-list-buffer-alist)))))) (defun riece-switch-to-nearest-channel (pointer) (let ((start riece-current-channels) diff --git a/lisp/riece-handle.el b/lisp/riece-handle.el index 91bc3ae..6ff8d2f 100644 --- a/lisp/riece-handle.el +++ b/lisp/riece-handle.el @@ -53,7 +53,7 @@ (if (riece-identity-equal-no-server (riece-make-identity old) riece-current-channel) (riece-switch-to-channel (riece-make-identity new))) - (push (riece-make-identity new) channels))) + (setq channels (cons (riece-make-identity new) channels)))) (riece-insert-change (mapcar (lambda (channel) (cdr (riece-identity-assoc-no-server @@ -73,26 +73,24 @@ (defun riece-handle-privmsg-message (prefix string) (let* ((user (riece-prefix-nickname prefix)) (parameters (riece-split-parameters string)) - (targets (split-string (pop parameters) ",")) - (message (pop parameters))) - (unless (equal message "") - (while targets - (riece-display-message - (riece-make-message user (riece-make-identity (pop targets)) - message)))))) + (targets (split-string (car parameters) ",")) + (message (nth 1 parameters))) + (unless (equal message "") ;not ignored by server? + (riece-display-message + (riece-make-message user (riece-make-identity (car targets)) + message))))) (defun riece-handle-notice-message (prefix string) (let* ((user (if prefix (riece-prefix-nickname prefix))) (parameters (riece-split-parameters string)) - (targets (split-string (pop parameters) ",")) - (message (pop parameters))) - (unless (equal message "") + (targets (split-string (car parameters) ",")) + (message (nth 1 parameters))) + (unless (equal message "") ;not ignored by server? (if user - (while targets - (riece-display-message - (riece-make-message user (riece-make-identity (pop targets)) - message 'notice))) + (riece-display-message + (riece-make-message user (riece-make-identity (car targets)) + message 'notice)) ;; message from server (riece-insert-notice (list riece-dialogue-buffer riece-others-buffer) @@ -139,8 +137,8 @@ (defun riece-handle-part-message (prefix string) (let* ((user (riece-prefix-nickname prefix)) (parameters (riece-split-parameters string)) - (channels (split-string (pop parameters) ",")) - (message (pop parameters))) + (channels (split-string (car parameters) ",")) + (message (nth 1 parameters))) (while channels (riece-naming-assert-part user (car channels)) (let ((buffer (cdr (riece-identity-assoc-no-server @@ -170,9 +168,9 @@ (defun riece-handle-kick-message (prefix string) (let* ((kicker (riece-prefix-nickname prefix)) (parameters (riece-split-parameters string)) - (channel (pop parameters)) - (user (pop parameters)) - (message (pop parameters))) + (channel (car parameters)) + (user (nth 1 parameters)) + (message (nth 2 parameters))) (riece-naming-assert-part user channel) (let ((buffer (cdr (riece-identity-assoc-no-server (riece-make-identity channel) @@ -241,8 +239,8 @@ (defun riece-handle-kill-message (prefix string) (let* ((killer (riece-prefix-nickname prefix)) (parameters (riece-split-parameters string)) - (user (pop parameters)) - (message (pop parameters)) + (user (car parameters)) + (message (nth 1 parameters)) (channels (copy-sequence (riece-user-get-channels user))) pointer) ;; You were talking with the user. @@ -282,7 +280,7 @@ (defun riece-handle-invite-message (prefix string) (let* ((user (riece-prefix-nickname prefix)) (parameters (riece-split-parameters string)) - (channel (pop parameters))) + (channel (car parameters))) (riece-insert-info (list riece-dialogue-buffer riece-others-buffer) (concat @@ -293,8 +291,8 @@ (defun riece-handle-topic-message (prefix string) (let* ((user (riece-prefix-nickname prefix)) (parameters (riece-split-parameters string)) - (channel (pop parameters)) - (topic (pop parameters))) + (channel (car parameters)) + (topic (nth 1 parameters))) (riece-channel-set-topic (riece-get-channel channel) topic) (let ((buffer (cdr (riece-identity-assoc-no-server (riece-make-identity channel) diff --git a/lisp/riece-misc.el b/lisp/riece-misc.el index bad8928..b269572 100644 --- a/lisp/riece-misc.el +++ b/lisp/riece-misc.el @@ -35,8 +35,8 @@ (defun riece-get-buffer-create (name) (let ((buffer (get-buffer-create name))) - (or (memq buffer riece-buffer-list) - (push buffer riece-buffer-list)) + (unless (memq buffer riece-buffer-list) + (setq riece-buffer-list (cons buffer riece-buffer-list))) buffer)) (defun riece-insert (buffers string) @@ -173,7 +173,7 @@ (mapatoms (lambda (atom) (unless (riece-channel-p (symbol-name atom)) - (push (symbol-name atom) users))) + (setq users (cons (symbol-name atom) users)))) riece-obarray) (if (member riece-real-nickname users) users diff --git a/lisp/riece-server.el b/lisp/riece-server.el index 4762802..4d5b244 100644 --- a/lisp/riece-server.el +++ b/lisp/riece-server.el @@ -97,11 +97,11 @@ is running on." (service (match-string 2 string)) (password (substring string (match-end 0))) plist) - (push `(:host ,host) plist) + (setq plist (cons `(:host ,host) plist)) (unless (equal service "") - (push `(:service ,(string-to-int service)) plist)) + (setq plist (cons `(:service ,(string-to-int service)) plist))) (unless (equal password "") - (push `(:password ,(substring password 1)) plist)) + (setq plist (cons `(:password ,(substring password 1)) plist))) (apply #'nconc plist)))) (defun riece-server-name-to-server (server-name) @@ -109,9 +109,9 @@ is running on." (if entry (unless (listp (cdr entry)) (setcdr entry (riece-server-parse-string (cdr entry)))) - (setq entry (cons server-name (riece-server-parse-string server-name))) - (push entry riece-server-alist) - (setq riece-save-variables-are-dirty t)) + (setq entry (cons server-name (riece-server-parse-string server-name)) + riece-server-alist (cons entry riece-server-alist) + riece-save-variables-are-dirty t)) (cdr entry))) (defun riece-open-server (server server-name) diff --git a/lisp/riece.el b/lisp/riece.el index c6debe9..75888f0 100644 --- a/lisp/riece.el +++ b/lisp/riece.el @@ -119,12 +119,14 @@ If optional argument SAFE is nil, overwrite previous definitions." (setq keymap (symbol-value (car keymap))))) (let (key) (while plist - (when (symbolp (setq key (pop plist))) - (setq key (symbol-value key))) + (if (symbolp (setq key (car plist))) + (setq key (symbol-value key))) + (setq plist (cdr plist)) (if (or (not safe) (eq (lookup-key keymap key) 'undefined)) - (define-key keymap key (pop plist)) - (pop plist))))) + (define-key keymap key (car plist)) + (car plist)) + (setq plist (cdr plist))))) (when t (riece-define-keys riece-dialogue-mode-map @@ -428,11 +430,13 @@ Instead, these commands are available: (while pointer (if (setq entry (assq (car pointer) dependencies)) (setcar (cdr entry) (1+ (nth 1 entry))) - (push (list (car pointer) 1 nil) dependencies)) + (setq dependencies (cons (list (car pointer) 1 nil) + dependencies))) (setq pointer (cdr pointer))) (if (setq entry (assq (car addons) dependencies)) (setcar (nthcdr 2 entry) requires) - (push (list (car addons) 0 requires) dependencies))) + (setq dependencies (cons (list (car addons) 0 requires) + dependencies)))) (setq addons (cdr addons))) dependencies)) @@ -441,14 +445,14 @@ Instead, these commands are available: (pointer dependencies) queue) (while pointer - (when (zerop (nth 1 (car pointer))) - (setq dependencies (delq (car pointer) dependencies)) - (push (car pointer) queue)) + (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 - (push (car (car queue)) addons) - (setq pointer (nth 2 (car queue))) + (setq addons (cons (car (car queue)) addons) + pointer (nth 2 (car queue))) (while pointer (let* ((entry (assq (car pointer) dependencies)) (count (1- (nth 1 entry)))) -- 1.7.10.4