[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: elmo-use-database? (5/5)



@@ -841,15 +840,15 @@ Message is inserted to the summary buffer."
 	    (throw 'done t)))
       nil)))
 
-;; (defun wl-thread-goto-bottom-of-sub-thread ()
-;;   (interactive)
-;;   (let ((depth (wl-thread-get-depth-of-current-line)))
-;;     (forward-line 1)
-;;     (while (and (not (eobp))
-;; 		(> (wl-thread-get-depth-of-current-line)
-;; 		   depth))
-;;       (forward-line 1))
-;;     (beginning-of-line)))
+;;;(defun wl-thread-goto-bottom-of-sub-thread ()
+;;;  (interactive)
+;;;  (let ((depth (wl-thread-get-depth-of-current-line)))
+;;;    (forward-line 1)
+;;;    (while (and (not (eobp))
+;;; 		(> (wl-thread-get-depth-of-current-line)
+;;; 		   depth))
+;;;      (forward-line 1))
+;;;    (beginning-of-line)))
 
 (defun wl-thread-goto-bottom-of-sub-thread (&optional msg)
   (interactive)
@@ -944,8 +943,7 @@ Message is inserted to the summary buffer."
   (let (depth beg)
     (wl-thread-entity-set-opened entity nil)
     (setq depth (wl-thread-get-depth-of-current-line))
-    (beginning-of-line)
-    (setq beg (point))
+    (setq beg (point-at-bol))
     (wl-thread-goto-bottom-of-sub-thread)
     (wl-thread-remove-argument-region beg
 				      (point))
@@ -971,11 +969,9 @@ Message is inserted to the summary buffer."
 
 (defun wl-thread-open (entity)
   (let (depth beg)
-    (beginning-of-line)
-    (setq beg (point))
+    (setq beg (point-at-bol))
     (setq depth (wl-thread-get-depth-of-current-line))
-    (end-of-line)
-    (delete-region beg (point))
+    (delete-region (point-at-bol) (point-at-eol))
     (wl-thread-entity-set-opened entity t)
     (wl-thread-insert-entity depth ;(- depth 1)
 			     entity
@@ -998,7 +994,7 @@ Message is inserted to the summary buffer."
 (defun wl-thread-open-close (&optional force-open)
   (interactive "P")
   (when (eq wl-summary-buffer-view 'thread)
-;;; (if (equal wl-thread-top-entity '(nil t nil nil))
+;;;    (if (equal wl-thread-top-entity '(nil t nil nil))
 ;;;	(error "There's no thread structure"))
     (save-excursion
       (let ((inhibit-read-only t)
	Modified wl/wl-util.el
diff --git a/wl/wl-util.el b/wl/wl-util.el
index 3fdf251..1613ea1 100644
--- a/wl/wl-util.el
+++ b/wl/wl-util.el
@@ -118,7 +118,7 @@ If HACK-ADDRESSES is t, then the strings are considered to be mail addresses,
 		    (string-to-char (format "%s" (this-command-keys))))))
     (message "%s" mes-string)
     (setq key (car (setq keve (wl-read-event-char))))
-    (if (or (equal key ?\ )
+    (if (or (equal key (string-to-char " "))
 	    (and cmd
 		 (equal key cmd)))
 	(progn
@@ -131,14 +131,14 @@ If HACK-ADDRESSES is t, then the strings are considered to be mail addresses,
   (or (string= name wl-draft-folder)
       (string= name wl-queue-folder)))
 
-;(defalias 'wl-make-hash 'elmo-make-hash)
-;;(make-obsolete 'wl-make-hash 'elmo-make-hash)
+;;;(defalias 'wl-make-hash 'elmo-make-hash)
+;;;(make-obsolete 'wl-make-hash 'elmo-make-hash)
 
-;;(defalias 'wl-get-hash-val 'elmo-get-hash-val)
-;;(make-obsolete 'wl-get-hash-val 'elmo-get-hash-val)
+;;;(defalias 'wl-get-hash-val 'elmo-get-hash-val)
+;;;(make-obsolete 'wl-get-hash-val 'elmo-get-hash-val)
 
-;;(defalias 'wl-set-hash-val 'elmo-set-hash-val)
-;;(make-obsolete 'wl-set-hash-val 'elmo-set-hash-val)
+;;;(defalias 'wl-set-hash-val 'elmo-set-hash-val)
+;;;(make-obsolete 'wl-set-hash-val 'elmo-set-hash-val)
 
 (defsubst wl-set-string-width (width string &optional padding ignore-invalid)
   "Make a new string which have specified WIDTH and content of STRING.
@@ -163,7 +163,7 @@ even when invalid character is contained."
 					(abs width))))
       (let ((paddings (make-string
 		       (max 0 (- (abs width) (string-width string)))
-		       (or padding ?\ ))))
+		       (or padding (string-to-char " ")))))
 	(if (< width 0)
 	    (concat paddings string)
 	  (concat string paddings)))))
@@ -180,7 +180,7 @@ even when invalid character is contained."
      (if (= (current-column) (abs width))
 	 string
        (let ((paddings (make-string (- (abs width) (current-column))
-				    (or padding ?\ ))))
+				    (or padding (string-to-char " ")))))
 	 (if (< width 0)
 	     (concat paddings string)
 	   (concat string paddings))))))))
