Define unmark functions for temporary marks.
[elisp/wanderlust.git] / wl / wl-draft.el
index 828b50a..afda8ff 100644 (file)
@@ -407,7 +407,7 @@ or `wl-draft-reply-with-argument-list' if WITH-ARG argument is non-nil."
       (setq mail-followup-to (wl-delete-duplicates mail-followup-to nil t)))
     (with-temp-buffer                  ; to keep raw buffer unibyte.
       (set-buffer-multibyte default-enable-multibyte-characters)
-      (setq newsgroups (wl-parse newsgroups
+      (setq newsgroups (elmo-parse newsgroups
                                 "[ \t\f\r\n,]*\\([^ \t\f\r\n,]+\\)")
            newsgroups (wl-delete-duplicates newsgroups)
            newsgroups
@@ -423,24 +423,24 @@ or `wl-draft-reply-with-argument-list' if WITH-ARG argument is non-nil."
                      to (copy-sequence to))
              t t))
     (and to (setq to (mapconcat
-                     '(lambda (addr)
-                        (if wl-draft-reply-use-address-with-full-name
-                            (or (cdr (assoc addr to-alist)) addr)
-                          addr))
+                     (lambda (addr)
+                       (if wl-draft-reply-use-address-with-full-name
+                           (or (cdr (assoc addr to-alist)) addr)
+                         addr))
                      to ",\n\t")))
     (and cc (setq cc (mapconcat
-                     '(lambda (addr)
-                        (if wl-draft-reply-use-address-with-full-name
-                            (or (cdr (assoc addr cc-alist)) addr)
-                          addr))
+                     (lambda (addr)
+                       (if wl-draft-reply-use-address-with-full-name
+                           (or (cdr (assoc addr cc-alist)) addr)
+                         addr))
                      cc ",\n\t")))
     (and mail-followup-to
         (setq mail-followup-to
               (mapconcat
-               '(lambda (addr)
-                  (if wl-draft-reply-use-address-with-full-name
-                      (or (cdr (assoc addr (append to-alist cc-alist))) addr)
-                    addr))
+               (lambda (addr)
+                 (if wl-draft-reply-use-address-with-full-name
+                     (or (cdr (assoc addr (append to-alist cc-alist))) addr)
+                   addr))
                mail-followup-to ",\n\t")))
     (and (null to) (setq to cc cc nil))
     (setq references (delq nil references)
@@ -865,7 +865,7 @@ text was killed."
                          (concat " to="
                                  (mapconcat
                                   'identity
-                                  (mapcar '(lambda(x) (format "<%s>" x)) to)
+                                  (mapcar (lambda (x) (format "<%s>" x)) to)
                                   ","))))
                   ""))
             (id (if id (concat " id=" id) ""))
