* wl-util.el (wl-current-message-buffer): Define as function;
authorteranisi <teranisi>
Tue, 5 Aug 2003 14:41:59 +0000 (14:41 +0000)
committerteranisi <teranisi>
Tue, 5 Aug 2003 14:41:59 +0000 (14:41 +0000)
Don't use the value of wl-messge-buffer.

* wl-summary.el (wl-summary-redisplay-no-mime-internal): Update
persistent mark.

* wl-mime.el (wl-draft-yank-current-message-entity): If there's
no current message, cause an error.

* elmo-mime.el (elmo-mime-message-display): Display message entirely
if folder length is zero.
(elmo-mime-display-as-is): Ditto.

* elmo-multi.el (elmo-folder-set-message-modified): Ditto.

elmo/ChangeLog
elmo/elmo-mime.el
elmo/elmo-multi.el
wl/ChangeLog
wl/wl-mime.el
wl/wl-summary.el
wl/wl-util.el

index 606819a..e57ad7d 100644 (file)
@@ -1,4 +1,8 @@
-2003-08-04  Yuuichi Teranishi  <teranisi@gohome.org>
+2003-08-05  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * elmo-mime.el (elmo-mime-message-display): Display message entirely
+       if folder length is zero.
+       (elmo-mime-display-as-is): Ditto.
 
        * elmo-filter.el (elmo-folder-set-message-modified): Define.
 
index feb5f42..0fa6fa0 100644 (file)
@@ -224,9 +224,11 @@ Return non-nil if not entire message was fetched."
   (let (mime-display-header-hook ; Do nothing.
        (elmo-message-displaying t)
        entity strategy)
-    (setq entity (elmo-message-entity folder number))
-    (setq strategy (elmo-find-fetch-strategy folder entity
-                                            ignore-cache))
+    (unless (zerop (elmo-folder-length folder))
+      (setq entity (elmo-message-entity folder number)))
+    (setq strategy (if entity (elmo-find-fetch-strategy folder entity
+                                                       ignore-cache)
+                    (elmo-make-fetch-strategy 'entire)))
     (mime-display-message
      (mime-open-entity
       (if (and strategy
@@ -256,21 +258,23 @@ Return non-nil if cache is used."
                                                (elmo-folder-msgdb folder)))
        mime-display-header-hook ; Do nothing.
        cache-file strategy use-cache)
-    (setq cache-file (elmo-file-cache-get
-                     (elmo-msgdb-overview-entity-get-id entity)))
-    (setq use-cache (and (elmo-message-use-cache-p folder number)
-                        (eq (elmo-file-cache-status cache-file) 'entire)))
+    (when entity
+      (setq cache-file (elmo-file-cache-get
+                       (elmo-msgdb-overview-entity-get-id entity)))
+      (setq use-cache (and (elmo-message-use-cache-p folder number)
+                          (eq (elmo-file-cache-status cache-file) 'entire))))
     (setq strategy (elmo-make-fetch-strategy
-                   'entire use-cache (elmo-message-use-cache-p folder number)
-                   (elmo-file-cache-path
-                    cache-file)))
+                   'entire use-cache
+                   (elmo-message-use-cache-p folder number)
+                   (elmo-file-cache-path cache-file)))
     (elmo-mime-display-as-is-internal
      (mime-open-entity
       'elmo-buffer
       (elmo-make-mime-message-location
        folder number strategy rawbuf unread))
      viewbuf nil keymap original-mode)
-    (elmo-fetch-strategy-use-cache strategy)))
+    (when strategy
+      (elmo-fetch-strategy-use-cache strategy))))
 
 ;; Replacement of mime-display-message.
 (defun elmo-mime-display-as-is-internal (message
index ded52a4..d03b1f6 100644 (file)
@@ -43,7 +43,7 @@
 
 (defmacro elmo-multi-real-folder-number (folder number)
   "Returns a cons cell of real FOLDER and NUMBER."
-  (` (cons (nth (- 
+  (` (cons (nth (-
                 (/ (, number)
                    (elmo-multi-folder-divide-number-internal (, folder)))
                 1) (elmo-multi-folder-children-internal (, folder)))
index e55b9d8..6f36d88 100644 (file)
@@ -1,3 +1,14 @@
+2003-08-05  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * wl-util.el (wl-current-message-buffer): Define as function;
+       Don't use the value of wl-messge-buffer.
+
+       * wl-summary.el (wl-summary-redisplay-no-mime-internal): Update
+       persistent mark.
+
+       * wl-mime.el (wl-draft-yank-current-message-entity): If there's
+       no current message, cause an error.
+
 2003-08-03  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
 
        * wl-summary.el (wl-summary-set-message-modified): Use
index d6f467b..16f56c0 100644 (file)
@@ -59,8 +59,11 @@ has Non-nil value\)"
                     (function wl-draft-yank-to-draft-buffer))))
        (mime-preview-following-method-alist
         (list (cons 'wl-original-message-mode
-                    (function wl-draft-yank-to-draft-buffer)))))
-    (if (get-buffer (wl-current-message-buffer))
+                    (function wl-draft-yank-to-draft-buffer))))
+       (message-buffer (wl-current-message-buffer)))
+    (unless message-buffer
+      (error "No message."))
+    (if (get-buffer message-buffer)
        (save-excursion
          (set-buffer (wl-current-message-buffer))
          (save-restriction
index 5b71144..4333652 100644 (file)
@@ -4155,7 +4155,11 @@ If ASK-CODING is non-nil, coding-system for the message is asked."
          (wl-message-redisplay fld num 'as-is
                                (string= (elmo-folder-name-internal fld)
                                         wl-draft-folder))
-         (wl-summary-mark-as-read num)
+         (ignore-errors
+           (if (member (elmo-message-mark fld num)
+                       (elmo-msgdb-unread-marks))
+               (wl-summary-mark-as-read num); no-folder-mark)
+             (wl-summary-update-persistent-mark)))
          (setq wl-summary-buffer-current-msg num)
          (when wl-summary-recenter
            (recenter (/ (- (window-height) 2) 2))
index 723874d..ebc1894 100644 (file)
@@ -539,11 +539,12 @@ that `read' can handle, whenever this is possible."
 (defmacro wl-concat-list (list separator)
   (` (mapconcat 'identity (delete "" (delq nil (, list))) (, separator))))
 
-(defmacro wl-current-message-buffer ()
-  (` (save-excursion
-       (if (buffer-live-p wl-current-summary-buffer)
-          (set-buffer wl-current-summary-buffer))
-       wl-message-buffer)))
+(defun wl-current-message-buffer ()
+  (when (buffer-live-p wl-current-summary-buffer)
+    (with-current-buffer wl-current-summary-buffer
+      (car (wl-message-buffer-display wl-summary-buffer-elmo-folder
+                                     (wl-summary-message-number)
+                                     'mime)))))
 
 (defmacro wl-kill-buffers (regexp)
   (` (mapcar (function