@@ -241,14 +241,14 @@ even when invalid character is contained."
 	(setq alist (cdr alist)))
       value)))
 
-(defmacro wl-match-string (pos string)
+(defun wl-match-string (pos string)
   "Substring POSth matched STRING."
-  `(substring ,string (match-beginning ,pos) (match-end ,pos)))
+  (substring string (match-beginning pos) (match-end pos)))
 
-(defmacro wl-match-buffer (pos)
+(defun wl-match-buffer (pos)
   "Substring POSth matched from the current buffer."
-  `(buffer-substring-no-properties
-    (match-beginning ,pos) (match-end ,pos)))
+  (buffer-substring-no-properties
+   (match-beginning pos) (match-end pos)))
 
 (put 'wl-as-coding-system 'lisp-indent-function 1)
 (put 'wl-as-mime-charset 'lisp-indent-function 1)
@@ -475,7 +475,7 @@ that `read' can handle, whenever this is possible."
 	      (setq fld-name nil))
 	  (if (eq (length (setq port
 				(elmo-match-string 2 url))) 0)
-	      (setq port (int-to-string elmo-nntp-default-port)))
+	      (setq port (number-to-string elmo-nntp-default-port)))
 	  (if (eq (length (setq server
 				(elmo-match-string 1 url))) 0)
 	      (setq server elmo-nntp-default-server))
@@ -504,25 +504,24 @@ that `read' can handle, whenever this is possible."
 		wl-summary-buffer-display-mime-mode
 		nil nil))))))
 