@@ -1167,7 +1167,7 @@ If FORCE-MSGID, insert message-id regardless of `wl-insert-message-id'."
            nil t)
       (when (string= "" (match-string 1))
        (replace-match ""))))
-;;;  (run-hooks 'wl-mail-send-pre-hook) ;; X-PGP-Sig, Cancel-Lock
+;;;  (run-hooks 'wl-mail-send-pre-hook) ; X-PGP-Sig, Cancel-Lock
   (wl-draft-dispatch-message)
   (when kill-when-done
     ;; hide editing-buffer.
@@ -1279,7 +1279,8 @@ This variable is valid when `wl-interactive-send' has non-nil value."
       (condition-case nil
          (progn
            (when wl-draft-send-confirm-with-preview
-             (let (wl-draft-send-hook)
+             (let (wl-draft-send-hook
+                   (pgg-decrypt-automatically nil))
                (wl-draft-preview-message)))
            (save-excursion
              (goto-char (point-min)) ; to show recipients in header
@@ -1300,9 +1301,9 @@ This variable is valid when `wl-interactive-send' has non-nil value."
   "Send current draft message.
 If KILL-WHEN-DONE is non-nil, current draft buffer is killed"
   (interactive)
-  ;; Don't call this explicitly.
-  ;; Added to 'wl-draft-send-hook (by teranisi)
-  ;; (wl-draft-config-exec)
+;;; Don't call this explicitly.
+;;; Added to 'wl-draft-send-hook (by teranisi)
+;;;  (wl-draft-config-exec)
   (run-hooks 'wl-draft-send-hook)
   (when (or (not wl-interactive-send)
            (wl-draft-send-confirm))
@@ -1848,7 +1849,7 @@ If KILL-WHEN-DONE is non-nil, current draft buffer is killed"
        field
       nil)))
 
-(defsubst wl-draft-default-headers ()
+(defun wl-draft-default-headers ()
   (list
    (cons 'Mail-Reply-To (and wl-insert-mail-reply-to
                             (wl-address-header-extract-address
@@ -1927,8 +1928,7 @@ If KILL-WHEN-DONE is non-nil, current draft buffer is killed"
 (defun wl-draft-generate-clone-buffer (name &optional local-variables)
   "Generate clone of current buffer named NAME."
   (let ((editing-buffer (current-buffer)))
-    (save-excursion
-      (set-buffer (generate-new-buffer name))
+    (with-current-buffer (generate-new-buffer name)
       (erase-buffer)
       (wl-draft-mode)
       (wl-draft-editor-mode)
@@ -1937,8 +1937,7 @@ If KILL-WHEN-DONE is non-nil, current draft buffer is killed"
       (while local-variables
        (make-local-variable (car local-variables))
        (set (car local-variables)
-            (save-excursion
-              (set-buffer editing-buffer)
+            (with-current-buffer editing-buffer
               (symbol-value (car local-variables))))
        (setq local-variables (cdr local-variables)))
       (current-buffer))))
@@ -2000,22 +1999,20 @@ If KILL-WHEN-DONE is non-nil, current draft buffer is killed"
     (goto-char (point-max))
     buffer))
 
-(defmacro wl-draft-body-goto-top ()
-  `(progn
-     (goto-char (point-min))
-     (if (re-search-forward mail-header-separator nil t)
-        (forward-char 1)
-       (goto-char (point-max)))))
+(defun wl-draft-body-goto-top ()
+  (goto-char (point-min))
+  (if (re-search-forward mail-header-separator nil t)
+      (forward-char 1)
+    (goto-char (point-max))))
 
-(defmacro wl-draft-body-goto-bottom ()
-  `(goto-char (point-max)))
+(defun wl-draft-body-goto-bottom ()
+  (goto-char (point-max)))
 
-(defmacro wl-draft-config-body-goto-header ()
-  `(progn
-     (goto-char (point-min))
-     (if (re-search-forward mail-header-separator nil t)
-        (beginning-of-line)
-       (goto-char (point-max)))))
+(defun wl-draft-config-body-goto-header ()
+  (goto-char (point-min))
+  (if (re-search-forward mail-header-separator nil t)
+      (beginning-of-line)
+    (goto-char (point-max))))
 
 (defsubst wl-draft-config-sub-eval-insert (content &optional newline)
   (let (content-value)
@@ -2157,8 +2154,7 @@ Automatically applied in draft sending time."
             ((eq key 'reply)
              (when (and
                     reply-buf
-                    (save-excursion
-                      (set-buffer reply-buf)
+                    (with-current-buffer reply-buf
                       (save-restriction
                         (std11-narrow-to-header)
                         (goto-char (point-min))
@@ -2443,8 +2439,8 @@ Automatically applied in draft sending time."
                  ((looking-at wl-folder-complete-header-regexp)
                   (and (boundp 'wl-read-folder-history)
                        (setq history wl-read-folder-history)))
-                 ;; ((looking-at wl-address-complete-header-regexp)
-                 ;;  (setq history .....))
+;;;              ((looking-at wl-address-complete-header-regexp)
+;;;               (setq history .....))
                  (t
                   nil)))
               (eolp))