From: ueno Date: Thu, 5 Oct 2000 14:30:34 +0000 (+0000) Subject: * wl-thread.el: Don't use `mapcar' only for iteration. X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=5f2e1682cff97352b6c2762a2a8d96f09d25c1e5;p=elisp%2Fwanderlust.git * wl-thread.el: Don't use `mapcar' only for iteration. (wl-thread-resume-entity): Ditto. (wl-thread-delete-message): Ditto. * wl-summary.el: Bind `dragdrop-drop-functions', `scrollbar-height' and `mail-reply-buffer'; specify 3rd argument of `require' for `timezone', `easymenu' and `ps-print'; don't use `mapcar' only for iteration. * wl-util.el: Bind `mule-version', `nemacs-version', `emacs-beta-version', `xemacs-codename', `mime-edit-insert-user-agent-field', `mime-edit-user-agent-value', `mime-editor/version' and `mime-editor/codename'; specify 3rd argument of `require' for `tm-edit' and `pp'; don't use `mapcar' only for iteration. * wl-score.el: Don't use `mapcar' only for iteration. (wl-score-simplify-buffer-fuzzy): Ditto. (wl-score-simplify-subject): Ditto. (wl-score-headers): Ditto. (wl-summary-score-update-all-lines): Ditto. * wl-mime.el: Bind `xemacs-betaname', `xemacs-codename', `enable-multibyte-characters' and `mule-version'. * wl-message.el: Bind `mmelmo-imap4-skipped-parts'; don't use `mapcar' only for iteration. * wl-demo.el: Don't use `mapcar' only for iteration. * wl-folder.el: Don't use `mapcar' only for iteration. (wl-folder-open-all): Ditto. (wl-folder-count-incorporates): Ditto. * wl-fldmgr.el (wl-add-entity): Don't use `mapcar' only for iteration. (wl-add-entity-sub): Ditto; use `delq' instead of `delete'. * wl-draft.el: Bind `x-face-add-x-face-version-header', `mail-reply-buffer', `mail-from-style', `smtp-authenticate-*' and `smtp-connection-type'; specify 3rd argument of `require' for `timezone'; don't use `mapcar' only for iteration. (wl-draft-clone-local-variables): Don't use `mapcar'. (wl-draft-generate-clone-buffer): Ditto. (wl-user-agent-compose-internal): Ditto. * wl-xmas.el (wl-folder-init-icons): Use `dolist' instead of `mapcar'. * wl.el (wl-toggle-plugged): Don't use `mapcar' only for iteration. (wl-save-status): Ditto. * wl-address.el (wl-local-address-init): Don't use `mapcar' only for iteration. --- diff --git a/wl/ChangeLog b/wl/ChangeLog index acf42e4..13090ad 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -3,6 +3,61 @@ * wl-demo.el (wl-demo): Don't pass by the XEmacs routine when window system is not used. +2000-10-04 Daiki Ueno + + * wl-thread.el: Don't use `mapcar' only for iteration. + (wl-thread-resume-entity): Ditto. + (wl-thread-delete-message): Ditto. + + * wl-summary.el: Bind `dragdrop-drop-functions', + `scrollbar-height' and `mail-reply-buffer'; specify 3rd argument + of `require' for `timezone', `easymenu' and `ps-print'; + don't use `mapcar' only for iteration. + + * wl-util.el: Bind `mule-version', `nemacs-version', + `emacs-beta-version', `xemacs-codename', + `mime-edit-insert-user-agent-field', `mime-edit-user-agent-value', + `mime-editor/version' and `mime-editor/codename'; specify 3rd + argument of `require' for `tm-edit' and `pp'; don't use `mapcar' + only for iteration. + + * wl-score.el: Don't use `mapcar' only for iteration. + (wl-score-simplify-buffer-fuzzy): Ditto. + (wl-score-simplify-subject): Ditto. + (wl-score-headers): Ditto. + (wl-summary-score-update-all-lines): Ditto. + + * wl-mime.el: Bind `xemacs-betaname', `xemacs-codename', + `enable-multibyte-characters' and `mule-version'. + + * wl-message.el: Bind `mmelmo-imap4-skipped-parts'; don't use + `mapcar' only for iteration. + + * wl-demo.el: Don't use `mapcar' only for iteration. + + * wl-folder.el: Don't use `mapcar' only for iteration. + (wl-folder-open-all): Ditto. + (wl-folder-count-incorporates): Ditto. + + * wl-fldmgr.el (wl-add-entity): Don't use `mapcar' only for iteration. + (wl-add-entity-sub): Ditto; use `delq' instead of `delete'. + + * wl-draft.el: Bind `x-face-add-x-face-version-header', + `mail-reply-buffer', `mail-from-style', `smtp-authenticate-*' and + `smtp-connection-type'; specify 3rd argument of `require' for + `timezone'; don't use `mapcar' only for iteration. + (wl-draft-clone-local-variables): Don't use `mapcar'. + (wl-draft-generate-clone-buffer): Ditto. + (wl-user-agent-compose-internal): Ditto. + + * wl-xmas.el (wl-folder-init-icons): Use `dolist' instead of `mapcar'. + + * wl.el (wl-toggle-plugged): Don't use `mapcar' only for iteration. + (wl-save-status): Ditto. + + * wl-address.el (wl-local-address-init): Don't use `mapcar' only + for iteration. + 2000-10-04 Yuuichi Teranishi * wl-vars.el (wl-summary-pick-field-default): Added `Last', `First' and diff --git a/wl/wl-address.el b/wl/wl-address.el index 799349f..e74ccb7 100644 --- a/wl/wl-address.el +++ b/wl/wl-address.el @@ -470,13 +470,12 @@ Matched address lists are append to CL." (append wl-address-completion-list (wl-address-make-alist-from-alias-file wl-alias-file)))) (setq wl-address-petname-hash (elmo-make-hash)) - (mapcar - (function - (lambda (x) - (elmo-set-hash-val (downcase (car x)) - (cadr x) - wl-address-petname-hash))) - wl-address-list) + (let ((addresses wl-address-list)) + (while addresses + (elmo-set-hash-val (downcase (car (car addresses))) + (cadr (car addresses)) + wl-address-petname-hash) + (setq addresses (cdr addresses)))) (message "Updating addresses...done.")) diff --git a/wl/wl-demo.el b/wl/wl-demo.el index 1bb3d27..68edb42 100644 --- a/wl/wl-demo.el +++ b/wl/wl-demo.el @@ -38,15 +38,26 @@ ;; Avoid byte compile warnings. (eval-when-compile - (mapcar - (function (lambda (fn) (or (fboundp fn) (fset fn 'ignore)))) - '(bitmap-compose - bitmap-decode-xbm bitmap-read-xbm-buffer bitmap-read-xbm-file - create-image device-on-window-system-p display-graphic-p - frame-char-height frame-char-width frame-parameter - image-type-available-p insert-image make-extent make-glyph - set-extent-end-glyph set-glyph-face set-specifier tool-bar-mode - window-pixel-height window-pixel-width))) + (defalias-maybe 'bitmap-compose 'ignore) + (defalias-maybe 'bitmap-decode-xbm 'ignore) + (defalias-maybe 'bitmap-read-xbm-buffer 'ignore) + (defalias-maybe 'bitmap-read-xbm-file 'ignore) + (defalias-maybe 'create-image 'ignore) + (defalias-maybe 'device-on-window-system-p 'ignore) + (defalias-maybe 'display-graphic-p 'ignore) + (defalias-maybe 'frame-char-height 'ignore) + (defalias-maybe 'frame-char-width 'ignore) + (defalias-maybe 'frame-parameter 'ignore) + (defalias-maybe 'image-type-available-p 'ignore) + (defalias-maybe 'insert-image 'ignore) + (defalias-maybe 'make-extent 'ignore) + (defalias-maybe 'make-glyph 'ignore) + (defalias-maybe 'set-extent-end-glyph 'ignore) + (defalias-maybe 'set-glyph-face 'ignore) + (defalias-maybe 'set-specifier 'ignore) + (defalias-maybe 'tool-bar-mode 'ignore) + (defalias-maybe 'window-pixel-height 'ignore) + (defalias-maybe 'window-pixel-width 'ignore)) ;; ;; demo ;-) diff --git a/wl/wl-draft.el b/wl/wl-draft.el index 75e9bab..a2c946d 100644 --- a/wl/wl-draft.el +++ b/wl/wl-draft.el @@ -32,31 +32,24 @@ (require 'sendmail) (require 'wl-template) (require 'emu) -(if (module-installed-p 'timezone) - (require 'timezone)) +(require 'timezone nil 'noerror) (require 'std11) (require 'wl-vars) +(defvar x-face-add-x-face-version-header) +(defvar mail-reply-buffer) +(defvar mail-from-style) +(defvar smtp-authenticate-type) +(defvar smtp-authenticate-user) +(defvar smtp-authenticate-passphrase) +(defvar smtp-connection-type) + (eval-when-compile - (require 'smtp) (require 'elmo-pop3) - (mapcar - (function - (lambda (symbol) - (unless (boundp symbol) - (set (make-local-variable symbol) nil)))) - '(x-face-add-x-face-version-header - mail-reply-buffer - mail-from-style - smtp-authenticate-type - smtp-authenticate-user - smtp-authenticate-passphrase - smtp-connection-type - )) - (defun-maybe x-face-insert (a)) - (defun-maybe x-face-insert-version-header ()) - (defun-maybe wl-init (&optional a)) - (defun-maybe wl-draft-mode ())) + (defalias-maybe 'x-face-insert 'ignore) + (defalias-maybe 'x-face-insert-version-header 'ignore) + (defalias-maybe 'wl-init 'ignore) + (defalias-maybe 'wl-draft-mode 'ignore)) (defvar wl-draft-buf-name "Draft") (defvar wl-caesar-region-func nil) @@ -1098,16 +1091,13 @@ non-nil." (defun wl-draft-clone-local-variables () (let ((locals (buffer-local-variables)) result) - (mapcar - (function - (lambda (local) - (when (and (consp local) - (car local) - (string-match - wl-draft-clone-local-variable-regexp - (symbol-name (car local)))) - (wl-append result (list (car local)))))) - locals) + (while locals + (when (and (consp (car locals)) + (car (car locals)) + (string-match wl-draft-clone-local-variable-regexp + (symbol-name (car (car locals))))) + (wl-append result (list (car (car locals))))) + (setq locals (cdr locals))) result)) (defun wl-draft-send (&optional kill-when-done mes-string) @@ -1462,15 +1452,13 @@ If optional argument is non-nil, current draft buffer is killed" (wl-draft-editor-mode) (insert-buffer editing-buffer) (message "") - (when local-variables - (mapcar - (function - (lambda (var) - (make-local-variable var) - (set var (save-excursion - (set-buffer editing-buffer) - (symbol-value var))))) - local-variables)) + (while local-variables + (make-local-variable (car local-variables)) + (set (car local-variables) + (save-excursion + (set-buffer editing-buffer) + (symbol-value (car local-variables)))) + (setq local-variables (cdr local-variables))) (current-buffer)))) (defun wl-draft-reedit (number) @@ -2004,16 +1992,15 @@ been implemented yet. Partial support for SWITCH-FUNCTION now supported." (if wl-user-agent-compose-p (progn ;; insert headers - (let ((case-fold-search t)) - (mapcar - (lambda (x) - (let ((header-name (car x)) - (header-value (cdr x))) - ;; skip body - (if (not (string-match "^body$" header-name)) - (wl-user-agent-insert-header header-name header-value) - t))) - wl-user-agent-headers-and-body-alist)) + (let ((headers wl-user-agent-headers-and-body-alist) + (case-fold-search t)) + (while headers + ;; skip body + (if (not (string-match "^body$" (car (car headers)))) + (wl-user-agent-insert-header + (car (car headers)) (cdr (car headers))) + t) + (setq headers (cdr headers)))) ;; highlight headers (from wl-draft in wl-draft.el) (let (wl-highlight-x-face-func) (wl-highlight-headers)) diff --git a/wl/wl-fldmgr.el b/wl/wl-fldmgr.el index bb52df7..f74a104 100644 --- a/wl/wl-fldmgr.el +++ b/wl/wl-fldmgr.el @@ -350,13 +350,10 @@ return value is diffs '(-new -unread -all)." (defun wl-add-entity (key-path new entity prev-entity-id &optional errmes) (when (string= (caar key-path) (car entity)) - (mapcar - '(lambda (ent) + (let ((entities new)) + (while entities (wl-folder-entity-assign-id - ent - wl-folder-entity-id-name-hashtb - t)) - new) + (pop entities) wl-folder-entity-id-name-hashtb t))) (when (wl-add-entity-sub (cdr key-path) new entity errmes) ;; return value is non-nil (diffs) (wl-fldmgr-add-entity-hashtb new)))) @@ -402,20 +399,15 @@ return value is diffs '(-new -unread -all)." ;; do it (when access ;; remove from unsubscribe - (mapcar - '(lambda (x) - (cond - ((consp x) + (setq new2 new) + (while new2 + (if (consp (car new2)) (setq unsubscribes - (delete (wl-string-assoc (car x) unsubscribes) - unsubscribes))) - (t - (setq unsubscribes (delete (elmo-string x) unsubscribes))))) - new) -;; (setq new2 new) -;; (while new2 -;; (setq unsubscribes (delete (elmo-string (car new2)) unsubscribes)) -;; (setq new2 (cdr new2))) + (delq (wl-string-assoc (car (car new2)) unsubscribes) + unsubscribes)) + (setq unsubscribes (delete (elmo-string (car new2)) + unsubscribes))) + (setq new2 (cdr new2))) (setcdr (cddr entity) (list unsubscribes)) (wl-fldmgr-add-modified-access-list group)) (if (not key-path);; insert group top diff --git a/wl/wl-folder.el b/wl/wl-folder.el index 9038b8e..7449e88 100644 --- a/wl/wl-folder.el +++ b/wl/wl-folder.el @@ -66,12 +66,10 @@ (defvar wl-folder-buffer-cur-path nil) (defvar wl-folder-buffer-cur-point nil) -(mapcar - (function make-variable-buffer-local) - (list 'wl-folder-buffer-disp-summary - 'wl-folder-buffer-cur-entity-id - 'wl-folder-buffer-cur-path - 'wl-folder-buffer-cur-point)) +(make-variable-buffer-local 'wl-folder-buffer-disp-summary) +(make-variable-buffer-local 'wl-folder-buffer-cur-entity-id) +(make-variable-buffer-local 'wl-folder-buffer-cur-path) +(make-variable-buffer-local 'wl-folder-buffer-cur-point) (defconst wl-folder-entity-regexp "^\\([ ]*\\)\\(\\[[\\+-]\\]\\)?\\([^\\[].+\\):[-*0-9]+/[-*0-9]+/[-*0-9]+") (defconst wl-folder-group-regexp "^\\([ ]*\\)\\[\\([\\+-]\\)\\]\\(.+\\):[-0-9-]+/[0-9-]+/[0-9-]+\n") @@ -2329,10 +2327,10 @@ Entering Folder mode calls the value of `wl-folder-mode-hook'." (if refresh (let ((id (progn (wl-folder-prev-entity-skip-invalid t) - (wl-folder-get-entity-from-buffer t)))) - (mapcar '(lambda (x) - (setcdr x t)) - wl-folder-group-alist) + (wl-folder-get-entity-from-buffer t))) + (alist wl-folder-group-alist)) + (while alist + (setcdr (pop alist) t)) (erase-buffer) (wl-folder-insert-entity " " wl-folder-entity) (wl-folder-move-path id)) @@ -2558,12 +2556,13 @@ Entering Folder mode calls the value of `wl-folder-mode-hook'." (cons 0 0)))))) (defun wl-folder-count-incorporates (folder) - (let ((sum 0)) - (mapcar '(lambda (x) - (if (member (cadr x) - wl-summary-incorporate-marks) - (incf sum))) - (elmo-msgdb-mark-load (elmo-msgdb-expand-path folder))) + (let ((marks (elmo-msgdb-mark-load (elmo-msgdb-expand-path folder))) + (sum 0)) + (while marks + (if (member (cadr (car marks)) + wl-summary-incorporate-marks) + (incf sum)) + (setq marks (cdr marks))) sum)) (defun wl-folder-prefetch-current-entity (&optional no-check) diff --git a/wl/wl-message.el b/wl/wl-message.el index d080cfb..1be2f4d 100644 --- a/wl/wl-message.el +++ b/wl/wl-message.el @@ -39,16 +39,10 @@ (require 'mime-view) (require 'mmelmo-imap4)) (require 'tm-wl)) - (mapcar - (function - (lambda (symbol) - (unless (boundp symbol) - (set (make-local-variable symbol) nil)))) - '(mmelmo-imap4-skipped-parts)) - (defun-maybe event-window (a)) - (defun-maybe posn-window (a)) - (defun-maybe event-start (a)) - (defun-maybe mime-open-entity (a b))) + (defalias-maybe 'event-window 'ignore) + (defalias-maybe 'posn-window 'ignore) + (defalias-maybe 'event-start 'ignore) + (defalias-maybe 'mime-open-entity 'ignore)) (defvar wl-original-buf-name "*Message*") (defvar wl-message-buf-name "Message") @@ -60,10 +54,10 @@ (defvar wl-original-buffer-cur-number nil) (defvar wl-original-buffer-cur-msgdb nil) -(mapcar - (function make-variable-buffer-local) - (list 'wl-message-buffer-cur-folder - 'wl-message-buffer-cur-number)) +(defvar mmelmo-imap4-skipped-parts) + +(make-variable-buffer-local 'wl-message-buffer-cur-folder) +(make-variable-buffer-local 'wl-message-buffer-cur-number) (provide 'wl-message) diff --git a/wl/wl-mime.el b/wl/wl-mime.el index abed57e..a32e27a 100644 --- a/wl/wl-mime.el +++ b/wl/wl-mime.el @@ -35,16 +35,12 @@ (require 'mmelmo) (eval-when-compile - (defun-maybe Meadow-version ()) - (mapcar - (function - (lambda (symbol) - (unless (boundp symbol) - (set (make-local-variable symbol) nil)))) - '(xemacs-betaname - xemacs-codename - enable-multibyte-characters - mule-version))) + (defalias-maybe 'Meadow-version 'ignore)) + +(defvar xemacs-betaname) +(defvar xemacs-codename) +(defvar enable-multibyte-characters) +(defvar mule-version) ;;; Draft diff --git a/wl/wl-score.el b/wl/wl-score.el index 4cef66f..96d2a10 100644 --- a/wl/wl-score.el +++ b/wl/wl-score.el @@ -36,6 +36,8 @@ (eval-when-compile (provide 'elmo-msgdb)) +(eval-when-compile (require 'cl)) ; dolist + (defvar wl-score-edit-header-char '((?a "from" nil string) (?s "subject" nil string) @@ -104,10 +106,8 @@ (defvar wl-score-edit-exit-func nil "Function run on exit from the score buffer.") -(mapcar - (function make-variable-buffer-local) - (list 'wl-current-score-file - 'wl-score-alist)) +(make-variable-buffer-local 'wl-current-score-file) +(make-variable-buffer-local 'wl-score-alist) ;; Utility functions @@ -118,18 +118,16 @@ It is assumed to be a single-line subject. Whitespace is generally cleaned up, and miscellaneous leading/trailing matter is removed. Additional things can be deleted by setting wl-score-simplify-fuzzy-regexp." - (let ((case-fold-search t) - (modified-tick)) + (let ((regexp + (if (listp wl-score-simplify-fuzzy-regexp) + (regexp-or wl-score-simplify-fuzzy-regexp) + wl-score-simplify-fuzzy-regexp)) + (case-fold-search t) + modified-tick) (elmo-buffer-replace "\t" " ") (while (not (eq modified-tick (buffer-modified-tick))) (setq modified-tick (buffer-modified-tick)) - (cond - ((listp wl-score-simplify-fuzzy-regexp) - (mapcar 'elmo-buffer-replace - wl-score-simplify-fuzzy-regexp)) - (wl-score-simplify-fuzzy-regexp - (elmo-buffer-replace - wl-score-simplify-fuzzy-regexp))) + (elmo-buffer-replace regexp) (elmo-buffer-replace "^ *\\[[-+?*!][-+?*!]\\] *") (elmo-buffer-replace "^ *\\(re\\|fw\\|fwd\\|forward\\)[[{(^0-9]*[])}]?[:;] *") @@ -150,15 +148,13 @@ See `wl-score-simplify-buffer-fuzzy' for details." (defun wl-score-simplify-subject (subject) (elmo-set-work-buf - (let ((case-fold-search t)) + (let ((regexp + (if (listp wl-score-simplify-fuzzy-regexp) + (regexp-or wl-score-simplify-fuzzy-regexp) + wl-score-simplify-fuzzy-regexp)) + (case-fold-search t)) (insert subject) - (cond - ((listp wl-score-simplify-fuzzy-regexp) - (mapcar 'elmo-buffer-replace - wl-score-simplify-fuzzy-regexp)) - (wl-score-simplify-fuzzy-regexp - (elmo-buffer-replace - wl-score-simplify-fuzzy-regexp))) + (elmo-buffer-replace regexp) (elmo-buffer-replace "^[ \t]*\\(re\\|was\\|fw\\|fwd\\|forward\\)[:;][ \t]*") (buffer-string)))) @@ -466,8 +462,9 @@ See `wl-score-simplify-buffer-fuzzy' for details." (setq wl-scores-messages (cdr wl-scores-messages)))) (message "Scoring...done") ;; Remove buffers. - (mapcar '(lambda (x) (elmo-kill-buffer x)) - wl-score-header-buffer-list) + (let ((buffers wl-score-header-buffer-list)) + (while buffers + (elmo-kill-buffer (pop buffers)))) (setq wl-score-header-buffer-list nil))) (defun wl-score-integer (scores header now expire) @@ -1261,10 +1258,8 @@ See `wl-score-simplify-buffer-fuzzy' for details." ; dels wl-summary-buffer-msgdb t) ;; mark as read. (setq mark-alist (elmo-msgdb-get-mark-alist wl-summary-buffer-msgdb)) - (mapcar (function (lambda (x) - (setq mark-alist - (elmo-msgdb-mark-set mark-alist x nil)))) - dels) + (dolist (del dels) + (setq mark-alist (elmo-msgdb-mark-set mark-alist del nil))) (elmo-mark-as-read wl-summary-buffer-folder-name dels wl-summary-buffer-msgdb) (elmo-msgdb-set-mark-alist wl-summary-buffer-msgdb mark-alist) diff --git a/wl/wl-summary.el b/wl/wl-summary.el index 6477b3b..f2d04e8 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -36,32 +36,24 @@ (require 'wl-highlight) (require 'wl-refile) (require 'wl-util) -(condition-case () - (progn - (require 'timezone) - (require 'easymenu)) - (error)) +(require 'timezone nil 'noerror) +(require 'easymenu nil 'noerror) (require 'elmo-date) - -(condition-case nil - (require 'ps-print) - (error)) +(require 'ps-print nil 'noerror) (eval-when-compile (require 'cl) (condition-case () (require 'timer) (error nil)) - (mapcar - (function - (lambda (symbol) - (unless (boundp symbol) - (set (make-local-variable symbol) nil)))) - '(dragdrop-drop-functions scrollbar-height mail-reply-buffer)) - (defun-maybe ps-print-buffer-with-faces (a)) - (defun-maybe elmo-database-msgid-put (a b c)) - (defun-maybe elmo-database-close ()) - (defun-maybe elmo-database-msgid-get (a)) - (defun-maybe run-with-idle-timer (secs repeat function &rest args)) - (defun-maybe ps-print-preprint (a))) + (defalias-maybe 'ps-print-buffer-with-faces 'ignore) + (defalias-maybe 'elmo-database-msgid-put 'ignore) + (defalias-maybe 'elmo-database-close 'ignore) + (defalias-maybe 'elmo-database-msgid-get 'ignore) + (defalias-maybe 'run-with-idle-timer 'ignore) + (defalias-maybe 'ps-print-preprint 'ignore)) + +(defvar dragdrop-drop-functions) +(defvar scrollbar-height) +(defvar mail-reply-buffer) (defvar wl-summary-buffer-name "Summary") (defvar wl-summary-mode-map nil) @@ -120,51 +112,49 @@ (defvar wl-ps-preprint-hook nil) (defvar wl-ps-print-hook nil) -(mapcar - (function make-variable-buffer-local) - (list 'wl-summary-buffer-msgdb - 'wl-summary-buffer-disp-msg - 'wl-summary-buffer-disp-folder - 'wl-summary-buffer-refile-list - 'wl-summary-buffer-copy-list - 'wl-summary-buffer-target-mark-list - 'wl-summary-buffer-delete-list - 'wl-summary-buffer-folder-name - 'wl-summary-buffer-folder-indicator - 'wl-summary-buffer-last-displayed-msg - 'wl-summary-buffer-unread-status - 'wl-summary-buffer-unread-count - 'wl-summary-buffer-new-count - 'wl-summary-buffer-mime-charset - 'wl-summary-buffer-weekday-name-lang - 'wl-summary-buffer-thread-indent-set - 'wl-summary-buffer-message-redisplay-func - 'wl-summary-buffer-view - 'wl-summary-buffer-message-modified - 'wl-summary-buffer-mark-modified - 'wl-summary-buffer-thread-modified - 'wl-summary-buffer-number-column - 'wl-summary-buffer-number-regexp - 'wl-summary-buffer-persistent - 'wl-summary-buffer-thread-nodes - 'wl-summary-buffer-prev-refile-destination - 'wl-summary-buffer-saved-message - 'wl-summary-scored - 'wl-summary-default-score - 'wl-summary-move-direction-downward - 'wl-summary-important-above - 'wl-summary-target-above - 'wl-summary-mark-below - 'wl-summary-expunge-below - 'wl-thread-indent-level-internal - 'wl-thread-have-younger-brother-str-internal - 'wl-thread-youngest-child-str-internal - 'wl-thread-vertical-str-internal - 'wl-thread-horizontal-str-internal - 'wl-thread-space-str-internal - 'wl-summary-buffer-prev-folder-func - 'wl-summary-buffer-next-folder-func - 'wl-summary-buffer-exit-func)) +(make-variable-buffer-local 'wl-summary-buffer-msgdb) +(make-variable-buffer-local 'wl-summary-buffer-disp-msg) +(make-variable-buffer-local 'wl-summary-buffer-disp-folder) +(make-variable-buffer-local 'wl-summary-buffer-refile-list) +(make-variable-buffer-local 'wl-summary-buffer-copy-list) +(make-variable-buffer-local 'wl-summary-buffer-target-mark-list) +(make-variable-buffer-local 'wl-summary-buffer-delete-list) +(make-variable-buffer-local 'wl-summary-buffer-folder-name) +(make-variable-buffer-local 'wl-summary-buffer-folder-indicator) +(make-variable-buffer-local 'wl-summary-buffer-last-displayed-msg) +(make-variable-buffer-local 'wl-summary-buffer-unread-status) +(make-variable-buffer-local 'wl-summary-buffer-unread-count) +(make-variable-buffer-local 'wl-summary-buffer-new-count) +(make-variable-buffer-local 'wl-summary-buffer-mime-charset) +(make-variable-buffer-local 'wl-summary-buffer-weekday-name-lang) +(make-variable-buffer-local 'wl-summary-buffer-thread-indent-set) +(make-variable-buffer-local 'wl-summary-buffer-message-redisplay-func) +(make-variable-buffer-local 'wl-summary-buffer-view) +(make-variable-buffer-local 'wl-summary-buffer-message-modified) +(make-variable-buffer-local 'wl-summary-buffer-mark-modified) +(make-variable-buffer-local 'wl-summary-buffer-thread-modified) +(make-variable-buffer-local 'wl-summary-buffer-number-column) +(make-variable-buffer-local 'wl-summary-buffer-number-regexp) +(make-variable-buffer-local 'wl-summary-buffer-persistent) +(make-variable-buffer-local 'wl-summary-buffer-thread-nodes) +(make-variable-buffer-local 'wl-summary-buffer-prev-refile-destination) +(make-variable-buffer-local 'wl-summary-buffer-saved-message) +(make-variable-buffer-local 'wl-summary-scored) +(make-variable-buffer-local 'wl-summary-default-score) +(make-variable-buffer-local 'wl-summary-move-direction-downward) +(make-variable-buffer-local 'wl-summary-important-above) +(make-variable-buffer-local 'wl-summary-target-above) +(make-variable-buffer-local 'wl-summary-mark-below) +(make-variable-buffer-local 'wl-summary-expunge-below) +(make-variable-buffer-local 'wl-thread-indent-level-internal) +(make-variable-buffer-local 'wl-thread-have-younger-brother-str-internal) +(make-variable-buffer-local 'wl-thread-youngest-child-str-internal) +(make-variable-buffer-local 'wl-thread-vertical-str-internal) +(make-variable-buffer-local 'wl-thread-horizontal-str-internal) +(make-variable-buffer-local 'wl-thread-space-str-internal) +(make-variable-buffer-local 'wl-summary-buffer-prev-folder-func) +(make-variable-buffer-local 'wl-summary-buffer-next-folder-func) +(make-variable-buffer-local 'wl-summary-buffer-exit-func) ;; internal functions (dummy) (unless (fboundp 'wl-summary-append-message-func-internal) @@ -1544,27 +1534,28 @@ If optional argument is non-nil, checking is omitted." (delete-region (match-beginning 1) (match-end 1)) (insert " "))))) +(defun wl-summary-delete-marks-on-buffer (marks) + (while marks + (wl-summary-unmark (pop marks)))) + (defun wl-summary-delete-copy-marks-on-buffer (copies) - (mapcar (function - (lambda (x) - (wl-summary-unmark x))) - copies)) + (wl-summary-delete-marks-on-buffer copies)) (defun wl-summary-delete-all-refile-marks () - (mapcar (function - (lambda (x) - (wl-summary-unmark (car x)))) wl-summary-buffer-refile-list)) + (let ((marks wl-summary-buffer-refile-list)) + (while marks + (wl-summary-unmark (car (pop marks)))))) (defun wl-summary-delete-all-copy-marks () - (mapcar (function - (lambda (x) - (wl-summary-unmark (car x)))) wl-summary-buffer-copy-list)) + (let ((marks wl-summary-buffer-copy-list)) + (while marks + (wl-summary-unmark (car (pop marks)))))) (defun wl-summary-delete-all-delete-marks () - (mapcar 'wl-summary-unmark wl-summary-buffer-delete-list)) + (wl-summary-delete-marks-on-buffer wl-summary-buffer-delete-list)) (defun wl-summary-delete-all-target-marks () - (mapcar 'wl-summary-unmark wl-summary-buffer-target-mark-list)) + (wl-summary-delete-marks-on-buffer wl-summary-buffer-target-mark-list)) (defun wl-summary-delete-all-temp-marks-on-buffer (&optional sticky) ;; for summary view cache saving. @@ -2631,13 +2622,12 @@ If optional argument is non-nil, checking is omitted." (let ((buffer-read-only nil)) (insert-buffer cur-buf)) (set-buffer-modified-p nil) - (mapcar - (function - (lambda (var) - (set var (save-excursion - (set-buffer cur-buf) - (symbol-value var))))) - copy-variables) + (while copy-variables + (set (car copy-variables) + (save-excursion + (set-buffer cur-buf) + (symbol-value (car copy-variables)))) + (setq copy-variables (cdr copy-variables))) (switch-to-buffer buf) (kill-buffer cur-buf) (wl-summary-count-unread @@ -3600,25 +3590,25 @@ If optional argument NUMBER is specified, mark message specified by NUMBER." (message "Marking...%d message(s)." count)) (if (eq wl-summary-buffer-view 'thread) ;; process invisible children. - (if (not (wl-thread-entity-get-opened - (setq thr-entity (wl-thread-get-entity number)))) - (mapcar - (function - (lambda (x) - (when (and (setq dst - (wl-refile-guess-by-rule - (elmo-msgdb-overview-get-entity - x wl-summary-buffer-msgdb))) - (not (equal dst spec))) - (if (wl-summary-refile dst x) - (incf count)) - (message "Marking...%d message(s)." count)))) - (elmo-delete-if - (function (lambda (x) - (wl-summary-no-auto-refile-message-p - x - mark-alist))) - (wl-thread-entity-get-descendant thr-entity))))) + (unless (wl-thread-entity-get-opened + (setq thr-entity (wl-thread-get-entity number))) + (let ((messages + (elmo-delete-if + (function + (lambda (x) + (wl-summary-no-auto-refile-message-p + x mark-alist))) + (wl-thread-entity-get-descendant thr-entity)))) + (while messages + (when (and (setq dst + (wl-refile-guess-by-rule + (elmo-msgdb-overview-get-entity + (car messages) wl-summary-buffer-msgdb))) + (not (equal dst spec))) + (if (wl-summary-refile dst (car messages)) + (incf count)) + (message "Marking...%d message(s)." count)) + (setq messages (cdr messages)))))) (forward-line)) (if (eq count 0) (message "No message was marked.") @@ -3743,11 +3733,9 @@ If optional argument NUMBER is specified, mark message specified by NUMBER." ;; opened...refile line. (funcall function folder number) ;; closed - (mapcar - (function - (lambda (x) - (funcall function folder x))) - (wl-thread-get-children-msgs number))) + (setq children (wl-thread-get-children-msgs number)) + (while children + (funcall function folder (pop children)))) (forward-line 1)))) (while (not (eobp)) (funcall function folder (wl-summary-message-number)) @@ -3768,8 +3756,7 @@ If optional argument NUMBER is specified, mark message specified by NUMBER." ;; opened...unmark line. (wl-summary-unmark) ;; closed - (mapcar - 'wl-summary-unmark + (wl-summary-delete-marks-on-buffer (wl-thread-get-children-msgs number)))) (forward-line 1))) (while (not (eobp)) @@ -3786,14 +3773,15 @@ If optional argument NUMBER is specified, mark message specified by NUMBER." (while (not (eobp)) (let* ((number (wl-summary-message-number)) (entity (wl-thread-get-entity number)) - (wl-summary-move-direction-downward t)) + (wl-summary-move-direction-downward t) + children) (if (wl-thread-entity-get-opened entity) ;; opened...delete line. (funcall function number) ;; closed - (mapcar - function - (wl-thread-get-children-msgs number))) + (setq children (wl-thread-get-children-msgs number)) + (while children + (funcall function (pop children)))) (forward-line 1)))) (while (not (eobp)) (funcall function (wl-summary-message-number)) diff --git a/wl/wl-thread.el b/wl/wl-thread.el index abc3db6..f65d92a 100644 --- a/wl/wl-thread.el +++ b/wl/wl-thread.el @@ -32,6 +32,8 @@ (require 'wl-summary) (require 'wl-highlight) +(eval-when-compile (require 'cl)) ; dolist + ;; buffer local variables. ;(defvar wl-thread-top-entity '(nil t nil nil)) ; top entity (defvar wl-thread-tops nil) ; top number list (number) @@ -40,13 +42,11 @@ (defvar wl-thread-entity-hashtb nil) ; obarray (defvar wl-thread-indent-regexp nil) -(mapcar - (function make-variable-buffer-local) - (list 'wl-thread-entity-hashtb - 'wl-thread-entities ; -> ".wl-thread-entity" - 'wl-thread-entity-list ; -> ".wl-thread-entity-list" - 'wl-thread-entity-cur - 'wl-thread-indent-regexp)) +(make-variable-buffer-local 'wl-thread-entity-hashtb) +(make-variable-buffer-local 'wl-thread-entities) ; ".wl-thread-entity" +(make-variable-buffer-local 'wl-thread-entity-list) ; ".wl-thread-entity-list" +(make-variable-buffer-local 'wl-thread-entity-cur) +(make-variable-buffer-local 'wl-thread-indent-regexp) ;;; global flag (defvar wl-thread-insert-force-opened nil) @@ -109,12 +109,9 @@ (message "Resuming thread structure...") ;; set obarray value. (setq wl-thread-entity-hashtb (elmo-make-hash (* (length entities) 2))) - (mapcar - '(lambda (x) - (elmo-set-hash-val (format "#%d" (car x)) - x - wl-thread-entity-hashtb)) - entities) + (dolist (entity entities) + (elmo-set-hash-val (format "#%d" (car entity)) entity + wl-thread-entity-hashtb)) ;; set buffer local variables. (setq wl-thread-entities entities) (setq wl-thread-entity-list top-list) @@ -808,16 +805,15 @@ the closed parent will be opened." ;; (unless deep (setq children (wl-thread-entity-get-children entity)) - (mapcar '(lambda (x) - (wl-thread-entity-set-parent - (wl-thread-get-entity x) - (wl-thread-entity-get-number parent)) - (wl-thread-entity-set-linked - (wl-thread-get-entity x) - t) - (wl-append update-msgs - (wl-thread-get-children-msgs x t))) - children)) + (dolist (entity children) + (wl-thread-entity-set-parent + (wl-thread-get-entity entity) + (wl-thread-entity-get-number parent)) + (wl-thread-entity-set-linked + (wl-thread-get-entity entity) + t) + (wl-append update-msgs + (wl-thread-get-children-msgs entity t)))) (wl-thread-entity-set-children parent (append @@ -851,13 +847,11 @@ the closed parent will be opened." (append (wl-thread-entity-get-children top-entity) children)) - (mapcar - '(lambda (x) - (wl-thread-entity-set-parent (wl-thread-get-entity x) - top-child) - (wl-thread-entity-set-linked (wl-thread-get-entity x) - t)) - children) + (dolist (entity children) + (wl-thread-entity-set-parent (wl-thread-get-entity entity) + top-child) + (wl-thread-entity-set-linked (wl-thread-get-entity entity) + t)) (wl-append update-msgs children))) ;; delete myself from top list. (setq older-brothers (wl-thread-entity-get-older-brothers @@ -912,20 +906,18 @@ the closed parent will be opened." (if (setq ent (wl-thread-get-entity (car insert-msgs))) (wl-thread-entity-set-opened ent t)))) ;; insert children - (mapcar - '(lambda (x) - ;; if no exists in summary, insert entity. - (when (and x (not (wl-summary-jump-to-msg x))) - (setq ent (wl-thread-get-entity x)) - (wl-thread-insert-entity 0 ; no mean now... - ent entity nil))) - insert-msgs)))) - + (while insert-msgs + ;; if no exists in summary, insert entity. + (when (and (car insert-msgs) + (not (wl-summary-jump-to-msg (car insert-msgs)))) + (setq ent (wl-thread-get-entity (car insert-msgs))) + (wl-thread-insert-entity 0 ; no mean now... + ent entity nil)) + (setq insert-msgs (cdr insert-msgs)))))) (if update ;; modify buffer. - (mapcar '(lambda (x) - (wl-thread-update-line-on-buffer-sub nil x)) - update-msgs) + (while update-msgs + (wl-thread-update-line-on-buffer-sub nil (pop update-msgs))) ;; don't update buffer update-msgs)))) ; return value diff --git a/wl/wl-util.el b/wl/wl-util.el index 65ff486..bfa20af 100644 --- a/wl/wl-util.el +++ b/wl/wl-util.el @@ -33,35 +33,28 @@ (eval-when-compile (require 'elmo-util)) -(condition-case () - (require 'tm-edit) - (error)) -(condition-case () - (require 'pp) - (error)) +(require 'tm-edit nil 'noerror) +(require 'pp nil 'noerror) + +(defvar mule-version) +(defvar nemacs-version) +(defvar emacs-beta-version) +(defvar xemacs-codename) +(defvar mime-edit-insert-user-agent-field) +(defvar mime-edit-user-agent-value) +(defvar mime-editor/version) +(defvar mime-editor/codename) + (eval-when-compile - (mapcar - (function - (lambda (symbol) - (unless (boundp symbol) - (set (make-local-variable symbol) nil)))) - '(mule-version - nemacs-version - emacs-beta-version - xemacs-codename - mime-edit-insert-user-agent-field - mime-edit-user-agent-value - mime-editor/version - mime-editor/codename)) (require 'time-stamp) - (defun-maybe read-event ()) - (defun-maybe next-command-event ()) - (defun-maybe event-to-character (a)) - (defun-maybe key-press-event-p (a)) - (defun-maybe button-press-event-p (a)) - (defun-maybe set-process-kanji-code (a b)) - (defun-maybe set-process-coding-system (a b c)) - (defun-maybe dispatch-event (a))) + (defalias-maybe 'read-event 'ignore) + (defalias-maybe 'next-command-event 'ignore) + (defalias-maybe 'event-to-character 'ignore) + (defalias-maybe 'key-press-event-p 'ignore) + (defalias-maybe 'button-press-event-p 'ignore) + (defalias-maybe 'set-process-kanji-code 'ignore) + (defalias-maybe 'set-process-coding-system 'ignore) + (defalias-maybe 'dispatch-event 'ignore)) (defalias 'wl-set-work-buf 'elmo-set-work-buf) (make-obsolete 'wl-set-work-buf 'elmo-set-work-buf) diff --git a/wl/wl-xmas.el b/wl/wl-xmas.el index d7be9eb..c62c08c 100644 --- a/wl/wl-xmas.el +++ b/wl/wl-xmas.el @@ -35,7 +35,8 @@ (require 'wl-draft) (require 'wl-message) (require 'wl-highlight) - (defvar-maybe wl-draft-mode-map (make-sparse-keymap))) + (defvar-maybe wl-draft-mode-map (make-sparse-keymap)) + (defalias-maybe 'toolbar-make-button-list 'ignore)) (add-hook 'wl-folder-mode-hook 'wl-setup-folder) (add-hook 'wl-folder-mode-hook 'wl-folder-init-icons) @@ -372,12 +373,10 @@ (wl-folder-trash-glyph . wl-trash-folder-icon))) (defun wl-folder-init-icons () - (mapcar - (lambda (x) - (unless (get (car x) 'glyph) - (put (car x) 'glyph - (wl-xmas-make-icon-glyph "" (symbol-value (cdr x)))))) - wl-folder-internal-icon-list)) + (dolist (icon wl-folder-internal-icon-list) + (unless (get (car icon) 'glyph) + (put (car icon) 'glyph + (wl-xmas-make-icon-glyph "" (symbol-value (cdr icon))))))) (defun wl-plugged-init-icons () (unless wl-plugged-glyph diff --git a/wl/wl.el b/wl/wl.el index 46e8456..b5939ac 100644 --- a/wl/wl.el +++ b/wl/wl.el @@ -99,14 +99,12 @@ (setq elmo-plugged wl-plugged wl-modeline-plug-status wl-plugged) (save-excursion - (mapcar - (function - (lambda (x) - (set-buffer x) + (let ((summaries (wl-collect-summary))) + (while summaries + (set-buffer (pop summaries)) (wl-summary-msgdb-save) ;; msgdb is saved, but cache is not saved yet. - (wl-summary-set-message-modified))) - (wl-collect-summary))) + (wl-summary-set-message-modified)))) (setq wl-biff-check-folders-running nil) (if wl-plugged (progn @@ -606,16 +604,14 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'." (let (summary-buf) (save-excursion (let ((summaries (wl-collect-summary))) - (mapcar - (function - (lambda (x) - (set-buffer x) - (unless keep-summary - (wl-summary-cleanup-temp-marks)) - (wl-summary-save-status keep-summary) - (unless keep-summary - (kill-buffer x)))) - summaries)))) + (while summaries + (set-buffer (car summaries)) + (unless keep-summary + (wl-summary-cleanup-temp-marks)) + (wl-summary-save-status keep-summary) + (unless keep-summary + (kill-buffer (car summaries))) + (setq summaries (cdr summaries)))))) (wl-refile-alist-save) (wl-folder-info-save) (and (featurep 'wl-fldmgr) (wl-fldmgr-exit))