-(defmacro wl-kill-buffers (regexp)
-  `(mapcar (function
-	    (lambda (x)
-	      (if (and (buffer-name x)
-		       (string-match ,regexp (buffer-name x)))
-		  (and (get-buffer x)
-		       (kill-buffer x)))))
-	   (buffer-list)))
+(defun wl-kill-buffers (regexp)
+  (mapc
+   (lambda (x)
+     (if (and (buffer-name x)
+	      (string-match regexp (buffer-name x)))
+	 (and (get-buffer x)
+	      (kill-buffer x))))
+   (buffer-list)))
 
 (defun wl-collect-summary ()
   (let (result)
-    (mapcar
-     (function (lambda (x)
-		 (if (and (string-match "^Summary"
-					(buffer-name x))
-			  (save-excursion
-			    (set-buffer x)
-			    (equal major-mode 'wl-summary-mode)))
-		     (setq result (nconc result (list x))))))
+    (mapc
+     (lambda (x)
+       (if (and (string-match "^Summary"
+			      (buffer-name x))
+		(with-current-buffer x
+		  (eq major-mode 'wl-summary-mode)))
+	   (setq result (nconc result (list x)))))
      (buffer-list))
     result))
 
@@ -654,10 +653,8 @@ that `read' can handle, whenever this is possible."
 
 ;;;
 
-(defmacro wl-count-lines ()
-  '(save-excursion
-     (beginning-of-line)
-     (count-lines 1 (point))))
+(defsubst wl-count-lines ()
+  (count-lines 1 (point-at-bol)))
 
 (defun wl-horizontal-recenter ()
   "Recenter the current buffer horizontally."
@@ -1075,10 +1072,10 @@ is enclosed by at least one regexp grouping construct."
       (let ((default (format-time-string "%Y-%m-%d")))
 	(setq value (completing-read
 		     (format "Value for '%s' [%s]: " field default)
-		     (mapcar (function
-			      (lambda (x)
-				(list (format "%s" (car x)))))
-			     elmo-date-descriptions)))
+		     (mapcar
+		      (lambda (x)
+			(list (format "%s" (car x))))
+		      elmo-date-descriptions)))
 	(concat (downcase field) ":"
 		(if (equal value "") default value))))
      ((string-match "!?Flag" field)
@@ -1118,7 +1115,7 @@ is enclosed by at least one regexp grouping construct."
 		(cdr (wl-read-event-char prompt)))
 	  ((?y ?Y)
 	   (throw 'done t))
-	  (?\ 
+	  ((string-to-char " ")
 	   (if scroll-by-SPC
 	       (ignore-errors (scroll-up))
 	     (throw 'done t)))
	Modified wl/wl-xmas.el
diff --git a/wl/wl-xmas.el b/wl/wl-xmas.el
index baa55e2..3e62300 100644
--- a/wl/wl-xmas.el
+++ b/wl/wl-xmas.el
@@ -538,7 +538,7 @@ Special commands:
   (define-key wl-draft-mode-map "\C-c\C-e" 'wl-draft-config-exec)
   (define-key wl-draft-mode-map "\C-c\C-j" 'wl-template-select)
   (define-key wl-draft-mode-map "\C-c\C-p" 'wl-draft-preview-message)
-;;   (define-key wl-draft-mode-map "\C-x\C-s" 'wl-draft-save)
+;;;  (define-key wl-draft-mode-map "\C-x\C-s" 'wl-draft-save)
   (define-key wl-draft-mode-map "\C-c\C-a" 'wl-addrmgr)
   (define-key wl-draft-mode-map "\C-xk"    'wl-draft-mimic-kill-buffer)
   (define-key wl-draft-mode-map "\C-c\C-d" 'wl-draft-elide-region)
@@ -548,7 +548,7 @@ Special commands:
 
 (defun wl-draft-overload-functions ()
   (wl-mode-line-buffer-identification)
-  ;; (local-set-key "\C-c\C-s" 'wl-draft-send);; override
+;;;  (local-set-key "\C-c\C-s" 'wl-draft-send) ; override
   (wl-xmas-setup-draft-toolbar)
   (wl-draft-overload-menubar))
 
	Modified wl/wl.el
diff --git a/wl/wl.el b/wl/wl.el
index ccc8269..300e144 100644
--- a/wl/wl.el
+++ b/wl/wl.el
@@ -119,14 +119,14 @@
 	(if (and wl-draft-enable-queuing
 		 wl-auto-flush-queue)
 	    (wl-draft-queue-flush))
-;; 	(when (and (eq major-mode 'wl-summary-mode)
-;; 		   (elmo-folder-plugged-p wl-summary-buffer-elmo-folder))
-;; 	  (let* ((msgdb-dir (elmo-folder-msgdb-path
-;; 			     wl-summary-buffer-elmo-folder))
-;; 		 (seen-list (elmo-msgdb-seen-load msgdb-dir)))
-;; 	 (setq seen-list
-;; 		  (wl-summary-flush-pending-append-operations seen-list))
-;; 	    (elmo-msgdb-seen-save msgdb-dir seen-list)))
+;;; 	(when (and (eq major-mode 'wl-summary-mode)
+;;; 		   (elmo-folder-plugged-p wl-summary-buffer-elmo-folder))
+;;; 	  (let* ((msgdb-dir (elmo-folder-msgdb-path
+;;; 			     wl-summary-buffer-elmo-folder))
+;;; 		 (seen-list (elmo-msgdb-seen-load msgdb-dir)))
+;;;	    (setq seen-list
+;;; 		  (wl-summary-flush-pending-append-operations seen-list))
+;;; 	    (elmo-msgdb-seen-save msgdb-dir seen-list)))
 	(run-hooks 'wl-plugged-hook))
     (wl-biff-stop)
     (run-hooks 'wl-unplugged-hook))
@@ -215,14 +215,15 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'."
   (setq buffer-read-only t)
   (run-hooks 'wl-plugged-mode-hook))
 
-(defmacro wl-plugged-string (plugged &optional time)
-  `(if ,time wl-plugged-auto-off
-     (if ,plugged
-	 wl-plugged-plug-on
-       wl-plugged-plug-off)))
+(defun wl-plugged-string (plugged &optional time)
+  (if time
+      wl-plugged-auto-off
+    (if plugged
+	wl-plugged-plug-on
+      wl-plugged-plug-off)))
 
-(defmacro wl-plugged-server-indent ()
-  '(make-string wl-plugged-server-indent ? ))
+(defun wl-plugged-server-indent ()
+  (make-string wl-plugged-server-indent (string-to-char " ")))
 
 (defun wl-plugged-set-variables ()
   (setq wl-plugged-sending-queue-alist
@@ -231,8 +232,8 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'."
 	(wl-plugged-dop-queue-info))
   (setq wl-plugged-alist
 	(sort (copy-sequence elmo-plugged-alist)
-	      '(lambda (a b)
-		 (string< (caar a) (caar b))))))
+	      (lambda (a b)
+		(string< (caar a) (caar b))))))
 
 (defun wl-plugged-sending-queue-info ()
   ;; sending queue status
@@ -264,7 +265,7 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'."
 	    (if (> len 1)
 		(format ": %d msgs (" len)
 	      (format ": %d msg (" len))
-	    (mapconcat (function int-to-string) (cdr qinfo) ",")
+	    (mapconcat (function number-to-string) (cdr qinfo) ",")
 	    ")")))
 
 (defun wl-plugged-dop-queue-info ()
@@ -273,11 +274,11 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'."
 	 (elmo-dop-queue (copy-sequence elmo-dop-queue))
 	 dop-queue last alist server-info
 	 ope operation)
-    ;(elmo-dop-queue-load)
+;;;    (elmo-dop-queue-load)
     (elmo-dop-queue-merge)
-    (setq dop-queue (sort elmo-dop-queue '(lambda (a b)
-					    (string< (elmo-dop-queue-fname a)
-						     (elmo-dop-queue-fname b)))))
+    (setq dop-queue (sort elmo-dop-queue (lambda (a b)
+					   (string< (elmo-dop-queue-fname a)
+						    (elmo-dop-queue-fname b)))))
     (wl-append dop-queue (list nil)) ;; terminate(dummy)
     (when (car dop-queue)
       (setq last (elmo-dop-queue-fname (car dop-queue)))) ;; first
@@ -293,7 +294,7 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'."
       (if (and (car dop-queue)
 	       (string= last (elmo-dop-queue-fname (car dop-queue))))
 	  (wl-append operation (list ope))
-	;;(setq count (1+ count))
+;;;	(setq count (1+ count))
 	(when (and last (setq server-info (elmo-net-port-info
 					   (wl-folder-get-elmo-folder last))))
 	  (setq alist
@@ -312,29 +313,29 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'."
   (let ((operations (cdr qinfo))
 	(column (or column wl-plugged-queue-status-column)))
     (mapconcat
-     '(lambda (folder-ope)
-	(concat (wl-plugged-set-folder-icon
-		 (car folder-ope)
-		 (wl-folder-get-petname (car folder-ope)))
-		"("
-		(let ((opes (cdr folder-ope))
-		      pair shrinked)
-		  (while opes
-		    (if (setq pair (assoc (car (car opes)) shrinked))
-			(setcdr pair (+ (cdr pair)
-					(max (cdr (car opes)) 1)))
-		      (setq shrinked (cons
-				      (cons (car (car opes))
-					    (max (cdr (car opes)) 1))
-				      shrinked)))
-		    (setq opes (cdr opes)))
-		  (mapconcat
-		   '(lambda (ope)
-		      (if (> (cdr ope) 0)
-			  (format "%s:%d" (car ope) (cdr ope))
-			(format "%s" (car ope))))
-		   (nreverse shrinked) ","))
-		")"))
+     (lambda (folder-ope)
+       (concat (wl-plugged-set-folder-icon
+		(car folder-ope)
+		(wl-folder-get-petname (car folder-ope)))
+	       "("
+	       (let ((opes (cdr folder-ope))
+		     pair shrinked)
+		 (while opes
+		   (if (setq pair (assoc (car (car opes)) shrinked))
+		       (setcdr pair (+ (cdr pair)
+				       (max (cdr (car opes)) 1)))
+		     (setq shrinked (cons
+				     (cons (car (car opes))
+					   (max (cdr (car opes)) 1))
+				     shrinked)))
+		   (setq opes (cdr opes)))
+		 (mapconcat
+		  (lambda (ope)
+		    (if (> (cdr ope) 0)
+			(format "%s:%d" (car ope) (cdr ope))
+		      (format "%s" (car ope))))
+		  (nreverse shrinked) ","))
+	       ")"))
      operations
      (concat "\n" (wl-set-string-width column "")))))
 
@@ -379,7 +380,7 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'."
       ;; port plug
       (setq line
 	    (format "%s[%s]%s"
-		    (make-string wl-plugged-port-indent ? )
+		    (make-string wl-plugged-port-indent (string-to-char " "))
 		    (wl-plugged-string plugged time)
 		    (cond
 		     ((stringp port)
@@ -419,7 +420,8 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'."
 (defun wl-plugged-redrawing-switch (indent switch &optional time)
   (beginning-of-line)
   (when (re-search-forward
-	 (format "^%s\\[\\([^]]+\\)\\]" (make-string indent ? )))
+	 (format "^%s\\[\\([^]]+\\)\\]"
+		 (make-string indent (string-to-char " "))))
     (goto-char (match-beginning 1))
     (delete-region (match-beginning 1) (match-end 1))
     (insert (wl-plugged-string switch time))
@@ -460,8 +462,7 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'."
 			  (/ (frame-height) 2)
 			(window-height)))
 	   window-lines lines)
-      (save-excursion
-	(set-buffer (get-buffer-create wl-plugged-buf-name))
+      (with-current-buffer (get-buffer-create wl-plugged-buf-name)
 	(wl-plugged-mode)
 	(buffer-disable-undo (current-buffer))
 	(delete-windows-on (current-buffer))
@@ -505,7 +506,7 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'."
 	(let (variable switch name)
 	  (goto-char cur-point)
 	  (when (and (not (bobp))
-		     (not (eq (char-before) ? )))
+		     (not (eq (char-before) (string-to-char " "))))
 	    (if (re-search-backward " [^ ]+" nil t)
 		(forward-char 1)
 	      (re-search-backward "^[^ ]+" nil t)))
@@ -572,8 +573,8 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'."
 
 (defun wl-plugged-exit ()
   (interactive)
-  (setq ;;elmo-plugged-alist wl-plugged-alist
-	wl-plugged wl-plugged-switch
+  (setq wl-plugged wl-plugged-switch
+;;;	elmo-plugged-alist wl-plugged-alist
 	wl-plugged-alist nil
 	wl-plugged-sending-queue-alist nil
 	wl-plugged-dop-queue-alist nil)
@@ -688,9 +689,9 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'."
 			"\\|")))
     (when wl-delete-startup-frame-function
       (funcall wl-delete-startup-frame-function))
-;;    (if (and wl-folder-use-frame
-;;	     (> (length (visible-frame-list)) 1))
-;;	(delete-frame))
+;;;    (if (and wl-folder-use-frame
+;;;	     (> (length (visible-frame-list)) 1))
+;;;	(delete-frame))
     (setq wl-init nil)
     (remove-hook 'kill-emacs-hook 'wl-save-status)
     (elmo-passwd-alist-clear)
@@ -905,23 +906,21 @@ If ARG (prefix argument) is specified, folder checkings are skipped."
 
 ;; Define some autoload functions WL might use.
 (eval-and-compile
-  ;; This little mapcar goes through the list below and marks the
+  ;; This little mapc goes through the list below and marks the
   ;; symbols in question as autoloaded functions.
-  (mapcar
-   (function
-    (lambda (package)
-      (let ((interactive (nth 1 (memq ':interactive package))))
-	(mapcar
-	 (function
-	  (lambda (function)
-	    (let (keymap)
-	      (when (consp function)
-		(setq keymap (car (memq 'keymap function)))
-		(setq function (car function)))
-	      (autoload function (car package) nil interactive keymap))))
-	 (if (eq (nth 1 package) ':interactive)
-	     (cdddr package)
-	   (cdr package))))))
+  (mapc
+   (lambda (package)
+     (let ((interactive (nth 1 (memq ':interactive package))))
+       (mapc
+	(lambda (function)
+	  (let (keymap)
+	    (when (consp function)
+	      (setq keymap (car (memq 'keymap function)))
+	      (setq function (car function)))
+	    (autoload function (car package) nil interactive keymap)))
+	(if (eq (nth 1 package) ':interactive)
+	    (cdddr package)
+	  (cdr package)))))
    '(("wl-fldmgr" :interactive t
       wl-fldmgr-access-display-all wl-fldmgr-access-display-normal
       wl-fldmgr-add wl-fldmgr-clear-cut-entity-list wl-fldmgr-copy


--Multipart_Mon_Jan_11_13:56:02_2010-1
Content-Type: text/plain; charset=US-ASCII



-- 
Dave Abrahams           Meet me at BoostCon: http://www.boostcon.com
BoostPro Computing
http://www.boostpro.com


--Multipart_Mon_Jan_11_13:56:02_2010-1--