(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 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'.
(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."
(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)
(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.
"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)
(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
: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)