From f3b544d0953da77fd627ea0a4ed4fb944d34eb96 Mon Sep 17 00:00:00 2001 From: teranisi Date: Thu, 24 Jan 2002 04:15:49 +0000 Subject: [PATCH] * 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. --- wl/ChangeLog | 12 ++++++++++++ wl/wl-draft.el | 30 +++++++++++++++++++++++------- wl/wl-summary.el | 12 ++---------- wl/wl-thread.el | 23 ++++++++--------------- wl/wl-vars.el | 3 +-- 5 files changed, 46 insertions(+), 34 deletions(-) diff --git a/wl/ChangeLog b/wl/ChangeLog index ad9938a..ea6f99f 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,15 @@ +2002-01-24 Yuuichi Teranishi + + * 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 * wl-message.el (wl-message-buffer-prefetch): Require `count'. diff --git a/wl/wl-draft.el b/wl/wl-draft.el index 53960bc..54cd54e 100644 --- a/wl/wl-draft.el +++ b/wl/wl-draft.el @@ -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) diff --git a/wl/wl-summary.el b/wl/wl-summary.el index 5a1dc6f..068b11e 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -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) diff --git a/wl/wl-thread.el b/wl/wl-thread.el index e31050f..5b50e4e 100644 --- a/wl/wl-thread.el +++ b/wl/wl-thread.el @@ -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 diff --git a/wl/wl-vars.el b/wl/wl-vars.el index 7570978..7b42425 100644 --- a/wl/wl-vars.el +++ b/wl/wl-vars.el @@ -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) -- 1.7.10.4