[mew-dist 25633] Re: [mew-win32 04136] Re: Firefox -> mozex -> mailto -> Mew
Hideyuki SHIRAI ( 白井秀行 )
shirai at example.com
2004年 11月 8日 (月) 19:15:18 JST
白井です。
# たくさん間が空いてしまってごめんなさい。
From: unisus at example.com さん曰く
Subject: [mew-win32 04136] Re: Firefox -> mozex -> mailto -> Mew
Message-ID: <20041025.225302.126572512.unisus at example.com>
Date: Mon, 25 Oct 2004 22:53:02 +0900 (JST)
> 一応この変更でうまく行きますので、
> 下記の場所に、差分と差分を当てたパッケージを置いておきます。
>
> http://members.jcom.home.ne.jp/unisus/app/mozex/mozex-1.07-i18n-0.1-0.1.diff
> http://members.jcom.home.ne.jp/unisus/app/mozex/mozex-1.07-i18n-0.1-0.1.xpi
インストールもできちゃうのですね。すばらしい。
mew-browse.el もこれで最後にします。
CVS の contrib/mew-browse.el にこのパッチをあてておいてもらえま
せんか? > かずさん
## で、これから Wiki 書きますね。
--
白井秀行 (mailto:shirai at example.com)
-------------- next part --------------
Index: mew-browse.el
===================================================================
RCS file: /cvsmew/mew/contrib/mew-browse.el,v
retrieving revision 1.5
diff -u -r1.5 mew-browse.el
--- mew-browse.el 18 Oct 2004 08:55:46 -0000 1.5
+++ mew-browse.el 8 Nov 2004 10:10:40 -0000
@@ -3,7 +3,7 @@
;; Author: Hideyuki SHIRAI <shirai at example.com>
;; Modify: Shuichi Kitaguchi <kit at example.com>
;; Created: May 19, 1999
-;; Revised: Oct 15, 2004
+;; Revised: Nov 08, 2004
;;;
;;; ~/.emacs settings.
@@ -55,9 +55,9 @@
;;
;;; Use from Mozilla & Firefox with MozEx, set followings on Mailer form of MozEx.
-;; "/path/gnudoit (mew-url-mailto-mozex "%A" "%C" "%Z" "%S" "%B" "%r")"
+;; "/path/gnudoit (mew-url-mailto-mozex "%r")"
;; or
-;; "/path/emacseval (mew-url-mailto-mozex "%A" "%C" "%Z" "%S" "%B" "%r")"
+;; "/path/emacseval (mew-url-mailto-mozex "%r")"
;;
;; `emacseval' is a shell scirpt like this,
;; ----cut here----
@@ -179,7 +179,7 @@
(append mew-ext-prog-url-args (list url))))))
(defun mew-url-mailto (url)
- "Exec mew-user-agent-compose with parsing RFC2368.
+ "Execute mew-user-agent-compose with parsing RFC2368.
If use from emacs-w3m, add followings in your ~/.emacs file.
(setq w3m-mailto-url-function 'mew-url-mailto)
@@ -193,59 +193,38 @@
(save-excursion
(require 'mew)
(mew-init)))
- (mew-browse-url-mailto url))
-
-(defun mew-browse-url-mailto (url)
- (let (lst)
- (setq lst (mew-browse-url-mailto-analysis url))
+ (let ((lst (mew-browse-url-mailto-analysis url)))
(mew-user-agent-compose (nth 0 lst) ;; to
(nth 1 lst) ;; subject
(nth 2 lst) ;; other
nil mew-browse-url-mailto-switch-func)))
-(defun mew-url-mailto-mozex (&optional to cc bcc subject body url)
- "Exec mew-user-agent-compose from Mozilla and Firefox with MozEx.
+(defun mew-url-mailto-mozex (url)
+ "Execute mew-user-agent-compose from Mozilla and Firefox with MozEx.
If use this command, set followings on Mailer form of MozEx.
-\"/path/gnudoit (mew-url-mailto-mozex \"%A\" \"%C\" \"%Z\" \"%S\" \"%B\" \"%r\")\"
+\"/path/gnudoit (mew-url-mailto-mozex \"%r\")\"
or
-\"/path/emacseval (mew-url-mailto-mozex \"%A\" \"%C\" \"%Z\" \"%S\" \"%B\" \"%r\")\"
+\"/path/emacseval (mew-url-mailto-mozex \"%r\")\"
`emacseval' is a shell scirpt like this,
----cut here----
#!/bin/sh
/usr/local/bin/emacsclient --eval \"`echo $*`\"
----cut here----"
+ (interactive)
(when (or (not (boundp 'mew-init-p)) (null mew-init-p))
(save-excursion
(require 'mew)
(mew-init)))
- (let ((dels '("To" "Subject" "Cc" "Bcc" "Body"))
- (other (nth 2 (mew-browse-url-mailto-analysis (or url "")))))
- (while dels
- (setq other (delete (assoc (car dels) other) other))
- (setq dels (cdr dels)))
-
- (if (or (not to) (string= to ""))
- (setq to nil)
- (setq to (mew-browse-url-mailto-hex-to-string to)))
- (if (or (not subject) (string= subject ""))
- (setq subject nil)
- (setq subject (mew-browse-url-mailto-hex-to-string subject)))
- (unless (or (not cc) (string= cc ""))
- (setq cc (mew-browse-url-mailto-hex-to-string cc))
- (setq other (cons (cons "Cc" cc) other)))
- (unless (or (not bcc) (string= bcc ""))
- (setq bcc (mew-browse-url-mailto-hex-to-string bcc))
- (setq other (cons (cons "Bcc" bcc) other)))
- (unless (or (not body) (string= body ""))
- (setq body (mew-browse-url-mailto-hex-to-string body))
- (setq other (cons (cons "Body" body) other)))
- (mew-user-agent-compose to subject other
+ (let ((lst (mew-browse-url-mailto-analysis url 'mozex)))
+ (mew-user-agent-compose (nth 0 lst) ;; to
+ (nth 1 lst) ;; subject
+ (nth 2 lst) ;; other
nil mew-browse-url-mailto-switch-func)))
;; return '(to subject other)"
-(defun mew-browse-url-mailto-analysis (url)
+(defun mew-browse-url-mailto-analysis (url &optional mozex)
(let (to subject other)
(while (string-match "[ \t]+" url)
(setq url (concat (substring url 0 (match-beginning 0))
@@ -262,6 +241,12 @@
(hvalue (mew-browse-url-mailto-hex-to-string
(substring url (match-beginning 2) (match-end 2)))))
(setq url (substring url (match-end 0)))
+ (when mozex
+ (setq hname (mew-browse-url-mailto-hex-to-string hname))
+ (while (string-match "[ \t\n]+" hname)
+ (setq hname (replace-match "" nil nil hname)))
+ (when (string-match "[ \t\n]+$" hvalue)
+ (setq hvalue (replace-match "" nil nil hvalue))))
(cond
((string-match "^to$" hname)
(if to
Mew-dist メーリングリストの案内