* wl-draft.el (wl-draft-save): Rewrite.
authorteranisi <teranisi>
Thu, 24 Jan 2002 04:15:49 +0000 (04:15 +0000)
committerteranisi <teranisi>
Thu, 24 Jan 2002 04:15:49 +0000 (04:15 +0000)
(wl-draft-create-buffer): Set buffer-file-name as nil.

* wl-summary.el (wl-summary-reedit): Don't care about draft folder.

* wl-thread.el (wl-thread-get-depth-of-current-line): Rewrite.

* wl-vars.el (wl-summary-no-mime-folder-list): Changed default value to nil.

wl/ChangeLog
wl/wl-draft.el
wl/wl-summary.el
wl/wl-thread.el
wl/wl-vars.el

index ad9938a..ea6f99f 100644 (file)
@@ -1,3 +1,15 @@
+2002-01-24  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * wl-draft.el (wl-draft-save): Rewrite.
+       (wl-draft-create-buffer): Set buffer-file-name as nil.
+
+       * wl-summary.el (wl-summary-reedit): Don't care about draft folder.
+
+       * wl-thread.el (wl-thread-get-depth-of-current-line): Rewrite.
+
+       * wl-vars.el (wl-summary-no-mime-folder-list): Changed default value to
+       nil.
+
 2002-01-24  Kenichi OKADA  <okada@opaopa.org>
 
        * wl-message.el (wl-message-buffer-prefetch): Require `count'.
index 53960bc..54cd54e 100644 (file)
@@ -1215,14 +1215,28 @@ If KILL-WHEN-DONE is non-nil, current draft buffer is killed"
             (kill-buffer sending-buffer))))))
 
 (defun wl-draft-save ()
-  "Save current draft."
+  "Save current draft.
+Derived from `message-save-drafts' in T-gnus."
   (interactive)
-  (save-buffer)
-  (wl-draft-config-info-operation
-   (and (string-match "[0-9]+$" wl-draft-buffer-file-name)
-       (string-to-int
-        (match-string 0 wl-draft-buffer-file-name)))
-   'save))
+  (if (buffer-modified-p)
+      (progn
+       (message "Saving %s..." wl-draft-buffer-file-name)
+       (let ((msg (buffer-substring-no-properties (point-min) (point-max))))
+         (with-temp-file wl-draft-buffer-file-name
+           (insert msg)
+           ;; XXX Discard error to ignore invalid content. Is it dangerous?
+           (condition-case nil
+               (mime-edit-translate-buffer)
+             (error))
+           (wl-draft-get-header-delimiter t)))
+       (set-buffer-modified-p nil)
+       (wl-draft-config-info-operation
+        (and (string-match "[0-9]+$" wl-draft-buffer-file-name)
+             (string-to-int
+              (match-string 0 wl-draft-buffer-file-name)))
+        'save)
+       (message "Saving %s...done" wl-draft-buffer-file-name))
+    (message "(No changes need to be saved)")))
 
 (defun wl-draft-mimic-kill-buffer ()
   "Kill the current (draft) buffer with query."
@@ -1461,6 +1475,8 @@ If KILL-WHEN-DONE is non-nil, current draft buffer is killed"
     (make-local-variable 'truncate-partial-width-windows)
     (setq truncate-partial-width-windows nil)
     (setq truncate-lines wl-draft-truncate-lines)
+    ;; Don't care about supersession.
+    (setq buffer-file-name nil)
     (setq wl-sent-message-via nil)
     (setq wl-sent-message-queued nil)
     (setq wl-draft-buffer-file-name file-name)
index 5a1dc6f..068b11e 100644 (file)
@@ -593,15 +593,7 @@ If ARG is non-nil, Supersedes message"
   (interactive "P")
   (if arg
       (wl-summary-supersedes-message)
-    (if (string= (wl-summary-buffer-folder-name) wl-draft-folder)
-       (if (wl-summary-message-number)
-           (unwind-protect
-               (wl-draft-reedit (wl-summary-message-number))
-             (if (wl-message-news-p)
-                 (mail-position-on-field "Newsgroups")
-               (mail-position-on-field "To"))
-             (delete-other-windows)))
-      (wl-draft-edit-string (wl-summary-message-string)))))
+    (wl-draft-edit-string (wl-summary-message-string))))
 
 (defun wl-summary-resend-bounced-mail ()
   "Re-mail the current message.
@@ -5383,7 +5375,7 @@ Use function list is `wl-summary-write-current-folder-functions'."
                      "Supersedes: " message-id "\n"
                      (and followup-to
                           (concat "Followup-To: " followup-to "\n")))))
-    (if message-buf (set-buffer message-buf))
+       (if message-buf (set-buffer message-buf))
        (wl-draft-edit-string (buffer-substring (point-min) (point-max)))))))
 
 (defun wl-summary-save (&optional arg wl-save-dir)
index e31050f..5b50e4e 100644 (file)
@@ -1143,22 +1143,15 @@ Message is inserted to the summary buffer."
       (wl-summary-set-message-modified)
       (set-buffer-modified-p nil))))
 
-
 (defun wl-thread-get-depth-of-current-line ()
-  (interactive)
-  (save-excursion
-    (beginning-of-line)
-    (let ((depth 0))
-      (if (re-search-forward (concat "^" wl-summary-buffer-number-regexp
-                                    "..../..\(.*\)..:.. ")
-                            nil t)
-         (while (string-match wl-thread-indent-regexp
-                              (char-to-string
-                               (char-after (point))))
-           (setq depth (1+ depth))
-           (forward-char)))
-      (/ depth wl-thread-indent-level-internal))))
-
+  (let ((entity (wl-thread-get-entity (wl-summary-message-number)))
+       (depth 0)
+       number)
+    (while (setq number (wl-thread-entity-get-parent entity))
+      (incf depth)
+      (setq entity (wl-thread-get-entity number)))
+    depth))
+  
 (defun wl-thread-update-indent-string-region (beg end)
   (interactive "r")
   (save-excursion
index 7570978..7b42425 100644 (file)
@@ -767,8 +767,7 @@ Default is for 'followup-to-me'."
   :type '(string :tag "Mark")
   :group 'wl-summary-marks)
 
-(defcustom wl-summary-no-mime-folder-list
-  (list (concat "^" (regexp-quote wl-draft-folder) "$"))
+(defcustom wl-summary-no-mime-folder-list nil
   "*All folders that match this list don't analysis mime."
   :type '(repeat string)
   :group 'wl-summary)