[Mew-dist 08640] Re: mail-user-agent

Kazu Yamamoto ( 山本和彦 ) kazu at example.com
1999年 4月 24日 (土) 16:01:25 JST


#skk-develop を外しました。

mew-user-agent-compose の定義はいい加減でよいということが判明しました。
以下のパッチをあて、.emacs に下記の設定をすれば、バグレポートを書く際
などに Mew が利用できるでしょう。

(if (boundp 'mail-user-agent)
    (progn
      (setq mail-user-agent 'mew-user-agent)
      (define-mail-user-agent 'mew-user-agent
	                      'mew-user-agent-compose
			      'mew-draft-send-letter
			      'mew-draft-kill
			      'mew-send-hook)))

まったくテストしていませんので、だれかテストして下さると幸いです。なお、
以下のパッチを当てると、XEmacs の toolbar 問題も解決されます。

--かず

-------------- next part --------------
Index: 00changes
===================================================================
RCS file: /usr/home/kazu/cvsroot/Mew/mew/00changes,v
retrieving revision 1.295
diff -c -r1.295 00changes
*** 00changes	1999/04/22 08:48:04	1.295
--- 00changes	1999/04/24 05:02:11
***************
*** 22,27 ****
--- 22,32 ----
  	Virtual mode extensions including thread.
  *** todo ***
  
+ 1.94b25
+ 
+ * Defined mew-unhighlight-header-region.
+ * Require highlight-headers instead of autoload.
+ 
  1.94b24 (99/04/22) mew-dist release
  
  * Deleting unnecessary null lines in a header when composed.
Index: mew-draft.el
===================================================================
RCS file: /usr/home/kazu/cvsroot/Mew/mew/mew-draft.el,v
retrieving revision 1.77
diff -c -r1.77 mew-draft.el
*** mew-draft.el	1999/03/27 15:12:20	1.77
--- mew-draft.el	1999/04/24 06:57:50
***************
*** 478,484 ****
    (concat (file-name-as-directory mew-draft-mime-folder)
  	  (file-name-nondirectory draft)))
  
! (defun mew-draft-header (&optional subject nl to cc newsgroups in-reply-to references)
  ;; to -- string or list
  ;; cc -- string or list
  ;; nl -- one empty line under "----", which is necessary if
--- 478,484 ----
    (concat (file-name-as-directory mew-draft-mime-folder)
  	  (file-name-nondirectory draft)))
  
! (defun mew-draft-header (&optional subject nl to cc newsgroups in-reply-to references other-headers)
  ;; to -- string or list
  ;; cc -- string or list
  ;; nl -- one empty line under "----", which is necessary if
***************
*** 555,560 ****
--- 555,564 ----
  	  )
  	(mew-draft-header-insert mew-x-face: xface)))
    (mew-draft-header-insert mew-x-mailer: mew-x-mailer)
+   (let ((halist other-headers))
+     (while halist
+       (mew-draft-header-insert (car (car halist)) (cdr (car halist)))
+       (setq halist (cdr halist))))
    (let ((halist mew-header-alist))
      (while halist
        (mew-draft-header-insert (car (car halist)) (cdr (car halist)))
Index: mew-encode.el
===================================================================
RCS file: /usr/home/kazu/cvsroot/Mew/mew/mew-encode.el,v
retrieving revision 1.65
diff -c -r1.65 mew-encode.el
*** mew-encode.el	1999/04/22 08:44:17	1.65
--- mew-encode.el	1999/04/24 05:00:43
***************
*** 99,105 ****
  
  (defun mew-draft-make-single ()
    (mew-draft-make-backup 'single)
!   (goto-char (mew-header-end))
    (forward-line)
    (mew-encode-singlepart (mew-encode-syntax-single "text-file") nil nil t))
  
--- 99,105 ----
  
  (defun mew-draft-make-single ()
    (mew-draft-make-backup 'single)
!   (mew-header-goto-end)
    (forward-line)
    (mew-encode-singlepart (mew-encode-syntax-single "text-file") nil nil t))
  
***************
*** 295,301 ****
  (defun mew-draft-make-multi ()
    (mew-draft-make-backup)
    ;; delete delimiter
!   (goto-char (mew-header-end))
    (forward-line)
    (let* ((beg (point))
  	 (syntax mew-encode-syntax) 
--- 295,301 ----
  (defun mew-draft-make-multi ()
    (mew-draft-make-backup)
    ;; delete delimiter
!   (mew-header-goto-end)
    (forward-line)
    (let* ((beg (point))
  	 (syntax mew-encode-syntax) 
Index: mew-highlight.el
===================================================================
RCS file: /usr/home/kazu/cvsroot/Mew/mew/mew-highlight.el,v
retrieving revision 1.31
diff -c -r1.31 mew-highlight.el
*** mew-highlight.el	1999/04/22 08:44:17	1.31
--- mew-highlight.el	1999/04/24 05:00:32
***************
*** 108,115 ****
         (save-excursion (end-of-line) (point))
         '(face nil))))
  
  (defun mew-unhighlight-header ()
!   (mew-overlay-delete-region (point-min) (mew-header-end)))
  
  (defun mew-highlight-header-region (BEG END)
    "A function to highligh header in Message and Draft mode."
--- 108,118 ----
         (save-excursion (end-of-line) (point))
         '(face nil))))
  
+ (defun mew-unhighlight-header-region (BEG END)
+   (mew-overlay-delete-region BEG END))
+ 
  (defun mew-unhighlight-header ()
!   (mew-unhighlight-header-region (point-min) (mew-header-end)))
  
  (defun mew-highlight-header-region (BEG END)
    "A function to highligh header in Message and Draft mode."
***************
*** 119,125 ****
  	    (defval (intern-soft "mew-highlight-header-face-marginal"))
  	    key beg med n-spec overlay key-face val-face)
  	(save-excursion
! 	  (mew-unhighlight-header)
  	  (save-restriction
  	    (narrow-to-region BEG END)
  	    (goto-char (point-min))
--- 122,128 ----
  	    (defval (intern-soft "mew-highlight-header-face-marginal"))
  	    key beg med n-spec overlay key-face val-face)
  	(save-excursion
! 	  (mew-unhighlight-header-region BEG END)
  	  (save-restriction
  	    (narrow-to-region BEG END)
  	    (goto-char (point-min))
***************
*** 184,190 ****
  
  (cond
   (mew-xemacs-p
!   (autoload 'highlight-headers-x-face-to-pixmap "highlight-headers")
    ;; now this is in the "mail-lib" package.
    (defvar mew-use-highlight-x-face-function
      (function (lambda (beg end)
--- 187,194 ----
  
  (cond
   (mew-xemacs-p
!   ;;(autoload 'highlight-headers-x-face-to-pixmap "highlight-headers")
!   (require 'highlight-headers) ;; due to the timing problem.
    ;; now this is in the "mail-lib" package.
    (defvar mew-use-highlight-x-face-function
      (function (lambda (beg end)
Index: mew.el
===================================================================
RCS file: /usr/home/kazu/cvsroot/Mew/mew/mew.el,v
retrieving revision 1.158
diff -c -r1.158 mew.el
*** mew.el	1999/04/22 08:44:51	1.158
--- mew.el	1999/04/24 06:58:32
***************
*** 75,80 ****
--- 75,105 ----
    (if (get-buffer mew-buffer-hello) (kill-buffer mew-buffer-hello))
    (mew-summary-send to cc subject))
  
+ (defun mew-user-agent-compose (&optional to subject other-headers continue
+                                              switch-function yank-action
+                                              send-actions)
+   "Set up mail composition draft with Mew.
+ This is `mail-user-agent' entry point to Mew.
+ 
+ The optional arguments TO and SUBJECT specify recipients and the
+ initial Subject field, respectively.
+ 
+ OTHER-HEADERS is an alist specifying additional
+ header fields.  Elements look like (HEADER . VALUE) where both
+ HEADER and VALUE are strings.
+ 
+ CONTINUE, SWITCH-FUNCTION, YANK-ACTION and SEND-ACTIONS are ignored."
+   (let ((file (mew-folder-new-message mew-draft-folder))
+         (find-file-hooks nil)
+         (inhibit-quit t))
+     (mew-current-set 'window (current-window-configuration))
+     (mew-window-configure (current-buffer) 'draft)
+     (mew-summary-prepare-draft
+      (switch-to-buffer (find-file-noselect file))
+      (mew-draft-rename file)
+      (mew-draft-header subject nil to nil nil nil nil other-headers)
+      (mew-draft-mode))))
+ 
  ;;;
  ;;; Functions for boot time
  ;;;


Mew-dist メーリングリストの案内